public class CompoundUnaryTransition extends Object implements Transition
| Modifier and Type | Field and Description |
|---|---|
boolean |
isRoot
root transitions are illegal in the middle of the tree, naturally
|
String[] |
labels
labels[0] is the top of the unary chain.
|
| Constructor and Description |
|---|
CompoundUnaryTransition(List<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(Object o) |
int |
hashCode() |
boolean |
isLegal(State state,
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.
|
String |
toString() |
public final String[] labels
public final boolean isRoot
public boolean isLegal(State state, List<ParserConstraint> constraints)
isLegal in interface Transitionpublic State apply(State state)
apply in interface Transitionpublic State apply(State state, double scoreDelta)
apply in interface Transition