public class Language extends Object implements Comparable<Language>
| Modifier and Type | Class and Description |
|---|---|
static class |
Language.LanguageNotSupportedException |
| Modifier and Type | Field and Description |
|---|---|
static Language |
ENGLISH
Modern English
|
static Language |
FRENCH
French
|
static Language |
GERMAN
German
|
protected String |
id |
static Language |
ITALIAN
Italian
|
static Language |
SPANISH
Spanish
|
protected static Map<String,String> |
supported |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Language other) |
boolean |
equals(Object other) |
protected static Language |
generateLanguage(String id) |
String |
getId() |
String |
getLongForm() |
List<String> |
getPronounCounterEntityTypes(String pronoun)
returns the entity type associated with the pronoun (e.g.
|
List<String> |
getPronounEntityTypes(String pronoun)
returns the entity type associated with the pronoun (e.g.
|
Set<String> |
getPronouns()
provides a list of all pronouns in this language
|
protected static Map<String,String> |
getPronounTypes(String id)
Pronoun lists for different languages;
(TODO: if it gets more involved, move into a PronounML class and/or load from file)
|
int |
hashCode() |
protected void |
initPronouns()
Sets pronoun properties for the current language
|
boolean |
isPronoun(String candidate)
checks whether a string could be a pronoun of the language ignoring cases
|
static void |
main(String[] argv)
Test routine
|
boolean |
supportedLanguage(String lang) |
protected String id
public static final Language ENGLISH
public static final Language GERMAN
public static final Language FRENCH
public static final Language SPANISH
public static final Language ITALIAN
public Language(String id) throws Language.LanguageNotSupportedException
id - ISO 639-1 language codeLanguage.LanguageNotSupportedExceptionprotected void initPronouns()
protected static final Map<String,String> getPronounTypes(String id)
public boolean isPronoun(String candidate)
public List<String> getPronounEntityTypes(String pronoun)
public List<String> getPronounCounterEntityTypes(String pronoun)
public final boolean supportedLanguage(String lang)
public final String getLongForm()
public final String getId()
public final int compareTo(Language other)
compareTo in interface Comparable<Language>Copyright © 2018. All rights reserved.