From: ntakahas Date: Mon, 12 Sep 2005 08:32:45 +0000 (+0000) Subject: Use FILENAME built-in variable. X-Git-Tag: REL-1-3-0~122 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ab5f5f6f2402015529277cdbd9a826bd665101f;p=m17n%2Fm17n-db.git Use FILENAME built-in variable. --- diff --git a/CASE-MAPPING.awk b/CASE-MAPPING.awk index c1bed2f..526a4ef 100644 --- a/CASE-MAPPING.awk +++ b/CASE-MAPPING.awk @@ -22,8 +22,7 @@ # 02111-1307, USA. BEGIN { - FS = ";"; - FILE = 1; + FS = "[ \t]*;[ \t]*"; } function mtext (str) { @@ -39,24 +38,21 @@ function mtext (str) { printf (" "); } -FILE == 1 && /^[^\#]/ && NF == 5 { - printf ("0x%s ( ", $1); - mtext ($2); - mtext ($3); - mtext ($4); - printf (")\n"); - X[$1] = 1; - next; -} - -/^0000;/ { - FILE = 2; -} - -FILE == 2 && /^[^\#]/ && ($13 || $14 || $15) && ! X[$1] { - if (! $13) $13 = $1; - if (! $14) $14 = $1; - if (! $15) $15 = $1; - printf ("0x%s ( \"\\u%s\" \"\\u%s\" \"\\u%s\" )\n", - $1, $14, $15, $13); +/^[^\#]/ { + if (FILENAME == "UNIDATA/SpecialCasing.txt" && NF == 5) { + printf ("0x%s ( ", $1); + mtext ($2); + mtext ($3); + mtext ($4); + printf (")\n"); + X[$1] = 1; + } + + else if (($13 || $14 || $15) && ! X[$1]) { + if (! $13) $13 = $1; + if (! $14) $14 = $1; + if (! $15) $15 = $1; + printf ("0x%s ( \"\\u%s\" \"\\u%s\" \"\\u%s\" )\n", + $1, $14, $15, $13); + } }