Package nltk_lite :: Package contrib :: Module marshal :: Class MarshalNgram
[hide private]
[frames] | no frames]

Class MarshalNgram

source code

     object --+                
              |                
yaml.YAMLObject --+            
                  |            
           tag.TagI --+        
                      |        
  tag.SequentialBackoff --+    
                          |    
            tag.ngram.Ngram --+
                              |
                             MarshalNgram

Nested Classes [hide private]

Inherited from yaml.YAMLObject: __metaclass__, yaml_dumper, yaml_loader

Instance Methods [hide private]
 
marshal(self, filename)
Marshals (saves to a plain text file) the tagger model.
source code
 
unmarshal(self, filename)
Unmarshals (loads from a plain text file) the tagger model.
source code

Inherited from tag.ngram.Ngram: __init__, __repr__, size, tag_one, train

Inherited from tag.SequentialBackoff: tag, tag_sents

Inherited from tag.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]
  _classname = 'NgramTagger'

Inherited from yaml.YAMLObject: yaml_flow_style, yaml_tag

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

marshal(self, filename)

source code 

Marshals (saves to a plain text file) the tagger model.

Parameters:
  • filename (string) - Name of the file to which save the model (will be overwritten if it already exists).

unmarshal(self, filename)

source code 

Unmarshals (loads from a plain text file) the tagger model. For safety, this operation is intended to be performed only on newly created taggers (i.e., without any previous model).

Parameters:
  • filename (string) - Name of the file from which the model will be read.