edu.stanford.nlp.parser.lexparser
Class BinaryGrammar
java.lang.Object
edu.stanford.nlp.parser.lexparser.BinaryGrammar
- All Implemented Interfaces:
- Serializable
- public class BinaryGrammar
- extends Object
- implements Serializable
Maintains efficient indexing of binary grammar rules.
- Author:
- Dan Klein
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinaryGrammar
public BinaryGrammar(int numStates)
BinaryGrammar
public BinaryGrammar(int numStates,
String stateSpace)
numRules
public int numRules()
rules
public List rules()
stateSpace
public String stateSpace()
isSynthetic
public boolean isSynthetic(int state)
splitRules
public void splitRules()
splitRulesWithLC
public BinaryRule[] splitRulesWithLC(int state)
splitRulesWithRC
public BinaryRule[] splitRulesWithRC(int state)
splitRulesWithParent
public BinaryRule[] splitRulesWithParent(int state)
scoreRule
public double scoreRule(BinaryRule br)
addRule
public void addRule(BinaryRule br)
ruleIterator
public Iterator ruleIterator()
ruleIteratorByParent
public Iterator ruleIteratorByParent(int state)
ruleIteratorByRightChild
public Iterator ruleIteratorByRightChild(int state)
ruleIteratorByLeftChild
public Iterator ruleIteratorByLeftChild(int state)
ruleListByParent
public List ruleListByParent(int state)
ruleListByRightChild
public List ruleListByRightChild(int state)
ruleListByLeftChild
public List ruleListByLeftChild(int state)
readData
public void readData(BufferedReader in)
throws IOException
- Populates data in this BinaryGrammar from the character stream
given by the Reader r.
- Throws:
IOException
writeData
public void writeData(Writer w)
throws IOException
- Writes out data from this Object to the Writer w.
- Throws:
IOException
Stanford NLP Group