public class UnaryRule extends Object implements Rule, Comparable<UnaryRule>, 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(String s,
Index<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(Object o)
A UnaryRule is equal to another UnaryRule with the same parent and child.
|
int |
hashCode() |
int |
parent() |
float |
score() |
String |
toString() |
String |
toString(Index<String> index) |
String |
toStringNoScore(Index<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 boolean equals(Object o)
public int compareTo(UnaryRule ur)
compareTo
in interface Comparable<UnaryRule>