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 TypeMethodDescriptionCreates language specific chunker.Creates language specific disambiguator.Creates language specific post disambiguation chunker.Creates language specific sentence tokenizer.Creates language specific part-of-speech synthesizer.Creates language specific part-of-speech tagger.Creates language specific word tokenizer.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.Languages that have country variants need to overwrite this to select their most common variant.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.getRelevantLanguageModelRules(ResourceBundle messages, LanguageModel languageModel, UserConfig userConfig) 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.Get the location of the rule file(s) in a form like/org/languagetool/rules/de/grammar.xml, i.e.Get this language's character code, e.g.Get this language's variant, e.g.booleanFor internal use only.Methods inherited from class org.languagetool.Language
adaptSuggestion, adjustMatch, createDefaultJLanguageTool, createDefaultSpellingRule, equals, equalsConsiderVariantsIfSpecified, filterRuleMatches, getChunker, getClosingDoubleQuote, getClosingSingleQuote, getCommonWordsPath, getConsistencyRulePrefix, getDefaultRulePriorityForStyle, getDefaultSpellingRule, getDefaultSpellingRule, getDisambiguationUnifier, getDisambiguationUnifierConfiguration, getDisambiguator, getIgnoredCharactersRegex, getMaintainedState, getMultitokenSpeller, getOpeningDoubleQuote, getOpeningSingleQuote, getPatternRules, getPostDisambiguationChunker, getPriorityForId, getPriorityMap, getRelevantLanguageModelCapableRules, getRelevantRemoteRules, getRelevantRulesGlobalConfig, getRemoteEnhancedRules, getRulePriority, getSentenceTokenizer, getShortCodeWithCountryAndVariant, getSynthesizer, getTagger, getTranslatedName, getUnifier, getUnifierConfiguration, getWordTokenizer, hashCode, hasMinMatchesRules, hasNGramFalseFriendRule, hasVariant, isAdvancedTypographyEnabled, isHiddenFromGui, isSpellcheckOnlyLanguage, isVariant, prepareLineForSpeller, setChunker, setDisambiguator, setPostDisambiguationChunker, setSentenceTokenizer, setSynthesizer, setTagger, setWordTokenizer, toAdvancedTypography, toString
-
Field Details
-
baseLanguage
-
name
-
ruleFile
-
-
Constructor Details
-
ExtendedLanguage
-
-
Method Details
-
getName
Description copied from class:LanguageGet this language's name in English, e.g.EnglishorGerman (Germany). -
getRuleFileNames
Description copied from class:LanguageGet 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:
getRuleFileNamesin classLanguage
-
isExternal
public boolean isExternal()Description copied from class:LanguageFor internal use only. Overwritten to returntruefor languages that have been loaded from an external file after start up.- Overrides:
isExternalin classLanguage
-
getLocale
Description copied from class:LanguageGet this language's Java locale, not considering the country code. -
getMaintainers
Description copied from class:LanguageGet the name(s) of the maintainer(s) for this language ornull.- Specified by:
getMaintainersin classLanguage
-
getShortCode
Description copied from class:LanguageGet this language's character code, e.g.enfor 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:
getShortCodein classLanguage
-
getCountries
Description copied from class:LanguageGet this language's country options , e.g.US(as inen-US) orPL(as inpl-PL).- Specified by:
getCountriesin 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:LanguageGet the rules classes that should run for texts in this language.- Specified by:
getRelevantRulesin classLanguage- Throws:
IOException
-
getVariant
Description copied from class:LanguageGet this language's variant, e.g.valencia(as inca-ES-valencia) ornull. Attention: not to be confused with "country" option- Overrides:
getVariantin classLanguage- Returns:
- variant for the language or
null
-
getDefaultEnabledRulesForVariant
Description copied from class:LanguageGet enabled rules different from the default ones for this language variant.- Overrides:
getDefaultEnabledRulesForVariantin classLanguage- Returns:
- enabled rules for the language variant.
-
getDefaultDisabledRulesForVariant
Description copied from class:LanguageGet disabled rules different from the default ones for this language variant.- Overrides:
getDefaultDisabledRulesForVariantin classLanguage- Returns:
- disabled rules for the language variant.
-
getLanguageModel
- Overrides:
getLanguageModelin classLanguage- Parameters:
indexDir- directory with a '3grams' sub directory which contains a Lucene index with 3gram occurrence counts- Returns:
- a LanguageModel or
nullif this language doesn't support one - Throws:
IOException
-
getRelevantLanguageModelRules
public List<Rule> getRelevantLanguageModelRules(ResourceBundle messages, LanguageModel languageModel, UserConfig userConfig) throws IOException Description copied from class:LanguageGet a list of rules that require aLanguageModel. Returns an empty list for languages that don't have such rules.- Overrides:
getRelevantLanguageModelRulesin classLanguage- Throws:
IOException
-
getLocaleWithCountryAndVariant
Description copied from class:LanguageGet this language's Java locale, considering language code and country code (if any).- Overrides:
getLocaleWithCountryAndVariantin classLanguage
-
getDefaultLanguageVariant
Description copied from class:LanguageLanguages that have country variants need to overwrite this to select their most common variant.- Overrides:
getDefaultLanguageVariantin classLanguage- Returns:
- default country variant
-
createDefaultDisambiguator
Description copied from class:LanguageCreates language specific disambiguator. This function will be called each time inLanguage.getDisambiguator()if disambiguator is not set.- Overrides:
createDefaultDisambiguatorin classLanguage
-
createDefaultTagger
Description copied from class:LanguageCreates language specific part-of-speech tagger. The tagger must not benull, but it can be a trivial pseudo-tagger that only assignsnulltags. This function will be called each time inLanguage.getTagger()()} if tagger is not set.- Overrides:
createDefaultTaggerin classLanguage
-
createDefaultSentenceTokenizer
Description copied from class:LanguageCreates language specific sentence tokenizer. This function will be called each time inLanguage.getSentenceTokenizer()if sentence tokenizer is not set.- Overrides:
createDefaultSentenceTokenizerin classLanguage
-
createDefaultWordTokenizer
Description copied from class:LanguageCreates language specific word tokenizer. This function will be called each time inLanguage.getWordTokenizer()if word tokenizer is not set.- Overrides:
createDefaultWordTokenizerin classLanguage
-
createDefaultChunker
Description copied from class:LanguageCreates language specific chunker. This function will be called each time inLanguage.getChunker()if chunker is not set.- Overrides:
createDefaultChunkerin classLanguage
-
createDefaultPostDisambiguationChunker
Description copied from class:LanguageCreates language specific post disambiguation chunker. This function will be called each time inLanguage.getPostDisambiguationChunker()if chunker is not set.- Overrides:
createDefaultPostDisambiguationChunkerin classLanguage
-
createDefaultSynthesizer
Description copied from class:LanguageCreates language specific part-of-speech synthesizer. This function will be called each time inLanguage.getSynthesizer()if synthesizer is not set.- Overrides:
createDefaultSynthesizerin classLanguage
-