| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
api.ParserI --+
|
ShiftReduceParser --+
|
SteppingShiftReduceParser
A ShiftReduceParser that allows you to setp through the
parsing process, performing a single operation at a time. It also allows
you to change the parser's grammar midway through parsing a text.
The initialize method is used to start parsing a text.
shift performs a single shift operation, and
reduce performs a single reduce operation.
step will perform a single reduce operation if possible;
otherwise, it will perform a single shift operation. parses
returns the set of parses that have been found by the parser.
See Also:
nltk.cfg
|
|||
|
|||
list of Tree
|
|
||
list of String and Tree
|
|
||
list of String
|
|
||
|
|||
Production or boolean
|
|
||
boolean
|
|
||
Production or None
|
|
||
boolean
|
|
||
list of Production
|
|
||
list of Tree
|
|
||
|
|||
|
Inherited from Inherited from Inherited from Inherited from |
|||
| Deprecated | |||
|---|---|---|---|
|
Inherited from |
|||
|
|||
|
_history A list of (stack, remaining_text) pairs, containing all
of the previous states of the parser.
|
|||
|
|||
|
Inherited from |
|||
|
|||
Create a new
|
|
|
|
Start parsing a given text. This sets the parser's stack to
|
Perform a single parsing operation. If a reduction is possible, then perform that reduction, and return the production that it is based on. Otherwise, if a shift is possible, then perform it, and return 1. Otherwise, return 0.
|
Move a token from the beginning of the remaining text to the end of the stack. If there are no more tokens in the remaining text, then do nothing.
|
Use
|
Return the parser to its state before the most recent shift or reduce
operation. Calling
|
|
|
Change the grammar used to parse texts.
|
|
|||
_historyA list of(stack, remaining_text) pairs, containing all of
the previous states of the parser. This history is used to implement the
undo operation.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Wed Aug 27 15:08:56 2008 | http://epydoc.sourceforge.net |