__init__(self,
grammar,
lexicon,
trace=0)
(Constructor)
| source code
|
Create a new Earley chart parser, that uses grammar to
parse texts.
- Parameters:
grammar (cfg.Grammar ) - The grammar used to parse texts.
lexicon (dict from string to (list
of string )) - 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.
trace (int ) - 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.
- Overrides:
AbstractParse.__init__
|