Package nltk :: Package tag :: Module sequential :: Class DefaultTagger
[hide private]
[frames] | no frames]

Class DefaultTagger

source code

         object --+        
                  |        
        api.TaggerI --+    
                      |    
SequentialBackoffTagger --+
                          |
             object --+   |
                      |   |
        yaml.YAMLObject --+
                          |
                         DefaultTagger

A tagger that assigns the same tag to every token.

Nested Classes [hide private]

Inherited from yaml.YAMLObject: __metaclass__, yaml_dumper, yaml_loader

Instance Methods [hide private]
 
__init__(self, tag)
Construct a new tagger that assigns tag to all tokens.
source code
str
choose_tag(self, tokens, index, history)
Decide which tag should be used for the specified token, and return that tag.
source code
 
__repr__(self)
repr(x)
source code

Inherited from SequentialBackoffTagger: tag, tag_one

Inherited from SequentialBackoffTagger (private): _get_backoff

Inherited from api.TaggerI: batch_tag

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

    Deprecated

Inherited from SequentialBackoffTagger: tag_sents

Class Methods [hide private]

Inherited from yaml.YAMLObject: from_yaml, to_yaml

Class Variables [hide private]
  yaml_tag = '!nltk.DefaultTagger'

Inherited from yaml.YAMLObject: yaml_flow_style

Instance Variables [hide private]

Inherited from SequentialBackoffTagger (private): _taggers

Properties [hide private]

Inherited from SequentialBackoffTagger: backoff

Inherited from object: __class__

Method Details [hide private]

__init__(self, tag)
(Constructor)

source code 

Construct a new tagger that assigns tag to all tokens.

Overrides: SequentialBackoffTagger.__init__

choose_tag(self, tokens, index, history)

source code 

Decide which tag should be used for the specified token, and return that tag. If this tagger is unable to determine a tag for the specified token, return None -- do not consult the backoff tagger. This method should be overridden by subclasses of SequentialBackoffTagger.

Parameters:
  • tokens - The list of words that are being tagged.
  • index - The index of the word whose tag should be returned.
  • history - A list of the tags for all words before index.
Returns: str
Overrides: SequentialBackoffTagger.choose_tag
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)