rd Instruction ¶This instruction has the syntax
rd NONT_QUOTED, RHS, POS, LENGTH
The instruction consumes LENGTH symbols from a training terminal symbol sequence, increments the frequency of a PCFG production with an auxiliary nonterminal symbol at the left-hand side and a consumed terminal symbol sequence at the right-hand side, and updates the spur accordingly. The parameters NONT_QUOTED, RHS, and POS identify the auxiliary nonterminal symbol in a right-hand side of a production of a PCFG corresponding to a regular expression grammar.
The parameter NONT_QUOTED is a PCFG nonterminal symbol specified in double quotation marks. The nonterminal symbol is at the left-hand side of a PCFG production containing the auxiliary nonterminal symbol in a right-hand side. The parameter RHS is zero-based index of a right-hand side containing the auxiliary nonterminal symbol. The parameter POS is zero-based position of the auxiliary nonterminal symbol in the right-hand side.
Example:
rd "E", 2, 3, 4
This instruction consumes a sequence of four terminal symbols from a training terminal symbol sequence, increments the frequency of a PCFG production for an auxiliary nonterminal symbol at the left-hand side and a consumed terminal symbol sequence at the right-hand side, and updates the spur accordingly.
The occurrence of the auxiliary nonterminal symbol is at zero-based position 3 in a right-hand side at zero-based index 2 for the PCFG nonterminal symbol E at the left-hand side.
For example, the auxiliary nonterminal symbol could be the symbol _E_2T4 in the following fragment of a context-free grammar:
E: A | B | _E_1T C C _E_2T4 D ;