de.danielnaber.languagetool
Class Language

Object
  extended by Language
Direct Known Subclasses:
Czech, Demo, Dutch, English, French, German, Italian, Lithuanian, Polish, Russian, Slovenian, Spanish, Swedish, Ukrainian

public abstract class Language
extends Object

Base class for any supported language (English, German, etc).

Author:
Daniel Naber

Field Summary
static Language CZECH
           
static Language DEMO
           
static Language DUTCH
           
static Language ENGLISH
           
static Language FRENCH
           
static Language GERMAN
           
static Language ITALIAN
           
static Language[] LANGUAGES
          All languages supported by LanguageTool.
static Language LITHUANIAN
           
static Language POLISH
           
static Language[] REAL_LANGUAGES
          All languages supported by LanguageTool, but without the demo language.
static Language RUSSIAN
           
static Language SLOVENIAN
           
static Language SPANISH
           
static Language SWEDISH
           
static Language UKRAINIAN
           
 
Constructor Summary
Language()
           
 
Method Summary
abstract  String[] getCountryVariants()
          Get this language's country variants, e.g.
 Disambiguator getDisambiguator()
          Get this language's part-of-speech disambiguator implementation.
static List<Language> getExternalLanguages()
          Return languages that are not built-in but have been added manually.
static Language getLanguageForName(String languageName)
          Get the Language object for the given language name.
static Language getLanguageForShortName(String shortLanguageCode)
          Get the Language object for the given short language name.
abstract  Locale getLocale()
          Get this language's Java locale.
abstract  Contributor[] getMaintainers()
          Get the name(s) of the maintainer(s) for this language or null.
abstract  String getName()
          Get this language's name in English, e.g.
abstract  Set<String> getRelevantRuleIDs()
          Get the IDs of the global rules that should run for texts in this language or null.
 String getRuleFileName()
          Get the location of the rule file.
 SentenceTokenizer getSentenceTokenizer()
          Get this language's sentence tokenizer implementation.
abstract  String getShortName()
          Get this language's two character code, e.g.
 Synthesizer getSynthesizer()
          Get this language's part-of-speech synthesizer implementation or null.
 Tagger getTagger()
          Get this language's part-of-speech tagger implementation.
 String getTranslatedName(ResourceBundle messages)
          Get the name of the language translated to the current locale, if available.
 Tokenizer getWordTokenizer()
          Get this language's word tokenizer implementation.
static void reInit(List<Language> languages)
          Re-inits the built-in languages and adds the specified ones.
 String toString()
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CZECH

public static final Language CZECH

DUTCH

public static final Language DUTCH

ENGLISH

public static final Language ENGLISH

FRENCH

public static final Language FRENCH

GERMAN

public static final Language GERMAN

ITALIAN

public static final Language ITALIAN

LITHUANIAN

public static final Language LITHUANIAN

POLISH

public static final Language POLISH

SLOVENIAN

public static final Language SLOVENIAN

SPANISH

public static final Language SPANISH

SWEDISH

public static final Language SWEDISH

UKRAINIAN

public static final Language UKRAINIAN

RUSSIAN

public static final Language RUSSIAN

DEMO

public static final Language DEMO

LANGUAGES

public static Language[] LANGUAGES
All languages supported by LanguageTool.


REAL_LANGUAGES

public static Language[] REAL_LANGUAGES
All languages supported by LanguageTool, but without the demo language.

Constructor Detail

Language

public Language()
Method Detail

getShortName

public abstract String getShortName()
Get this language's two character code, e.g. en for English.

Returns:
String - language code

getName

public abstract String getName()
Get this language's name in English, e.g. English or German.

Returns:
String - language name

getCountryVariants

public abstract String[] getCountryVariants()
Get this language's country variants, e.g. US or PL.

Returns:
String[] - array of country variants for the language.

getLocale

public abstract Locale getLocale()
Get this language's Java locale.


getMaintainers

public abstract Contributor[] getMaintainers()
Get the name(s) of the maintainer(s) for this language or null.


getRelevantRuleIDs

public abstract Set<String> getRelevantRuleIDs()
Get the IDs of the global rules that should run for texts in this language or null.


getRuleFileName

public String getRuleFileName()
Get the location of the rule file.


getDisambiguator

public Disambiguator getDisambiguator()
Get this language's part-of-speech disambiguator implementation.


getTagger

public Tagger getTagger()
Get this language's part-of-speech tagger implementation.


getSentenceTokenizer

public SentenceTokenizer getSentenceTokenizer()
Get this language's sentence tokenizer implementation.


getWordTokenizer

public Tokenizer getWordTokenizer()
Get this language's word tokenizer implementation.


getSynthesizer

public Synthesizer getSynthesizer()
Get this language's part-of-speech synthesizer implementation or null.


getTranslatedName

public String getTranslatedName(ResourceBundle messages)
Get the name of the language translated to the current locale, if available. Otherwise, get the untranslated name.


reInit

public static void reInit(List<Language> languages)
Re-inits the built-in languages and adds the specified ones.


getExternalLanguages

public static List<Language> getExternalLanguages()
Return languages that are not built-in but have been added manually.


getLanguageForShortName

public static Language getLanguageForShortName(String shortLanguageCode)
Get the Language object for the given short language name.

Parameters:
shortLanguageCode - e.g. en or de
Returns:
a Language object or null

getLanguageForName

public static Language getLanguageForName(String languageName)
Get the Language object for the given language name.

Parameters:
languageName - e.g. English or German (case is significant)
Returns:
a Language object or null

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2007 Daniel Naber