public class OpenNlpParser extends AbstractParser
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER
Logger for this class.
|
| Constructor and Description |
|---|
OpenNlpParser(File modelFile,
File corefModelDirectory) |
| Modifier and Type | Method and Description |
|---|---|
opennlp.tools.parser.Parse[] |
getFullParse(String sentence)
Returns the full parse for a sentence as openNLP parse.
|
opennlp.tools.parser.Parse |
getParse() |
void |
link(opennlp.tools.parser.Parse[] parses)
Identifies coreferences in an array of full parses of sentences.
|
OpenNlpParser |
loadDefaultModel()
loads the default model into the parser.
|
OpenNlpParser |
loadModel(String configModelPath)
loads the model into the parser.
|
OpenNlpParser |
parse(String sentence)
Peforms a full parsing on a sentence of space-delimited tokens.
|
OpenNlpParser |
parse(String sentence,
int index)
Persforms a full parse and selects the given index where 0 is the most
likely parse
|
void |
setParse(opennlp.tools.parser.Parse parse) |
getModel, getName, getTagAnnotations, parse2Annotations, printParse, setModel, setName, setTagAnnotationspublic void link(opennlp.tools.parser.Parse[] parses)
parses - array of full parses of sentencespublic opennlp.tools.parser.Parse[] getFullParse(String sentence)
sentence - public opennlp.tools.parser.Parse getParse()
public OpenNlpParser loadDefaultModel()
AbstractParserthis instance of AbstractParser, to allow
convenient concatenations of method
invocations, like: new OpenNLPParser().loadDefaultModel().parse(...).getTagAnnotations();loadDefaultModel in class AbstractParserpublic OpenNlpParser loadModel(String configModelPath)
AbstractParserloadModel in class AbstractParserpublic final OpenNlpParser parse(String sentence)
parse in class AbstractParsersentence - the sentencenull, if the parser is not
initialized or the sentence is emptypublic final OpenNlpParser parse(String sentence, int index)
sentence - index - public void setParse(opennlp.tools.parser.Parse parse)
parse - the parse to setCopyright © 2018. All rights reserved.