|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectopennlp.tools.util.BaseToolFactory
opennlp.tools.tokenize.TokenizerFactory
public class TokenizerFactory
The factory that provides Tokenizer default implementations and
resources. Users can extend this class if their application requires
overriding the TokenContextGenerator, Dictionary etc.
| Constructor Summary | |
|---|---|
TokenizerFactory()
Creates a TokenizerFactory that provides the default implementation
of the resources. |
|
TokenizerFactory(String languageCode,
Dictionary abbreviationDictionary,
boolean useAlphaNumericOptimization,
Pattern alphaNumericPattern)
Creates a TokenizerFactory. |
|
| Method Summary | |
|---|---|
static TokenizerFactory |
create(String subclassName,
String languageCode,
Dictionary abbreviationDictionary,
boolean useAlphaNumericOptimization,
Pattern alphaNumericPattern)
Factory method the framework uses create a new TokenizerFactory. |
Map<String,Object> |
createArtifactMap()
Creates a Map with pairs of keys and objects. |
Map<String,String> |
createManifestEntries()
Creates the manifest entries that will be added to the model manifest |
Dictionary |
getAbbreviationDictionary()
Gets the abbreviation dictionary |
Pattern |
getAlphaNumericPattern()
Gets the alpha numeric pattern. |
TokenContextGenerator |
getContextGenerator()
Gets the context generator |
String |
getLanguageCode()
Gets the language code |
boolean |
isUseAlphaNumericOptmization()
Gets whether to use alphanumeric optimization. |
void |
validateArtifactMap()
Validates the parsed artifacts. |
| Methods inherited from class opennlp.tools.util.BaseToolFactory |
|---|
create, create, createArtifactSerializersMap |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TokenizerFactory()
TokenizerFactory that provides the default implementation
of the resources.
public TokenizerFactory(String languageCode,
Dictionary abbreviationDictionary,
boolean useAlphaNumericOptimization,
Pattern alphaNumericPattern)
TokenizerFactory. Use this constructor to
programmatically create a factory.
languageCode - the language of the natural textabbreviationDictionary - an abbreviations dictionaryuseAlphaNumericOptimization - if true alpha numerics are skippedalphaNumericPattern - null or a custom alphanumeric pattern (default is:
"^[A-Za-z0-9]+$", provided by Factory.DEFAULT_ALPHANUMERIC| Method Detail |
|---|
public void validateArtifactMap()
throws InvalidFormatException
BaseToolFactoryInvalidFormatException.
Note:
Subclasses should generally invoke super.validateArtifactMap at the beginning
of this method.
validateArtifactMap in class BaseToolFactoryInvalidFormatExceptionpublic Map<String,Object> createArtifactMap()
BaseToolFactoryMap with pairs of keys and objects. The models
implementation should call this constructor that creates a model
programmatically.
The base implementation will return a HashMap that should be
populated by sub-classes.
createArtifactMap in class BaseToolFactorypublic Map<String,String> createManifestEntries()
BaseToolFactory
createManifestEntries in class BaseToolFactory
public static TokenizerFactory create(String subclassName,
String languageCode,
Dictionary abbreviationDictionary,
boolean useAlphaNumericOptimization,
Pattern alphaNumericPattern)
throws InvalidFormatException
TokenizerFactory.
InvalidFormatExceptionpublic Pattern getAlphaNumericPattern()
public boolean isUseAlphaNumericOptmization()
public Dictionary getAbbreviationDictionary()
public String getLanguageCode()
public TokenContextGenerator getContextGenerator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||