public class ShiftReduceParserQuery extends java.lang.Object implements ParserQuery
| Constructor and Description |
|---|
ShiftReduceParserQuery(ShiftReduceParser parser) |
| Modifier and Type | Method and Description |
|---|---|
Tree |
getBestBinarizedParse() |
Tree |
getBestDependencyParse(boolean debinarize) |
Tree |
getBestFactoredParse() |
Tree |
getBestParse() |
Tree |
getBestPCFGParse()
TODO: can we get away with not calling this PCFG?
|
java.util.List<ScoredObject<Tree>> |
getBestPCFGParses()
TODO: if this is a beam, return all equal parses
|
double |
getBestScore() |
java.util.List<Transition> |
getBestTransitionSequence() |
KBestViterbiParser |
getDependencyParser() |
KBestViterbiParser |
getFactoredParser() |
java.util.List<ScoredObject<Tree>> |
getKBestParses(int k) |
java.util.List<ScoredObject<Tree>> |
getKBestPCFGParses(int kbestPCFG)
TODO: return more if this used a beam
|
java.util.List<ScoredObject<Tree>> |
getKGoodFactoredParses(int kbest) |
KBestViterbiParser |
getPCFGParser() |
double |
getPCFGScore() |
boolean |
hasFactoredParse() |
java.util.List<? extends HasWord> |
originalSentence() |
boolean |
parse(java.util.List<? extends HasWord> sentence) |
boolean |
parse(Tree tree) |
boolean |
parseAndReport(java.util.List<? extends HasWord> sentence,
java.io.PrintWriter pwErr)
TODO: if we add anything interesting to report, we should report it here
|
boolean |
parseFallback()
The model had to fall back to a simpler model on the previous parse
|
boolean |
parseNoMemory()
TODO: add memory handling?
|
boolean |
parseSkipped()
TODO: skip sentences which are too long
|
boolean |
parseSucceeded()
Parsing succeeded without any horrible errors or fallback
|
boolean |
parseUnparsable()
The model could not parse the most recent sentence for some reason
|
void |
restoreOriginalWords(Tree tree)
TODO: clearly this should be a default method in ParserQuery once Java 8 comes out
|
boolean |
saidMemMessage() |
void |
setConstraints(java.util.List<ParserConstraint> constraints) |
public ShiftReduceParserQuery(ShiftReduceParser parser)
public boolean parse(java.util.List<? extends HasWord> sentence)
parse in interface ParserQuerypublic boolean parse(Tree tree)
public boolean parseAndReport(java.util.List<? extends HasWord> sentence, java.io.PrintWriter pwErr)
parseAndReport in interface ParserQuerypublic Tree getBestBinarizedParse()
public java.util.List<Transition> getBestTransitionSequence()
public double getPCFGScore()
getPCFGScore in interface ParserQuerypublic Tree getBestParse()
getBestParse in interface ParserQuerypublic java.util.List<ScoredObject<Tree>> getKBestParses(int k)
getKBestParses in interface ParserQuerypublic double getBestScore()
getBestScore in interface ParserQuerypublic Tree getBestPCFGParse()
getBestPCFGParse in interface ParserQuerypublic Tree getBestDependencyParse(boolean debinarize)
getBestDependencyParse in interface ParserQuerypublic Tree getBestFactoredParse()
getBestFactoredParse in interface ParserQuerypublic java.util.List<ScoredObject<Tree>> getBestPCFGParses()
getBestPCFGParses in interface ParserQuerypublic boolean hasFactoredParse()
hasFactoredParse in interface ParserQuerypublic java.util.List<ScoredObject<Tree>> getKBestPCFGParses(int kbestPCFG)
getKBestPCFGParses in interface ParserQuerypublic java.util.List<ScoredObject<Tree>> getKGoodFactoredParses(int kbest)
getKGoodFactoredParses in interface ParserQuerypublic KBestViterbiParser getPCFGParser()
getPCFGParser in interface ParserQuerypublic KBestViterbiParser getDependencyParser()
getDependencyParser in interface ParserQuerypublic KBestViterbiParser getFactoredParser()
getFactoredParser in interface ParserQuerypublic void setConstraints(java.util.List<ParserConstraint> constraints)
setConstraints in interface ParserQuerypublic boolean saidMemMessage()
saidMemMessage in interface ParserQuerypublic boolean parseSucceeded()
ParserQueryparseSucceeded in interface ParserQuerypublic boolean parseSkipped()
parseSkipped in interface ParserQuerypublic boolean parseFallback()
ParserQueryparseFallback in interface ParserQuerypublic boolean parseNoMemory()
parseNoMemory in interface ParserQuerypublic boolean parseUnparsable()
ParserQueryparseUnparsable in interface ParserQuerypublic java.util.List<? extends HasWord> originalSentence()
originalSentence in interface ParserQuerypublic void restoreOriginalWords(Tree tree)
restoreOriginalWords in interface ParserQuery