|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.BinaryGrammar
public class BinaryGrammar
Maintains efficient indexing of binary grammar rules.
Constructor Summary | |
---|---|
BinaryGrammar(int numStates)
|
|
BinaryGrammar(int numStates,
java.lang.String stateSpace)
|
Method Summary | |
---|---|
void |
addRule(BinaryRule br)
|
boolean |
isSynthetic(int state)
|
java.util.Iterator<BinaryRule> |
iterator()
|
int |
numRules()
|
void |
readData(java.io.BufferedReader in)
Populates data in this BinaryGrammar from the character stream given by the Reader r. |
java.util.Iterator<BinaryRule> |
ruleIteratorByLeftChild(int state)
|
java.util.Iterator<BinaryRule> |
ruleIteratorByParent(int state)
|
java.util.Iterator<BinaryRule> |
ruleIteratorByRightChild(int state)
|
java.util.List<BinaryRule> |
ruleListByLeftChild(int state)
|
java.util.List<BinaryRule> |
ruleListByParent(int state)
|
java.util.List<BinaryRule> |
ruleListByRightChild(int state)
|
java.util.List<BinaryRule> |
rules()
|
java.util.Set<BinaryRule> |
ruleSetByLeftChild(int state)
|
java.util.Set<BinaryRule> |
ruleSetByRightChild(int state)
|
double |
scoreRule(BinaryRule br)
|
void |
splitRules()
Populates the "splitRules" accessor lists using the existing rule lists. |
BinaryRule[] |
splitRulesWithLC(int state)
|
BinaryRule[] |
splitRulesWithRC(int state)
|
java.lang.String |
stateSpace()
|
void |
writeData(java.io.Writer w)
Writes out data from this Object to the Writer w. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryGrammar(int numStates)
public BinaryGrammar(int numStates, java.lang.String stateSpace)
Method Detail |
---|
public int numRules()
public java.util.List<BinaryRule> rules()
public java.lang.String stateSpace()
public boolean isSynthetic(int state)
public void splitRules()
This method must be called before the grammar is used, either after training or deserializing grammar.
public BinaryRule[] splitRulesWithLC(int state)
public BinaryRule[] splitRulesWithRC(int state)
public double scoreRule(BinaryRule br)
public void addRule(BinaryRule br)
public java.util.Iterator<BinaryRule> iterator()
iterator
in interface java.lang.Iterable<BinaryRule>
public java.util.Iterator<BinaryRule> ruleIteratorByParent(int state)
public java.util.Iterator<BinaryRule> ruleIteratorByRightChild(int state)
public java.util.Iterator<BinaryRule> ruleIteratorByLeftChild(int state)
public java.util.List<BinaryRule> ruleListByParent(int state)
public java.util.List<BinaryRule> ruleListByRightChild(int state)
public java.util.List<BinaryRule> ruleListByLeftChild(int state)
public java.util.Set<BinaryRule> ruleSetByRightChild(int state)
public java.util.Set<BinaryRule> ruleSetByLeftChild(int state)
public void readData(java.io.BufferedReader in) throws java.io.IOException
in
- Where input is read from
java.io.IOException
- If format is bungpublic void writeData(java.io.Writer w) throws java.io.IOException
w
- Where output is written
java.io.IOException
- If data can't be written
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |