|
|||||||||
| 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(Index<java.lang.String> stateIndex)
|
|
| 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()
|
double |
scoreRule(BinaryRule br)
|
void |
splitRules()
Populates the "splitRules" accessor lists using the existing rule lists. |
BinaryRule[] |
splitRulesWithLC(int state)
|
BinaryRule[] |
splitRulesWithRC(int state)
|
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(Index<java.lang.String> stateIndex)
| Method Detail |
|---|
public int numRules()
public java.util.List<BinaryRule> rules()
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 void readData(java.io.BufferedReader in)
throws java.io.IOException
in - Where input is read from
java.io.IOException - If format is bung
public 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 | ||||||||