edu.stanford.nlp.parser.lexparser
Class UnaryRule
java.lang.Object
edu.stanford.nlp.parser.lexparser.Rule
edu.stanford.nlp.parser.lexparser.UnaryRule
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<UnaryRule>
public class UnaryRule
- extends Rule
- implements java.lang.Comparable<UnaryRule>
Unary grammar rules (with ints for parent and child).
- Author:
- Dan Klein
- See Also:
- Serialized Form
Fields inherited from class edu.stanford.nlp.parser.lexparser.Rule |
parent, score |
Constructor Summary |
UnaryRule()
Fields are set to: -1, -1, Float.NaN. |
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,
Numberer n)
Decode a UnaryRule out of a String representation with help from
a Numberer. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
child
public int child
UnaryRule
public UnaryRule()
- Fields are set to: -1, -1, Float.NaN.
UnaryRule
public UnaryRule(int parent,
int child)
- The score is set to Float.NaN by default.
UnaryRule
public UnaryRule(int parent,
int child,
double score)
UnaryRule
public UnaryRule(java.lang.String s,
Numberer n)
- Decode a UnaryRule out of a String representation with help from
a Numberer.
isUnary
public boolean isUnary()
- Overrides:
isUnary
in class Rule
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- A UnaryRule is equal to another UnaryRule with the same parent and child.
The score is not included in the equality computation.
- Overrides:
equals
in class java.lang.Object
- Parameters:
o
- Object to be compared with
- Returns:
- Whether the object is equal to this
compareTo
public int compareTo(UnaryRule ur)
- Specified by:
compareTo
in interface java.lang.Comparable<UnaryRule>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toStringNoScore
public java.lang.String toStringNoScore()
Stanford NLP Group