de.tudarmstadt.ukp.jwktl.api.util
Class Language

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.api.util.Language
All Implemented Interfaces:
ILanguage, Comparable<ILanguage>

public class Language
extends Object
implements ILanguage

Implementation of the ILanguage interface. This class should not be instanciated by yourself. Use the static methods to find registered instances - either by language code or name.

Author:
Christian M. Meyer

Field Summary
protected  String code
           
static ILanguage ENGLISH
          The English language.
static ILanguage GERMAN
          The German language.
protected  String iso639_1
           
protected  String iso639_2b
           
protected  String iso639_2t
           
protected  String iso639_3
           
protected  String name
           
static ILanguage RUSSIAN
          The Russian language.
 
Constructor Summary
protected Language(String code, String name, String iso639_3, String iso639_2b, String iso639_2t, String iso639_1)
           
 
Method Summary
 int compareTo(ILanguage other)
           
static boolean equals(ILanguage language1, ILanguage language2)
          Tests if the specified languages are equal.
 boolean equals(Object other)
           
static ILanguage findByCode(String code)
          Find the language with the given code.
static ILanguage findByName(String name)
          Find the language with the given name.
static ILanguage get(String code)
          Returns the language with the given internal code.
 String getCode()
          Returns the internal language code used by JWTKL.
 String getISO639_1()
          Returns the ISO 639-1 code or an empty string if none.
 String getISO639_2B()
          Returns the ISO 639-2b code or an empty string if none.
 String getISO639_2T()
          Returns the ISO 639-2t code or an empty string if none.
 String getISO639_3()
          Returns the ISO 639-3 code or an empty string if none.
 String getName()
          Returns the language name (in English language).
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code

protected String code

name

protected String name

iso639_3

protected String iso639_3

iso639_2b

protected String iso639_2b

iso639_2t

protected String iso639_2t

iso639_1

protected String iso639_1

ENGLISH

public static final ILanguage ENGLISH
The English language.


GERMAN

public static final ILanguage GERMAN
The German language.


RUSSIAN

public static final ILanguage RUSSIAN
The Russian language.

Constructor Detail

Language

protected Language(String code,
                   String name,
                   String iso639_3,
                   String iso639_2b,
                   String iso639_2t,
                   String iso639_1)
Method Detail

getCode

public String getCode()
Description copied from interface: ILanguage
Returns the internal language code used by JWTKL. These codes roughly correspond to ISO 639-3, but also include language families, deprecated classifications, and not yet classified languages.

Specified by:
getCode in interface ILanguage

getName

public String getName()
Description copied from interface: ILanguage
Returns the language name (in English language).

Specified by:
getName in interface ILanguage

getISO639_3

public String getISO639_3()
Description copied from interface: ILanguage
Returns the ISO 639-3 code or an empty string if none.

Specified by:
getISO639_3 in interface ILanguage

getISO639_2B

public String getISO639_2B()
Description copied from interface: ILanguage
Returns the ISO 639-2b code or an empty string if none.

Specified by:
getISO639_2B in interface ILanguage

getISO639_2T

public String getISO639_2T()
Description copied from interface: ILanguage
Returns the ISO 639-2t code or an empty string if none.

Specified by:
getISO639_2T in interface ILanguage

getISO639_1

public String getISO639_1()
Description copied from interface: ILanguage
Returns the ISO 639-1 code or an empty string if none.

Specified by:
getISO639_1 in interface ILanguage

compareTo

public int compareTo(ILanguage other)
Specified by:
compareTo in interface Comparable<ILanguage>

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

get

public static ILanguage get(String code)
Returns the language with the given internal code. Note that the internal codes roughly correspond to ISO 639-3 code, but also model some extensions to this. Use findByCode(String) if you are unsure about your code. If no language could be found, null is returned.


findByCode

public static ILanguage findByCode(String code)
Find the language with the given code. The method checks both for the internal language codes and for any ISO 639 code. If no language could be found, null is returned.


findByName

public static ILanguage findByName(String name)
Find the language with the given name. The method checks both for the canonical English name as well as alternative names in other languages or spelling errors found in Wiktionary. If no language could be found, null is returned.


equals

public static boolean equals(ILanguage language1,
                             ILanguage language2)
Tests if the specified languages are equal. The method returns true if both languages are null, but false if only one of them is null.



Copyright © 2011-2013 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.