de.danielnaber.languagetool
Class Language

Object
  extended by Language
Direct Known Subclasses:
Catalan, Czech, Danish, Demo, Dutch, English, French, Galician, German, Icelandic, Italian, Lithuanian, Polish, Romanian, Russian, Slovak, 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 CATALAN
           
static Language DANISH
           
static Language DEMO
           
static Language DUTCH
           
static Language ENGLISH
           
static Language FRENCH
           
static Language GALICIAN
           
static Language GERMAN
           
static Language ICELANDIC
           
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 ROMANIAN
           
static Language RUSSIAN
           
static Language SLOVAK
           
static Language SLOVENIAN
           
static Language SPANISH
           
static Language SWEDISH
           
static Language UKRAINIAN
           
 
Constructor Summary
Language()
           
 
Method Summary
static String getAllMaintainers(ResourceBundle messages)
          Get sorted info about all maintainers.
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.
 Unifier getUnifier()
          Get this language's feature unifier.
 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

DANISH

public static final Language DANISH

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

SLOVAK

public static final Language SLOVAK

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

ROMANIAN

public static final Language ROMANIAN

ICELANDIC

public static final Language ICELANDIC

GALICIAN

public static final Language GALICIAN

CATALAN

public static final Language CATALAN

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.


getUnifier

public Unifier getUnifier()
Get this language's feature unifier.

Returns:
Feature unifier for analyzed tokens.

getTranslatedName

public final 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 final String toString()
Overrides:
toString in class Object

getAllMaintainers

public static String getAllMaintainers(ResourceBundle messages)
Get sorted info about all maintainers.

Parameters:
messages - {ResourceBundle language bundle to translate the info
Returns:
A sorted list of maintainers.
Since:
0.9.9


Copyright © 2005-2009 Daniel Naber