Class ShiftTransition
- java.lang.Object
-
- edu.stanford.nlp.parser.shiftreduce.ShiftTransition
-
- All Implemented Interfaces:
Transition,Serializable
public class ShiftTransition extends Object implements Transition
Transition that moves a single item from the front of the queue to the top of the stack without making any other changes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ShiftTransition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stateapply(State state)Add the new preterminal to the stack, increment the queue position.Stateapply(State state, double scoreDelta)Add the new preterminal to the stack, increment the queue position.booleanequals(Object o)inthashCode()booleanisLegal(State state, List<ParserConstraint> constraints)Shifting is legal as long as the state is not finished and there are more items on the queue to be shifted.StringtoString()
-
-
-
Method Detail
-
isLegal
public boolean isLegal(State state, List<ParserConstraint> constraints)
Shifting is legal as long as the state is not finished and there are more items on the queue to be shifted. TODO: go through the papers and make sure they don't mention any other conditions where one shouldn't shift- Specified by:
isLegalin interfaceTransition
-
apply
public State apply(State state)
Add the new preterminal to the stack, increment the queue position.- Specified by:
applyin interfaceTransition
-
apply
public State apply(State state, double scoreDelta)
Add the new preterminal to the stack, increment the queue position.- Specified by:
applyin interfaceTransition
-
-