public class UnaryRule extends java.lang.Object implements Rule, java.lang.Comparable<UnaryRule>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
int |
child |
int |
parent |
float |
score
Score should be a log probability
|
Constructor and Description |
---|
UnaryRule(int parent,
int child)
The score is set to Float.NaN by default.
|
UnaryRule(int parent,
int child,
double score) |
UnaryRule(java.lang.String s,
Index<java.lang.String> index)
Decode a UnaryRule out of a String representation with help from
an Index.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(UnaryRule ur) |
boolean |
equals(java.lang.Object o)
A UnaryRule is equal to another UnaryRule with the same parent and child.
|
int |
hashCode() |
int |
parent() |
float |
score() |
java.lang.String |
toString() |
java.lang.String |
toString(Index<java.lang.String> index) |
java.lang.String |
toStringNoScore(Index<java.lang.String> index) |
public int parent
public float score
public int child
public UnaryRule(int parent, int child)
parent
- Parent statechild
- Child statepublic UnaryRule(int parent, int child, double score)
public UnaryRule(java.lang.String s, Index<java.lang.String> index)
s
- The String representationindex
- The Index used to convert String to intpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Object to be compared withpublic int compareTo(UnaryRule ur)
compareTo
in interface java.lang.Comparable<UnaryRule>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Index<java.lang.String> index)
public java.lang.String toStringNoScore(Index<java.lang.String> index)