Package opennlp.tools.tokenize.lang
Class Factory
- java.lang.Object
-
- opennlp.tools.tokenize.lang.Factory
-
public class Factory extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
DEFAULT_ALPHANUMERIC
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenContextGenerator
createTokenContextGenerator(String languageCode, Set<String> abbreviations)
Initializes a customizedTokenContextGenerator
via a set ofabbreviations
.Pattern
getAlphanumeric(String languageCode)
Gets the alphanumeric pattern for a language.
-
-
-
Field Detail
-
DEFAULT_ALPHANUMERIC
public static final Pattern DEFAULT_ALPHANUMERIC
-
-
Method Detail
-
getAlphanumeric
public Pattern getAlphanumeric(String languageCode)
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.
-
-