comparison interps/c-intercal/src/numerals.c @ 996:859f9b4339e6

<Gregor> tar xf egobot.tar.xz
author HackBot
date Sun, 09 Dec 2012 19:30:08 +0000
parents
children
comparison
equal deleted inserted replaced
995:6883f5911eb7 996:859f9b4339e6
1 /*
2 * numeral.c -- internationalization support for INTERCAL input.
3 *
4 * After release 0.5, I wrote:
5 *
6 * 2. (ESR) Input format internationalization -- allow WRITE IN input digits in
7 * major languages such as Nahuatl, Tagalog, Sanskrit, and Basque.
8 *
9 * The twisted loons in the alt.folklore.computers crowd loved this
10 * idea, and I actually got sent digit lists for Nahuatl, Tagalog,
11 * Sanskrit, and Basque -- also, Kwakiutl, Georgian, Ojibwe. Albanian,
12 * and Volap\"uk. I've left out Albanian (didn't want to keep track
13 * of the dipthong diacritical) and Ojibwe (no zero digit). So:
14 * Nahuatl, Tagalog, Sanskrit, Basque, Georgian, Kwakiutl, and
15 * Volap\"uk are now supported in addition to English.
16 *
17 * As of release 0.18, Volap\"uk digits can be entered in either ick_traditional
18 * Tex format, Latin-1, or UTF-8. Latin is also now a supported language,
19 * to fulfill the requirement for Ancient Roman localization.
20 *
21 LICENSE TERMS
22 Copyright (C) 1996 Eric S. Raymond
23
24 This program is free software; you can redistribute it and/or modify
25 it under the terms of the GNU General Public License as published by
26 the Free Software Foundation; either version 2 of the License, or
27 (at your option) any later version.
28
29 This program is distributed in the hope that it will be useful,
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 GNU General Public License for more details.
33
34 You should have received a copy of the GNU General Public License
35 along with this program; if not, write to the Free Software
36 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37 */
38
39 #include "config.h"
40
41 typedef struct
42 {
43 /*@observer@*/ const char *name;
44 const int value;
45 }
46 numeral;
47
48 const numeral ick_numerals[] =
49 {
50 /* English */
51 { "OH", 0 },
52 { "ZERO", 0 },
53 { "ONE", 1 },
54 { "TWO", 2 },
55 { "THREE", 3 },
56 { "FOUR", 4 },
57 { "FIVE", 5 },
58 { "SIX", 6 },
59 { "SEVEN", 7 },
60 { "EIGHT", 8 },
61 { "NINE", 9 },
62 { "NINER", 9 }, /* For all you junior birdmen */
63 /* Sanskrit */
64 { "SUTYA", 0 }, /* Retroflex s, pronounced halfway to sh */
65 { "SHUTYA", 0 },
66 { "EKA", 1 },
67 { "DVI", 2 },
68 { "TRI", 3 },
69 { "CHATUR", 4 },
70 { "PANCHAN", 5 },
71 { "SHASH", 6 },
72 { "SAPTAM", 7 },
73 { "ASHTAN", 8 },
74 { "NAVAN", 9 },
75 /* Basque */
76 { "ZEROA", 0 },
77 { "BAT", 1 },
78 { "BI", 2 },
79 { "HIRO", 3 },
80 { "LAU", 4 },
81 { "BORTZ", 5 },
82 { "SEI", 6 },
83 { "ZAZPI", 7 },
84 { "ZORTZI", 8 },
85 { "BEDERATZI", 9 },
86 /* Tagalog */
87 { "WALA", 0 },
88 { "ISA", 1 },
89 { "DALAWA", 2 },
90 { "TATLO", 3 },
91 { "APAT", 4 },
92 { "LIMA", 5 },
93 { "ANIM", 6 },
94 { "PITO", 7 },
95 { "WALO", 8 },
96 { "SIYAM", 9 },
97 /* Classical Nahuatl */
98 { "AHTLE", 0 }, /* Actually `nothing'; no separate zero word is known */
99 { "CE", 1 },
100 { "OME", 2 },
101 { "IEI", 3 },
102 { "NAUI", 4 },
103 { "NACUILI", 5 },
104 { "CHIQUACE", 6 },
105 { "CHICOME", 7 },
106 { "CHICUE", 8 },
107 { "CHICUNAUI", 9 },
108 /* Georgian */
109 { "NULI", 0 },
110 { "ERTI", 1 },
111 { "ORI", 2 },
112 { "SAMI", 3 },
113 { "OTXI", 4 },
114 { "XUTI", 5 },
115 { "EKSVI", 6 },
116 { "SHVIDI", 7 },
117 { "RVA", 8 },
118 { "CXRA", 9 },
119 /* Kwakiutl (technically, Kwak'wala) */
120 { "KE'YOS", 0 }, /* Actually `nothing'; no separate zero word is known */
121 { "'NEM", 1 },
122 { "MAL'H", 2 },
123 { "YUDEXW", 3 },
124 { "MU", 4 },
125 { "SEK'A", 5 },
126 { "Q'ETL'A", 6 },
127 { "ETLEBU", 7 },
128 { "MALHGWENALH", 8 },
129 { "'NA'NE'MA", 9 },
130 /* Volap\"uk */
131 { "NOS", 0 },
132 { "BAL", 1 },
133 { "TEL", 2 },
134 { "KIL", 3 },
135 { "FOL", 4 },
136 { "LUL", 5 },
137 { "M\\\"AL", 6 },
138 { "M\xC4L", 6 }, /* Latin-1 support */
139 { "M\xA3\xA4L", 6 }, /* UTF-8 support */
140 { "VEL", 7 },
141 { "J\\\"OL", 8 },
142 { "J\xD6L", 8 }, /* Latin-1 support */
143 { "J\xA3\x96L", 8 }, /* UTF-8 support */
144 { "Z\\\"UL", 9 },
145 { "Z\xDCL", 9 }, /* Latin-1 support */
146 { "Z\xA3\x9CL", 9 }, /* UTF-8 support */
147 /* Latin localization */
148 { "NIL", 0 },
149 { "NIHIL", 0 },
150 { "UNUS", 1 },
151 { "UNA", 1 },
152 { "UNUM", 1 },
153 { "DUO", 2 },
154 { "DUAE", 2 },
155 { "TRES", 3 },
156 { "QUATTUOR", 4 },
157 { "QUATUOR", 4 },
158 { "QUINQUE", 5 },
159 { "SEX", 6 },
160 { "SEPTEM", 7 },
161 { "OCTO", 8 },
162 { "NOVEM", 9 },
163 };
164
165 /* numeral.c ends here */