Enum Class LanguageIdentifierService
java.lang.Object
java.lang.Enum<LanguageIdentifierService>
org.languagetool.language.identifier.LanguageIdentifierService
- All Implemented Interfaces:
Serializable,Comparable<LanguageIdentifierService>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanLanguageBeDetected(String langCode, List<String> additionalLanguageCodes) getDefaultLanguageIdentifier(int maxLength, File ngramLangIdentData, File fasttextBinary, File fasttextModel) Try to get an already initialized LanguageIdentifiergetSimpleLanguageIdentifier(List<String> preferredLangCodes) static LanguageIdentifierServiceReturns the enum constant of this class with the specified name.static LanguageIdentifierService[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
defaultIdentifier
-
simpleIdentifier
-
-
Constructor Details
-
LanguageIdentifierService
private LanguageIdentifierService()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getDefaultLanguageIdentifier
public LanguageIdentifier getDefaultLanguageIdentifier(int maxLength, @Nullable File ngramLangIdentData, @Nullable File fasttextBinary, @Nullable File fasttextModel) - Parameters:
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, ifnullngram will not be initialized.fasttextBinary- - the fasttext binary file, ifnullfasttext will not be initialized.fasttextModel- - the fasttext model file, ifnullfasttext will not be initialized.- Returns:
- new
LanguageIdentifieror existing if already initialized. - Since:
- 5.8
-
getSimpleLanguageIdentifier
- Parameters:
preferredLangCodes- - a list of language codes for that a spellchecker will be initialized. Ifnullall spellcheckers will be used.- Returns:
- new
LanguageIdentifieror existing if already initialized. - Since:
- 5.8
-
getInitialized
Try to get an already initialized LanguageIdentifier- Returns:
- defaultIdentifier or if null simpleIdentifier or null
-
canLanguageBeDetected
-
clearLanguageIdentifier
- Parameters:
type- - option: "default", "simpel, or both to clear the identifiers- Returns:
LanguageIdentifierServiceinstance
-