1 # LANGNAME.awk -- awk script to generate LANGNAME.en and LANGNAME.fr
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.
32 printf ";; LANGNAME.%s -- %s language names -*- mode:lisp; coding:utf-8; -*-\n", LANG, Language;
33 print ";; Copyright (C) 2007";
34 print ";; National Institute of Advanced Industrial Science and Technology (AIST)";
35 print ";; Registration Number H15PRO112";
37 print ";; This file is part of the m17n database; a sub-part of the m17n";
40 print ";; The m17n library is free software; you can redistribute it and/or";
41 print ";; modify it under the terms of the GNU Lesser General Public License";
42 print ";; as published by the Free Software Foundation; either version 2.1 of";
43 print ";; the License, or (at your option) any later version.";
45 print ";; The m17n library is distributed in the hope that it will be useful,";
46 print ";; but WITHOUT ANY WARRANTY; without even the implied warranty of";
47 print ";; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU";
48 print ";; Lesser General Public License for more details.";
50 print ";; You should have received a copy of the GNU Lesser General Public";
51 print ";; License along with the m17n library; if not, write to the Free";
52 print ";; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,";
53 print ";; Boston, MA 02110-1301, USA.";
55 print ";; Each line of this file has this form:";
56 printf ";; (ISO639-2 \"%s-NAME\" ...)\n", LANGUAGE;
57 print ";; ISO639-2: 3-letter language code of ISO639-2.";
58 printf ";; %s-NAME: %s name of the language\n", LANGUAGE, Language;
59 print ";; in ISO639-2 with the following modifications:";
61 print ";; 'Greek, Modern (1453-)' is changed to 'Greek'";
62 print ";; Tailing ' (Other)' is deleted.";
63 print ";; Tailing ' languages' is deleted.";
64 print ";; Tailing part specifying the date (e.g. ' (ca.450-1100)') is deleted.";
65 print ";; Reorder, for instance, 'English, Old' to 'Old English'.";
67 print ";; 'grec moderne (après 1453)' is changed to 'grec'";
68 print ";; Tailing ', autres langues' is deleted.";
69 print ";; Tailing ', autres' is deleted.";
70 print ";; Tailing ', langues' is deleted.";
71 print ";; Tailing ', langues (famille)' is deleted.";
72 print ";; Tailing part specifying the date (e.g. ' (ca.450-1100)') is deleted.";
73 print ";; Reorder, for instance, 'saxon, bas' to 'bas saxon'.";
75 print ";; Delete duplicated names after the above modifications.";
77 printf "(language name %s)\n", LANG;
83 for (idx in names) delete names[idx];
85 split($4, array, "; ");
88 if (name == "Greek, Modern (1453-)")
90 else if (name == "Multiple languages")
93 gsub(" \\(Other\\)$", "", name);
94 gsub(" languages$", "", name);
95 if (name ~ /\(.*[0-9].*\)$/) {
96 gsub(" \\([^)]*\\)$", "", name);
99 split(name,array2,", ");
100 name = array2[2] " " array2[1];
106 split($5, array, "; ");
109 if (name == "grec ancien (jusqu'à 1453)")
112 gsub(", autres langues$", "", name);
113 gsub(", autres$", "", name);
114 gsub(", langues$", "", name);
115 gsub(", langues \\(famille\\)$", "", name);
116 if (name ~ /\(.*[0-9].*\)$/)
117 gsub(" \\([^)]*\\)$", "", name);
119 split(name,array2,", ");
120 name = array2[2] " " array2[1];
127 for (name in names) {
128 printf " \"%s\"", name;