From dd554301621833b19e8ac36ea8a93e5e8e0d626c Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 15 Jun 2007 11:37:54 +0000 Subject: [PATCH] (BEGIN): Fix regluar expression for extracting an English name. (/^[a-z][a-z][a-z]\|/): Don't modify English names extracted from "en.lnm". --- LANGDATA/LANGUAGE.awk | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) 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; -- 1.7.10.4