public class BinaryTransition extends java.lang.Object implements Transition
Modifier and Type | Class and Description |
---|---|
static class |
BinaryTransition.Side |
Modifier and Type | Field and Description |
---|---|
boolean |
isRoot
root transitions are illegal in the middle of the tree, naturally
|
java.lang.String |
label |
BinaryTransition.Side |
side
Which side the head is on
|
Constructor and Description |
---|
BinaryTransition(java.lang.String label,
BinaryTransition.Side side,
boolean isRoot) |
Modifier and Type | Method and Description |
---|---|
State |
apply(State state)
Add a binary node to the existing node on top of the stack
|
State |
apply(State state,
double scoreDelta)
Add a binary node to the existing node on top of the stack
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isBinarized() |
boolean |
isLegal(State state,
java.util.List<ParserConstraint> constraints)
Legal as long as there are at least two items on the state's stack.
|
java.lang.String |
toString() |
public final java.lang.String label
public final BinaryTransition.Side side
public final boolean isRoot
public BinaryTransition(java.lang.String label, BinaryTransition.Side side, boolean isRoot)
public boolean isLegal(State state, java.util.List<ParserConstraint> constraints)
isLegal
in interface Transition
public boolean isBinarized()
public State apply(State state)
apply
in interface Transition
public State apply(State state, double scoreDelta)
apply
in interface Transition
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object