Class ParserTool
java.lang.Object
opennlp.tools.cmdline.CmdLineTool
opennlp.tools.cmdline.BasicCmdLineTool
opennlp.tools.cmdline.parser.ParserTool
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class CmdLineTool
getBasicHelp, getBasicHelp, getName, hasParams, validateAndParseParams
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
UNTOKENIZED_PAREN_PATTERN_1
-
UNTOKENIZED_PAREN_PATTERN_2
-
-
Constructor Details
-
ParserTool
public ParserTool()
-
-
Method Details
-
getShortDescription
- Overrides:
getShortDescriptionin classCmdLineTool- Returns:
- Retrieves a short description of what the tool does
-
getHelp
- Specified by:
getHelpin classCmdLineTool- Returns:
- Retrieves a description on how to use the tool
-
parseLine
-
parseLine
-
parseLine
Parses the specified pre-tokenized sentence and returns the requested number of parses or fewer.This is a convenience method for cases where the input has already been tokenized into individual tokens. It avoids re-tokenizing and the need to manually construct the whitespace-separated text and compute character offsets.
- Parameters:
tokens- The tokens of the sentence to parse.parser- TheParserto use.numParses- The number of parses desired.- Returns:
- The specified number of
parsesfor the given tokens. - Throws:
IllegalArgumentException- iftokensisnullor empty.
-
run
Description copied from class:BasicCmdLineToolExecutes the tool with the given parameters.- Specified by:
runin classBasicCmdLineTool- Parameters:
args- arguments
-