Package nltk :: Package chunk :: Module regexp :: Class ChinkRule
[hide private]
[frames] | no frames]

Class ChinkRule

source code

     object --+    
              |    
RegexpChunkRule --+
                  |
                 ChinkRule

A rule specifying how to remove chinks to a ChunkString, using a matching tag pattern. When applied to a ChunkString, it will find any substring that matches this tag pattern and that is contained in a chunk, and remove it from that chunk, thus creating two new chunks.

Instance Methods [hide private]
 
__init__(self, tag_pattern, descr)
Construct a new ChinkRule.
source code
string
__repr__(self)
Returns: A string representation of this rule.
source code

Inherited from RegexpChunkRule: apply, descr

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Static Methods [hide private]

Inherited from RegexpChunkRule: parse

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tag_pattern, descr)
(Constructor)

source code 

Construct a new ChinkRule.

Parameters:
  • tag_pattern (string) - This rule's tag pattern. When applied to a ChunkString, this rule will find any substring that matches this tag pattern and that is contained in a chunk, and remove it from that chunk, thus creating two new chunks.
  • descr (string) - A short description of the purpose and/or effect of this rule.
Overrides: RegexpChunkRule.__init__

__repr__(self)
(Representation operator)

source code 
Returns: string
A string representation of this rule. This string representation has the form:
   <ChinkRule: '<IN|VB.*>'>

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

Overrides: RegexpChunkRule.__repr__