Package opennlp.tools.tokenize.lang
Class Factory
java.lang.Object
opennlp.tools.tokenize.lang.Factory
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateTokenContextGenerator
(String languageCode, Set<String> abbreviations) Initializes a customizedTokenContextGenerator
via a set ofabbreviations
.getAlphanumeric
(String languageCode) Gets the alphanumeric pattern for a language.
-
Field Details
-
DEFAULT_ALPHANUMERIC
-
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
getAlphanumeric
Gets the alphanumeric pattern for a language.- Parameters:
languageCode
- The ISO_639-1 code. Ifnull
, or unknown, theDEFAULT_ALPHANUMERIC
pattern will be returned.- Returns:
- The alphanumeric
Pattern
for the language, or the default pattern.
-
createTokenContextGenerator
public TokenContextGenerator createTokenContextGenerator(String languageCode, Set<String> abbreviations) Initializes a customizedTokenContextGenerator
via a set ofabbreviations
.- Parameters:
languageCode
- The ISO_639-1 code to be used.abbreviations
- The abbreviations to be used for new instance.
-