|
|||||||||
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<String> stateIndex)
|
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<BinaryRule> |
ruleIteratorByLeftChild(int state)
|
Iterator<BinaryRule> |
ruleIteratorByParent(int state)
|
Iterator<BinaryRule> |
ruleIteratorByRightChild(int state)
|
List<BinaryRule> |
ruleListByLeftChild(int state)
|
List<BinaryRule> |
ruleListByParent(int state)
|
List<BinaryRule> |
ruleListByRightChild(int state)
|
List<BinaryRule> |
rules()
|
Set<BinaryRule> |
ruleSetByLeftChild(int state)
|
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)
|
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(Index<String> stateIndex)
Method Detail |
---|
public int numRules()
public 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 Iterator<BinaryRule> iterator()
iterator
in interface Iterable<BinaryRule>
public Iterator<BinaryRule> ruleIteratorByParent(int state)
public Iterator<BinaryRule> ruleIteratorByRightChild(int state)
public Iterator<BinaryRule> ruleIteratorByLeftChild(int state)
public List<BinaryRule> ruleListByParent(int state)
public List<BinaryRule> ruleListByRightChild(int state)
public List<BinaryRule> ruleListByLeftChild(int state)
public Set<BinaryRule> ruleSetByRightChild(int state)
public Set<BinaryRule> ruleSetByLeftChild(int state)
public void readData(BufferedReader in) throws IOException
in
- Where input is read from
IOException
- If format is bungpublic void writeData(Writer w) throws IOException
w
- Where output is written
IOException
- If data can't be written
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |