|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.UnaryRule
public class UnaryRule
Unary grammar rules (with ints for parent and child).
Field Summary | |
---|---|
int |
child
|
int |
parent
|
float |
score
Score should be a log probability |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int parent
public float score
public int child
Constructor Detail |
---|
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 intMethod Detail |
---|
public float score()
score
in interface Rule
public int parent()
parent
in interface Rule
public 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 with
public 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |