|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.cmdline.CmdLineTool
opennlp.tools.cmdline.TypedCmdLineTool<T>
public abstract class TypedCmdLineTool<T>
Base class for tools which support processing of samples of some type T coming from a stream of a certain format.
| Field Summary | |
|---|---|
protected Class<T> |
type
variable to access the type of the generic parameter. |
| Constructor Summary | |
|---|---|
protected |
TypedCmdLineTool(Class<T> sampleType)
Constructor with type parameters. |
| Method Summary | ||
|---|---|---|
protected
|
getBasicHelp(Class<A>... argProxyInterfaces)
|
|
String |
getHelp()
Retrieves a description on how to use the tool. |
|
abstract String |
getHelp(String format)
Retrieves a description on how to use the tool. |
|
protected ObjectStreamFactory<T> |
getStreamFactory(String format)
Returns stream factory for the type of this tool for the format. |
|
abstract void |
run(String format,
String[] args)
Executes the tool with the given parameters. |
|
protected
|
validateAllArgs(String[] args,
Class<A> argProxyInterface,
String format)
Validates arguments using parameters from argProxyInterface and the parameters of the
format. |
|
protected void |
validateFactoryArgs(ObjectStreamFactory<T> factory,
String[] args)
Validates arguments for a format processed by the factory. |
|
| Methods inherited from class opennlp.tools.cmdline.CmdLineTool |
|---|
getBasicHelp, getName, getShortDescription, hasParams, validateAndParseParams |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Class<T> type
| Constructor Detail |
|---|
protected TypedCmdLineTool(Class<T> sampleType)
sampleType - class of the template parameter| Method Detail |
|---|
protected ObjectStreamFactory<T> getStreamFactory(String format)
format - data format name
protected <A> void validateAllArgs(String[] args,
Class<A> argProxyInterface,
String format)
argProxyInterface and the parameters of the
format.
A - Aargs - argumentsargProxyInterface - interface with parameter descriptionsformat - data format name
protected void validateFactoryArgs(ObjectStreamFactory<T> factory,
String[] args)
factory.
factory - a stream factoryargs - argumentsprotected <A> String getBasicHelp(Class<A>... argProxyInterfaces)
getBasicHelp in class CmdLineToolpublic String getHelp()
CmdLineTool
getHelp in class CmdLineTool
public abstract void run(String format,
String[] args)
format - format to work withargs - command line argumentspublic abstract String getHelp(String format)
format - data format
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||