|
__init__(self,
grammar,
trace=0)
Create a new ShiftReduceParser , that uses
grammar to parse texts. |
source code
|
|
list of Tree
|
nbest_parse(self,
tokens,
n=None)
Returns:
A list of parse trees that represent possible structures for the
given sentence. |
source code
|
|
list of String and Tree
|
|
list of String
|
|
|
|
Production or boolean
|
|
boolean
|
shift(self)
Move a token from the beginning of the remaining text to the end of
the stack. |
source code
|
|
Production or None
|
reduce(self,
production=None)
Use production to combine the rightmost stack elements
into a single Tree . |
source code
|
|
boolean
|
undo(self)
Return the parser to its state before the most recent shift or reduce
operation. |
source code
|
|
list of Production
|
|
list of Tree
|
parses(self)
Returns:
A list of the parses that have been found by this parser so far. |
source code
|
|
|
|
Inherited from ShiftReduceParser :
grammar ,
parse ,
trace
Inherited from api.ParserI :
batch_iter_parse ,
batch_nbest_parse ,
batch_parse ,
batch_prob_parse ,
iter_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
|