|
|||||||||
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,
String stateSpace)
|
Method Summary | |
---|---|
void |
addRule(BinaryRule br)
|
boolean |
isSynthetic(int state)
|
Iterator<BinaryRule> |
iterator()
|
int |
numRules()
|
void |
readData(BufferedReader in)
Populates data in this BinaryGrammar from the character stream given by the Reader r. |
Iterator |
ruleIteratorByLeftChild(int state)
|
Iterator |
ruleIteratorByParent(int state)
|
Iterator |
ruleIteratorByRightChild(int state)
|
List |
ruleListByLeftChild(int state)
|
List |
ruleListByParent(int state)
|
List |
ruleListByRightChild(int state)
|
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)
|
String |
stateSpace()
|
void |
writeData(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, String stateSpace)
Method Detail |
---|
public int numRules()
public List<BinaryRule> rules()
public 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 Iterator<BinaryRule> iterator()
iterator
in interface Iterable<BinaryRule>
public Iterator ruleIteratorByParent(int state)
public Iterator ruleIteratorByRightChild(int state)
public Iterator ruleIteratorByLeftChild(int state)
public List ruleListByParent(int state)
public List ruleListByRightChild(int state)
public List ruleListByLeftChild(int state)
public void readData(BufferedReader in) throws IOException
IOException
public void writeData(Writer w) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |