nltk.SteppingShiftReduceParser.reduce

SteppingShiftReduceParser.reduce(production=None)[source]

Use production to combine the rightmost stack elements into a single Tree. If production does not match the rightmost stack elements, then do nothing.

Returns:The production used to reduce the stack, if a reduction was performed. If no reduction was performed, return None.
Return type:Production or None