__init__(self,
grammar,
strategy=BU_LC_INCREMENTAL_STRATEGY,
trace=0,
trace_chart_width=50,
chart_class=<class 'nltk.parse.earleychart.IncrementalChart'>)
(Constructor)
| source code
|
Create a new Earley chart parser, that uses grammar to
parse texts.
- Parameters:
grammar (ContextFreeGrammar) - The grammar used to parse texts.
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.
trace_chart_width (int) - The default total width reserved for the chart in trace output.
The remainder of each line will be used to display edges.
chart_class - The class that should be used to create the charts used by this
parser.
- Overrides:
chart.ChartParser.__init__
|