Permalink
Browse files

add ukr and pol to DCEntry.getLanguage ISO639-2 3-char language code

conversion to deliver uk, pl 2-char code
and use if else to return on match
  • Loading branch information...
reger24 committed Jan 21, 2017
1 parent 8d790ab commit df80c578428272bab4adf456ca2b7e2e3ac9affd
Showing with 13 additions and 10 deletions.
  1. +13 −10 source/net/yacy/document/content/DCEntry.java
@@ -211,16 +211,19 @@ public String getLanguage() {//final language computation
// TODO: implement complete list of ISO639-2/ISO639-3 language codes
if (l != null && l.length() == 3) {
if (l.startsWith("ger") || l.startsWith("deu")) l = "de";
if (l.startsWith("eng")) l = "en";
if (l.startsWith("rus")) l = "ru";
if (l.startsWith("jpn")) l = "ja";
if (l.startsWith("ita")) l = "it";
if (l.startsWith("por")) l = "pt";
if (l.startsWith("spa")) l = "es";
if (l.startsWith("chi") || l.startsWith("zho")) l = "zh";
if (l.startsWith("fre") || l.startsWith("fra")) l = "fr";
if (l.startsWith("eus") || l.startsWith("baq")) l = "eu";
if (l.startsWith("gre") || l.startsWith("ell")) l = "el";
else if (l.startsWith("eng")) l = "en";
else if (l.startsWith("rus")) l = "ru";
else if (l.startsWith("jpn")) l = "ja";
else if (l.startsWith("ita")) l = "it";
else if (l.startsWith("por")) l = "pt";
else if (l.startsWith("pol")) l = "pl";
else if (l.startsWith("spa")) l = "es";
else if (l.startsWith("ukr")) l = "uk";
else if (l.startsWith("chi") || l.startsWith("zho")) l = "zh";
else if (l.startsWith("fre") || l.startsWith("fra")) l = "fr";
else if (l.startsWith("eus") || l.startsWith("baq")) l = "eu";
else if (l.startsWith("gre") || l.startsWith("ell")) l = "el";
return l;
}
if (l == null) l = getIdentifier(true).language(); // determine from identifier-url.TLD

0 comments on commit df80c57

Please sign in to comment.