[4316] | 1 | #ifndef CASEFOLDING_TXT_H |
---|
| 2 | #define CASEFOLDING_TXT_H |
---|
| 3 | /* |
---|
[5656] | 4 | * Copyright (c) 2017 International Characters, Inc. |
---|
[4316] | 5 | * This software is licensed to the public under the Open Software License 3.0. |
---|
| 6 | * icgrep is a trademark of International Characters, Inc. |
---|
| 7 | * |
---|
| 8 | * This file is generated by casefold.py - manual edits may be lost. |
---|
| 9 | */ |
---|
| 10 | |
---|
[5145] | 11 | #include "re/re_cc.h" |
---|
[4316] | 12 | #include <vector> |
---|
| 13 | |
---|
[5145] | 14 | typedef unsigned codepoint_t; |
---|
| 15 | |
---|
[4316] | 16 | struct FoldEntry { |
---|
[4615] | 17 | re::codepoint_t range_lo; |
---|
[4316] | 18 | int fold_offset; |
---|
[4617] | 19 | std::vector<re::interval_t> fold_pairs; |
---|
[4316] | 20 | }; |
---|
| 21 | |
---|
[5145] | 22 | |
---|
[4615] | 23 | void caseInsensitiveInsertRange(re::CC * cc, const re::codepoint_t lo, const re::codepoint_t hi); |
---|
[4316] | 24 | |
---|
[4615] | 25 | inline void caseInsensitiveInsert(re::CC * cc, const re::codepoint_t cp) { |
---|
[5145] | 26 | caseInsensitiveInsertRange(cc, cp, cp); |
---|
[4615] | 27 | } |
---|
[4316] | 28 | |
---|
[5145] | 29 | const int foldTableSize = 246; |
---|
[4316] | 30 | |
---|
| 31 | const FoldEntry foldTable[foldTableSize] = { |
---|
| 32 | {0x0, 0, {}}, |
---|
| 33 | {0x41, 32, {{0x4b, 0x212a}, {0x53, 0x17f}}}, |
---|
| 34 | {0x5b, 0, {}}, |
---|
| 35 | {0x61, -32, {{0x6b, 0x212a}, {0x73, 0x17f}}}, |
---|
| 36 | {0x7b, 0, {{0xb5, 0x3bc}, {0xb5, 0x39c}}}, |
---|
| 37 | {0xc0, 32, {{0xc5, 0x212b}}}, |
---|
| 38 | {0xd7, 0, {}}, |
---|
| 39 | {0xd8, 32, {}}, |
---|
| 40 | {0xdf, 0, {{0xdf, 0x1e9e}}}, |
---|
| 41 | {0xe0, -32, {{0xe5, 0x212b}}}, |
---|
| 42 | {0xf7, 0, {}}, |
---|
| 43 | {0xf8, -32, {}}, |
---|
| 44 | {0xff, 0, {{0xff, 0x178}}}, |
---|
| 45 | {0x100, 1, {}}, |
---|
| 46 | {0x130, 0, {}}, |
---|
| 47 | {0x132, 1, {}}, |
---|
| 48 | {0x138, 0, {}}, |
---|
| 49 | {0x139, 1, {}}, |
---|
| 50 | {0x149, 0, {}}, |
---|
| 51 | {0x14a, 1, {}}, |
---|
| 52 | {0x178, 0, {{0x178, 0xff}}}, |
---|
| 53 | {0x179, 1, {}}, |
---|
| 54 | {0x17f, 0, {{0x17f, 0x73}, {0x17f, 0x53}, {0x180, 0x243}, {0x181, 0x253}}}, |
---|
| 55 | {0x182, 1, {}}, |
---|
| 56 | {0x186, 0, {{0x186, 0x254}}}, |
---|
| 57 | {0x187, 1, {}}, |
---|
| 58 | {0x189, 205, {}}, |
---|
| 59 | {0x18b, 1, {}}, |
---|
| 60 | {0x18d, 0, {{0x18e, 0x1dd}, {0x18f, 0x259}, {0x190, 0x25b}}}, |
---|
| 61 | {0x191, 1, {}}, |
---|
| 62 | {0x193, 0, {{0x193, 0x260}, {0x194, 0x263}, {0x195, 0x1f6}, {0x196, 0x269}, |
---|
| 63 | {0x197, 0x268}}}, |
---|
| 64 | {0x198, 1, {}}, |
---|
| 65 | {0x19a, 0, {{0x19a, 0x23d}, {0x19c, 0x26f}, {0x19d, 0x272}, {0x19e, 0x220}, |
---|
| 66 | {0x19f, 0x275}}}, |
---|
| 67 | {0x1a0, 1, {}}, |
---|
| 68 | {0x1a6, 0, {{0x1a6, 0x280}}}, |
---|
| 69 | {0x1a7, 1, {}}, |
---|
| 70 | {0x1a9, 0, {{0x1a9, 0x283}}}, |
---|
| 71 | {0x1ac, 1, {}}, |
---|
| 72 | {0x1ae, 0, {{0x1ae, 0x288}}}, |
---|
| 73 | {0x1af, 1, {}}, |
---|
| 74 | {0x1b1, 217, {}}, |
---|
| 75 | {0x1b3, 1, {}}, |
---|
| 76 | {0x1b7, 0, {{0x1b7, 0x292}}}, |
---|
| 77 | {0x1b8, 1, {}}, |
---|
| 78 | {0x1ba, 0, {}}, |
---|
| 79 | {0x1bc, 1, {}}, |
---|
| 80 | {0x1be, 0, {{0x1bf, 0x1f7}}}, |
---|
| 81 | {0x1c4, 1, {{0x1c4, 0x1c6}}}, |
---|
| 82 | {0x1c6, 0, {}}, |
---|
| 83 | {0x1c5, 1, {{0x1c6, 0x1c4}, {0x1c7, 0x1c9}}}, |
---|
| 84 | {0x1c9, 0, {}}, |
---|
| 85 | {0x1c8, 1, {{0x1c9, 0x1c7}, {0x1ca, 0x1cc}}}, |
---|
| 86 | {0x1cc, 0, {}}, |
---|
| 87 | {0x1cb, 1, {{0x1cc, 0x1ca}}}, |
---|
| 88 | {0x1dd, 0, {{0x1dd, 0x18e}}}, |
---|
| 89 | {0x1de, 1, {}}, |
---|
| 90 | {0x1f0, 0, {}}, |
---|
| 91 | {0x1f1, 1, {{0x1f1, 0x1f3}}}, |
---|
| 92 | {0x1f3, 0, {}}, |
---|
| 93 | {0x1f2, 1, {{0x1f3, 0x1f1}}}, |
---|
| 94 | {0x1f6, 0, {{0x1f6, 0x195}, {0x1f7, 0x1bf}}}, |
---|
| 95 | {0x1f8, 1, {}}, |
---|
| 96 | {0x220, 0, {{0x220, 0x19e}}}, |
---|
| 97 | {0x222, 1, {}}, |
---|
| 98 | {0x234, 0, {{0x23a, 0x2c65}}}, |
---|
| 99 | {0x23b, 1, {}}, |
---|
| 100 | {0x23d, 0, {{0x23d, 0x19a}, {0x23e, 0x2c66}}}, |
---|
| 101 | {0x23f, 10815, {}}, |
---|
| 102 | {0x241, 1, {}}, |
---|
| 103 | {0x243, 0, {{0x243, 0x180}, {0x244, 0x289}, {0x245, 0x28c}}}, |
---|
| 104 | {0x246, 1, {}}, |
---|
| 105 | {0x250, 0, {{0x250, 0x2c6f}, {0x251, 0x2c6d}, {0x252, 0x2c70}, {0x253, 0x181}, |
---|
| 106 | {0x254, 0x186}}}, |
---|
| 107 | {0x256, -205, {}}, |
---|
| 108 | {0x258, 0, {{0x259, 0x18f}, {0x25b, 0x190}, {0x25c, 0xa7ab}, {0x260, 0x193}, |
---|
| 109 | {0x261, 0xa7ac}, {0x263, 0x194}, {0x265, 0xa78d}, {0x266, 0xa7aa}, |
---|
[5145] | 110 | {0x268, 0x197}, {0x269, 0x196}, {0x26a, 0xa7ae}, {0x26b, 0x2c62}, |
---|
| 111 | {0x26c, 0xa7ad}, {0x26f, 0x19c}, {0x271, 0x2c6e}, {0x272, 0x19d}, |
---|
| 112 | {0x275, 0x19f}, {0x27d, 0x2c64}, {0x280, 0x1a6}, {0x283, 0x1a9}, |
---|
| 113 | {0x287, 0xa7b1}, {0x288, 0x1ae}, {0x289, 0x244}}}, |
---|
[4316] | 114 | {0x28a, -217, {}}, |
---|
[5145] | 115 | {0x28c, 0, {{0x28c, 0x245}, {0x292, 0x1b7}, {0x29d, 0xa7b2}, {0x29e, 0xa7b0}, |
---|
| 116 | {0x345, 0x3b9}, {0x345, 0x399}, {0x345, 0x1fbe}}}, |
---|
[4316] | 117 | {0x370, 1, {}}, |
---|
| 118 | {0x374, 0, {}}, |
---|
| 119 | {0x376, 1, {}}, |
---|
| 120 | {0x378, 0, {}}, |
---|
| 121 | {0x37b, 130, {}}, |
---|
| 122 | {0x37e, 0, {{0x37f, 0x3f3}, {0x386, 0x3ac}}}, |
---|
| 123 | {0x388, 37, {}}, |
---|
| 124 | {0x38b, 0, {{0x38c, 0x3cc}}}, |
---|
| 125 | {0x38e, 63, {}}, |
---|
| 126 | {0x390, 0, {}}, |
---|
| 127 | {0x391, 32, {{0x392, 0x3d0}, {0x395, 0x3f5}, {0x398, 0x3d1}, {0x398, 0x3f4}, |
---|
| 128 | {0x399, 0x345}, {0x399, 0x1fbe}, {0x39a, 0x3f0}, {0x39c, 0xb5}, |
---|
| 129 | {0x3a0, 0x3d6}, {0x3a1, 0x3f1}}}, |
---|
| 130 | {0x3a2, 0, {}}, |
---|
| 131 | {0x3a3, 32, {{0x3a3, 0x3c2}, {0x3a6, 0x3d5}, {0x3a9, 0x2126}}}, |
---|
| 132 | {0x3ac, 0, {{0x3ac, 0x386}}}, |
---|
| 133 | {0x3ad, -37, {}}, |
---|
| 134 | {0x3b0, 0, {}}, |
---|
| 135 | {0x3b1, -32, {{0x3b2, 0x3d0}, {0x3b5, 0x3f5}, {0x3b8, 0x3d1}, {0x3b8, 0x3f4}, |
---|
| 136 | {0x3b9, 0x345}, {0x3b9, 0x1fbe}, {0x3ba, 0x3f0}, {0x3bc, 0xb5}, |
---|
| 137 | {0x3c0, 0x3d6}, {0x3c1, 0x3f1}}}, |
---|
| 138 | {0x3c2, 1, {{0x3c2, 0x3a3}}}, |
---|
| 139 | {0x3c4, 0, {}}, |
---|
| 140 | {0x3c3, -32, {{0x3c6, 0x3d5}, {0x3c9, 0x2126}}}, |
---|
| 141 | {0x3cc, 0, {{0x3cc, 0x38c}}}, |
---|
| 142 | {0x3cd, -63, {}}, |
---|
| 143 | {0x3cf, 0, {{0x3cf, 0x3d7}, {0x3d0, 0x3b2}, {0x3d0, 0x392}, {0x3d1, 0x3b8}, |
---|
| 144 | {0x3d1, 0x398}, {0x3d1, 0x3f4}, {0x3d5, 0x3c6}, {0x3d5, 0x3a6}, |
---|
| 145 | {0x3d6, 0x3c0}, {0x3d6, 0x3a0}, {0x3d7, 0x3cf}}}, |
---|
| 146 | {0x3d8, 1, {}}, |
---|
| 147 | {0x3f0, 0, {{0x3f0, 0x3ba}, {0x3f0, 0x39a}, {0x3f1, 0x3c1}, {0x3f1, 0x3a1}, |
---|
| 148 | {0x3f2, 0x3f9}, {0x3f3, 0x37f}, {0x3f4, 0x3b8}, {0x3f4, 0x398}, |
---|
| 149 | {0x3f4, 0x3d1}, {0x3f5, 0x3b5}, {0x3f5, 0x395}}}, |
---|
| 150 | {0x3f7, 1, {}}, |
---|
| 151 | {0x3f9, 0, {{0x3f9, 0x3f2}}}, |
---|
| 152 | {0x3fa, 1, {}}, |
---|
| 153 | {0x3fc, 0, {}}, |
---|
| 154 | {0x3fd, -130, {}}, |
---|
| 155 | {0x400, 80, {}}, |
---|
[5145] | 156 | {0x410, 0, {{0x412, 0x1c80}, {0x414, 0x1c81}, {0x41e, 0x1c82}}}, |
---|
| 157 | {0x421, 6242, {{0x422, 0x1c85}}}, |
---|
| 158 | {0x423, 0, {{0x42a, 0x1c86}, {0x432, 0x1c80}, {0x434, 0x1c81}, {0x43e, 0x1c82}}}, |
---|
| 159 | {0x441, 6210, {{0x442, 0x1c85}}}, |
---|
| 160 | {0x443, 0, {}}, |
---|
| 161 | {0x410, 32, {{0x412, 0x1c80}, {0x414, 0x1c81}, {0x41e, 0x1c82}, {0x422, 0x1c85}, |
---|
| 162 | {0x42a, 0x1c86}, {0x432, 0x1c80}, {0x434, 0x1c81}, {0x43e, 0x1c82}, |
---|
| 163 | {0x442, 0x1c85}, {0x44a, 0x1c86}}}, |
---|
[4316] | 164 | {0x450, -80, {}}, |
---|
[5145] | 165 | {0x460, 1, {{0x462, 0x1c87}, {0x463, 0x1c87}}}, |
---|
[4316] | 166 | {0x482, 0, {}}, |
---|
| 167 | {0x48a, 1, {}}, |
---|
| 168 | {0x4c0, 0, {{0x4c0, 0x4cf}}}, |
---|
| 169 | {0x4c1, 1, {}}, |
---|
| 170 | {0x4cf, 0, {{0x4cf, 0x4c0}}}, |
---|
| 171 | {0x4d0, 1, {}}, |
---|
| 172 | {0x530, 0, {}}, |
---|
| 173 | {0x531, 48, {}}, |
---|
| 174 | {0x557, 0, {}}, |
---|
| 175 | {0x561, -48, {}}, |
---|
| 176 | {0x587, 0, {}}, |
---|
| 177 | {0x10a0, 7264, {}}, |
---|
[5145] | 178 | {0x10c6, 0, {{0x10c7, 0x2d27}, {0x10cd, 0x2d2d}}}, |
---|
| 179 | {0x13a0, 38864, {}}, |
---|
| 180 | {0x13f0, 8, {}}, |
---|
| 181 | {0x13f6, 0, {}}, |
---|
| 182 | {0x13f8, -8, {}}, |
---|
| 183 | {0x13fe, 0, {{0x1c80, 0x432}, {0x1c80, 0x412}, {0x1c81, 0x434}, {0x1c81, 0x414}, |
---|
| 184 | {0x1c82, 0x43e}, {0x1c82, 0x41e}}}, |
---|
| 185 | {0x1c83, -6210, {}}, |
---|
| 186 | {0x1c85, 0, {}}, |
---|
| 187 | {0x1c83, -6242, {}}, |
---|
| 188 | {0x1c85, 0, {}}, |
---|
| 189 | {0x1c84, 1, {{0x1c85, 0x442}, {0x1c85, 0x422}}}, |
---|
| 190 | {0x1c86, 0, {{0x1c86, 0x44a}, {0x1c86, 0x42a}, {0x1c87, 0x463}, {0x1c87, 0x462}, |
---|
| 191 | {0x1c88, 0xa64b}, {0x1c88, 0xa64a}, {0x1d79, 0xa77d}, {0x1d7d, 0x2c63}}}, |
---|
[4316] | 192 | {0x1e00, 1, {{0x1e60, 0x1e9b}, {0x1e61, 0x1e9b}}}, |
---|
| 193 | {0x1e96, 0, {{0x1e9b, 0x1e61}, {0x1e9b, 0x1e60}, {0x1e9e, 0xdf}}}, |
---|
| 194 | {0x1ea0, 1, {}}, |
---|
| 195 | {0x1f00, 8, {}}, |
---|
| 196 | {0x1f16, 0, {}}, |
---|
| 197 | {0x1f18, -8, {}}, |
---|
| 198 | {0x1f1e, 0, {}}, |
---|
| 199 | {0x1f20, 8, {}}, |
---|
| 200 | {0x1f46, 0, {}}, |
---|
| 201 | {0x1f48, -8, {}}, |
---|
| 202 | {0x1f4e, 0, {{0x1f51, 0x1f59}, {0x1f53, 0x1f5b}, {0x1f55, 0x1f5d}, {0x1f57, 0x1f5f}, |
---|
| 203 | {0x1f59, 0x1f51}, {0x1f5b, 0x1f53}, {0x1f5d, 0x1f55}, {0x1f5f, 0x1f57}}}, |
---|
| 204 | {0x1f60, 8, {}}, |
---|
| 205 | {0x1f70, 74, {}}, |
---|
| 206 | {0x1f72, 86, {}}, |
---|
| 207 | {0x1f76, 100, {}}, |
---|
| 208 | {0x1f78, 128, {}}, |
---|
| 209 | {0x1f7a, 112, {}}, |
---|
| 210 | {0x1f7c, 126, {}}, |
---|
| 211 | {0x1f7e, 0, {}}, |
---|
| 212 | {0x1f80, 8, {}}, |
---|
| 213 | {0x1fb2, 0, {{0x1fb3, 0x1fbc}}}, |
---|
| 214 | {0x1fb8, -8, {}}, |
---|
| 215 | {0x1fba, -74, {}}, |
---|
| 216 | {0x1fbc, 0, {{0x1fbc, 0x1fb3}, {0x1fbe, 0x3b9}, {0x1fbe, 0x345}, {0x1fbe, 0x399}, |
---|
| 217 | {0x1fc3, 0x1fcc}}}, |
---|
| 218 | {0x1fc8, -86, {}}, |
---|
| 219 | {0x1fcc, 0, {{0x1fcc, 0x1fc3}}}, |
---|
| 220 | {0x1fd0, 8, {}}, |
---|
| 221 | {0x1fd2, 0, {}}, |
---|
| 222 | {0x1fd8, -8, {}}, |
---|
| 223 | {0x1fda, -100, {}}, |
---|
| 224 | {0x1fdc, 0, {}}, |
---|
| 225 | {0x1fe0, 8, {}}, |
---|
| 226 | {0x1fe2, 0, {{0x1fe5, 0x1fec}}}, |
---|
| 227 | {0x1fe8, -8, {}}, |
---|
| 228 | {0x1fea, -112, {}}, |
---|
| 229 | {0x1fec, 0, {{0x1fec, 0x1fe5}, {0x1ff3, 0x1ffc}}}, |
---|
| 230 | {0x1ff8, -128, {}}, |
---|
| 231 | {0x1ffa, -126, {}}, |
---|
| 232 | {0x1ffc, 0, {{0x1ffc, 0x1ff3}, {0x2126, 0x3c9}, {0x2126, 0x3a9}, {0x212a, 0x6b}, |
---|
| 233 | {0x212a, 0x4b}, {0x212b, 0xe5}, {0x212b, 0xc5}, {0x2132, 0x214e}, |
---|
| 234 | {0x214e, 0x2132}}}, |
---|
| 235 | {0x2160, 16, {}}, |
---|
| 236 | {0x2180, 0, {}}, |
---|
| 237 | {0x2183, 1, {}}, |
---|
| 238 | {0x2185, 0, {}}, |
---|
| 239 | {0x24b6, 26, {}}, |
---|
| 240 | {0x24ea, 0, {}}, |
---|
| 241 | {0x2c00, 48, {}}, |
---|
| 242 | {0x2c2f, 0, {}}, |
---|
| 243 | {0x2c30, -48, {}}, |
---|
| 244 | {0x2c5f, 0, {}}, |
---|
| 245 | {0x2c60, 1, {}}, |
---|
| 246 | {0x2c62, 0, {{0x2c62, 0x26b}, {0x2c63, 0x1d7d}, {0x2c64, 0x27d}, {0x2c65, 0x23a}, |
---|
| 247 | {0x2c66, 0x23e}}}, |
---|
| 248 | {0x2c67, 1, {}}, |
---|
| 249 | {0x2c6d, 0, {{0x2c6d, 0x251}, {0x2c6e, 0x271}, {0x2c6f, 0x250}, {0x2c70, 0x252}}}, |
---|
| 250 | {0x2c72, 1, {}}, |
---|
| 251 | {0x2c74, 0, {}}, |
---|
| 252 | {0x2c75, 1, {}}, |
---|
| 253 | {0x2c77, 0, {}}, |
---|
| 254 | {0x2c7e, -10815, {}}, |
---|
| 255 | {0x2c80, 1, {}}, |
---|
| 256 | {0x2ce4, 0, {}}, |
---|
| 257 | {0x2ceb, 1, {}}, |
---|
| 258 | {0x2cef, 0, {}}, |
---|
| 259 | {0x2cf2, 1, {}}, |
---|
| 260 | {0x2cf4, 0, {}}, |
---|
| 261 | {0x2d00, -7264, {}}, |
---|
| 262 | {0x2d26, 0, {{0x2d27, 0x10c7}, {0x2d2d, 0x10cd}}}, |
---|
[5145] | 263 | {0xa640, 1, {{0xa64a, 0x1c88}, {0xa64b, 0x1c88}}}, |
---|
[4316] | 264 | {0xa66e, 0, {}}, |
---|
| 265 | {0xa680, 1, {}}, |
---|
| 266 | {0xa69c, 0, {}}, |
---|
| 267 | {0xa722, 1, {}}, |
---|
| 268 | {0xa730, 0, {}}, |
---|
| 269 | {0xa732, 1, {}}, |
---|
| 270 | {0xa770, 0, {}}, |
---|
| 271 | {0xa779, 1, {}}, |
---|
| 272 | {0xa77d, 0, {{0xa77d, 0x1d79}}}, |
---|
| 273 | {0xa77e, 1, {}}, |
---|
| 274 | {0xa788, 0, {}}, |
---|
| 275 | {0xa78b, 1, {}}, |
---|
| 276 | {0xa78d, 0, {{0xa78d, 0x265}}}, |
---|
| 277 | {0xa790, 1, {}}, |
---|
| 278 | {0xa794, 0, {}}, |
---|
| 279 | {0xa796, 1, {}}, |
---|
| 280 | {0xa7aa, 0, {{0xa7aa, 0x266}, {0xa7ab, 0x25c}, {0xa7ac, 0x261}, {0xa7ad, 0x26c}, |
---|
[5145] | 281 | {0xa7ae, 0x26a}, {0xa7b0, 0x29e}, {0xa7b1, 0x287}, {0xa7b2, 0x29d}, |
---|
| 282 | {0xa7b3, 0xab53}}}, |
---|
| 283 | {0xa7b4, 1, {}}, |
---|
| 284 | {0xa7b8, 0, {{0xab53, 0xa7b3}}}, |
---|
| 285 | {0xab70, -38864, {}}, |
---|
| 286 | {0xabc0, 0, {}}, |
---|
[4316] | 287 | {0xff21, 32, {}}, |
---|
| 288 | {0xff3b, 0, {}}, |
---|
| 289 | {0xff41, -32, {}}, |
---|
| 290 | {0xff5b, 0, {}}, |
---|
| 291 | {0x10400, 40, {}}, |
---|
| 292 | {0x10450, 0, {}}, |
---|
[5145] | 293 | {0x104b0, 40, {}}, |
---|
| 294 | {0x104d4, 0, {}}, |
---|
| 295 | {0x104d8, -40, {}}, |
---|
| 296 | {0x104fc, 0, {}}, |
---|
| 297 | {0x10c80, 64, {}}, |
---|
| 298 | {0x10cb3, 0, {}}, |
---|
| 299 | {0x10cc0, -64, {}}, |
---|
| 300 | {0x10cf3, 0, {}}, |
---|
[4316] | 301 | {0x118a0, 32, {}}, |
---|
| 302 | {0x118e0, 0, {}}, |
---|
[5145] | 303 | {0x1e900, 34, {}}, |
---|
| 304 | {0x1e944, 0, {}}, |
---|
[4316] | 305 | {0x110000, 0, {}}}; |
---|
| 306 | #endif |
---|