1 # CASED.awk -- awk script to generate CASED.tab
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., 59 Temple Place, Suite 330, Boston, MA
48 FILE = "UnicodeData.txt";
49 FS = "[ \t]*[;#][ \t]*";
52 function decode_hex(str, idx) {
55 for (i = idx; i <= len; i++)
57 c = tohex[substr(str, i, 1)];
65 function single(str, bit) {
66 i = decode_hex(str, 1);
71 function range(str, bit) {
72 end = decode_hex(str, index(str, "..") + 2);
73 for (i = decode_hex(str, 1); i <= end; i++)
80 if (FILE == "UnicodeData.txt") {
83 else if ($3 ~ /Mn|Me|Cf|Lm|Sk/)
88 else if (FILE == "PropList.txt") {
89 if ($2 ~ /Other_(Upp|Low)ercase/) {
98 else { # FILE == "WordBreakProperty.txt"
99 if ($2 == "MidLetter") {
109 /^\# PropList-.+\.txt/ {
110 FILE = "PropList.txt";
113 /^\# WordBreakProperty-.+\.txt/ {
114 FILE = "WordBreakProperty.txt";
119 printf ("0x%X %d\n", i, cased[i]);