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

Type FeatureEarleyChartParse

object --+            
         |            
    ParseI --+        
             |        
 AbstractParse --+    
                 |    
  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.
Method Summary
  __init__(self, grammar, lexicon, trace)
Create a new Earley chart parser, that uses grammar to parse texts.
  get_parse_list(self, tokens)
Inherited from AbstractParse: get_parse, grammar, parse
Inherited from ParseI: get_parse_probs
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Method Details

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

Create a new Earley chart parser, that uses grammar to parse texts.
Parameters:
grammar - The grammar used to parse texts.
           (type=cfg.Grammar)
lexicon - A lexicon of words that records the parts of speech that each word can have. Each key is a word, and the corresponding value is a list of parts of speech.
           (type=dict from string to (list of string))
trace - The level of tracing that should be used when parsing a text. 0 will generate no tracing output; and higher numbers will produce more verbose tracing output.
           (type=int)
Overrides:
nltk_lite.parse.chart.EarleyChartParse.__init__ (inherited documentation)

Generated by Epydoc 2.1 on Tue Sep 5 09:37:21 2006 http://epydoc.sf.net