public abstract class ParserGrammar extends Object implements java.util.function.Function<List<? extends HasWord>,Tree>
EvaluateTreebank
analyze the performance of a parser.
TODO: it would be nice to actually make this an interface again.
Perhaps Java 8 will allow that| Constructor and Description |
|---|
ParserGrammar() |
| Modifier and Type | Method and Description |
|---|---|
Tree |
apply(List<? extends HasWord> words)
Parses the list of HasWord.
|
abstract String[] |
defaultCoreNLPFlags()
Returns a set of options which should be set by default when used
in corenlp.
|
abstract List<Eval> |
getExtraEvals()
Returns a list of extra Eval objects to use when scoring the parser.
|
abstract Options |
getOp() |
abstract List<ParserQueryEval> |
getParserQueryEvals()
Return a list of Eval-style objects which care about the whole
ParserQuery, not just the finished tree
|
abstract TreebankLangParserParams |
getTLPParams() |
List<CoreLabel> |
lemmatize(List<? extends HasWord> tokens)
Only works on English, as it is hard coded for using the
Morphology class, which is English-only
|
List<CoreLabel> |
lemmatize(String sentence) |
static ParserGrammar |
loadModel(String path,
String... extraFlags) |
java.util.function.Function<List<? extends HasWord>,List<TaggedWord>> |
loadTagger() |
abstract Tree |
parse(List<? extends HasWord> words)
Parses the list of HasWord.
|
Tree |
parse(String sentence)
Will parse the text in
sentence as if it represented
a single sentence by first processing it with a tokenizer. |
abstract ParserQuery |
parserQuery() |
abstract boolean |
requiresTags()
The model requires text to be pretagged
|
abstract void |
setOptionFlags(String... flags) |
List<? extends HasWord> |
tokenize(String sentence)
Tokenize the text using the parser's tokenizer
|
abstract TreebankLanguagePack |
treebankLanguagePack() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThen, compose, identitypublic abstract ParserQuery parserQuery()
public Tree apply(List<? extends HasWord> words)
apply in interface java.util.function.Function<List<? extends HasWord>,Tree>words - The input sentence (a List of words)public List<? extends HasWord> tokenize(String sentence)
public Tree parse(String sentence)
sentence as if it represented
a single sentence by first processing it with a tokenizer.public java.util.function.Function<List<? extends HasWord>,List<TaggedWord>> loadTagger()
public List<CoreLabel> lemmatize(List<? extends HasWord> tokens)
public abstract Tree parse(List<? extends HasWord> words)
words - The input sentence (a List of words)public abstract List<Eval> getExtraEvals()
public abstract List<ParserQueryEval> getParserQueryEvals()
public abstract Options getOp()
public abstract TreebankLangParserParams getTLPParams()
public abstract TreebankLanguagePack treebankLanguagePack()
public abstract String[] defaultCoreNLPFlags()
public abstract void setOptionFlags(String... flags)
public abstract boolean requiresTags()
public static ParserGrammar loadModel(String path, String... extraFlags)