com.thematchbox.common.Language Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of TheMatchBox-Common Show documentation
Show all versions of TheMatchBox-Common Show documentation
This project contains some common utilities used in different projects from theMatchBox.
package com.thematchbox.common;
/* Copyright 2015 theMatchBox
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import javax.xml.bind.annotation.XmlRootElement;
@SuppressWarnings("UnusedDeclaration")
@XmlRootElement
public enum Language {
UNIVERSAL(null, null, "Universal"),
UNDEFINED(null, null, "Undefined"),
AAR(null, "aa", "Afar"),
ABK(null, "ab", "Abkhazian"),
ACE(null, null, "Achinese"),
ACH(null, null, "Acoli"),
ADA(null, null, "Adangme"),
ADY(null, null, "Adyghe; Adygei"),
AFA(null, null, "Afro-Asiatic languages"),
AFH(null, null, "Afrihili"),
AFR(null, "af", "Afrikaans"),
AIN(null, null, "Ainu"),
AKA(null, "ak", "Akan"),
AKK(null, null, "Akkadian"),
ALB("sqi", "sq", "Albanian"),
ALE(null, null, "Aleut"),
ALG(null, null, "Algonquian languages"),
ALT(null, null, "Southern Altai"),
AMH(null, "am", "Amharic"),
ANG(null, null, "English, Old (ca.450-1100)"),
ANP(null, null, "Angika"),
APA(null, null, "Apache languages"),
ARA(null, "ar", "Arabic"),
ARC(null, null, "Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)"),
ARG(null, "an", "Aragonese"),
ARM("hye", "hy", "Armenian"),
ARN(null, null, "Mapudungun; Mapuche"),
ARP(null, null, "Arapaho"),
ART(null, null, "Artificial languages"),
ARW(null, null, "Arawak"),
ASM(null, "as", "Assamese"),
AST(null, null, "Asturian; Bable; Leonese; Asturleonese"),
ATH(null, null, "Athapascan languages"),
AUS(null, null, "Australian languages"),
AVA(null, "av", "Avaric"),
AVE(null, "ae", "Avestan"),
AWA(null, null, "Awadhi"),
AYM(null, "ay", "Aymara"),
AZE(null, "az", "Azerbaijani"),
BAD(null, null, "Banda languages"),
BAI(null, null, "Bamileke languages"),
BAK(null, "ba", "Bashkir"),
BAL(null, null, "Baluchi"),
BAM(null, "bm", "Bambara"),
BAN(null, null, "Balinese"),
BAQ("eus", "eu", "Basque"),
BAS(null, null, "Basa"),
BAT(null, null, "Baltic languages"),
BEJ(null, null, "Beja; Bedawiyet"),
BEL(null, "be", "Belarusian"),
BEM(null, null, "Bemba"),
BEN(null, "bn", "Bengali"),
BER(null, null, "Berber languages"),
BHO(null, null, "Bhojpuri"),
BIH(null, "bh", "Bihari languages"),
BIK(null, null, "Bikol"),
BIN(null, null, "Bini; Edo"),
BIS(null, "bi", "Bislama"),
BLA(null, null, "Siksika"),
BNT(null, null, "Bantu languages"),
BOS(null, "bs", "Bosnian"),
BRA(null, null, "Braj"),
BRE(null, "br", "Breton"),
BTK(null, null, "Batak languages"),
BUA(null, null, "Buriat"),
BUG(null, null, "Buginese"),
BUL(null, "bg", "Bulgarian"),
BUR("mya", "my", "Burmese"),
BYN(null, null, "Blin; Bilin"),
CAD(null, null, "Caddo"),
CAI(null, null, "Central American Indian languages"),
CAR(null, null, "Galibi Carib"),
CAT(null, "ca", "Catalan; Valencian"),
CAU(null, null, "Caucasian languages"),
CEB(null, null, "Cebuano"),
CEL(null, null, "Celtic languages"),
CHA(null, "ch", "Chamorro"),
CHB(null, null, "Chibcha"),
CHE(null, "ce", "Chechen"),
CHG(null, null, "Chagatai"),
CHI("zho", "zh", "Chinese"),
CHK(null, null, "Chuukese"),
CHM(null, null, "Mari"),
CHN(null, null, "Chinook jargon"),
CHO(null, null, "Choctaw"),
CHP(null, null, "Chipewyan; Dene Suline"),
CHR(null, null, "Cherokee"),
CHU(null, "cu", "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"),
CHV(null, "cv", "Chuvash"),
CHY(null, null, "Cheyenne"),
CMC(null, null, "Chamic languages"),
COP(null, null, "Coptic"),
COR(null, "kw", "Cornish"),
COS(null, "co", "Corsican"),
CPE(null, null, "Creoles and pidgins, English based"),
CPF(null, null, "Creoles and pidgins, French-based"),
CPP(null, null, "Creoles and pidgins, Portuguese-based"),
CRE(null, "cr", "Cree"),
CRH(null, null, "Crimean Tatar; Crimean Turkish"),
CRP(null, null, "Creoles and pidgins"),
CSB(null, null, "Kashubian"),
CUS(null, null, "Cushitic languages"),
CZE("ces", "cs", "Czech"),
DAK(null, null, "Dakota"),
DAN(null, "da", "Danish"),
DAR(null, null, "Dargwa"),
DAY(null, null, "Land Dayak languages"),
DEL(null, null, "Delaware"),
DEN(null, null, "Slave (Athapascan)"),
DGR(null, null, "Dogrib"),
DIN(null, null, "Dinka"),
DIV(null, "dv", "Divehi; Dhivehi; Maldivian"),
DOI(null, null, "Dogri"),
DRA(null, null, "Dravidian languages"),
DSB(null, null, "Lower Sorbian"),
DUA(null, null, "Duala"),
DUM(null, null, "Dutch, Middle (ca.1050-1350)"),
DUT("nld", "nl", "Dutch; Flemish"),
DYU(null, null, "Dyula"),
DZO(null, "dz", "Dzongkha"),
EFI(null, null, "Efik"),
EGY(null, null, "Egyptian (Ancient)"),
EKA(null, null, "Ekajuk"),
ELX(null, null, "Elamite"),
ENG(null, "en", "English"),
ENM(null, null, "English, Middle (1100-1500)"),
EPO(null, "eo", "Esperanto"),
EST(null, "et", "Estonian"),
EWE(null, "ee", "Ewe"),
EWO(null, null, "Ewondo"),
FAN(null, null, "Fang"),
FAO(null, "fo", "Faroese"),
FAT(null, null, "Fanti"),
FIJ(null, "fj", "Fijian"),
FIL(null, null, "Filipino; Pilipino"),
FIN(null, "fi", "Finnish"),
FIU(null, null, "Finno-Ugrian languages"),
FON(null, null, "Fon"),
FRE("fra", "fr", "French"),
FRM(null, null, "French, Middle (ca.1400-1600)"),
FRO(null, null, "French, Old (842-ca.1400)"),
FRR(null, null, "Northern Frisian"),
FRS(null, null, "Eastern Frisian"),
FRY(null, "fy", "Western Frisian"),
FUL(null, "ff", "Fulah"),
FUR(null, null, "Friulian"),
GAA(null, null, "Ga"),
GAY(null, null, "Gayo"),
GBA(null, null, "Gbaya"),
GEM(null, null, "Germanic languages"),
GEO("kat", "ka", "Georgian"),
GER("deu", "de", "German"),
GEZ(null, null, "Geez"),
GIL(null, null, "Gilbertese"),
GLA(null, "gd", "Gaelic; Scottish Gaelic"),
GLE(null, "ga", "Irish"),
GLG(null, "gl", "Galician"),
GLV(null, "gv", "Manx"),
GMH(null, null, "German, Middle High (ca.1050-1500)"),
GOH(null, null, "German, Old High (ca.750-1050)"),
GON(null, null, "Gondi"),
GOR(null, null, "Gorontalo"),
GOT(null, null, "Gothic"),
GRB(null, null, "Grebo"),
GRC(null, null, "Greek, Ancient (to 1453)"),
GRE("ell", "el", "Greek, Modern (1453-)"),
GRN(null, "gn", "Guarani"),
GSW(null, null, "Swiss German; Alemannic; Alsatian"),
GUJ(null, "gu", "Gujarati"),
GWI(null, null, "Gwich'in"),
HAI(null, null, "Haida"),
HAT(null, "ht", "Haitian; Haitian Creole"),
HAU(null, "ha", "Hausa"),
HAW(null, null, "Hawaiian"),
HEB(null, "he", "Hebrew"),
HER(null, "hz", "Herero"),
HIL(null, null, "Hiligaynon"),
HIM(null, null, "Himachali languages; Western Pahari languages"),
HIN(null, "hi", "Hindi"),
HIT(null, null, "Hittite"),
HMN(null, null, "Hmong; Mong"),
HMO(null, "ho", "Hiri Motu"),
HRV(null, "hr", "Croatian"),
HSB(null, null, "Upper Sorbian"),
HUN(null, "hu", "Hungarian"),
HUP(null, null, "Hupa"),
IBA(null, null, "Iban"),
IBO(null, "ig", "Igbo"),
ICE("isl", "is", "Icelandic"),
IDO(null, "io", "Ido"),
III(null, "ii", "Sichuan Yi; Nuosu"),
IJO(null, null, "Ijo languages"),
IKU(null, "iu", "Inuktitut"),
ILE(null, "ie", "Interlingue; Occidental"),
ILO(null, null, "Iloko"),
INA(null, "ia", "Interlingua (International Auxiliary Language Association)"),
INC(null, null, "Indic languages"),
IND(null, "id", "Indonesian"),
INE(null, null, "Indo-European languages"),
INH(null, null, "Ingush"),
IPK(null, "ik", "Inupiaq"),
IRA(null, null, "Iranian languages"),
IRO(null, null, "Iroquoian languages"),
ITA(null, "it", "Italian"),
JAV(null, "jv", "Javanese"),
JBO(null, null, "Lojban"),
JPN(null, "ja", "Japanese"),
JPR(null, null, "Judeo-Persian"),
JRB(null, null, "Judeo-Arabic"),
KAA(null, null, "Kara-Kalpak"),
KAB(null, null, "Kabyle"),
KAC(null, null, "Kachin; Jingpho"),
KAL(null, "kl", "Kalaallisut; Greenlandic"),
KAM(null, null, "Kamba"),
KAN(null, "kn", "Kannada"),
KAR(null, null, "Karen languages"),
KAS(null, "ks", "Kashmiri"),
KAU(null, "kr", "Kanuri"),
KAW(null, null, "Kawi"),
KAZ(null, "kk", "Kazakh"),
KBD(null, null, "Kabardian"),
KHA(null, null, "Khasi"),
KHI(null, null, "Khoisan languages"),
KHM(null, "km", "Central Khmer"),
KHO(null, null, "Khotanese; Sakan"),
KIK(null, "ki", "Kikuyu; Gikuyu"),
KIN(null, "rw", "Kinyarwanda"),
KIR(null, "ky", "Kirghiz; Kyrgyz"),
KMB(null, null, "Kimbundu"),
KOK(null, null, "Konkani"),
KOM(null, "kv", "Komi"),
KON(null, "kg", "Kongo"),
KOR(null, "ko", "Korean"),
KOS(null, null, "Kosraean"),
KPE(null, null, "Kpelle"),
KRC(null, null, "Karachay-Balkar"),
KRL(null, null, "Karelian"),
KRO(null, null, "Kru languages"),
KRU(null, null, "Kurukh"),
KUA(null, "kj", "Kuanyama; Kwanyama"),
KUM(null, null, "Kumyk"),
KUR(null, "ku", "Kurdish"),
KUT(null, null, "Kutenai"),
LAD(null, null, "Ladino"),
LAH(null, null, "Lahnda"),
LAM(null, null, "Lamba"),
LAO(null, "lo", "Lao"),
LAT(null, "la", "Latin"),
LAV(null, "lv", "Latvian"),
LEZ(null, null, "Lezghian"),
LIM(null, "li", "Limburgan; Limburger; Limburgish"),
LIN(null, "ln", "Lingala"),
LIT(null, "lt", "Lithuanian"),
LOL(null, null, "Mongo"),
LOZ(null, null, "Lozi"),
LTZ(null, "lb", "Luxembourgish; Letzeburgesch"),
LUA(null, null, "Luba-Lulua"),
LUB(null, "lu", "Luba-Katanga"),
LUG(null, "lg", "Ganda"),
LUI(null, null, "Luiseno"),
LUN(null, null, "Lunda"),
LUO(null, null, "Luo (Kenya and Tanzania)"),
LUS(null, null, "Lushai"),
MAC("mkd", "mk", "Macedonian"),
MAD(null, null, "Madurese"),
MAG(null, null, "Magahi"),
MAH(null, "mh", "Marshallese"),
MAI(null, null, "Maithili"),
MAK(null, null, "Makasar"),
MAL(null, "ml", "Malayalam"),
MAN(null, null, "Mandingo"),
MAO("mri", "mi", "Maori"),
MAP(null, null, "Austronesian languages"),
MAR(null, "mr", "Marathi"),
MAS(null, null, "Masai"),
MAY("msa", "ms", "Malay"),
MDF(null, null, "Moksha"),
MDR(null, null, "Mandar"),
MEN(null, null, "Mende"),
MGA(null, null, "Irish, Middle (900-1200)"),
MIC(null, null, "Mi'kmaq; Micmac"),
MIN(null, null, "Minangkabau"),
MIS(null, null, "Uncoded languages"),
MKH(null, null, "Mon-Khmer languages"),
MLG(null, "mg", "Malagasy"),
MLT(null, "mt", "Maltese"),
MNC(null, null, "Manchu"),
MNI(null, null, "Manipuri"),
MNO(null, null, "Manobo languages"),
MOH(null, null, "Mohawk"),
MON(null, "mn", "Mongolian"),
MOS(null, null, "Mossi"),
MUL(null, null, "Multiple languages"),
MUN(null, null, "Munda languages"),
MUS(null, null, "Creek"),
MWL(null, null, "Mirandese"),
MWR(null, null, "Marwari"),
MYN(null, null, "Mayan languages"),
MYV(null, null, "Erzya"),
NAH(null, null, "Nahuatl languages"),
NAI(null, null, "North American Indian languages"),
NAP(null, null, "Neapolitan"),
NAU(null, "na", "Nauru"),
NAV(null, "nv", "Navajo; Navaho"),
NBL(null, "nr", "Ndebele, South; South Ndebele"),
NDE(null, "nd", "Ndebele, North; North Ndebele"),
NDO(null, "ng", "Ndonga"),
NDS(null, null, "Low German; Low Saxon; German, Low; Saxon, Low"),
NEP(null, "ne", "Nepali"),
NEW(null, null, "Nepal Bhasa; Newari"),
NIA(null, null, "Nias"),
NIC(null, null, "Niger-Kordofanian languages"),
NIU(null, null, "Niuean"),
NNO(null, "nn", "Norwegian Nynorsk; Nynorsk, Norwegian"),
NOB(null, "nb", "Bokmål, Norwegian; Norwegian Bokmål"),
NOG(null, null, "Nogai"),
NON(null, null, "Norse, Old"),
NOR(null, "no", "Norwegian"),
NQO(null, null, "N'Ko"),
NSO(null, null, "Pedi; Sepedi; Northern Sotho"),
NUB(null, null, "Nubian languages"),
NWC(null, null, "Classical Newari; Old Newari; Classical Nepal Bhasa"),
NYA(null, "ny", "Chichewa; Chewa; Nyanja"),
NYM(null, null, "Nyamwezi"),
NYN(null, null, "Nyankole"),
NYO(null, null, "Nyoro"),
NZI(null, null, "Nzima"),
OCI(null, "oc", "Occitan (post 1500)"),
OJI(null, "oj", "Ojibwa"),
ORI(null, "or", "Oriya"),
ORM(null, "om", "Oromo"),
OSA(null, null, "Osage"),
OSS(null, "os", "Ossetian; Ossetic"),
OTA(null, null, "Turkish, Ottoman (1500-1928)"),
OTO(null, null, "Otomian languages"),
PAA(null, null, "Papuan languages"),
PAG(null, null, "Pangasinan"),
PAL(null, null, "Pahlavi"),
PAM(null, null, "Pampanga; Kapampangan"),
PAN(null, "pa", "Panjabi; Punjabi"),
PAP(null, null, "Papiamento"),
PAU(null, null, "Palauan"),
PEO(null, null, "Persian, Old (ca.600-400 B.C.)"),
PER("fas", "fa", "Persian"),
PHI(null, null, "Philippine languages"),
PHN(null, null, "Phoenician"),
PLI(null, "pi", "Pali"),
POL(null, "pl", "Polish"),
PON(null, null, "Pohnpeian"),
POR(null, "pt", "Portuguese"),
PRA(null, null, "Prakrit languages"),
PRO(null, null, "Provençal, Old (to 1500);Occitan, Old (to 1500)"),
PUS(null, "ps", "Pushto; Pashto"),
QAA("qtz", null, "Reserved for local use"),
QUE(null, "qu", "Quechua"),
RAJ(null, null, "Rajasthani"),
RAP(null, null, "Rapanui"),
RAR(null, null, "Rarotongan; Cook Islands Maori"),
ROA(null, null, "Romance languages"),
ROH(null, "rm", "Romansh"),
ROM(null, null, "Romany"),
RUM("ron", "ro", "Romanian; Moldavian; Moldovan"),
RUN(null, "rn", "Rundi"),
RUP(null, null, "Aromanian; Arumanian; Macedo-Romanian"),
RUS(null, "ru", "Russian"),
SAD(null, null, "Sandawe"),
SAG(null, "sg", "Sango"),
SAH(null, null, "Yakut"),
SAI(null, null, "South American Indian languages"),
SAL(null, null, "Salishan languages"),
SAM(null, null, "Samaritan Aramaic"),
SAN(null, "sa", "Sanskrit"),
SAS(null, null, "Sasak"),
SAT(null, null, "Santali"),
SCN(null, null, "Sicilian"),
SCO(null, null, "Scots"),
SEL(null, null, "Selkup"),
SEM(null, null, "Semitic languages"),
SGA(null, null, "Irish, Old (to 900)"),
SGN(null, null, "Sign Languages"),
SHN(null, null, "Shan"),
SID(null, null, "Sidamo"),
SIN(null, "si", "Sinhala; Sinhalese"),
SIO(null, null, "Siouan languages"),
SIT(null, null, "Sino-Tibetan languages"),
SLA(null, null, "Slavic languages"),
SLO("slk", "sk", "Slovak"),
SLV(null, "sl", "Slovenian"),
SMA(null, null, "Southern Sami"),
SME(null, "se", "Northern Sami"),
SMI(null, null, "Sami languages"),
SMJ(null, null, "Lule Sami"),
SMN(null, null, "Inari Sami"),
SMO(null, "sm", "Samoan"),
SMS(null, null, "Skolt Sami"),
SNA(null, "sn", "Shona"),
SND(null, "sd", "Sindhi"),
SNK(null, null, "Soninke"),
SOG(null, null, "Sogdian"),
SOM(null, "so", "Somali"),
SON(null, null, "Songhai languages"),
SOT(null, "st", "Sotho, Southern"),
SPA(null, "es", "Spanish; Castilian"),
SRD(null, "sc", "Sardinian"),
SRN(null, null, "Sranan Tongo"),
SRP(null, "sr", "Serbian"),
SRR(null, null, "Serer"),
SSA(null, null, "Nilo-Saharan languages"),
SSW(null, "ss", "Swati"),
SUK(null, null, "Sukuma"),
SUN(null, "su", "Sundanese"),
SUS(null, null, "Susu"),
SUX(null, null, "Sumerian"),
SWA(null, "sw", "Swahili"),
SWE(null, "sv", "Swedish"),
SYC(null, null, "Classical Syriac"),
SYR(null, null, "Syriac"),
TAH(null, "ty", "Tahitian"),
TAI(null, null, "Tai languages"),
TAM(null, "ta", "Tamil"),
TAT(null, "tt", "Tatar"),
TEL(null, "te", "Telugu"),
TEM(null, null, "Timne"),
TER(null, null, "Tereno"),
TET(null, null, "Tetum"),
TGK(null, "tg", "Tajik"),
TGL(null, "tl", "Tagalog"),
THA(null, "th", "Thai"),
TIB("bod", "bo", "Tibetan"),
TIG(null, null, "Tigre"),
TIR(null, "ti", "Tigrinya"),
TIV(null, null, "Tiv"),
TKL(null, null, "Tokelau"),
TLH(null, null, "Klingon; tlhIngan-Hol"),
TLI(null, null, "Tlingit"),
TMH(null, null, "Tamashek"),
TOG(null, null, "Tonga (Nyasa)"),
TON(null, "to", "Tonga (Tonga Islands)"),
TPI(null, null, "Tok Pisin"),
TSI(null, null, "Tsimshian"),
TSN(null, "tn", "Tswana"),
TSO(null, "ts", "Tsonga"),
TUK(null, "tk", "Turkmen"),
TUM(null, null, "Tumbuka"),
TUP(null, null, "Tupi languages"),
TUR(null, "tr", "Turkish"),
TUT(null, null, "Altaic languages"),
TVL(null, null, "Tuvalu"),
TWI(null, "tw", "Twi"),
TYV(null, null, "Tuvinian"),
UDM(null, null, "Udmurt"),
UGA(null, null, "Ugaritic"),
UIG(null, "ug", "Uighur; Uyghur"),
UKR(null, "uk", "Ukrainian"),
UMB(null, null, "Umbundu"),
UND(null, null, "Undetermined"),
URD(null, "ur", "Urdu"),
UZB(null, "uz", "Uzbek"),
VAI(null, null, "Vai"),
VEN(null, "ve", "Venda"),
VIE(null, "vi", "Vietnamese"),
VOL(null, "vo", "Volapük"),
VOT(null, null, "Votic"),
WAK(null, null, "Wakashan languages"),
WAL(null, null, "Wolaitta; Wolaytta"),
WAR(null, null, "Waray"),
WAS(null, null, "Washo"),
WEL("cym", "cy", "Welsh"),
WEN(null, null, "Sorbian languages"),
WLN(null, "wa", "Walloon"),
WOL(null, "wo", "Wolof"),
XAL(null, null, "Kalmyk; Oirat"),
XHO(null, "xh", "Xhosa"),
YAO(null, null, "Yao"),
YAP(null, null, "Yapese"),
YID(null, "yi", "Yiddish"),
YOR(null, "yo", "Yoruba"),
YPK(null, null, "Yupik languages"),
ZAP(null, null, "Zapotec"),
ZBL(null, null, "Blissymbols; Blissymbolics; Bliss"),
ZEN(null, null, "Zenaga"),
ZGH(null, null, "Standard Moroccan Tamazight"),
ZHA(null, "za", "Zhuang; Chuang"),
ZND(null, null, "Zande languages"),
ZUL(null, "zu", "Zulu"),
ZUN(null, null, "Zuni"),
ZXX(null, null, "No linguistic content; Not applicable"),
ZZA(null, null, "Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki"),;
public final String terminologyCode;
public final String iso639_1_code;
public final String label;
Language(String terminologyCode, String iso639_1_code, String label) {
this.terminologyCode = terminologyCode;
this.iso639_1_code = iso639_1_code;
this.label = label;
}
public static Language findLanguage(String code) {
for (Language language : Language.values()) {
if (code.equalsIgnoreCase(language.name()) || code.equalsIgnoreCase(language.iso639_1_code) || code.equalsIgnoreCase(language.terminologyCode)) {
return language;
}
}
return UNDEFINED;
}
public static Language findLanguage(String code, LanguageCoding languageCoding) {
for (Language language : Language.values()) {
switch (languageCoding) {
case TERMINOLOGY_CODE:
if (code.equalsIgnoreCase(language.terminologyCode)) {
return language;
}
break;
case ISO639_1_CODE:
if (code.equalsIgnoreCase(language.iso639_1_code)) {
return language;
}
break;
case ISO639_2_CODE:
if (code.equalsIgnoreCase(language.name())) {
return language;
}
break;
}
}
return UNDEFINED;
}
}