javatools.parsers
Class Language

java.lang.Object
  extended by javatools.parsers.Language
All Implemented Interfaces:
java.lang.Comparable<Language>

public class Language
extends java.lang.Object
implements java.lang.Comparable<Language>

Class representing human languages

Author:
Gerard de Melo

Nested Class Summary
static class Language.LanguageNotSupportedException
           
 
Field Summary
static Language ENGLISH
          Modern English
static Language FRENCH
          French
static Language GERMAN
          German
static Language ITALIAN
          Italian
static Language SPANISH
          Spanish
 
Constructor Summary
Language(java.lang.String id)
          Constructor
 
Method Summary
 int compareTo(Language other)
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getId()
           
 java.lang.String getLongForm()
           
 java.util.List<java.lang.String> getPronounCounterEntityTypes(java.lang.String pronoun)
          returns the entity type associated with the pronoun (e.g.
 java.util.List<java.lang.String> getPronounEntityTypes(java.lang.String pronoun)
          returns the entity type associated with the pronoun (e.g.
 java.util.Set<java.lang.String> getPronouns()
          provides a list of all pronouns in this language
 int hashCode()
           
 boolean isPronoun(java.lang.String candidate)
          checks whether a string could be a pronoun of the language ignoring cases
static void main(java.lang.String[] argv)
          Test routine
 boolean supportedLanguage(java.lang.String lang)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENGLISH

public static final Language ENGLISH
Modern English


GERMAN

public static final Language GERMAN
German


FRENCH

public static final Language FRENCH
French


SPANISH

public static final Language SPANISH
Spanish


ITALIAN

public static final Language ITALIAN
Italian

Constructor Detail

Language

public Language(java.lang.String id)
         throws Language.LanguageNotSupportedException
Constructor

Parameters:
id - ISO 639-1 language code
Throws:
Language.LanguageNotSupportedException
Method Detail

isPronoun

public boolean isPronoun(java.lang.String candidate)
checks whether a string could be a pronoun of the language ignoring cases


getPronouns

public java.util.Set<java.lang.String> getPronouns()
provides a list of all pronouns in this language


getPronounEntityTypes

public java.util.List<java.lang.String> getPronounEntityTypes(java.lang.String pronoun)
returns the entity type associated with the pronoun (e.g. Person, Female Person etc.)


getPronounCounterEntityTypes

public java.util.List<java.lang.String> getPronounCounterEntityTypes(java.lang.String pronoun)
returns the entity type associated with the pronoun (e.g. Person, Female Person etc.)


supportedLanguage

public final boolean supportedLanguage(java.lang.String lang)

getLongForm

public final java.lang.String getLongForm()

getId

public final java.lang.String getId()
Returns:
the id

equals

public final boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public final int compareTo(Language other)
Specified by:
compareTo in interface java.lang.Comparable<Language>

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Test routine

Throws:
java.lang.Exception