Package nltk_lite :: Package tag :: Module unigram :: Class Regexp
[hide private]
[frames] | no frames]

Class Regexp

source code

     object --+            
              |            
yaml.YAMLObject --+        
                  |        
               TagI --+    
                      |    
      SequentialBackoff --+
                          |
                         Regexp

A tagger that assigns tags to words based on regular expressions.

Nested Classes [hide private]

Inherited from yaml.YAMLObject: __metaclass__, yaml_dumper, yaml_loader

Instance Methods [hide private]
 
__init__(self, regexps, backoff=None)
Construct a new regexp tagger.
source code
 
tag_one(self, token, history=None) source code
 
__repr__(self)
repr(x)
source code

Inherited from SequentialBackoff: tag, tag_sents

Inherited from SequentialBackoff (private): _backoff_tag_one

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

Class Methods [hide private]

Inherited from yaml.YAMLObject: from_yaml, to_yaml

Class Variables [hide private]
  yaml_tag = '!tag.Regexp'

Inherited from yaml.YAMLObject: yaml_flow_style

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, regexps, backoff=None)
(Constructor)

source code 

Construct a new regexp tagger.

Parameters:
  • regexps (list of (string,string)) - A list of (regexp,tag) pairs, each of which indicates that a word matching regexp should be tagged with tag. The pairs will be evalutated in order. If none of the regexps match a word, then the optional backoff tagger is invoked, else it is assigned the tag None.
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)