Package org.languagetool.language
Class LanguageBuilder.ExtendedLanguage
java.lang.Object
org.languagetool.Language
org.languagetool.language.LanguageBuilder.ExtendedLanguage
- Enclosing class:
LanguageBuilder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Chunker
Get this language's chunker implementation ornull
.String[]
Get this language's country options , e.g.Get disabled rules different from the default ones for this language variant.Get enabled rules different from the default ones for this language variant.@Nullable Language
Languages that have country variants need to overwrite this to select their most common variant.Get this language's part-of-speech disambiguator implementation.@Nullable LanguageModel
getLanguageModel
(File indexDir) Get this language's Java locale, not considering the country code.Get this language's Java locale, considering language code and country code (if any).Get the name(s) of the maintainer(s) for this language ornull
.getName()
Get this language's name in English, e.g.@Nullable Chunker
Get this language's chunker implementation ornull
.getRelevantLanguageModelRules
(ResourceBundle messages, LanguageModel languageModel) Get a list of rules that require aLanguageModel
.getRelevantRules
(ResourceBundle messages, UserConfig userConfig, Language motherTongue, List<Language> altLanguages) Get the rules classes that should run for texts in this language.getRelevantWord2VecModelRules
(ResourceBundle messages, Word2VecModel word2vecModel) Get a list of rules that require aWord2VecModel
.Get the location of the rule file(s) in a form like/org/languagetool/rules/de/grammar.xml
, i.e.Get this language's sentence tokenizer implementation.Get this language's character code, e.g.@Nullable Synthesizer
Get this language's part-of-speech synthesizer implementation ornull
.Get this language's part-of-speech tagger implementation.@Nullable String
Get this language's variant, e.g.Get this language's word tokenizer implementation.boolean
For internal use only.Methods inherited from class org.languagetool.Language
equals, equalsConsiderVariantsIfSpecified, getCommonWordsPath, getDisambiguationUnifier, getDisambiguationUnifierConfiguration, getIgnoredCharactersRegex, getMaintainedState, getPatternRules, getPriorityForId, getRelevantLanguageModelCapableRules, getRelevantNeuralNetworkModels, getRelevantRulesGlobalConfig, getShortCodeWithCountryAndVariant, getTranslatedName, getUnifier, getUnifierConfiguration, getWord2VecModel, hashCode, hasNGramFalseFriendRule, hasVariant, initLanguageModel, isHiddenFromGui, isSpellcheckOnlyLanguage, isVariant, toString
-
Field Details
-
baseLanguage
-
name
-
ruleFile
-
-
Constructor Details
-
ExtendedLanguage
-
-
Method Details
-
getName
Description copied from class:Language
Get this language's name in English, e.g.English
orGerman (Germany)
. -
getRuleFileNames
Description copied from class:Language
Get the location of the rule file(s) in a form like/org/languagetool/rules/de/grammar.xml
, i.e. a path in the classpath. The files must exist or an exception will be thrown, unless the filename contains the string-test-
.- Overrides:
getRuleFileNames
in classLanguage
-
isExternal
public boolean isExternal()Description copied from class:Language
For internal use only. Overwritten to returntrue
for languages that have been loaded from an external file after start up.- Overrides:
isExternal
in classLanguage
-
getLocale
Description copied from class:Language
Get this language's Java locale, not considering the country code. -
getMaintainers
Description copied from class:Language
Get the name(s) of the maintainer(s) for this language ornull
.- Specified by:
getMaintainers
in classLanguage
-
getShortCode
Description copied from class:Language
Get this language's character code, e.g.en
for English. For most languages this is a two-letter code according to ISO 639-1, but for those languages that don't have a two-letter code, a three-letter code according to ISO 639-2 is returned. The country parameter (e.g. "US"), if any, is not returned.- Specified by:
getShortCode
in classLanguage
-
getCountries
Description copied from class:Language
Get this language's country options , e.g.US
(as inen-US
) orPL
(as inpl-PL
).- Specified by:
getCountries
in classLanguage
- Returns:
- String[] - array of country options for the language.
-
getRelevantRules
public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, Language motherTongue, List<Language> altLanguages) throws IOException Description copied from class:Language
Get the rules classes that should run for texts in this language.- Specified by:
getRelevantRules
in classLanguage
- Throws:
IOException
-
getVariant
Description copied from class:Language
Get this language's variant, e.g.valencia
(as inca-ES-valencia
) ornull
. Attention: not to be confused with "country" option- Overrides:
getVariant
in classLanguage
- Returns:
- variant for the language or
null
-
getDefaultEnabledRulesForVariant
Description copied from class:Language
Get enabled rules different from the default ones for this language variant.- Overrides:
getDefaultEnabledRulesForVariant
in classLanguage
- Returns:
- enabled rules for the language variant.
-
getDefaultDisabledRulesForVariant
Description copied from class:Language
Get disabled rules different from the default ones for this language variant.- Overrides:
getDefaultDisabledRulesForVariant
in classLanguage
- Returns:
- disabled rules for the language variant.
-
getLanguageModel
- Overrides:
getLanguageModel
in classLanguage
- Parameters:
indexDir
- directory with a '3grams' sub directory which contains a Lucene index with 3gram occurrence counts- Returns:
- a LanguageModel or
null
if this language doesn't support one - Throws:
IOException
-
getRelevantLanguageModelRules
public List<Rule> getRelevantLanguageModelRules(ResourceBundle messages, LanguageModel languageModel) throws IOException Description copied from class:Language
Get a list of rules that require aLanguageModel
. Returns an empty list for languages that don't have such rules.- Overrides:
getRelevantLanguageModelRules
in classLanguage
- Throws:
IOException
-
getRelevantWord2VecModelRules
public List<Rule> getRelevantWord2VecModelRules(ResourceBundle messages, Word2VecModel word2vecModel) throws IOException Description copied from class:Language
Get a list of rules that require aWord2VecModel
. Returns an empty list for languages that don't have such rules.- Overrides:
getRelevantWord2VecModelRules
in classLanguage
- Throws:
IOException
-
getLocaleWithCountryAndVariant
Description copied from class:Language
Get this language's Java locale, considering language code and country code (if any).- Overrides:
getLocaleWithCountryAndVariant
in classLanguage
-
getDefaultLanguageVariant
Description copied from class:Language
Languages that have country variants need to overwrite this to select their most common variant.- Overrides:
getDefaultLanguageVariant
in classLanguage
- Returns:
- default country variant or
null
-
getDisambiguator
Description copied from class:Language
Get this language's part-of-speech disambiguator implementation.- Overrides:
getDisambiguator
in classLanguage
-
getTagger
Description copied from class:Language
Get this language's part-of-speech tagger implementation. The tagger must not benull
, but it can be a trivial pseudo-tagger that only assignsnull
tags. -
getSentenceTokenizer
Description copied from class:Language
Get this language's sentence tokenizer implementation.- Overrides:
getSentenceTokenizer
in classLanguage
-
getWordTokenizer
Description copied from class:Language
Get this language's word tokenizer implementation.- Overrides:
getWordTokenizer
in classLanguage
-
getChunker
Description copied from class:Language
Get this language's chunker implementation ornull
.- Overrides:
getChunker
in classLanguage
-
getPostDisambiguationChunker
Description copied from class:Language
Get this language's chunker implementation ornull
.- Overrides:
getPostDisambiguationChunker
in classLanguage
-
getSynthesizer
Description copied from class:Language
Get this language's part-of-speech synthesizer implementation ornull
.- Overrides:
getSynthesizer
in classLanguage
-