|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.parser.lexparser.LexicalizedParserQuery
public class LexicalizedParserQuery
Field Summary | |
---|---|
protected Function<List<? extends HasWord>,ArrayList<TaggedWord>> |
tagger
The tagger optionally used before parsing. |
Method Summary | |
---|---|
Tree |
getBestParse()
Return the best parse of the sentence most recently parsed. |
List<ScoredObject<Tree>> |
getKBestPCFGParses(int k)
Returns the trees (and scores) corresponding to the k-best derivations of the sentence. |
List<ScoredObject<Tree>> |
getKGoodFactoredParses(int k)
|
TreePrint |
getTreePrint()
Return a TreePrint for formatting parsed output trees. |
boolean |
parse(List<? extends HasWord> sentence)
Parse a sentence represented as a List of tokens. |
void |
setConstraints(List<ParserConstraint> constraints)
|
double |
testOnTreebank(Treebank testTreebank)
Test the parser on a treebank. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Function<List<? extends HasWord>,ArrayList<TaggedWord>> tagger
Method Detail |
---|
public void setConstraints(List<ParserConstraint> constraints)
public boolean parse(List<? extends HasWord> sentence)
sentence
- The sentence to parse
UnsupportedOperationException
- If the Sentence is too long or
of zero length or the parse
otherwise fails for resource reasonspublic Tree getBestParse()
NoSuchElementException
- If no previously successfully parsed
sentencepublic List<ScoredObject<Tree>> getKGoodFactoredParses(int k)
public List<ScoredObject<Tree>> getKBestPCFGParses(int k)
k
- The number of best parses to return
public double testOnTreebank(Treebank testTreebank)
op.testOptions.verbose
is true.
testTreebank
- The treebank to parse
public TreePrint getTreePrint()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |