Each rule is the mapping of a token to a tuple of values; this is the tuple of values. Care should be made in creating the production function, and the condition.
| 23 | |
| 24 | @dataclass |
| 25 | class RuleMapping: |
| 26 | """Each rule is the mapping of a token to a tuple of values; this is the tuple of values. |
| 27 | |
| 28 | Care should be made in creating the production function, and the condition. |
| 29 | """ |
| 30 | |
| 31 | production: Tuple[Token] |
| 32 | # If not None, and between 0 and 1, apply this rule with the given probability. |
| 33 | probability: Union[None, Number] = None |
| 34 | left_context: Union[None, Token] = None |
| 35 | right_context: Union[None, Token] = None |
| 36 | |
| 37 | |
| 38 | def triplewise(iterable): |
no outgoing calls