Class ParserTool
java.lang.Object
opennlp.tools.cmdline.CmdLineTool
opennlp.tools.cmdline.BasicCmdLineTool
opennlp.tools.cmdline.parser.ParserTool
public final class ParserTool
extends opennlp.tools.cmdline.BasicCmdLineTool
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class opennlp.tools.cmdline.CmdLineTool
getName, hasParams
-
Constructor Details
-
ParserTool
public ParserTool()
-
-
Method Details
-
getShortDescription
- Overrides:
getShortDescriptionin classopennlp.tools.cmdline.CmdLineTool- Returns:
- Retrieves a short description of what the tool does
-
getHelp
- Specified by:
getHelpin classopennlp.tools.cmdline.CmdLineTool- 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:opennlp.tools.cmdline.BasicCmdLineToolExecutes the tool with the given parameters.- Specified by:
runin classopennlp.tools.cmdline.BasicCmdLineTool- Parameters:
args- arguments
-