Package nltk_lite :: Package parse :: Module featurechart :: Class FeatureEarleyChartParse
[hide private]
[frames] | no frames]

Class FeatureEarleyChartParse

source code

    object --+            
             |            
        ParseI --+        
                 |        
     AbstractParse --+    
                     |    
chart.EarleyChartParse --+
                         |
                        FeatureEarleyChartParse

A chart parser implementing the Earley parsing algorithm, allowing nonterminals that have features (known as Categories).

FeatureEarleyChartParse uses a lexicon to decide whether a leaf has a given part of speech. This lexicon is encoded as a dictionary that maps each word to a list of parts of speech that word can have. Unlike in the EarleyChartParse, this lexicon is case-insensitive.

Instance Methods [hide private]
 
__init__(self, grammar, lexicon, trace=0)
Create a new Earley chart parser, that uses grammar to parse texts.
source code
list of Tree
get_parse_list(self, tokens)
Returns: A list of the parse trees for the sentence.
source code

Inherited from AbstractParse: get_parse, grammar, parse

Inherited from ParseI: get_parse_dict, get_parse_probs

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, grammar, lexicon, trace=0)
(Constructor)

source code 

Create a new Earley chart parser, that uses grammar to parse texts.

Overrides: chart.EarleyChartParse.__init__
(inherited documentation)

get_parse_list(self, tokens)

source code 
Returns: list of Tree
A list of the parse trees for the sentence. When possible, this list should be sorted from most likely to least likely.
Overrides: chart.EarleyChartParse.get_parse_list