public class CompoundUnaryTransition extends java.lang.Object implements Transition
| Modifier and Type | Field and Description |
|---|---|
boolean |
isRoot
root transitions are illegal in the middle of the tree, naturally
|
java.lang.String[] |
labels
labels[0] is the top of the unary chain.
|
| Constructor and Description |
|---|
CompoundUnaryTransition(java.util.List<java.lang.String> labels,
boolean isRoot) |
| Modifier and Type | Method and Description |
|---|---|
State |
apply(State state)
Add a unary node to the existing node on top of the stack
|
State |
apply(State state,
double scoreDelta)
Add a unary node to the existing node on top of the stack
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isLegal(State state,
java.util.List<ParserConstraint> constraints)
Legal as long as there is at least one item on the state's stack
and that item has not already been unary transformed.
|
java.lang.String |
toString() |
public final java.lang.String[] labels
public final boolean isRoot
public CompoundUnaryTransition(java.util.List<java.lang.String> labels,
boolean isRoot)
public boolean isLegal(State state, java.util.List<ParserConstraint> constraints)
isLegal in interface Transitionpublic State apply(State state)
apply in interface Transitionpublic State apply(State state, double scoreDelta)
apply in interface Transitionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object