public class ExhaustiveDependencyParser extends java.lang.Object implements Scorer, KBestViterbiParser
| Constructor and Description |
|---|
ExhaustiveDependencyParser(DependencyGrammar dg,
Lexicon lex,
Options op,
Index<java.lang.String> wordIndex,
Index<java.lang.String> tagIndex) |
| Modifier and Type | Method and Description |
|---|---|
void |
displayHeadScores()
This displays a headScore matrix, which will be valid after parsing
a sentence.
|
Tree |
getBestParse()
Return the best dependency parse for a sentence.
|
java.util.List<ScoredObject<Tree>> |
getBestParses()
Get a complete set of the maximally scoring parses for a sentence,
rather than one chosen at random.
|
double |
getBestScore()
Gets the score (typically a log probability) of the best
parse of a sentence.
|
java.util.List<ScoredObject<Tree>> |
getKBestParses(int k)
Get the exact k best parses for the sentence.
|
java.util.List<ScoredObject<Tree>> |
getKGoodParses(int k)
Get k good parses for the sentence.
|
java.util.List<ScoredObject<Tree>> |
getKSampledParses(int k)
Get k parse samples for the sentence.
|
boolean |
hasParse()
Does the sentence in the last call to parse() have a parse?
In theory this method shouldn't be here, but it seemed a
convenient place to put it for our more general parser interface.
|
boolean |
iPossible(Hook hook) |
double |
iScore(Edge edge) |
boolean |
oPossible(Hook hook) |
double |
oScore(Edge edge) |
boolean |
parse(java.util.List<? extends HasWord> sentence)
Parses the given sentence.
|
public ExhaustiveDependencyParser(DependencyGrammar dg, Lexicon lex, Options op, Index<java.lang.String> wordIndex, Index<java.lang.String> tagIndex)
public boolean parse(java.util.List<? extends HasWord> sentence)
ParserS).public boolean hasParse()
KBestViterbiParserhasParse in interface KBestViterbiParserpublic double getBestScore()
KBestViterbiParsergetBestScore in interface KBestViterbiParserpublic void displayHeadScores()
public Tree getBestParse()
parse() before a call to this method.
Implementation note: the best parse is recalculated from the chart each time this method is called. It isn't cached.
getBestParse in interface ViterbiParsernull.
The returned tree will begin with a binary branching node, the
left branch of which is the dependency tree proper, and the right
side of which contains a boundary word .$. which heads the
sentence.public java.util.List<ScoredObject<Tree>> getKBestParses(int k)
getKBestParses in interface KBestViterbiParserk - The number of best parses to returnpublic java.util.List<ScoredObject<Tree>> getBestParses()
getBestParses in interface KBestViterbiParserpublic java.util.List<ScoredObject<Tree>> getKGoodParses(int k)
getKGoodParses in interface KBestViterbiParserk - The number of good parses to returnpublic java.util.List<ScoredObject<Tree>> getKSampledParses(int k)
getKSampledParses in interface KBestViterbiParserk - The number of sampled parses to return