public interface DependencyGrammar
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
short |
distanceBin(int distance) |
int |
numDistBins() |
int |
numTagBins() |
void |
readData(java.io.BufferedReader in)
Read from text grammar.
|
double |
score(IntDependency dependency)
Score a IntDependency according to the grammar.
|
double |
score(int headWord,
int headTag,
int argWord,
int argTag,
boolean leftHeaded,
int dist)
Score a dependency according to the grammar, where the elements of the
dependency are represented in separate paramters.
|
double |
scoreTB(IntDependency dependency)
Score an IntDependency in the reduced tagBin space according to the
grammar.
|
double |
scoreTB(int headWord,
int headTag,
int argWord,
int argTag,
boolean leftHeaded,
int dist)
Score a dependency according to the grammar, where the elements of the
dependency are represented in separate paramters.
|
void |
setLexicon(Lexicon lexicon)
Set the Lexicon, which the DependencyGrammar may use in scoring P(w|t).
|
int |
tagBin(int tag)
Converts a tag (coded as an integer via a Numberer) from its
representation in the full tag space to the reduced (projected) tag
space used in the DependencyGrammar.
|
void |
tune(java.util.Collection<Tree> trees)
Tune free parameters on these trees.
|
void |
writeData(java.io.PrintWriter w)
Write to text grammar.
|
int numTagBins()
int tagBin(int tag)
tag
- An int encoding a tag (in the "tags" Numberer)int numDistBins()
short distanceBin(int distance)
distance
- A distance in intervening words between head and argvoid tune(java.util.Collection<Tree> trees)
trees
- A Collection of Trees for use as a tuning data setdouble score(IntDependency dependency)
dependency
- The dependency object to be scored, in normal form.double scoreTB(IntDependency dependency)
dependency
- The dependency object to be scored, where the tags in
the dependency have already been mapped to a reduced space by a
tagProjection function.double score(int headWord, int headTag, int argWord, int argTag, boolean leftHeaded, int dist)
double scoreTB(int headWord, int headTag, int argWord, int argTag, boolean leftHeaded, int dist)
void readData(java.io.BufferedReader in) throws java.io.IOException
java.io.IOException
void writeData(java.io.PrintWriter w) throws java.io.IOException
java.io.IOException
void setLexicon(Lexicon lexicon)