Class LanguageBuilder.ExtendedLanguage

java.lang.Object
org.languagetool.Language
org.languagetool.language.LanguageBuilder.ExtendedLanguage
Enclosing class:
LanguageBuilder

static class LanguageBuilder.ExtendedLanguage extends Language
  • Field Details

    • baseLanguage

      private final Language baseLanguage
    • name

      private final String name
    • ruleFile

      private final File ruleFile
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from class: Language
      Get this language's name in English, e.g. English or German (Germany).
      Specified by:
      getName in class Language
      Returns:
      language name
    • getRuleFileNames

      public List<String> 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 class Language
    • isExternal

      public boolean isExternal()
      Description copied from class: Language
      For internal use only. Overwritten to return true for languages that have been loaded from an external file after start up.
      Overrides:
      isExternal in class Language
    • getLocale

      public Locale getLocale()
      Description copied from class: Language
      Get this language's Java locale, not considering the country code.
      Overrides:
      getLocale in class Language
    • getMaintainers

      public Contributor[] getMaintainers()
      Description copied from class: Language
      Get the name(s) of the maintainer(s) for this language or null.
      Specified by:
      getMaintainers in class Language
    • getShortCode

      public String 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 class Language
    • getCountries

      public String[] getCountries()
      Description copied from class: Language
      Get this language's country options , e.g. US (as in en-US) or PL (as in pl-PL).
      Specified by:
      getCountries in class Language
      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 class Language
      Throws:
      IOException
    • getVariant

      @Nullable public String getVariant()
      Description copied from class: Language
      Get this language's variant, e.g. valencia (as in ca-ES-valencia) or null. Attention: not to be confused with "country" option
      Overrides:
      getVariant in class Language
      Returns:
      variant for the language or null
    • getDefaultEnabledRulesForVariant

      public List<String> getDefaultEnabledRulesForVariant()
      Description copied from class: Language
      Get enabled rules different from the default ones for this language variant.
      Overrides:
      getDefaultEnabledRulesForVariant in class Language
      Returns:
      enabled rules for the language variant.
    • getDefaultDisabledRulesForVariant

      public List<String> getDefaultDisabledRulesForVariant()
      Description copied from class: Language
      Get disabled rules different from the default ones for this language variant.
      Overrides:
      getDefaultDisabledRulesForVariant in class Language
      Returns:
      disabled rules for the language variant.
    • getLanguageModel

      @Nullable public LanguageModel getLanguageModel(File indexDir) throws IOException
      Overrides:
      getLanguageModel in class Language
      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, UserConfig userConfig) throws IOException
      Description copied from class: Language
      Get a list of rules that require a LanguageModel. Returns an empty list for languages that don't have such rules.
      Overrides:
      getRelevantLanguageModelRules in class Language
      Throws:
      IOException
    • getLocaleWithCountryAndVariant

      public Locale getLocaleWithCountryAndVariant()
      Description copied from class: Language
      Get this language's Java locale, considering language code and country code (if any).
      Overrides:
      getLocaleWithCountryAndVariant in class Language
    • getDefaultLanguageVariant

      @Nullable public Language getDefaultLanguageVariant()
      Description copied from class: Language
      Languages that have country variants need to overwrite this to select their most common variant.
      Overrides:
      getDefaultLanguageVariant in class Language
      Returns:
      default country variant
    • createDefaultDisambiguator

      public Disambiguator createDefaultDisambiguator()
      Description copied from class: Language
      Creates language specific disambiguator. This function will be called each time in Language.getDisambiguator() if disambiguator is not set.
      Overrides:
      createDefaultDisambiguator in class Language
    • createDefaultTagger

      @NotNull public Tagger createDefaultTagger()
      Description copied from class: Language
      Creates language specific part-of-speech tagger. The tagger must not be null, but it can be a trivial pseudo-tagger that only assigns null tags. This function will be called each time in Language.getTagger() ()} if tagger is not set.
      Overrides:
      createDefaultTagger in class Language
    • createDefaultSentenceTokenizer

      public SentenceTokenizer createDefaultSentenceTokenizer()
      Description copied from class: Language
      Creates language specific sentence tokenizer. This function will be called each time in Language.getSentenceTokenizer() if sentence tokenizer is not set.
      Overrides:
      createDefaultSentenceTokenizer in class Language
    • createDefaultWordTokenizer

      public Tokenizer createDefaultWordTokenizer()
      Description copied from class: Language
      Creates language specific word tokenizer. This function will be called each time in Language.getWordTokenizer() if word tokenizer is not set.
      Overrides:
      createDefaultWordTokenizer in class Language
    • createDefaultChunker

      @Nullable public Chunker createDefaultChunker()
      Description copied from class: Language
      Creates language specific chunker. This function will be called each time in Language.getChunker() if chunker is not set.
      Overrides:
      createDefaultChunker in class Language
    • createDefaultPostDisambiguationChunker

      @Nullable public Chunker createDefaultPostDisambiguationChunker()
      Description copied from class: Language
      Creates language specific post disambiguation chunker. This function will be called each time in Language.getPostDisambiguationChunker() if chunker is not set.
      Overrides:
      createDefaultPostDisambiguationChunker in class Language
    • createDefaultSynthesizer

      @Nullable public Synthesizer createDefaultSynthesizer()
      Description copied from class: Language
      Creates language specific part-of-speech synthesizer. This function will be called each time in Language.getSynthesizer() if synthesizer is not set.
      Overrides:
      createDefaultSynthesizer in class Language