public abstract class AbstractParser extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER
Logger for this class.
|
| Constructor and Description |
|---|
AbstractParser() |
| Modifier and Type | Method and Description |
|---|---|
Object |
getModel() |
String |
getName() |
List<Annotation> |
getTagAnnotations() |
abstract AbstractParser |
loadDefaultModel()
loads the default model into the parser.
|
abstract AbstractParser |
loadModel(String configModelPath)
loads the model into the parser.
|
abstract AbstractParser |
parse(String sentence)
Parses a given string and writes it into the parse object of this class.
|
void |
parse2Annotations(opennlp.tools.parser.Parse parse,
List<Annotation> tagAnnotations)
Converts a parse tree into Annotations.
|
void |
printParse(opennlp.tools.parser.Parse parse)
Prints out the parse tree.
|
void |
setModel(Object model) |
void |
setName(String name) |
void |
setTagAnnotations(List<Annotation> tagAnnotations) |
public final Object getModel()
public final String getName()
public final List<Annotation> getTagAnnotations()
public abstract AbstractParser loadDefaultModel()
this instance of AbstractParser, to allow
convenient concatenations of method
invocations, like: new OpenNLPParser().loadDefaultModel().parse(...).getTagAnnotations();public abstract AbstractParser loadModel(String configModelPath)
configModelPath - public abstract AbstractParser parse(String sentence)
this instance of AbstractParser, to allow
convenient concatenations of method invocations, like:
new OpenNLPParser().loadDefaultModel().parse(...).getTagAnnotations();sentence - public final void parse2Annotations(opennlp.tools.parser.Parse parse,
List<Annotation> tagAnnotations)
parse - tagAnnotations - public void printParse(opennlp.tools.parser.Parse parse)
parse - public final void setModel(Object model)
model - the model to setpublic final void setName(String name)
name - the name to setpublic final void setTagAnnotations(List<Annotation> tagAnnotations)
tagAnnotations - the tagAnnotations to setCopyright © 2018. All rights reserved.