edu.stanford.nlp.parser.shiftreduce.Transition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-parser Show documentation
Show all versions of stanford-parser Show documentation
Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.
package edu.stanford.nlp.parser.shiftreduce;
import java.io.Serializable;
import java.util.List;
import edu.stanford.nlp.parser.common.ParserConstraint;
/**
* An interface which defines a transition type in the shift-reduce
* parser. Expected transition types are shift, unary, binary,
* finalize, and idle.
*
* There is also a compound unary transition for combining multiple
* unary transitions into one, which lets us prevent the parser from
* creating arbitrary unary transition sequences.
*/
public interface Transition extends Serializable {
/**
* Whether or not it is legal to apply this transition to this state.
*/
public boolean isLegal(State state, List constraints);
/**
* Applies this transition to get a new state.
*/
public State apply(State state);
/**
* Applies this transition to get a new state.
*/
public State apply(State state, double scoreDelta);
}