-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrowcolumn_diacritics_helpers.rs
91 lines (91 loc) · 5.2 KB
/
rowcolumn_diacritics_helpers.rs
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
pub fn diacritic_to_num(c: char) -> u32 {
match c {
'\u{305}'..='\u{305}' => c as u32 - 0x305u32 + 1,
'\u{30d}'..='\u{30e}' => c as u32 - 0x30du32 + 2,
'\u{310}'..='\u{310}' => c as u32 - 0x310u32 + 4,
'\u{312}'..='\u{312}' => c as u32 - 0x312u32 + 5,
'\u{33d}'..='\u{33f}' => c as u32 - 0x33du32 + 6,
'\u{346}'..='\u{346}' => c as u32 - 0x346u32 + 9,
'\u{34a}'..='\u{34c}' => c as u32 - 0x34au32 + 10,
'\u{350}'..='\u{352}' => c as u32 - 0x350u32 + 13,
'\u{357}'..='\u{357}' => c as u32 - 0x357u32 + 16,
'\u{35b}'..='\u{35b}' => c as u32 - 0x35bu32 + 17,
'\u{363}'..='\u{36f}' => c as u32 - 0x363u32 + 18,
'\u{483}'..='\u{487}' => c as u32 - 0x483u32 + 31,
'\u{592}'..='\u{595}' => c as u32 - 0x592u32 + 36,
'\u{597}'..='\u{599}' => c as u32 - 0x597u32 + 40,
'\u{59c}'..='\u{5a1}' => c as u32 - 0x59cu32 + 43,
'\u{5a8}'..='\u{5a9}' => c as u32 - 0x5a8u32 + 49,
'\u{5ab}'..='\u{5ac}' => c as u32 - 0x5abu32 + 51,
'\u{5af}'..='\u{5af}' => c as u32 - 0x5afu32 + 53,
'\u{5c4}'..='\u{5c4}' => c as u32 - 0x5c4u32 + 54,
'\u{610}'..='\u{617}' => c as u32 - 0x610u32 + 55,
'\u{657}'..='\u{65b}' => c as u32 - 0x657u32 + 63,
'\u{65d}'..='\u{65e}' => c as u32 - 0x65du32 + 68,
'\u{6d6}'..='\u{6dc}' => c as u32 - 0x6d6u32 + 70,
'\u{6df}'..='\u{6e2}' => c as u32 - 0x6dfu32 + 77,
'\u{6e4}'..='\u{6e4}' => c as u32 - 0x6e4u32 + 81,
'\u{6e7}'..='\u{6e8}' => c as u32 - 0x6e7u32 + 82,
'\u{6eb}'..='\u{6ec}' => c as u32 - 0x6ebu32 + 84,
'\u{730}'..='\u{730}' => c as u32 - 0x730u32 + 86,
'\u{732}'..='\u{733}' => c as u32 - 0x732u32 + 87,
'\u{735}'..='\u{736}' => c as u32 - 0x735u32 + 89,
'\u{73a}'..='\u{73a}' => c as u32 - 0x73au32 + 91,
'\u{73d}'..='\u{73d}' => c as u32 - 0x73du32 + 92,
'\u{73f}'..='\u{741}' => c as u32 - 0x73fu32 + 93,
'\u{743}'..='\u{743}' => c as u32 - 0x743u32 + 96,
'\u{745}'..='\u{745}' => c as u32 - 0x745u32 + 97,
'\u{747}'..='\u{747}' => c as u32 - 0x747u32 + 98,
'\u{749}'..='\u{74a}' => c as u32 - 0x749u32 + 99,
'\u{7eb}'..='\u{7f1}' => c as u32 - 0x7ebu32 + 101,
'\u{7f3}'..='\u{7f3}' => c as u32 - 0x7f3u32 + 108,
'\u{816}'..='\u{819}' => c as u32 - 0x816u32 + 109,
'\u{81b}'..='\u{823}' => c as u32 - 0x81bu32 + 113,
'\u{825}'..='\u{827}' => c as u32 - 0x825u32 + 122,
'\u{829}'..='\u{82d}' => c as u32 - 0x829u32 + 125,
'\u{951}'..='\u{951}' => c as u32 - 0x951u32 + 130,
'\u{953}'..='\u{954}' => c as u32 - 0x953u32 + 131,
'\u{f82}'..='\u{f83}' => c as u32 - 0xf82u32 + 133,
'\u{f86}'..='\u{f87}' => c as u32 - 0xf86u32 + 135,
'\u{135d}'..='\u{135f}' => c as u32 - 0x135du32 + 137,
'\u{17dd}'..='\u{17dd}' => c as u32 - 0x17ddu32 + 140,
'\u{193a}'..='\u{193a}' => c as u32 - 0x193au32 + 141,
'\u{1a17}'..='\u{1a17}' => c as u32 - 0x1a17u32 + 142,
'\u{1a75}'..='\u{1a7c}' => c as u32 - 0x1a75u32 + 143,
'\u{1b6b}'..='\u{1b6b}' => c as u32 - 0x1b6bu32 + 151,
'\u{1b6d}'..='\u{1b73}' => c as u32 - 0x1b6du32 + 152,
'\u{1cd0}'..='\u{1cd2}' => c as u32 - 0x1cd0u32 + 159,
'\u{1cda}'..='\u{1cdb}' => c as u32 - 0x1cdau32 + 162,
'\u{1ce0}'..='\u{1ce0}' => c as u32 - 0x1ce0u32 + 164,
'\u{1dc0}'..='\u{1dc1}' => c as u32 - 0x1dc0u32 + 165,
'\u{1dc3}'..='\u{1dc9}' => c as u32 - 0x1dc3u32 + 167,
'\u{1dcb}'..='\u{1dcc}' => c as u32 - 0x1dcbu32 + 174,
'\u{1dd1}'..='\u{1de6}' => c as u32 - 0x1dd1u32 + 176,
'\u{1dfe}'..='\u{1dfe}' => c as u32 - 0x1dfeu32 + 198,
'\u{20d0}'..='\u{20d1}' => c as u32 - 0x20d0u32 + 199,
'\u{20d4}'..='\u{20d7}' => c as u32 - 0x20d4u32 + 201,
'\u{20db}'..='\u{20dc}' => c as u32 - 0x20dbu32 + 205,
'\u{20e1}'..='\u{20e1}' => c as u32 - 0x20e1u32 + 207,
'\u{20e7}'..='\u{20e7}' => c as u32 - 0x20e7u32 + 208,
'\u{20e9}'..='\u{20e9}' => c as u32 - 0x20e9u32 + 209,
'\u{20f0}'..='\u{20f0}' => c as u32 - 0x20f0u32 + 210,
'\u{2cef}'..='\u{2cf1}' => c as u32 - 0x2cefu32 + 211,
'\u{2de0}'..='\u{2dff}' => c as u32 - 0x2de0u32 + 214,
'\u{a66f}'..='\u{a66f}' => c as u32 - 0xa66fu32 + 246,
'\u{a67c}'..='\u{a67d}' => c as u32 - 0xa67cu32 + 247,
'\u{a6f0}'..='\u{a6f1}' => c as u32 - 0xa6f0u32 + 249,
'\u{a8e0}'..='\u{a8f1}' => c as u32 - 0xa8e0u32 + 251,
'\u{aab0}'..='\u{aab0}' => c as u32 - 0xaab0u32 + 269,
'\u{aab2}'..='\u{aab3}' => c as u32 - 0xaab2u32 + 270,
'\u{aab7}'..='\u{aab8}' => c as u32 - 0xaab7u32 + 272,
'\u{aabe}'..='\u{aabf}' => c as u32 - 0xaabeu32 + 274,
'\u{aac1}'..='\u{aac1}' => c as u32 - 0xaac1u32 + 276,
'\u{fe20}'..='\u{fe26}' => c as u32 - 0xfe20u32 + 277,
'\u{10a0f}'..='\u{10a0f}' => c as u32 - 0x10a0fu32 + 284,
'\u{10a38}'..='\u{10a38}' => c as u32 - 0x10a38u32 + 285,
'\u{1d185}'..='\u{1d189}' => c as u32 - 0x1d185u32 + 286,
'\u{1d1aa}'..='\u{1d1ad}' => c as u32 - 0x1d1aau32 + 291,
'\u{1d242}'..='\u{1d244}' => c as u32 - 0x1d242u32 + 295,
_ => 0
};
}