|
|
__init__(self,
grammar,
strategy=None,
trace=0)
Create a new chart parser, that uses grammar to parse
texts. |
source code
|
|
|
|
initialize(self,
tokens)
Begin parsing the given tokens. |
source code
|
|
|
|
step(self)
Returns:
A generator that adds edges to the chart, one at a time. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parses(self,
tree_class=<class 'nltk.tree.Tree'>)
Returns:
The parse trees currently contained in the chart. |
source code
|
|
|
|
set_strategy(self,
strategy)
Change the startegy that the parser uses to decide which edges to add
to the chart. |
source code
|
|
|
|
set_grammar(self,
grammar)
Change the grammar used by the parser. |
source code
|
|
|
|
set_chart(self,
chart)
Load a given chart into the chart parser. |
source code
|
|
list of Tree
|
nbest_parse(self,
tokens,
n=None,
tree_class=<class 'nltk.tree.Tree'>)
Returns:
A list of parse trees that represent possible structures for the
given sentence. |
source code
|
|
|
Inherited from api.ParserI:
batch_iter_parse,
batch_nbest_parse,
batch_parse,
batch_prob_parse,
iter_parse,
parse,
prob_parse
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
Inherited from api.ParserI:
batch_test,
get_parse,
get_parse_dict,
get_parse_list,
get_parse_prob
|