class documentation

A rule specifying how to add chunks to a ChunkString, using three matching tag patterns: one for the left context, one for the chunk, and one for the right context. When applied to a ChunkString, it will find any substring that matches the chunk tag pattern, is surrounded by substrings that match the two context patterns, and is not already part of a chunk; and create a new chunk containing the substring that matched the chunk tag pattern.

Caveat: Both the left and right context are consumed when this rule matches; therefore, if you need to find overlapping matches, you will need to apply your rule more than once.

Method __init__ Construct a new ChunkRuleWithContext.
Method __repr__ Return a string representation of this rule. It has the form:
Instance Variable _chunk_tag_pattern Undocumented
Instance Variable _left_context_tag_pattern Undocumented
Instance Variable _right_context_tag_pattern 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
def __init__(self, left_context_tag_pattern, chunk_tag_pattern, right_context_tag_pattern, descr): (source)

Construct a new ChunkRuleWithContext.

Parameters
left_context_tag_pattern:strA tag pattern that must match the left context of chunk_tag_pattern for this rule to apply.
chunk_tag_pattern:strA tag pattern that must match for this rule to apply. If the rule does apply, then this pattern also identifies the substring that will be made into a chunk.
right_context_tag_pattern:strA tag pattern that must match the right context of chunk_tag_pattern for this rule to apply.
descr:strA short description of the purpose and/or effect of this rule.
def __repr__(self): (source)

Return a string representation of this rule. It has the form:

<ChunkRuleWithContext: '<IN>', '<NN>', '<DT>'>

Note that this representation does not include the description string; that string can be accessed separately with the descr() method.

Returns
strUndocumented
_chunk_tag_pattern = (source)

Undocumented

_left_context_tag_pattern = (source)

Undocumented

_right_context_tag_pattern = (source)

Undocumented