public enum LanguageIdentifierService extends Enum<LanguageIdentifierService>
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLanguageBeDetected(String langCode,
List<String> additionalLanguageCodes) |
LanguageIdentifierService |
clearLanguageIdentifier(String type) |
LanguageIdentifier |
getDefaultLanguageIdentifier(int maxLength,
File ngramLangIdentData,
File fasttextBinary,
File fasttextModel) |
LanguageIdentifier |
getInitialized()
Try to get an already initialized LanguageIdentifier
|
LanguageIdentifier |
getSimpleLanguageIdentifier(List<String> preferredLangCodes) |
static LanguageIdentifierService |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LanguageIdentifierService[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LanguageIdentifierService INSTANCE
public static LanguageIdentifierService[] values()
for (LanguageIdentifierService c : LanguageIdentifierService.values()) System.out.println(c);
public static LanguageIdentifierService valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic LanguageIdentifier getDefaultLanguageIdentifier(int maxLength, @Nullable File ngramLangIdentData, @Nullable File fasttextBinary, @Nullable File fasttextModel)
maxLength - - the maximum of characters that will be considered - can help with performance.
If 0 the default value of 1000 is used.
Don't use values between 1-100, as this would decrease accuracy.ngramLangIdentData - - the ngramLangIdentData file, if null ngram will not be initialized.fasttextBinary - - the fasttext binary file, if null fasttext will not be initialized.fasttextModel - - the fasttext model file, if null fasttext will not be initialized.LanguageIdentifier or existing if already initialized.public LanguageIdentifier getSimpleLanguageIdentifier(@Nullable List<String> preferredLangCodes)
preferredLangCodes - - a list of language codes for that a spellchecker will be initialized.
If null all spellcheckers will be used.LanguageIdentifier or existing if already initialized.@Nullable public LanguageIdentifier getInitialized()
public boolean canLanguageBeDetected(String langCode, List<String> additionalLanguageCodes)
@TestOnly public LanguageIdentifierService clearLanguageIdentifier(String type)
type - - option: "default", "simpel, or both to clear the identifiersLanguageIdentifierService instance