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).
-
For each index end in [0, 1, ..., N]:
-
For each edge s.t. edge.end = end:
-
If edge is incomplete, and edge.next is not a
part of speech:
-
Apply PredictorRule to edge
-
If edge is incomplete, and edge.next is a part
of speech:
-
Apply ScannerRule to edge
-
If edge is complete:
-
Apply CompleterRule to edge
-
Return any complete parses in the chart
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.
|
__init__(self,
grammar,
lexicon,
trace=0)
Create a new Earley chart parser, that uses grammar to
parse texts. |
source code
|
|
list of Tree
|
|
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__
|