indickit 0.0.0-stage → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,175 @@
1
+ // segment/rules.json
2
+ var rules_default = {
3
+ version: "2026-10-06",
4
+ unicode: "17.0.0",
5
+ grapheme_break: [[0, 9, "Control"], [10, 10, "LF"], [11, 12, "Control"], [13, 13, "CR"], [14, 31, "Control"], [127, 159, "Control"], [173, 173, "Control"], [768, 879, "Extend"], [1155, 1161, "Extend"], [1425, 1469, "Extend"], [1471, 1471, "Extend"], [1473, 1474, "Extend"], [1476, 1477, "Extend"], [1479, 1479, "Extend"], [1536, 1541, "Prepend"], [1552, 1562, "Extend"], [1564, 1564, "Control"], [1611, 1631, "Extend"], [1648, 1648, "Extend"], [1750, 1756, "Extend"], [1757, 1757, "Prepend"], [1759, 1764, "Extend"], [1767, 1768, "Extend"], [1770, 1773, "Extend"], [1807, 1807, "Prepend"], [1809, 1809, "Extend"], [1840, 1866, "Extend"], [1958, 1968, "Extend"], [2027, 2035, "Extend"], [2045, 2045, "Extend"], [2070, 2073, "Extend"], [2075, 2083, "Extend"], [2085, 2087, "Extend"], [2089, 2093, "Extend"], [2137, 2139, "Extend"], [2192, 2193, "Prepend"], [2199, 2207, "Extend"], [2250, 2273, "Extend"], [2274, 2274, "Prepend"], [2275, 2306, "Extend"], [2307, 2307, "SpacingMark"], [2362, 2362, "Extend"], [2363, 2363, "SpacingMark"], [2364, 2364, "Extend"], [2366, 2368, "SpacingMark"], [2369, 2376, "Extend"], [2377, 2380, "SpacingMark"], [2381, 2381, "Extend"], [2382, 2383, "SpacingMark"], [2385, 2391, "Extend"], [2402, 2403, "Extend"], [2433, 2433, "Extend"], [2434, 2435, "SpacingMark"], [2492, 2492, "Extend"], [2494, 2494, "Extend"], [2495, 2496, "SpacingMark"], [2497, 2500, "Extend"], [2503, 2504, "SpacingMark"], [2507, 2508, "SpacingMark"], [2509, 2509, "Extend"], [2519, 2519, "Extend"], [2530, 2531, "Extend"], [2558, 2558, "Extend"], [2561, 2562, "Extend"], [2563, 2563, "SpacingMark"], [2620, 2620, "Extend"], [2622, 2624, "SpacingMark"], [2625, 2626, "Extend"], [2631, 2632, "Extend"], [2635, 2637, "Extend"], [2641, 2641, "Extend"], [2672, 2673, "Extend"], [2677, 2677, "Extend"], [2689, 2690, "Extend"], [2691, 2691, "SpacingMark"], [2748, 2748, "Extend"], [2750, 2752, "SpacingMark"], [2753, 2757, "Extend"], [2759, 2760, "Extend"], [2761, 2761, "SpacingMark"], [2763, 2764, "SpacingMark"], [2765, 2765, "Extend"], [2786, 2787, "Extend"], [2810, 2815, "Extend"], [2817, 2817, "Extend"], [2818, 2819, "SpacingMark"], [2876, 2876, "Extend"], [2878, 2879, "Extend"], [2880, 2880, "SpacingMark"], [2881, 2884, "Extend"], [2887, 2888, "SpacingMark"], [2891, 2892, "SpacingMark"], [2893, 2893, "Extend"], [2901, 2903, "Extend"], [2914, 2915, "Extend"], [2946, 2946, "Extend"], [3006, 3006, "Extend"], [3007, 3007, "SpacingMark"], [3008, 3008, "Extend"], [3009, 3010, "SpacingMark"], [3014, 3016, "SpacingMark"], [3018, 3020, "SpacingMark"], [3021, 3021, "Extend"], [3031, 3031, "Extend"], [3072, 3072, "Extend"], [3073, 3075, "SpacingMark"], [3076, 3076, "Extend"], [3132, 3132, "Extend"], [3134, 3136, "Extend"], [3137, 3140, "SpacingMark"], [3142, 3144, "Extend"], [3146, 3149, "Extend"], [3157, 3158, "Extend"], [3170, 3171, "Extend"], [3201, 3201, "Extend"], [3202, 3203, "SpacingMark"], [3260, 3260, "Extend"], [3262, 3262, "SpacingMark"], [3263, 3264, "Extend"], [3265, 3265, "SpacingMark"], [3266, 3266, "Extend"], [3267, 3268, "SpacingMark"], [3270, 3272, "Extend"], [3274, 3277, "Extend"], [3285, 3286, "Extend"], [3298, 3299, "Extend"], [3315, 3315, "SpacingMark"], [3328, 3329, "Extend"], [3330, 3331, "SpacingMark"], [3387, 3388, "Extend"], [3390, 3390, "Extend"], [3391, 3392, "SpacingMark"], [3393, 3396, "Extend"], [3398, 3400, "SpacingMark"], [3402, 3404, "SpacingMark"], [3405, 3405, "Extend"], [3406, 3406, "Prepend"], [3415, 3415, "Extend"], [3426, 3427, "Extend"], [3457, 3457, "Extend"], [3458, 3459, "SpacingMark"], [3530, 3530, "Extend"], [3535, 3535, "Extend"], [3536, 3537, "SpacingMark"], [3538, 3540, "Extend"], [3542, 3542, "Extend"], [3544, 3550, "SpacingMark"], [3551, 3551, "Extend"], [3570, 3571, "SpacingMark"], [3633, 3633, "Extend"], [3635, 3635, "SpacingMark"], [3636, 3642, "Extend"], [3655, 3662, "Extend"], [3761, 3761, "Extend"], [3763, 3763, "SpacingMark"], [3764, 3772, "Extend"], [3784, 3790, "Extend"], [3864, 3865, "Extend"], [3893, 3893, "Extend"], [3895, 3895, "Extend"], [3897, 3897, "Extend"], [3902, 3903, "SpacingMark"], [3953, 3966, "Extend"], [3967, 3967, "SpacingMark"], [3968, 3972, "Extend"], [3974, 3975, "Extend"], [3981, 3991, "Extend"], [3993, 4028, "Extend"], [4038, 4038, "Extend"], [4141, 4144, "Extend"], [4145, 4145, "SpacingMark"], [4146, 4151, "Extend"], [4153, 4154, "Extend"], [4155, 4156, "SpacingMark"], [4157, 4158, "Extend"], [4182, 4183, "SpacingMark"], [4184, 4185, "Extend"], [4190, 4192, "Extend"], [4209, 4212, "Extend"], [4226, 4226, "Extend"], [4228, 4228, "SpacingMark"], [4229, 4230, "Extend"], [4237, 4237, "Extend"], [4253, 4253, "Extend"], [4352, 4447, "L"], [4448, 4519, "V"], [4520, 4607, "T"], [4957, 4959, "Extend"], [5906, 5909, "Extend"], [5938, 5940, "Extend"], [5970, 5971, "Extend"], [6002, 6003, "Extend"], [6068, 6069, "Extend"], [6070, 6070, "SpacingMark"], [6071, 6077, "Extend"], [6078, 6085, "SpacingMark"], [6086, 6086, "Extend"], [6087, 6088, "SpacingMark"], [6089, 6099, "Extend"], [6109, 6109, "Extend"], [6155, 6157, "Extend"], [6158, 6158, "Control"], [6159, 6159, "Extend"], [6277, 6278, "Extend"], [6313, 6313, "Extend"], [6432, 6434, "Extend"], [6435, 6438, "SpacingMark"], [6439, 6440, "Extend"], [6441, 6443, "SpacingMark"], [6448, 6449, "SpacingMark"], [6450, 6450, "Extend"], [6451, 6456, "SpacingMark"], [6457, 6459, "Extend"], [6679, 6680, "Extend"], [6681, 6682, "SpacingMark"], [6683, 6683, "Extend"], [6741, 6741, "SpacingMark"], [6742, 6742, "Extend"], [6743, 6743, "SpacingMark"], [6744, 6750, "Extend"], [6752, 6752, "Extend"], [6754, 6754, "Extend"], [6757, 6764, "Extend"], [6765, 6770, "SpacingMark"], [6771, 6780, "Extend"], [6783, 6783, "Extend"], [6832, 6877, "Extend"], [6880, 6891, "Extend"], [6912, 6915, "Extend"], [6916, 6916, "SpacingMark"], [6964, 6973, "Extend"], [6974, 6977, "SpacingMark"], [6978, 6980, "Extend"], [7019, 7027, "Extend"], [7040, 7041, "Extend"], [7042, 7042, "SpacingMark"], [7073, 7073, "SpacingMark"], [7074, 7077, "Extend"], [7078, 7079, "SpacingMark"], [7080, 7085, "Extend"], [7142, 7142, "Extend"], [7143, 7143, "SpacingMark"], [7144, 7145, "Extend"], [7146, 7148, "SpacingMark"], [7149, 7149, "Extend"], [7150, 7150, "SpacingMark"], [7151, 7155, "Extend"], [7204, 7211, "SpacingMark"], [7212, 7219, "Extend"], [7220, 7221, "SpacingMark"], [7222, 7223, "Extend"], [7376, 7378, "Extend"], [7380, 7392, "Extend"], [7393, 7393, "SpacingMark"], [7394, 7400, "Extend"], [7405, 7405, "Extend"], [7412, 7412, "Extend"], [7415, 7415, "SpacingMark"], [7416, 7417, "Extend"], [7616, 7679, "Extend"], [8203, 8203, "Control"], [8204, 8204, "Extend"], [8205, 8205, "ZWJ"], [8206, 8207, "Control"], [8232, 8238, "Control"], [8288, 8303, "Control"], [8400, 8432, "Extend"], [11503, 11505, "Extend"], [11647, 11647, "Extend"], [11744, 11775, "Extend"], [12330, 12335, "Extend"], [12441, 12442, "Extend"], [42607, 42610, "Extend"], [42612, 42621, "Extend"], [42654, 42655, "Extend"], [42736, 42737, "Extend"], [43010, 43010, "Extend"], [43014, 43014, "Extend"], [43019, 43019, "Extend"], [43043, 43044, "SpacingMark"], [43045, 43046, "Extend"], [43047, 43047, "SpacingMark"], [43052, 43052, "Extend"], [43136, 43137, "SpacingMark"], [43188, 43203, "SpacingMark"], [43204, 43205, "Extend"], [43232, 43249, "Extend"], [43263, 43263, "Extend"], [43302, 43309, "Extend"], [43335, 43345, "Extend"], [43346, 43346, "SpacingMark"], [43347, 43347, "Extend"], [43360, 43388, "L"], [43392, 43394, "Extend"], [43395, 43395, "SpacingMark"], [43443, 43443, "Extend"], [43444, 43445, "SpacingMark"], [43446, 43449, "Extend"], [43450, 43451, "SpacingMark"], [43452, 43453, "Extend"], [43454, 43455, "SpacingMark"], [43456, 43456, "Extend"], [43493, 43493, "Extend"], [43561, 43566, "Extend"], [43567, 43568, "SpacingMark"], [43569, 43570, "Extend"], [43571, 43572, "SpacingMark"], [43573, 43574, "Extend"], [43587, 43587, "Extend"], [43596, 43596, "Extend"], [43597, 43597, "SpacingMark"], [43644, 43644, "Extend"], [43696, 43696, "Extend"], [43698, 43700, "Extend"], [43703, 43704, "Extend"], [43710, 43711, "Extend"], [43713, 43713, "Extend"], [43755, 43755, "SpacingMark"], [43756, 43757, "Extend"], [43758, 43759, "SpacingMark"], [43765, 43765, "SpacingMark"], [43766, 43766, "Extend"], [44003, 44004, "SpacingMark"], [44005, 44005, "Extend"], [44006, 44007, "SpacingMark"], [44008, 44008, "Extend"], [44009, 44010, "SpacingMark"], [44012, 44012, "SpacingMark"], [44013, 44013, "Extend"], [44032, 55203, "LV_LVT"], [55216, 55238, "V"], [55243, 55291, "T"], [64286, 64286, "Extend"], [65024, 65039, "Extend"], [65056, 65071, "Extend"], [65279, 65279, "Control"], [65438, 65439, "Extend"], [65520, 65531, "Control"], [66045, 66045, "Extend"], [66272, 66272, "Extend"], [66422, 66426, "Extend"], [68097, 68099, "Extend"], [68101, 68102, "Extend"], [68108, 68111, "Extend"], [68152, 68154, "Extend"], [68159, 68159, "Extend"], [68325, 68326, "Extend"], [68900, 68903, "Extend"], [68969, 68973, "Extend"], [69291, 69292, "Extend"], [69370, 69375, "Extend"], [69446, 69456, "Extend"], [69506, 69509, "Extend"], [69632, 69632, "SpacingMark"], [69633, 69633, "Extend"], [69634, 69634, "SpacingMark"], [69688, 69702, "Extend"], [69744, 69744, "Extend"], [69747, 69748, "Extend"], [69759, 69761, "Extend"], [69762, 69762, "SpacingMark"], [69808, 69810, "SpacingMark"], [69811, 69814, "Extend"], [69815, 69816, "SpacingMark"], [69817, 69818, "Extend"], [69821, 69821, "Prepend"], [69826, 69826, "Extend"], [69837, 69837, "Prepend"], [69888, 69890, "Extend"], [69927, 69931, "Extend"], [69932, 69932, "SpacingMark"], [69933, 69940, "Extend"], [69957, 69958, "SpacingMark"], [70003, 70003, "Extend"], [70016, 70017, "Extend"], [70018, 70018, "SpacingMark"], [70067, 70069, "SpacingMark"], [70070, 70078, "Extend"], [70079, 70079, "SpacingMark"], [70080, 70080, "Extend"], [70082, 70083, "Prepend"], [70089, 70092, "Extend"], [70094, 70094, "SpacingMark"], [70095, 70095, "Extend"], [70188, 70190, "SpacingMark"], [70191, 70193, "Extend"], [70194, 70195, "SpacingMark"], [70196, 70199, "Extend"], [70206, 70206, "Extend"], [70209, 70209, "Extend"], [70367, 70367, "Extend"], [70368, 70370, "SpacingMark"], [70371, 70378, "Extend"], [70400, 70401, "Extend"], [70402, 70403, "SpacingMark"], [70459, 70460, "Extend"], [70462, 70462, "Extend"], [70463, 70463, "SpacingMark"], [70464, 70464, "Extend"], [70465, 70468, "SpacingMark"], [70471, 70472, "SpacingMark"], [70475, 70476, "SpacingMark"], [70477, 70477, "Extend"], [70487, 70487, "Extend"], [70498, 70499, "SpacingMark"], [70502, 70508, "Extend"], [70512, 70516, "Extend"], [70584, 70584, "Extend"], [70585, 70586, "SpacingMark"], [70587, 70592, "Extend"], [70594, 70594, "Extend"], [70597, 70597, "Extend"], [70599, 70601, "Extend"], [70602, 70602, "SpacingMark"], [70604, 70605, "SpacingMark"], [70606, 70608, "Extend"], [70609, 70609, "Prepend"], [70610, 70610, "Extend"], [70625, 70626, "Extend"], [70709, 70711, "SpacingMark"], [70712, 70719, "Extend"], [70720, 70721, "SpacingMark"], [70722, 70724, "Extend"], [70725, 70725, "SpacingMark"], [70726, 70726, "Extend"], [70750, 70750, "Extend"], [70832, 70832, "Extend"], [70833, 70834, "SpacingMark"], [70835, 70840, "Extend"], [70841, 70841, "SpacingMark"], [70842, 70842, "Extend"], [70843, 70844, "SpacingMark"], [70845, 70845, "Extend"], [70846, 70846, "SpacingMark"], [70847, 70848, "Extend"], [70849, 70849, "SpacingMark"], [70850, 70851, "Extend"], [71087, 71087, "Extend"], [71088, 71089, "SpacingMark"], [71090, 71093, "Extend"], [71096, 71099, "SpacingMark"], [71100, 71101, "Extend"], [71102, 71102, "SpacingMark"], [71103, 71104, "Extend"], [71132, 71133, "Extend"], [71216, 71218, "SpacingMark"], [71219, 71226, "Extend"], [71227, 71228, "SpacingMark"], [71229, 71229, "Extend"], [71230, 71230, "SpacingMark"], [71231, 71232, "Extend"], [71339, 71339, "Extend"], [71340, 71340, "SpacingMark"], [71341, 71341, "Extend"], [71342, 71343, "SpacingMark"], [71344, 71351, "Extend"], [71453, 71453, "Extend"], [71454, 71454, "SpacingMark"], [71455, 71455, "Extend"], [71458, 71461, "Extend"], [71462, 71462, "SpacingMark"], [71463, 71467, "Extend"], [71724, 71726, "SpacingMark"], [71727, 71735, "Extend"], [71736, 71736, "SpacingMark"], [71737, 71738, "Extend"], [71984, 71984, "Extend"], [71985, 71989, "SpacingMark"], [71991, 71992, "SpacingMark"], [71995, 71998, "Extend"], [71999, 71999, "Prepend"], [72000, 72000, "SpacingMark"], [72001, 72001, "Prepend"], [72002, 72002, "SpacingMark"], [72003, 72003, "Extend"], [72145, 72147, "SpacingMark"], [72148, 72151, "Extend"], [72154, 72155, "Extend"], [72156, 72159, "SpacingMark"], [72160, 72160, "Extend"], [72164, 72164, "SpacingMark"], [72193, 72202, "Extend"], [72243, 72248, "Extend"], [72249, 72249, "SpacingMark"], [72251, 72254, "Extend"], [72263, 72263, "Extend"], [72273, 72278, "Extend"], [72279, 72280, "SpacingMark"], [72281, 72283, "Extend"], [72324, 72329, "Prepend"], [72330, 72342, "Extend"], [72343, 72343, "SpacingMark"], [72344, 72345, "Extend"], [72544, 72544, "Extend"], [72545, 72545, "SpacingMark"], [72546, 72548, "Extend"], [72549, 72549, "SpacingMark"], [72550, 72550, "Extend"], [72551, 72551, "SpacingMark"], [72751, 72751, "SpacingMark"], [72752, 72758, "Extend"], [72760, 72765, "Extend"], [72766, 72766, "SpacingMark"], [72767, 72767, "Extend"], [72850, 72871, "Extend"], [72873, 72873, "SpacingMark"], [72874, 72880, "Extend"], [72881, 72881, "SpacingMark"], [72882, 72883, "Extend"], [72884, 72884, "SpacingMark"], [72885, 72886, "Extend"], [73009, 73014, "Extend"], [73018, 73018, "Extend"], [73020, 73021, "Extend"], [73023, 73029, "Extend"], [73030, 73030, "Prepend"], [73031, 73031, "Extend"], [73098, 73102, "SpacingMark"], [73104, 73105, "Extend"], [73107, 73108, "SpacingMark"], [73109, 73109, "Extend"], [73110, 73110, "SpacingMark"], [73111, 73111, "Extend"], [73459, 73460, "Extend"], [73461, 73462, "SpacingMark"], [73472, 73473, "Extend"], [73474, 73474, "Prepend"], [73475, 73475, "SpacingMark"], [73524, 73525, "SpacingMark"], [73526, 73530, "Extend"], [73534, 73535, "SpacingMark"], [73536, 73538, "Extend"], [73562, 73562, "Extend"], [78896, 78911, "Control"], [78912, 78912, "Extend"], [78919, 78933, "Extend"], [90398, 90409, "Extend"], [90410, 90412, "SpacingMark"], [90413, 90415, "Extend"], [92912, 92916, "Extend"], [92976, 92982, "Extend"], [93539, 93539, "V"], [93543, 93546, "V"], [94031, 94031, "Extend"], [94033, 94087, "SpacingMark"], [94095, 94098, "Extend"], [94180, 94180, "Extend"], [94192, 94193, "Extend"], [113821, 113822, "Extend"], [113824, 113827, "Control"], [118528, 118573, "Extend"], [118576, 118598, "Extend"], [119141, 119145, "Extend"], [119149, 119154, "Extend"], [119155, 119162, "Control"], [119163, 119170, "Extend"], [119173, 119179, "Extend"], [119210, 119213, "Extend"], [119362, 119364, "Extend"], [121344, 121398, "Extend"], [121403, 121452, "Extend"], [121461, 121461, "Extend"], [121476, 121476, "Extend"], [121499, 121503, "Extend"], [121505, 121519, "Extend"], [122880, 122886, "Extend"], [122888, 122904, "Extend"], [122907, 122913, "Extend"], [122915, 122916, "Extend"], [122918, 122922, "Extend"], [123023, 123023, "Extend"], [123184, 123190, "Extend"], [123566, 123566, "Extend"], [123628, 123631, "Extend"], [124140, 124143, "Extend"], [124398, 124399, "Extend"], [124643, 124643, "Extend"], [124646, 124646, "Extend"], [124654, 124655, "Extend"], [124661, 124661, "Extend"], [125136, 125142, "Extend"], [125252, 125258, "Extend"], [127462, 127487, "Regional_Indicator"], [127995, 127999, "Extend"], [917504, 917535, "Control"], [917536, 917631, "Extend"], [917632, 917759, "Control"], [917760, 917999, "Extend"], [918000, 921599, "Control"]],
6
+ extended_pictographic: [[169, 169], [174, 174], [8252, 8252], [8265, 8265], [8482, 8482], [8505, 8505], [8596, 8601], [8617, 8618], [8986, 8987], [9000, 9000], [9167, 9167], [9193, 9203], [9208, 9210], [9410, 9410], [9642, 9643], [9654, 9654], [9664, 9664], [9723, 9726], [9728, 9732], [9742, 9742], [9745, 9745], [9748, 9749], [9752, 9752], [9757, 9757], [9760, 9760], [9762, 9763], [9766, 9766], [9770, 9770], [9774, 9775], [9784, 9786], [9792, 9792], [9794, 9794], [9800, 9811], [9823, 9824], [9827, 9827], [9829, 9830], [9832, 9832], [9851, 9851], [9854, 9855], [9874, 9879], [9881, 9881], [9883, 9884], [9888, 9889], [9895, 9895], [9898, 9899], [9904, 9905], [9917, 9918], [9924, 9925], [9928, 9928], [9934, 9935], [9937, 9937], [9939, 9940], [9961, 9962], [9968, 9973], [9975, 9978], [9981, 9981], [9986, 9986], [9989, 9989], [9992, 9997], [9999, 9999], [10002, 10002], [10004, 10004], [10006, 10006], [10013, 10013], [10017, 10017], [10024, 10024], [10035, 10036], [10052, 10052], [10055, 10055], [10060, 10060], [10062, 10062], [10067, 10069], [10071, 10071], [10083, 10084], [10133, 10135], [10145, 10145], [10160, 10160], [10175, 10175], [10548, 10549], [11013, 11015], [11035, 11036], [11088, 11088], [11093, 11093], [12336, 12336], [12349, 12349], [12951, 12951], [12953, 12953], [126980, 126980], [127020, 127023], [127124, 127135], [127151, 127152], [127168, 127168], [127183, 127184], [127222, 127231], [127344, 127345], [127358, 127359], [127374, 127374], [127377, 127386], [127406, 127461], [127489, 127503], [127514, 127514], [127535, 127535], [127538, 127546], [127548, 127551], [127561, 127583], [127590, 127777], [127780, 127891], [127894, 127895], [127897, 127899], [127902, 127984], [127987, 127989], [127991, 127994], [128000, 128253], [128255, 128317], [128329, 128334], [128336, 128359], [128367, 128368], [128371, 128378], [128391, 128391], [128394, 128397], [128400, 128400], [128405, 128406], [128420, 128421], [128424, 128424], [128433, 128434], [128444, 128444], [128450, 128452], [128465, 128467], [128476, 128478], [128481, 128481], [128483, 128483], [128488, 128488], [128495, 128495], [128499, 128499], [128506, 128591], [128640, 128709], [128715, 128722], [128725, 128741], [128745, 128745], [128747, 128752], [128755, 128767], [128986, 129023], [129036, 129039], [129096, 129103], [129114, 129119], [129160, 129167], [129198, 129199], [129212, 129215], [129218, 129231], [129241, 129279], [129292, 129338], [129340, 129349], [129351, 129535], [129624, 129631], [129646, 129791], [130048, 131069]],
7
+ incb: [[768, 879, "Extend"], [1155, 1161, "Extend"], [1425, 1469, "Extend"], [1471, 1471, "Extend"], [1473, 1474, "Extend"], [1476, 1477, "Extend"], [1479, 1479, "Extend"], [1552, 1562, "Extend"], [1611, 1631, "Extend"], [1648, 1648, "Extend"], [1750, 1756, "Extend"], [1759, 1764, "Extend"], [1767, 1768, "Extend"], [1770, 1773, "Extend"], [1809, 1809, "Extend"], [1840, 1866, "Extend"], [1958, 1968, "Extend"], [2027, 2035, "Extend"], [2045, 2045, "Extend"], [2070, 2073, "Extend"], [2075, 2083, "Extend"], [2085, 2087, "Extend"], [2089, 2093, "Extend"], [2137, 2139, "Extend"], [2199, 2207, "Extend"], [2250, 2273, "Extend"], [2275, 2306, "Extend"], [2325, 2361, "Consonant"], [2362, 2362, "Extend"], [2364, 2364, "Extend"], [2369, 2376, "Extend"], [2381, 2381, "Linker"], [2385, 2391, "Extend"], [2392, 2399, "Consonant"], [2402, 2403, "Extend"], [2424, 2431, "Consonant"], [2433, 2433, "Extend"], [2453, 2472, "Consonant"], [2474, 2480, "Consonant"], [2482, 2482, "Consonant"], [2486, 2489, "Consonant"], [2492, 2492, "Extend"], [2494, 2494, "Extend"], [2497, 2500, "Extend"], [2509, 2509, "Linker"], [2519, 2519, "Extend"], [2524, 2525, "Consonant"], [2527, 2527, "Consonant"], [2530, 2531, "Extend"], [2544, 2545, "Consonant"], [2558, 2558, "Extend"], [2561, 2562, "Extend"], [2620, 2620, "Extend"], [2625, 2626, "Extend"], [2631, 2632, "Extend"], [2635, 2637, "Extend"], [2641, 2641, "Extend"], [2672, 2673, "Extend"], [2677, 2677, "Extend"], [2689, 2690, "Extend"], [2709, 2728, "Consonant"], [2730, 2736, "Consonant"], [2738, 2739, "Consonant"], [2741, 2745, "Consonant"], [2748, 2748, "Extend"], [2753, 2757, "Extend"], [2759, 2760, "Extend"], [2765, 2765, "Linker"], [2786, 2787, "Extend"], [2809, 2809, "Consonant"], [2810, 2815, "Extend"], [2817, 2817, "Extend"], [2837, 2856, "Consonant"], [2858, 2864, "Consonant"], [2866, 2867, "Consonant"], [2869, 2873, "Consonant"], [2876, 2876, "Extend"], [2878, 2879, "Extend"], [2881, 2884, "Extend"], [2893, 2893, "Linker"], [2901, 2903, "Extend"], [2908, 2909, "Consonant"], [2911, 2911, "Consonant"], [2914, 2915, "Extend"], [2929, 2929, "Consonant"], [2946, 2946, "Extend"], [3006, 3006, "Extend"], [3008, 3008, "Extend"], [3021, 3021, "Extend"], [3031, 3031, "Extend"], [3072, 3072, "Extend"], [3076, 3076, "Extend"], [3093, 3112, "Consonant"], [3114, 3129, "Consonant"], [3132, 3132, "Extend"], [3134, 3136, "Extend"], [3142, 3144, "Extend"], [3146, 3148, "Extend"], [3149, 3149, "Linker"], [3157, 3158, "Extend"], [3160, 3162, "Consonant"], [3170, 3171, "Extend"], [3201, 3201, "Extend"], [3260, 3260, "Extend"], [3263, 3264, "Extend"], [3266, 3266, "Extend"], [3270, 3272, "Extend"], [3274, 3277, "Extend"], [3285, 3286, "Extend"], [3298, 3299, "Extend"], [3328, 3329, "Extend"], [3349, 3386, "Consonant"], [3387, 3388, "Extend"], [3390, 3390, "Extend"], [3393, 3396, "Extend"], [3405, 3405, "Linker"], [3415, 3415, "Extend"], [3426, 3427, "Extend"], [3457, 3457, "Extend"], [3530, 3530, "Extend"], [3535, 3535, "Extend"], [3538, 3540, "Extend"], [3542, 3542, "Extend"], [3551, 3551, "Extend"], [3633, 3633, "Extend"], [3636, 3642, "Extend"], [3655, 3662, "Extend"], [3761, 3761, "Extend"], [3764, 3772, "Extend"], [3784, 3790, "Extend"], [3864, 3865, "Extend"], [3893, 3893, "Extend"], [3895, 3895, "Extend"], [3897, 3897, "Extend"], [3953, 3966, "Extend"], [3968, 3972, "Extend"], [3974, 3975, "Extend"], [3981, 3991, "Extend"], [3993, 4028, "Extend"], [4038, 4038, "Extend"], [4096, 4138, "Consonant"], [4141, 4144, "Extend"], [4146, 4151, "Extend"], [4153, 4153, "Linker"], [4154, 4154, "Extend"], [4157, 4158, "Extend"], [4159, 4159, "Consonant"], [4176, 4181, "Consonant"], [4184, 4185, "Extend"], [4186, 4189, "Consonant"], [4190, 4192, "Extend"], [4193, 4193, "Consonant"], [4197, 4198, "Consonant"], [4206, 4208, "Consonant"], [4209, 4212, "Extend"], [4213, 4225, "Consonant"], [4226, 4226, "Extend"], [4229, 4230, "Extend"], [4237, 4237, "Extend"], [4238, 4238, "Consonant"], [4253, 4253, "Extend"], [4957, 4959, "Extend"], [5906, 5909, "Extend"], [5938, 5940, "Extend"], [5970, 5971, "Extend"], [6002, 6003, "Extend"], [6016, 6067, "Consonant"], [6068, 6069, "Extend"], [6071, 6077, "Extend"], [6086, 6086, "Extend"], [6089, 6097, "Extend"], [6098, 6098, "Linker"], [6099, 6099, "Extend"], [6109, 6109, "Extend"], [6155, 6157, "Extend"], [6159, 6159, "Extend"], [6277, 6278, "Extend"], [6313, 6313, "Extend"], [6432, 6434, "Extend"], [6439, 6440, "Extend"], [6450, 6450, "Extend"], [6457, 6459, "Extend"], [6679, 6680, "Extend"], [6683, 6683, "Extend"], [6688, 6740, "Consonant"], [6742, 6742, "Extend"], [6744, 6750, "Extend"], [6752, 6752, "Linker"], [6754, 6754, "Extend"], [6757, 6764, "Extend"], [6771, 6780, "Extend"], [6783, 6783, "Extend"], [6832, 6877, "Extend"], [6880, 6891, "Extend"], [6912, 6915, "Extend"], [6923, 6924, "Consonant"], [6931, 6963, "Consonant"], [6964, 6973, "Extend"], [6978, 6979, "Extend"], [6980, 6980, "Linker"], [6981, 6988, "Consonant"], [7019, 7027, "Extend"], [7040, 7041, "Extend"], [7043, 7072, "Consonant"], [7074, 7077, "Extend"], [7080, 7082, "Extend"], [7083, 7083, "Linker"], [7084, 7085, "Extend"], [7086, 7087, "Consonant"], [7099, 7101, "Consonant"], [7142, 7142, "Extend"], [7144, 7145, "Extend"], [7149, 7149, "Extend"], [7151, 7155, "Extend"], [7212, 7219, "Extend"], [7222, 7223, "Extend"], [7376, 7378, "Extend"], [7380, 7392, "Extend"], [7394, 7400, "Extend"], [7405, 7405, "Extend"], [7412, 7412, "Extend"], [7416, 7417, "Extend"], [7616, 7679, "Extend"], [8205, 8205, "Extend"], [8400, 8432, "Extend"], [11503, 11505, "Extend"], [11647, 11647, "Extend"], [11744, 11775, "Extend"], [12330, 12335, "Extend"], [12441, 12442, "Extend"], [42607, 42610, "Extend"], [42612, 42621, "Extend"], [42654, 42655, "Extend"], [42736, 42737, "Extend"], [43010, 43010, "Extend"], [43014, 43014, "Extend"], [43019, 43019, "Extend"], [43045, 43046, "Extend"], [43052, 43052, "Extend"], [43204, 43205, "Extend"], [43232, 43249, "Extend"], [43263, 43263, "Extend"], [43302, 43309, "Extend"], [43335, 43345, "Extend"], [43347, 43347, "Extend"], [43392, 43394, "Extend"], [43401, 43403, "Consonant"], [43407, 43442, "Consonant"], [43443, 43443, "Extend"], [43446, 43449, "Extend"], [43452, 43453, "Extend"], [43456, 43456, "Linker"], [43488, 43492, "Consonant"], [43493, 43493, "Extend"], [43495, 43503, "Consonant"], [43514, 43518, "Consonant"], [43561, 43566, "Extend"], [43569, 43570, "Extend"], [43573, 43574, "Extend"], [43587, 43587, "Extend"], [43596, 43596, "Extend"], [43616, 43631, "Consonant"], [43633, 43635, "Consonant"], [43642, 43642, "Consonant"], [43644, 43644, "Extend"], [43646, 43647, "Consonant"], [43696, 43696, "Extend"], [43698, 43700, "Extend"], [43703, 43704, "Extend"], [43710, 43711, "Extend"], [43713, 43713, "Extend"], [43744, 43754, "Consonant"], [43756, 43757, "Extend"], [43766, 43766, "Linker"], [43968, 43994, "Consonant"], [44005, 44005, "Extend"], [44008, 44008, "Extend"], [44013, 44013, "Extend"], [64286, 64286, "Extend"], [65024, 65039, "Extend"], [65056, 65071, "Extend"], [65438, 65439, "Extend"], [66045, 66045, "Extend"], [66272, 66272, "Extend"], [66422, 66426, "Extend"], [68096, 68096, "Consonant"], [68097, 68099, "Extend"], [68101, 68102, "Extend"], [68108, 68111, "Extend"], [68112, 68115, "Consonant"], [68117, 68119, "Consonant"], [68121, 68149, "Consonant"], [68152, 68154, "Extend"], [68159, 68159, "Linker"], [68325, 68326, "Extend"], [68900, 68903, "Extend"], [68969, 68973, "Extend"], [69291, 69292, "Extend"], [69370, 69375, "Extend"], [69446, 69456, "Extend"], [69506, 69509, "Extend"], [69633, 69633, "Extend"], [69688, 69702, "Extend"], [69744, 69744, "Extend"], [69747, 69748, "Extend"], [69759, 69761, "Extend"], [69811, 69814, "Extend"], [69817, 69818, "Extend"], [69826, 69826, "Extend"], [69888, 69890, "Extend"], [69891, 69926, "Consonant"], [69927, 69931, "Extend"], [69933, 69938, "Extend"], [69939, 69939, "Linker"], [69940, 69940, "Extend"], [69956, 69956, "Consonant"], [69959, 69959, "Consonant"], [70003, 70003, "Extend"], [70016, 70017, "Extend"], [70070, 70078, "Extend"], [70080, 70080, "Extend"], [70089, 70092, "Extend"], [70095, 70095, "Extend"], [70191, 70193, "Extend"], [70196, 70199, "Extend"], [70206, 70206, "Extend"], [70209, 70209, "Extend"], [70367, 70367, "Extend"], [70371, 70378, "Extend"], [70400, 70401, "Extend"], [70459, 70460, "Extend"], [70462, 70462, "Extend"], [70464, 70464, "Extend"], [70477, 70477, "Extend"], [70487, 70487, "Extend"], [70502, 70508, "Extend"], [70512, 70516, "Extend"], [70528, 70537, "Consonant"], [70539, 70539, "Consonant"], [70542, 70542, "Consonant"], [70544, 70581, "Consonant"], [70584, 70584, "Extend"], [70587, 70592, "Extend"], [70594, 70594, "Extend"], [70597, 70597, "Extend"], [70599, 70601, "Extend"], [70606, 70607, "Extend"], [70608, 70608, "Linker"], [70610, 70610, "Extend"], [70625, 70626, "Extend"], [70712, 70719, "Extend"], [70722, 70724, "Extend"], [70726, 70726, "Extend"], [70750, 70750, "Extend"], [70832, 70832, "Extend"], [70835, 70840, "Extend"], [70842, 70842, "Extend"], [70845, 70845, "Extend"], [70847, 70848, "Extend"], [70850, 70851, "Extend"], [71087, 71087, "Extend"], [71090, 71093, "Extend"], [71100, 71101, "Extend"], [71103, 71104, "Extend"], [71132, 71133, "Extend"], [71219, 71226, "Extend"], [71229, 71229, "Extend"], [71231, 71232, "Extend"], [71339, 71339, "Extend"], [71341, 71341, "Extend"], [71344, 71351, "Extend"], [71453, 71453, "Extend"], [71455, 71455, "Extend"], [71458, 71461, "Extend"], [71463, 71467, "Extend"], [71727, 71735, "Extend"], [71737, 71738, "Extend"], [71936, 71942, "Consonant"], [71945, 71945, "Consonant"], [71948, 71955, "Consonant"], [71957, 71958, "Consonant"], [71960, 71983, "Consonant"], [71984, 71984, "Extend"], [71995, 71997, "Extend"], [71998, 71998, "Linker"], [72003, 72003, "Extend"], [72148, 72151, "Extend"], [72154, 72155, "Extend"], [72160, 72160, "Extend"], [72192, 72192, "Consonant"], [72193, 72202, "Extend"], [72203, 72242, "Consonant"], [72243, 72248, "Extend"], [72251, 72254, "Extend"], [72263, 72263, "Linker"], [72272, 72272, "Consonant"], [72273, 72278, "Extend"], [72281, 72283, "Extend"], [72284, 72323, "Consonant"], [72330, 72342, "Extend"], [72344, 72344, "Extend"], [72345, 72345, "Linker"], [72544, 72544, "Extend"], [72546, 72548, "Extend"], [72550, 72550, "Extend"], [72752, 72758, "Extend"], [72760, 72765, "Extend"], [72767, 72767, "Extend"], [72850, 72871, "Extend"], [72874, 72880, "Extend"], [72882, 72883, "Extend"], [72885, 72886, "Extend"], [73009, 73014, "Extend"], [73018, 73018, "Extend"], [73020, 73021, "Extend"], [73023, 73029, "Extend"], [73031, 73031, "Extend"], [73104, 73105, "Extend"], [73109, 73109, "Extend"], [73111, 73111, "Extend"], [73459, 73460, "Extend"], [73472, 73473, "Extend"], [73476, 73488, "Consonant"], [73490, 73523, "Consonant"], [73526, 73530, "Extend"], [73536, 73537, "Extend"], [73538, 73538, "Linker"], [73562, 73562, "Extend"], [78912, 78912, "Extend"], [78919, 78933, "Extend"], [90398, 90409, "Extend"], [90413, 90415, "Extend"], [92912, 92916, "Extend"], [92976, 92982, "Extend"], [94031, 94031, "Extend"], [94095, 94098, "Extend"], [94180, 94180, "Extend"], [94192, 94193, "Extend"], [113821, 113822, "Extend"], [118528, 118573, "Extend"], [118576, 118598, "Extend"], [119141, 119145, "Extend"], [119149, 119154, "Extend"], [119163, 119170, "Extend"], [119173, 119179, "Extend"], [119210, 119213, "Extend"], [119362, 119364, "Extend"], [121344, 121398, "Extend"], [121403, 121452, "Extend"], [121461, 121461, "Extend"], [121476, 121476, "Extend"], [121499, 121503, "Extend"], [121505, 121519, "Extend"], [122880, 122886, "Extend"], [122888, 122904, "Extend"], [122907, 122913, "Extend"], [122915, 122916, "Extend"], [122918, 122922, "Extend"], [123023, 123023, "Extend"], [123184, 123190, "Extend"], [123566, 123566, "Extend"], [123628, 123631, "Extend"], [124140, 124143, "Extend"], [124398, 124399, "Extend"], [124643, 124643, "Extend"], [124646, 124646, "Extend"], [124654, 124655, "Extend"], [124661, 124661, "Extend"], [125136, 125142, "Extend"], [125252, 125258, "Extend"], [127995, 127999, "Extend"], [917536, 917631, "Extend"], [917760, 917999, "Extend"]],
8
+ joins: [{ virama: "್", consonants: "ಕಖಗಘಙಚಛಜಝಞಟಠಡಢಣತಥದಧನಪಫಬಭಮಯರಱಲಳವಶಷಸಹೝೞ", sign: "", after: "" }, { virama: "੍", consonants: "ਰਹ", sign: "", after: "" }, { virama: "্", consonants: "য", sign: "া", after: "" }, { virama: "்", consonants: "ர", sign: "ீ", after: "ஸ" }],
9
+ classes: { "್": { letters: "ಀಅಆಇಈಉಊಋಌಎಏಐಒಓಔಕಖಗಘಙಚಛಜಝಞಟಠಡಢಣತಥದಧನಪಫಬಭಮಯರಱಲಳವಶಷಸಹಽೝೞೠೡೱೲ", nuktas: "಼", signs: "ಾಿೀುೂೃೄೆೇೈೊೋೌೢೣ" }, "੍": { letters: "ਅਆਇਈਉਊਏਐਓਔਕਖਗਘਙਚਛਜਝਞਟਠਡਢਣਤਥਦਧਨਪਫਬਭਮਯਰਲਲ਼ਵਸ਼ਸਹਖ਼ਗ਼ਜ਼ੜਫ਼ੲੳੴ", nuktas: "਼", signs: "ਾਿੀੁੂੇੈੋੌ" }, "্": { letters: "ঀঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহঽৎড়ঢ়য়ৠৡৰৱৼ", nuktas: "়", signs: "ািীুূৃৄেৈোৌৢৣ" }, "்": { letters: "ஃஅஆஇஈஉஊஎஏஐஒஓஔகஙசஜஞடணதநனபமயரறலளழவஶஷஸஹௐ", nuktas: "", signs: "ாிீுூெேைொோௌ" } }
10
+ };
11
+
12
+ // js/segment.ts
13
+ var BREAK = {
14
+ CR: 1 /* CR */,
15
+ LF: 2 /* LF */,
16
+ Control: 3 /* Control */,
17
+ Extend: 4 /* Extend */,
18
+ ZWJ: 5 /* ZWJ */,
19
+ Regional_Indicator: 6 /* RI */,
20
+ Prepend: 7 /* Prepend */,
21
+ SpacingMark: 8 /* SpacingMark */,
22
+ L: 9 /* L */,
23
+ V: 10 /* V */,
24
+ T: 11 /* T */,
25
+ LV: 12 /* LV */,
26
+ LVT: 13 /* LVT */,
27
+ LV_LVT: 14 /* LV_LVT */
28
+ };
29
+ var INCB = { Linker: 1 /* Linker */, Consonant: 2 /* Consonant */, Extend: 3 /* Extend */ };
30
+
31
+ class Ranges {
32
+ first;
33
+ last;
34
+ value;
35
+ constructor(rows, val) {
36
+ this.first = new Uint32Array(rows.map((r) => r[0]));
37
+ this.last = new Uint32Array(rows.map((r) => r[1]));
38
+ this.value = new Uint8Array(rows.map(val));
39
+ }
40
+ get(cp) {
41
+ let lo = 0, hi = this.first.length - 1;
42
+ while (lo <= hi) {
43
+ const mid = lo + hi >> 1;
44
+ if (cp < this.first[mid])
45
+ hi = mid - 1;
46
+ else if (cp > this.last[mid])
47
+ lo = mid + 1;
48
+ else
49
+ return this.value[mid];
50
+ }
51
+ return 0;
52
+ }
53
+ }
54
+ function compile(rules) {
55
+ const breaks = new Ranges(rules.grapheme_break, (r) => BREAK[r[2]]);
56
+ const pict = new Ranges(rules.extended_pictographic, () => 1);
57
+ const incb = new Ranges(rules.incb, (r) => INCB[r[2]]);
58
+ const joins = new Map;
59
+ for (const j of rules.joins) {
60
+ const v = j.virama.codePointAt(0);
61
+ joins.set(v, [...joins.get(v) ?? [], j]);
62
+ }
63
+ const classes = new Map(Object.entries(rules.classes).map(([v, k]) => [v.codePointAt(0), k]));
64
+ const ZWJ = 8205;
65
+ function breakOf(cp) {
66
+ const b = breaks.get(cp);
67
+ return b === 14 /* LV_LVT */ ? (cp - 44032) % 28 === 0 ? 12 /* LV */ : 13 /* LVT */ : b;
68
+ }
69
+ function graphemeBounds(cps) {
70
+ const out = [];
71
+ if (cps.length === 0)
72
+ return out;
73
+ let prev = breakOf(cps[0]);
74
+ let ri = prev === 6 /* RI */ ? 1 : 0;
75
+ let pictExt = pict.get(cps[0]) === 1;
76
+ let zwjAfterPict = false;
77
+ let conj = incb.get(cps[0]) === 2 /* Consonant */ ? 1 : 0;
78
+ for (let i = 1;i < cps.length; i++) {
79
+ const cp = cps[i];
80
+ const cur = breakOf(cp);
81
+ const isPict = pict.get(cp) === 1;
82
+ const inc = incb.get(cp);
83
+ let brk;
84
+ if (prev === 1 /* CR */ && cur === 2 /* LF */)
85
+ brk = false;
86
+ else if (prev === 3 /* Control */ || prev === 1 /* CR */ || prev === 2 /* LF */)
87
+ brk = true;
88
+ else if (cur === 3 /* Control */ || cur === 1 /* CR */ || cur === 2 /* LF */)
89
+ brk = true;
90
+ else if (prev === 9 /* L */ && (cur === 9 /* L */ || cur === 10 /* V */ || cur === 12 /* LV */ || cur === 13 /* LVT */))
91
+ brk = false;
92
+ else if ((prev === 12 /* LV */ || prev === 10 /* V */) && (cur === 10 /* V */ || cur === 11 /* T */))
93
+ brk = false;
94
+ else if ((prev === 13 /* LVT */ || prev === 11 /* T */) && cur === 11 /* T */)
95
+ brk = false;
96
+ else if (cur === 4 /* Extend */ || cur === 5 /* ZWJ */)
97
+ brk = false;
98
+ else if (cur === 8 /* SpacingMark */)
99
+ brk = false;
100
+ else if (prev === 7 /* Prepend */)
101
+ brk = false;
102
+ else if (conj === 2 && inc === 2 /* Consonant */)
103
+ brk = false;
104
+ else if (zwjAfterPict && isPict)
105
+ brk = false;
106
+ else if (prev === 6 /* RI */ && cur === 6 /* RI */)
107
+ brk = ri % 2 === 0;
108
+ else
109
+ brk = true;
110
+ if (brk)
111
+ out.push(i);
112
+ ri = cur === 6 /* RI */ ? brk ? 1 : ri + 1 : 0;
113
+ zwjAfterPict = cur === 5 /* ZWJ */ && pictExt;
114
+ pictExt = isPict || cur === 4 /* Extend */ && pictExt;
115
+ if (inc === 2 /* Consonant */)
116
+ conj = 1;
117
+ else if (inc === 1 /* Linker */ && conj > 0)
118
+ conj = 2;
119
+ else if (inc !== 3 /* Extend */)
120
+ conj = 0;
121
+ prev = cur;
122
+ }
123
+ return out;
124
+ }
125
+ function joined(cps, i) {
126
+ const v = cps[i - 1];
127
+ const rs = joins.get(v);
128
+ if (!rs || i < 2)
129
+ return false;
130
+ const k = classes.get(v);
131
+ const has = (s, cp) => s.includes(String.fromCodePoint(cp));
132
+ let x = i - 2;
133
+ while (x > 0 && has(k.nuktas, cps[x]))
134
+ x--;
135
+ if (!has(k.letters, cps[x]))
136
+ return false;
137
+ let n = i + 1;
138
+ while (n < cps.length && has(k.nuktas, cps[n]))
139
+ n++;
140
+ if (cps[n] === v && cps[n + 1] === ZWJ)
141
+ return false;
142
+ const sign = n < cps.length && has(k.signs, cps[n]) ? cps[n] : -1;
143
+ return rs.some((r) => has(r.consonants, cps[i]) && (!r.sign || r.sign.codePointAt(0) === sign) && (!r.after || has(r.after, cps[x])));
144
+ }
145
+ return function bounds(cps) {
146
+ return graphemeBounds(cps).filter((i) => !joined(cps, i));
147
+ };
148
+ }
149
+ var bounds = compile(rules_default);
150
+ function segment(text) {
151
+ const chars = Array.from(text);
152
+ const cps = chars.map((c) => c.codePointAt(0));
153
+ const cuts = [0, ...bounds(cps), chars.length];
154
+ const out = [];
155
+ for (let i = 1;i < cuts.length; i++) {
156
+ if (cuts[i] > cuts[i - 1])
157
+ out.push(chars.slice(cuts[i - 1], cuts[i]).join(""));
158
+ }
159
+ return out;
160
+ }
161
+ function count(text) {
162
+ return segment(text).length;
163
+ }
164
+ function codePointBounds(text) {
165
+ return bounds(Array.from(text, (c) => c.codePointAt(0)));
166
+ }
167
+ var RULES_VERSION = rules_default.version;
168
+ var UNICODE_VERSION = rules_default.unicode;
169
+ export {
170
+ segment,
171
+ count,
172
+ codePointBounds,
173
+ UNICODE_VERSION,
174
+ RULES_VERSION
175
+ };
package/dist/stem.js ADDED
@@ -0,0 +1,40 @@
1
+ // stem/rules.json
2
+ var rules_default = {
3
+ version: "2026-10-06",
4
+ min_stem: 2,
5
+ max_end: 6,
6
+ vowel_signs: [2362, 2363, 2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2382, 2383, 2389, 2390, 2391, 2402, 2403, 2494, 2495, 2496, 2497, 2498, 2499, 2500, 2503, 2504, 2507, 2508, 2530, 2531, 2622, 2623, 2624, 2625, 2626, 2631, 2632, 2635, 2636, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 2757, 2759, 2760, 2761, 2763, 2764, 2786, 2787, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2887, 2888, 2891, 2892, 2914, 2915, 3006, 3007, 3008, 3009, 3010, 3014, 3015, 3016, 3018, 3019, 3020, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3142, 3143, 3144, 3146, 3147, 3148, 3170, 3171, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3270, 3271, 3272, 3274, 3275, 3276, 3298, 3299, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3398, 3399, 3400, 3402, 3403, 3404, 3426, 3427],
7
+ languages: { as: { vowel_step: true, endings: ["ও", "ক", "কক", "কত", "কে", "কৰ", "খন", "খনৰ", "গত", "ছিল", "ছে", "জন", "টো", "টোক", "টোত", "টোৰ", "টোৱে", "ত", "তত", "তে", "তো", "তৰ", "বলৈ", "বোৰ", "বোৰৰ", "মূলক", "য়ে", "লৈ", "লৈকে", "সকলক", "সকলে", "সকলৰ", "সমূহ", "সমূহক", "সমূহে", "সমূহৰ", "াই", "াক", "াব", "ায়", "ালে", "াৰ", "াৰত", "াৰে", "িব", "িবলৈ", "িয়ে", "িলে", "িৰ", "ীয়", "ীয়ে", "ীৰ", "েৰে", "োৱা", "োৱে", "্ত", "ৰ", "ৰক", "ৰত", "ৰলৈ", "ৰি", "ৰে", "ৰো", "ৰৰ"] }, bn: { vowel_step: true, endings: ["ও", "করণ", "গত", "গুলি", "গুলিকে", "গুলিতে", "গুলির", "ছে", "টার", "তে", "দের", "মূলক", "রা", "রার", "াই", "াকে", "াটি", "ানো", "ায়", "ার", "ারকে", "ারে", "ারের", "িকে", "িয়ে", "ির", "ীর", "ুর", "েন", "ের"] }, gu: { vowel_step: false, endings: ["ં", "એ", "ઓ", "ણા", "થી", "ના", "ની", "નું", "ને", "નો", "માં", "વા", "વાની", "વાનું", "વાનો", "વામાં", "વી", "વું", "શે", "ા", "ાં", "ાએ", "ાઓ", "ાઓની", "ાઓને", "ાઓમાં", "ાના", "ાની", "ાનું", "ાને", "ાનો", "ામાં", "ાય", "િત", "ી", "ીએ", "ીઓ", "ીઓને", "ીના", "ીની", "ીને", "ીમાં", "ીય", "ુ", "ું", "ે", "ો", "ોએ", "ોના", "ોની", "ોનું", "ોને", "ોનો", "ોમાં", "્યા", "્યું", "્સ"] }, hi: { vowel_step: true, endings: ["ं", "एँ", "एं", "ओं", "कर", "ता", "ताओं", "ती", "ते", "ना", "नी", "ने", "पूर्ण", "यां", "ाना", "ाने", "ाया", "ियाँ", "ियों", "्"] }, kn: { vowel_step: true, endings: ["ಕ್ಕಾಗಿ", "ಕ್ಕೆ", "ಗಳ", "ಗಳನ್ನು", "ಗಳಲ್ಲಿ", "ಗಳಿಂದ", "ಗಳಿಗೆ", "ಗಳು", "ಗಾಗಿ", "ಗೆ", "ತ್ತವೆ", "ತ್ತಾನೆ", "ತ್ತಾರೆ", "ದ", "ದನು", "ದರು", "ದಲ್ಲಿ", "ದವು", "ದಿಂದ", "ದ್ದಾರೆ", "ನನ್ನು", "ನು", "ನ್ನು", "ಬೇಕು", "ಯನ್ನು", "ಯಲ್ಲಿ", "ಯಾಗಿ", "ಯಿಂದ", "ಯಿತು", "ಯು", "ರೆ", "ಲಿನ", "ಲು", "ಲ್ಲಿ", "ವನ್ನು", "ವರು", "ವಾಗಿ", "ವಾಗಿದೆ", "ವಾದ", "ವು", "ಾಗಿ", "ಾಗಿದೆ", "ಿಂದ", "ಿಗೂ", "ಿತ", "ಿತು", "ಿದೆ", "ಿನ", "ಿನಿಂದ", "ಿಯ", "ುತ್ತದೆ", "ುವ", "ುವುದು", "ೆಯ", "ೊಂದಿಗೆ", "್"] }, ml: { vowel_step: true, endings: ["ം", "കയും", "കളിലും", "കളിൽ", "കളും", "കളുടെ", "കളെ", "കൾ", "കൾക്ക്", "ങ്ങളിൽ", "ങ്ങളും", "ങ്ങളെ", "ങ്ങൾ", "ച്ച്", "ത്തിന്", "ത്തിലെ", "ത്തിൽ", "നും", "നുള്ള", "നെ", "ന്", "ന്ന", "ന്നത്", "ന്റെ", "മാണ്", "മായ", "മായി", "മാർ", "മുള്ള", "യാണ്", "യായി", "യിലും", "യിലെ", "യിൽ", "യും", "യുടെ", "യെ", "യ്ക്ക്", "രുടെ", "രെ", "റെ", "ല്ല", "ള്ള", "വും", "വ്", "ായി", "ിക്ക്", "ിലുള്ള", "ിലെ", "ിൽ", "ുക", "ുന്നു", "്", "്ടു", "്സ്", "ൺ", "ൻ", "ർക്ക്"] }, mr: { vowel_step: false, endings: ["ं", "चा", "ची", "चे", "च्या", "ने", "पणे", "मधील", "मध्ये", "ही", "ा", "ांचा", "ांची", "ांचे", "ांच्या", "ांत", "ांना", "ांनी", "ांवर", "ांशी", "ांसाठी", "ाचा", "ाची", "ाचे", "ाच्या", "ात", "ातील", "ातून", "ानंतर", "ाना", "ाने", "ाला", "ावर", "ाशी", "ासाठी", "ित", "ी", "ीचा", "ीची", "ीचे", "ीच्या", "ीत", "ीतील", "ीने", "ीमध्ये", "ीय", "ील", "ीला", "ीसाठी", "े", "ेचा", "ेची", "ेचे", "ेच्या", "ेत", "ेने", "ेला", "ेवर", "ो", "्य", "्या", "्यांचा", "्यांची", "्यांना", "्याचा", "्याची", "्याचे", "्यात", "्याने", "्याला", "्ये"] }, ne: { vowel_step: true, endings: ["ं", "का", "की", "को", "देखि", "द्वारा", "बाट", "भन्दा", "मा", "माथि", "सँग", "सम्म", "हरूका", "हरूको", "हरूमा", "हरूलाई", "हरूले", "ामा", "ालाई", "ाले", "ाहरू", "िएका", "ित", "िन", "िने", "िन्", "िहरू", "ीमा", "ीलाई", "ीले", "ीहरू", "ेका", "ेन", "ेर", "्छ", "्छन्", "्दा", "्दै", "्न", "्नु", "्ने", "्यो"] }, pa: { vowel_step: true, endings: ["ਆਂ", "ਇਆ", "ਈ", "ਈਆਂ", "ਉਂਦਾ", "ਉਂਦੇ", "ਉਣ", "ਉਣਾ", "ਏ", "ਕ", "ਕਤਾ", "ਕਰਨ", "ਕਾਂ", "ਣ", "ਣਾ", "ਣਾਂ", "ਤਾ", "ਨ", "ਨਾ", "ਨਾਂ", "਼", "਼ਾਂ", "਼ੀ", "ਾਂ", "ਾਏ", "ਾਨ", "ਾਵਾਂ", "ਿਆ", "ਿਤ", "ੀਂ", "ੀਆ", "ੇਂ", "ੋਂ"] }, sa: { vowel_step: false, endings: ["ं", "ः", "त्", "द्", "न्", "म्", "य", "या", "याः", "याम्", "यै", "योः", "षु", "सु", "स्य", "ा", "ाः", "ाणि", "ात्", "ानाम्", "ानि", "ान्", "ाम्", "ाय", "ायाः", "ायाम्", "ासु", "िनः", "ी", "े", "ेण", "ेन", "ेभ्यः", "ेषु", "ैः", "ौ"] }, ta: { vowel_step: true, endings: ["களால்", "களின்", "களில்", "களுடன்", "களை", "களைப்", "கள்", "கின்றன", "கிறார்", "க்", "க்கள்", "க்காக", "க்கான", "ச்", "த்", "ன", "னர்", "னார்", "னால்", "னின்", "ன்", "ப்", "ப்பட்ட", "மான", "ய", "யாக", "யான", "யால்", "யின்", "யில்", "யுடன்", "யே", "யை", "ய்", "ற்கு", "லாம்", "லின்", "வது", "வர்", "வர்கள்", "வின்", "வில்", "வில்லை", "ாக", "ாத", "ார்", "ார்கள்", "ால்", "ாவின்", "ிக்கு", "ின்", "ிய", "ியது", "ியில்", "ிறது", "ில்", "ுகிறது", "ுக்கு", "ுடன்", "ுதல்", "ும்", "ுள்ள", "ுள்ளது", "ைக்கு", "ையில்", "ையும்", "ோடு", "்டது"] }, te: { vowel_step: true, endings: ["ం", "ంగా", "ంతో", "ందని", "ంది", "ంలో", "ంలోని", "గా", "టు", "డు", "తో", "నాడు", "ని", "నికి", "ను", "న్న", "న్నాడు", "న్నాయి", "న్నారు", "పై", "మని", "ము", "మైన", "లకు", "లతో", "లను", "లపై", "లలో", "లు", "లో", "లోకి", "లోని", "ల్లో", "ాను", "ాన్ని", "ాయి", "ారు", "ించారు", "ించిన", "ికి", "ుడు", "ుతో", "ుని", "ుల", "్", "్న", "్‌లో"] }, ur: { vowel_step: false, endings: ["ئی", "ئیں", "ئے", "اء", "ائی", "ات", "اں", "تا", "تہ", "تی", "تے", "را", "ری", "ریوں", "رے", "ز", "نا", "نی", "نیوں", "نے", "و", "وں", "ِ", "ٰ", "ٹنگ", "ں", "ہ", "ہوں", "یا", "یت", "ین", "ینی", "یں", "ے"] } }
8
+ };
9
+
10
+ // js/stem.ts
11
+ var MIN_STEM = rules_default.min_stem;
12
+ var MAX_END = rules_default.max_end;
13
+ var VOWEL_SIGNS = new Set(rules_default.vowel_signs.map((c) => String.fromCodePoint(c)));
14
+ var TABLES = new Map(Object.entries(rules_default.languages).map(([lang, l]) => [
15
+ lang,
16
+ { endings: new Set(l.endings), vowel: l.vowel_step }
17
+ ]));
18
+ var RULES_VERSION = rules_default.version;
19
+ var LANGUAGES = [...TABLES.keys()].sort();
20
+ function stem(word, lang) {
21
+ const t = TABLES.get(lang);
22
+ if (!t)
23
+ return word;
24
+ const r = Array.from(word);
25
+ let end = r.length;
26
+ for (let k = Math.min(MAX_END, r.length - MIN_STEM);k > 0; k--) {
27
+ if (t.endings.has(r.slice(r.length - k).join(""))) {
28
+ end = r.length - k;
29
+ break;
30
+ }
31
+ }
32
+ if (t.vowel && end > MIN_STEM && VOWEL_SIGNS.has(r[end - 1]))
33
+ end--;
34
+ return end === r.length ? word : r.slice(0, end).join("");
35
+ }
36
+ export {
37
+ stem,
38
+ RULES_VERSION,
39
+ LANGUAGES
40
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * normalize: one encoding for text that looks the same. Two strings that a
3
+ * reader cannot tell apart (an invisible joiner, an old Malayalam chillu, a
4
+ * ज़ typed as one code point or two) get the same bytes; what a reader sees
5
+ * never changes. Use it before you store, index or compare text.
6
+ *
7
+ * fold: normalize, then merge accepted spellings of one word (हिन्दी and
8
+ * हिंदी, गाँव and गांव). Its output is still readable, but it loses
9
+ * information on purpose: apply it to a query and to an index, never to
10
+ * stored text.
11
+ *
12
+ * `lang` is a language code ("as", "hi", ...). Assamese text needs it: after
13
+ * a virama, Assamese ৰ and Bengali র look alike, and each language keeps its
14
+ * own.
15
+ *
16
+ * The rules change between versions. Store RULES_VERSION next to output that
17
+ * you keep, and recompute it when the version changes.
18
+ *
19
+ * @module
20
+ */
21
+ /** Changes when any output changes: store it beside normalized text that you keep. */
22
+ export declare const RULES_VERSION: string;
23
+ /** One encoding for text that looks the same; never changes what a reader sees. */
24
+ export declare function normalize(text: string, lang?: string): string;
25
+ /** normalize, then merge accepted spellings of one word. For search only. */
26
+ export declare function fold(text: string, lang?: string): string;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * A name's key is the same in every script it is written in: राम, ರಾಮ, രാമ,
3
+ * ராம, رام and "Ram" share a key.
4
+ *
5
+ * A word has a SET of keys (most have one); two names match when they have
6
+ * the same number of words and each pair of words shares a key.
7
+ *
8
+ * The rules change between versions, and a change makes stored keys stale.
9
+ * Store RULES_VERSION next to your keys, and recompute them when it changes.
10
+ *
11
+ * @module
12
+ */
13
+ /** The rules every key from this module was made with. */
14
+ export declare const RULES_VERSION: string;
15
+ /** NameKeys stops here: a long Tamil name can have many key combinations. */
16
+ export declare const MAX_NAME_KEYS = 256;
17
+ /** The sorted keys of one word; empty when it holds no letter the rules read. */
18
+ export declare function keys(word: string): string[];
19
+ /** A name split the way nameKeys and match split it: on spaces and
20
+ * punctuation, with anything in brackets removed. */
21
+ export declare function words(name: string): string[];
22
+ /** The keys of a whole name, one per combination of its words' keys, words
23
+ * separated by a space. Two names match when these share an element, so
24
+ * these are what to index. At most MAX_NAME_KEYS. */
25
+ export declare function nameKeys(name: string): string[];
26
+ /** Whether two names have the same number of words and every pair of words,
27
+ * in order, shares a key. */
28
+ export declare function match(a: string, b: string): boolean;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The letters a reader sees: segment("ಲಕ್ಷ್ಮಿ") is ["ಲ", "ಕ್ಷ್ಮಿ"].
3
+ *
4
+ * Unicode's grapheme clusters (UAX #29) keep a conjunct whole only where the
5
+ * script's virama is a conjunct linker: not in Kannada or Gurmukhi, so
6
+ * Intl.Segmenter gives ಲ|ಕ್|ಷ್|ಮಿ. `segment` is the grapheme clusters of
7
+ * Unicode 17.0, computed here (no platform Unicode version), then a few
8
+ * joins after a virama, each measured: every consonant in Kannada, ਰ and ਹ in
9
+ * Gurmukhi, য before া in Bengali (অ্যা), and Tamil ஸ்ரீ.
10
+ *
11
+ * @module
12
+ */
13
+ /** The letters of text, in order; joined, they give text back. */
14
+ export declare function segment(text: string): string[];
15
+ /** How many letters a reader sees in text. */
16
+ export declare function count(text: string): number;
17
+ /** Inner letter boundaries of text, as code-point offsets (for tests and tools). */
18
+ export declare function codePointBounds(text: string): number[];
19
+ /** The rules version; stored letter counts go stale when it changes. */
20
+ export declare const RULES_VERSION: string;
21
+ /** The Unicode version of the grapheme-cluster data. */
22
+ export declare const UNICODE_VERSION: string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A search key for the forms of one word:
3
+ * stem("ஆண்டில்", "ta") === stem("ஆண்டு", "ta").
4
+ *
5
+ * `stem` strips the longest ending listed for the language that leaves at
6
+ * least two code points; in languages with the vowel step it then drops one
7
+ * final vowel sign (the Dravidian enunciative u). A word with no listed
8
+ * ending is its own stem, and so is every word of a language with no table.
9
+ *
10
+ * A stem is a key, not text. Apply `stem` once to the words you index and
11
+ * once to the query, and compare. stem(stem(w)) may cut again, as Snowball
12
+ * and Lucene stems do. Normalize text first: `stem` compares code points.
13
+ *
14
+ * @module
15
+ */
16
+ /** Changes whenever any word's stem changes: store it beside stems. */
17
+ export declare const RULES_VERSION: string;
18
+ /** The language codes that have a table. */
19
+ export declare const LANGUAGES: readonly string[];
20
+ /**
21
+ * The search key of `word` in language `lang` (as bn gu hi kn ml mr ne pa
22
+ * sa ta te ur). For any other `lang`, `word` unchanged.
23
+ */
24
+ export declare function stem(word: string, lang: string): string;
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "indickit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.2",
4
+ "description": "Small, exact utilities for text in Indian languages: a phonetic key that matches a name across 21 Indian scripts and English, a normalizer that gives text that looks the same one encoding, a segmenter for the letters a reader sees, and a stemmer for search.",
5
+ "license": "MIT",
6
+ "packageManager": "bun@1.3.14",
7
+ "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/micahchoo/indickit.git"
11
+ },
12
+ "exports": {
13
+ "./phonetic": {
14
+ "types": "./dist/types/js/phonetic.d.ts",
15
+ "default": "./dist/phonetic.js"
16
+ },
17
+ "./normalize": {
18
+ "types": "./dist/types/js/normalize.d.ts",
19
+ "default": "./dist/normalize.js"
20
+ },
21
+ "./segment": {
22
+ "types": "./dist/types/js/segment.d.ts",
23
+ "default": "./dist/segment.js"
24
+ },
25
+ "./stem": {
26
+ "types": "./dist/types/js/stem.d.ts",
27
+ "default": "./dist/stem.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "sideEffects": false,
34
+ "scripts": {
35
+ "build": "bun build js/phonetic.ts --outfile dist/phonetic.js --target browser --format esm && bun build js/normalize.ts --outfile dist/normalize.js --target browser --format esm && bun build js/segment.ts --outfile dist/segment.js --target browser --format esm && bun build js/stem.ts --outfile dist/stem.js --target browser --format esm && tsc -p tsconfig.json",
36
+ "test": "bun test",
37
+ "check-dist": "node js/check-dist.mjs"
38
+ },
39
+ "devDependencies": {
40
+ "@types/bun": "1.3.0",
41
+ "typescript": "5.9.3"
42
+ }
43
+ }