-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrowcolumn_diacritics_helpers.c
391 lines (390 loc) · 6.47 KB
/
rowcolumn_diacritics_helpers.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
#include <stdint.h>
uint16_t diacritic_to_num(uint32_t code)
{
switch (code) {
case 0x305:
return code - 0x305 + 1;
case 0x30d:
case 0x30e:
return code - 0x30d + 2;
case 0x310:
return code - 0x310 + 4;
case 0x312:
return code - 0x312 + 5;
case 0x33d:
case 0x33e:
case 0x33f:
return code - 0x33d + 6;
case 0x346:
return code - 0x346 + 9;
case 0x34a:
case 0x34b:
case 0x34c:
return code - 0x34a + 10;
case 0x350:
case 0x351:
case 0x352:
return code - 0x350 + 13;
case 0x357:
return code - 0x357 + 16;
case 0x35b:
return code - 0x35b + 17;
case 0x363:
case 0x364:
case 0x365:
case 0x366:
case 0x367:
case 0x368:
case 0x369:
case 0x36a:
case 0x36b:
case 0x36c:
case 0x36d:
case 0x36e:
case 0x36f:
return code - 0x363 + 18;
case 0x483:
case 0x484:
case 0x485:
case 0x486:
case 0x487:
return code - 0x483 + 31;
case 0x592:
case 0x593:
case 0x594:
case 0x595:
return code - 0x592 + 36;
case 0x597:
case 0x598:
case 0x599:
return code - 0x597 + 40;
case 0x59c:
case 0x59d:
case 0x59e:
case 0x59f:
case 0x5a0:
case 0x5a1:
return code - 0x59c + 43;
case 0x5a8:
case 0x5a9:
return code - 0x5a8 + 49;
case 0x5ab:
case 0x5ac:
return code - 0x5ab + 51;
case 0x5af:
return code - 0x5af + 53;
case 0x5c4:
return code - 0x5c4 + 54;
case 0x610:
case 0x611:
case 0x612:
case 0x613:
case 0x614:
case 0x615:
case 0x616:
case 0x617:
return code - 0x610 + 55;
case 0x657:
case 0x658:
case 0x659:
case 0x65a:
case 0x65b:
return code - 0x657 + 63;
case 0x65d:
case 0x65e:
return code - 0x65d + 68;
case 0x6d6:
case 0x6d7:
case 0x6d8:
case 0x6d9:
case 0x6da:
case 0x6db:
case 0x6dc:
return code - 0x6d6 + 70;
case 0x6df:
case 0x6e0:
case 0x6e1:
case 0x6e2:
return code - 0x6df + 77;
case 0x6e4:
return code - 0x6e4 + 81;
case 0x6e7:
case 0x6e8:
return code - 0x6e7 + 82;
case 0x6eb:
case 0x6ec:
return code - 0x6eb + 84;
case 0x730:
return code - 0x730 + 86;
case 0x732:
case 0x733:
return code - 0x732 + 87;
case 0x735:
case 0x736:
return code - 0x735 + 89;
case 0x73a:
return code - 0x73a + 91;
case 0x73d:
return code - 0x73d + 92;
case 0x73f:
case 0x740:
case 0x741:
return code - 0x73f + 93;
case 0x743:
return code - 0x743 + 96;
case 0x745:
return code - 0x745 + 97;
case 0x747:
return code - 0x747 + 98;
case 0x749:
case 0x74a:
return code - 0x749 + 99;
case 0x7eb:
case 0x7ec:
case 0x7ed:
case 0x7ee:
case 0x7ef:
case 0x7f0:
case 0x7f1:
return code - 0x7eb + 101;
case 0x7f3:
return code - 0x7f3 + 108;
case 0x816:
case 0x817:
case 0x818:
case 0x819:
return code - 0x816 + 109;
case 0x81b:
case 0x81c:
case 0x81d:
case 0x81e:
case 0x81f:
case 0x820:
case 0x821:
case 0x822:
case 0x823:
return code - 0x81b + 113;
case 0x825:
case 0x826:
case 0x827:
return code - 0x825 + 122;
case 0x829:
case 0x82a:
case 0x82b:
case 0x82c:
case 0x82d:
return code - 0x829 + 125;
case 0x951:
return code - 0x951 + 130;
case 0x953:
case 0x954:
return code - 0x953 + 131;
case 0xf82:
case 0xf83:
return code - 0xf82 + 133;
case 0xf86:
case 0xf87:
return code - 0xf86 + 135;
case 0x135d:
case 0x135e:
case 0x135f:
return code - 0x135d + 137;
case 0x17dd:
return code - 0x17dd + 140;
case 0x193a:
return code - 0x193a + 141;
case 0x1a17:
return code - 0x1a17 + 142;
case 0x1a75:
case 0x1a76:
case 0x1a77:
case 0x1a78:
case 0x1a79:
case 0x1a7a:
case 0x1a7b:
case 0x1a7c:
return code - 0x1a75 + 143;
case 0x1b6b:
return code - 0x1b6b + 151;
case 0x1b6d:
case 0x1b6e:
case 0x1b6f:
case 0x1b70:
case 0x1b71:
case 0x1b72:
case 0x1b73:
return code - 0x1b6d + 152;
case 0x1cd0:
case 0x1cd1:
case 0x1cd2:
return code - 0x1cd0 + 159;
case 0x1cda:
case 0x1cdb:
return code - 0x1cda + 162;
case 0x1ce0:
return code - 0x1ce0 + 164;
case 0x1dc0:
case 0x1dc1:
return code - 0x1dc0 + 165;
case 0x1dc3:
case 0x1dc4:
case 0x1dc5:
case 0x1dc6:
case 0x1dc7:
case 0x1dc8:
case 0x1dc9:
return code - 0x1dc3 + 167;
case 0x1dcb:
case 0x1dcc:
return code - 0x1dcb + 174;
case 0x1dd1:
case 0x1dd2:
case 0x1dd3:
case 0x1dd4:
case 0x1dd5:
case 0x1dd6:
case 0x1dd7:
case 0x1dd8:
case 0x1dd9:
case 0x1dda:
case 0x1ddb:
case 0x1ddc:
case 0x1ddd:
case 0x1dde:
case 0x1ddf:
case 0x1de0:
case 0x1de1:
case 0x1de2:
case 0x1de3:
case 0x1de4:
case 0x1de5:
case 0x1de6:
return code - 0x1dd1 + 176;
case 0x1dfe:
return code - 0x1dfe + 198;
case 0x20d0:
case 0x20d1:
return code - 0x20d0 + 199;
case 0x20d4:
case 0x20d5:
case 0x20d6:
case 0x20d7:
return code - 0x20d4 + 201;
case 0x20db:
case 0x20dc:
return code - 0x20db + 205;
case 0x20e1:
return code - 0x20e1 + 207;
case 0x20e7:
return code - 0x20e7 + 208;
case 0x20e9:
return code - 0x20e9 + 209;
case 0x20f0:
return code - 0x20f0 + 210;
case 0x2cef:
case 0x2cf0:
case 0x2cf1:
return code - 0x2cef + 211;
case 0x2de0:
case 0x2de1:
case 0x2de2:
case 0x2de3:
case 0x2de4:
case 0x2de5:
case 0x2de6:
case 0x2de7:
case 0x2de8:
case 0x2de9:
case 0x2dea:
case 0x2deb:
case 0x2dec:
case 0x2ded:
case 0x2dee:
case 0x2def:
case 0x2df0:
case 0x2df1:
case 0x2df2:
case 0x2df3:
case 0x2df4:
case 0x2df5:
case 0x2df6:
case 0x2df7:
case 0x2df8:
case 0x2df9:
case 0x2dfa:
case 0x2dfb:
case 0x2dfc:
case 0x2dfd:
case 0x2dfe:
case 0x2dff:
return code - 0x2de0 + 214;
case 0xa66f:
return code - 0xa66f + 246;
case 0xa67c:
case 0xa67d:
return code - 0xa67c + 247;
case 0xa6f0:
case 0xa6f1:
return code - 0xa6f0 + 249;
case 0xa8e0:
case 0xa8e1:
case 0xa8e2:
case 0xa8e3:
case 0xa8e4:
case 0xa8e5:
case 0xa8e6:
case 0xa8e7:
case 0xa8e8:
case 0xa8e9:
case 0xa8ea:
case 0xa8eb:
case 0xa8ec:
case 0xa8ed:
case 0xa8ee:
case 0xa8ef:
case 0xa8f0:
case 0xa8f1:
return code - 0xa8e0 + 251;
case 0xaab0:
return code - 0xaab0 + 269;
case 0xaab2:
case 0xaab3:
return code - 0xaab2 + 270;
case 0xaab7:
case 0xaab8:
return code - 0xaab7 + 272;
case 0xaabe:
case 0xaabf:
return code - 0xaabe + 274;
case 0xaac1:
return code - 0xaac1 + 276;
case 0xfe20:
case 0xfe21:
case 0xfe22:
case 0xfe23:
case 0xfe24:
case 0xfe25:
case 0xfe26:
return code - 0xfe20 + 277;
case 0x10a0f:
return code - 0x10a0f + 284;
case 0x10a38:
return code - 0x10a38 + 285;
case 0x1d185:
case 0x1d186:
case 0x1d187:
case 0x1d188:
case 0x1d189:
return code - 0x1d185 + 286;
case 0x1d1aa:
case 0x1d1ab:
case 0x1d1ac:
case 0x1d1ad:
return code - 0x1d1aa + 291;
case 0x1d242:
case 0x1d243:
case 0x1d244:
return code - 0x1d242 + 295;
}
return 0;
}