1 # LANGUAGE.awk -- awk script to generate LANGUAGE.tbl
3 # National Institute of Advanced Industrial Science and Technology (AIST)
4 # Registration Number H15PRO112
6 # This file is part of the m17n database; a sub-part of the m17n
9 # The m17n library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1 of
12 # the License, or (at your option) any later version.
14 # The m17n library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with the m17n library; if not, write to the Free
21 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 # Boston, MA 02110-1301, USA.
25 print ";; LANGUAGE.tbl -- ISO639 Language Code -*- mode:lisp; coding:utf-8; -*-";
26 print ";; Copyright (C) 2007";
27 print ";; National Institute of Advanced Industrial Science and Technology (AIST)";
28 print ";; Registration Number H15PRO112";
30 print ";; This file is part of the m17n database; a sub-part of the m17n";
33 print ";; The m17n library is free software; you can redistribute it and/or";
34 print ";; modify it under the terms of the GNU Lesser General Public License";
35 print ";; as published by the Free Software Foundation; either version 2.1 of";
36 print ";; the License, or (at your option) any later version.";
38 print ";; The m17n library is distributed in the hope that it will be useful,";
39 print ";; but WITHOUT ANY WARRANTY; without even the implied warranty of";
40 print ";; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU";
41 print ";; Lesser General Public License for more details.";
43 print ";; You should have received a copy of the GNU Lesser General Public";
44 print ";; License along with the m17n library; if not, write to the Free";
45 print ";; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,";
46 print ";; Boston, MA 02110-1301, USA.";
48 print ";; The file format is this:";
49 print ";; (ISO639-2 ISO639-1 \"ENGLISH-NAME\" [ \"NATIVE-NAME\" [ \"EXTRA-CHARS\" ]]) ...";
50 print ";; ISO639-2: 3-letter language code of ISO639-2.";
51 print ";; ISO639-1: 2-letter language code of ISO639-1, or nil if it doesn't exist.";
52 print ";; ENGLISH-NAME: English name of the language. The first name listed";
53 print ";; in ISO639-2 with the following modifications:";
54 print ";; 'Greek, Modern (1453-)' is changed to 'Greek'";
55 print ";; Tailing ' (Other)' is deleted.";
56 print ";; Tailing ' languages' is deleted.";
57 print ";; Tailing part specifying the date (e.g. ' (ca.450-1100)') is deleted.";
58 print ";; Reorder, for instance, 'English, Old' to 'Old English'.";
59 while (getline < "LANGDATA/native.txt") {
64 } else if ($0 ~ /^;;/) {
70 /^[a-z][a-z][a-z]\|/ {
74 if (two_letter == "" || two_letter == "NULL")
77 if (name == "Greek, Modern (1453-)")
80 gsub("; .*", "", name);
81 gsub(" \\(Other\\)$", "", name);
82 gsub(" languages$", "", name);
83 if (name ~ /\(.*[0-9].*\)$/)
84 gsub(" \\([^)]*\\)$", "", name);
86 split(name,array,", ");
87 name = array[2] " " array[1];
90 printf "(%s %-3s \"%s\"", $1, two_letter, name;
92 printf " \"%s\"", native;
96 printf " \"%s\"", chars;