class documentation
class SplitRule(RegexpChunkRule): (source)
Constructor: SplitRule(left_tag_pattern, right_tag_pattern, descr)
A rule specifying how to split chunks in a ChunkString, using two matching tag patterns: a left pattern, and a right pattern. When applied to a ChunkString, it will find any chunk that matches the left pattern followed by the right pattern. It will then split the chunk into two new chunks, at the point between the two pattern matches.
Method | __init__ |
Construct a new SplitRule. |
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 SplitRule.
Parameters | |
left | This rule's left tag pattern. When applied to a ChunkString, this rule will find any chunk containing a substring that matches this pattern followed by right_tag_pattern. It will then split the chunk into two new chunks at the point between these two matching patterns. |
right | This rule's right tag pattern. When applied to a ChunkString, this rule will find any chunk containing a substring that matches left_tag_pattern followed by this pattern. It will then split the chunk into two new chunks at the point between these two matching patterns. |
descr:str | A short description of the purpose and/or effect of this rule. |