edu.stanford.nlp.parser.lexparser
Class BinaryRule
java.lang.Object
edu.stanford.nlp.parser.lexparser.Rule
edu.stanford.nlp.parser.lexparser.BinaryRule
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable
public class BinaryRule
- extends Rule
- implements java.io.Serializable, java.lang.Comparable
Binary rules (ints for parent, left and right children)
- Author:
- Dan Klein
- See Also:
- Serialized Form
Fields inherited from class edu.stanford.nlp.parser.lexparser.Rule |
parent, score |
Constructor Summary |
BinaryRule()
|
BinaryRule(int parent,
int leftChild,
int rightChild)
Create a new BinaryRule with the parent and children coded as ints. |
BinaryRule(int parent,
int leftChild,
int rightChild,
double score)
|
BinaryRule(java.lang.String s,
Numberer n)
Creates a BinaryRule from String s, assuming it was created using toString(). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
leftChild
public int leftChild
rightChild
public int rightChild
BinaryRule
public BinaryRule()
BinaryRule
public BinaryRule(int parent,
int leftChild,
int rightChild)
- Create a new BinaryRule with the parent and children coded as ints.
Score defaults to Float.NaN.
- Parameters:
parent
- The parent intleftChild
- The left child intrightChild
- The right child int
BinaryRule
public BinaryRule(int parent,
int leftChild,
int rightChild,
double score)
BinaryRule
public BinaryRule(java.lang.String s,
Numberer n)
- Creates a BinaryRule from String s, assuming it was created using toString().
- Parameters:
s
- A String in which the binary rule is represented as parent,
left-child, right-child, score, with the items quoted as neededn
- Number used to convert String names to ints
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toStringNoScore
public java.lang.String toStringNoScore()
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interface java.lang.Comparable
Stanford NLP Group