class documentation

class Transition(object): (source)

Constructor: Transition(alg_option)

View In Hierarchy

This class defines a set of transition which is applied to a configuration to get another configuration Note that for different parsing algorithm, the transition is different.

Method __init__ No summary
Method left_arc :return : A new configuration or -1 if the pre-condition is not satisfied
Method reduce :return : A new configuration or -1 if the pre-condition is not satisfied
Method right_arc :return : A new configuration or -1 if the pre-condition is not satisfied
Method shift :return : A new configuration or -1 if the pre-condition is not satisfied
Constant LEFT_ARC Undocumented
Constant REDUCE Undocumented
Constant RIGHT_ARC Undocumented
Constant SHIFT Undocumented
Instance Variable _algo Undocumented
def __init__(self, alg_option): (source)
Parameters
alg_option:strthe algorithm option of this parser. Currently support arc-standard and arc-eager algorithm
def left_arc(self, conf, relation): (source)

Note that the algorithm for left-arc is quite similar except for precondition for both arc-standard and arc-eager
:return : A new configuration or -1 if the pre-condition is not satisfied

Parameters
confUndocumented
relationUndocumented
configurationis the current configuration
def reduce(self, conf): (source)

Note that the algorithm for reduce is only available for arc-eager
:return : A new configuration or -1 if the pre-condition is not satisfied

Parameters
confUndocumented
configurationis the current configuration
def right_arc(self, conf, relation): (source)

Note that the algorithm for right-arc is DIFFERENT for arc-standard and arc-eager
:return : A new configuration or -1 if the pre-condition is not satisfied

Parameters
confUndocumented
relationUndocumented
configurationis the current configuration
def shift(self, conf): (source)

Note that the algorithm for shift is the SAME for arc-standard and arc-eager
:return : A new configuration or -1 if the pre-condition is not satisfied

Parameters
confUndocumented
configurationis the current configuration
LEFT_ARC: str = (source)

Undocumented

Value
'LEFTARC'
REDUCE: str = (source)

Undocumented

Value
'REDUCE'
RIGHT_ARC: str = (source)

Undocumented

Value
'RIGHTARC'
SHIFT: str = (source)

Undocumented

Value
'SHIFT'

Undocumented