From: handa Date: Fri, 15 Jun 2007 11:37:54 +0000 (+0000) Subject: (BEGIN): Fix regluar expression for X-Git-Tag: REL-1-4-0~30 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=dd554301621833b19e8ac36ea8a93e5e8e0d626c;p=m17n%2Fm17n-db.git (BEGIN): Fix regluar expression for extracting an English name. (/^[a-z][a-z][a-z]\|/): Don't modify English names extracted from "en.lnm". --- diff --git a/LANGDATA/LANGUAGE.awk b/LANGDATA/LANGUAGE.awk index 945198b..3bc0a49 100644 --- a/LANGDATA/LANGUAGE.awk +++ b/LANGDATA/LANGUAGE.awk @@ -72,8 +72,10 @@ BEGIN { } } while (getline < "en.lnm") { - split($0, array, "\(| \"|\" \"|\"\)") - ENGLISH[array[2]] = array[3]; + split($0, array, "[( ]"); + code = array[2]; + split($0, array, "\""); + ENGLISH[code] = array[2]; } } @@ -90,19 +92,20 @@ BEGIN { name = ENGLISH[code2]; if (! name) name = ENGLISH[code3]; - if (name == "Greek, Modern (1453-)") - name = "Greek"; - else { - gsub("; .*", "", name); - gsub(" \\(Other\\)$", "", name); - gsub(" languages$", "", name); - if (name ~ /\(.*[0-9].*\)$/) - gsub(" \\([^)]*\\)$", "", name); - if (name ~ ", ") { - split(name, array, ", "); - name = array[2] " " array[1]; - } - } +# if (name == "Greek, Modern (1453-)") +# name = "Greek"; +# else { +# gsub("; .*", "", name); +# gsub(" \\(Other\\)$", "", name); +# gsub(" languages$", "", name); +# gsub(" Languages$", "", name); +# if (name ~ /\(.*[0-9].*\)$/) +# gsub(" \\([^)]*\\)$", "", name); +# if (name ~ ", ") { +# split(name, array, ", "); +# name = array[2] " " array[1]; +# } +# } printf "(%s %-3s \"%s\"", code3, code2, name; if (native != "") printf " \"%s\"", native;