class documentation
class ExpandLeftRule(RegexpChunkRule): (source)
Constructor: ExpandLeftRule(left_tag_pattern, right_tag_pattern, descr)
A rule specifying how to expand chunks in a ChunkString to the left, using two matching tag patterns: a left pattern, and a right pattern. When applied to a ChunkString, it will find any chunk whose beginning matches right pattern, and immediately preceded by a strip whose end matches left pattern. It will then expand the chunk to incorporate the new material on the left.
Method | __init__ |
Construct a new ExpandRightRule. |
Method | __repr__ |
Return a string representation of this rule. It has the form: |
Instance Variable | _left |
Undocumented |
Instance Variable | _right |
Undocumented |
Inherited from RegexpChunkRule
:
Static Method | fromstring |
Create a RegexpChunkRule from a string description. Currently, the following formats are supported: |
Method | apply |
Apply this rule to the given ChunkString. See the class reference documentation for a description of what it means to apply a rule. |
Method | descr |
Return a short description of the purpose and/or effect of this rule. |
Instance Variable | _descr |
Undocumented |
Instance Variable | _regexp |
Undocumented |
Instance Variable | _repl |
Undocumented |
Construct a new ExpandRightRule.
Parameters | |
left | This rule's left tag pattern. When applied to a ChunkString, this rule will find any chunk whose beginning matches this pattern, and immediately preceded by a strip whose end matches left_tag_pattern. It will then expand the chunk to incorporate the new material on the left. |
right | This rule's right tag pattern. When applied to a ChunkString, this rule will find any chunk whose beginning matches right_tag_pattern, and immediately preceded by a strip whose end matches this pattern. It will then merge those two chunks into a single chunk. |
descr:str | A short description of the purpose and/or effect of this rule. |