@delali/narsil-react-native 0.3.1-next.154 → 0.3.1-next.156

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.
Files changed (253) hide show
  1. package/NOTICE +144 -0
  2. package/NarsilReactNative.podspec +2 -2
  3. package/android/CMakeLists.txt +1 -1
  4. package/cpp/HybridNarsilCoreAnalysis.cpp +277 -0
  5. package/cpp/HybridNarsilCoreImpl.hpp +43 -0
  6. package/cpp/HybridNarsilCoreKeyword.cpp +253 -0
  7. package/cpp/HybridNarsilCoreMath.cpp +47 -0
  8. package/cpp/core/include/narsil_analysis.h +86 -0
  9. package/cpp/core/include/narsil_core.h +1 -1
  10. package/cpp/core/include/narsil_keyword.h +110 -0
  11. package/cpp/core/include/narsil_math.h +36 -0
  12. package/cpp/core/src/analysis/analyse.c +281 -0
  13. package/cpp/core/src/analysis/analyser.h +49 -0
  14. package/cpp/core/src/analysis/languages.c +79 -0
  15. package/cpp/core/src/analysis/languages.h +42 -0
  16. package/cpp/core/src/analysis/normalise.c +242 -0
  17. package/cpp/core/src/analysis/normalise.h +28 -0
  18. package/cpp/core/src/analysis/split.c +183 -0
  19. package/cpp/core/src/analysis/split.h +27 -0
  20. package/cpp/core/src/analysis/stop_words.c +82 -0
  21. package/cpp/core/src/analysis/stop_words.h +19 -0
  22. package/cpp/core/src/analysis/term_cache.c +88 -0
  23. package/cpp/core/src/analysis/term_cache.h +36 -0
  24. package/cpp/core/src/analysis/text.c +161 -0
  25. package/cpp/core/src/analysis/text.h +45 -0
  26. package/cpp/core/src/analysis/transform.c +103 -0
  27. package/cpp/core/src/analysis/unicode.c +252 -0
  28. package/cpp/core/src/analysis/unicode.h +54 -0
  29. package/cpp/core/src/internal.h +4 -0
  30. package/cpp/core/src/keyword/pass.h +117 -0
  31. package/cpp/core/src/keyword/prune.c +324 -0
  32. package/cpp/core/src/keyword/request.c +179 -0
  33. package/cpp/core/src/keyword/rows.c +83 -0
  34. package/cpp/core/src/keyword/rows.h +18 -0
  35. package/cpp/core/src/keyword/score.c +257 -0
  36. package/cpp/core/src/keyword/score.h +17 -0
  37. package/cpp/core/src/keyword/scratch.c +226 -0
  38. package/cpp/core/src/keyword/scratch.h +55 -0
  39. package/cpp/core/src/keyword/select.c +155 -0
  40. package/cpp/core/src/keyword/select.h +17 -0
  41. package/cpp/core/src/languages/bulgarian_stemmer.c +114 -0
  42. package/cpp/core/src/languages/data/albanian.c +54 -0
  43. package/cpp/core/src/languages/data/amharic.c +93 -0
  44. package/cpp/core/src/languages/data/arabic.c +146 -0
  45. package/cpp/core/src/languages/data/armenian.c +46 -0
  46. package/cpp/core/src/languages/data/azerbaijani.c +68 -0
  47. package/cpp/core/src/languages/data/bambara.c +48 -0
  48. package/cpp/core/src/languages/data/basque.c +62 -0
  49. package/cpp/core/src/languages/data/belarusian.c +56 -0
  50. package/cpp/core/src/languages/data/bengali.c +63 -0
  51. package/cpp/core/src/languages/data/bosnian.c +73 -0
  52. package/cpp/core/src/languages/data/breton.c +52 -0
  53. package/cpp/core/src/languages/data/bulgarian.c +144 -0
  54. package/cpp/core/src/languages/data/burmese.c +48 -0
  55. package/cpp/core/src/languages/data/catalan.c +84 -0
  56. package/cpp/core/src/languages/data/chinese.c +70 -0
  57. package/cpp/core/src/languages/data/croatian.c +72 -0
  58. package/cpp/core/src/languages/data/czech.c +72 -0
  59. package/cpp/core/src/languages/data/dagbani.c +88 -0
  60. package/cpp/core/src/languages/data/danish.c +56 -0
  61. package/cpp/core/src/languages/data/declarations.h +114 -0
  62. package/cpp/core/src/languages/data/dutch.c +58 -0
  63. package/cpp/core/src/languages/data/english.c +172 -0
  64. package/cpp/core/src/languages/data/esperanto.c +71 -0
  65. package/cpp/core/src/languages/data/estonian.c +417 -0
  66. package/cpp/core/src/languages/data/ewe.c +89 -0
  67. package/cpp/core/src/languages/data/faroese.c +54 -0
  68. package/cpp/core/src/languages/data/fijian.c +44 -0
  69. package/cpp/core/src/languages/data/finnish.c +100 -0
  70. package/cpp/core/src/languages/data/french.c +74 -0
  71. package/cpp/core/src/languages/data/ga.c +83 -0
  72. package/cpp/core/src/languages/data/galician.c +70 -0
  73. package/cpp/core/src/languages/data/georgian.c +57 -0
  74. package/cpp/core/src/languages/data/german.c +96 -0
  75. package/cpp/core/src/languages/data/greek.c +202 -0
  76. package/cpp/core/src/languages/data/guarani.c +110 -0
  77. package/cpp/core/src/languages/data/gujarati.c +90 -0
  78. package/cpp/core/src/languages/data/haitian-creole.c +54 -0
  79. package/cpp/core/src/languages/data/hausa.c +85 -0
  80. package/cpp/core/src/languages/data/hawaiian.c +50 -0
  81. package/cpp/core/src/languages/data/hebrew.c +85 -0
  82. package/cpp/core/src/languages/data/hindi.c +91 -0
  83. package/cpp/core/src/languages/data/hungarian.c +98 -0
  84. package/cpp/core/src/languages/data/icelandic.c +73 -0
  85. package/cpp/core/src/languages/data/igbo.c +90 -0
  86. package/cpp/core/src/languages/data/indonesian.c +296 -0
  87. package/cpp/core/src/languages/data/irish.c +60 -0
  88. package/cpp/core/src/languages/data/italian.c +107 -0
  89. package/cpp/core/src/languages/data/japanese.c +52 -0
  90. package/cpp/core/src/languages/data/kannada.c +60 -0
  91. package/cpp/core/src/languages/data/kazakh.c +57 -0
  92. package/cpp/core/src/languages/data/khmer.c +71 -0
  93. package/cpp/core/src/languages/data/kinyarwanda.c +54 -0
  94. package/cpp/core/src/languages/data/kirundi.c +53 -0
  95. package/cpp/core/src/languages/data/korean.c +74 -0
  96. package/cpp/core/src/languages/data/kurmanji.c +43 -0
  97. package/cpp/core/src/languages/data/kyrgyz.c +65 -0
  98. package/cpp/core/src/languages/data/lao.c +46 -0
  99. package/cpp/core/src/languages/data/latin.c +46 -0
  100. package/cpp/core/src/languages/data/latvian.c +75 -0
  101. package/cpp/core/src/languages/data/lingala.c +88 -0
  102. package/cpp/core/src/languages/data/lithuanian.c +65 -0
  103. package/cpp/core/src/languages/data/luxembourgish.c +80 -0
  104. package/cpp/core/src/languages/data/macedonian.c +286 -0
  105. package/cpp/core/src/languages/data/malagasy.c +51 -0
  106. package/cpp/core/src/languages/data/malay.c +184 -0
  107. package/cpp/core/src/languages/data/malayalam.c +64 -0
  108. package/cpp/core/src/languages/data/maltese.c +102 -0
  109. package/cpp/core/src/languages/data/maori.c +52 -0
  110. package/cpp/core/src/languages/data/marathi.c +62 -0
  111. package/cpp/core/src/languages/data/nepali.c +72 -0
  112. package/cpp/core/src/languages/data/norwegian.c +74 -0
  113. package/cpp/core/src/languages/data/oromo.c +51 -0
  114. package/cpp/core/src/languages/data/persian.c +150 -0
  115. package/cpp/core/src/languages/data/polish.c +111 -0
  116. package/cpp/core/src/languages/data/portuguese.c +91 -0
  117. package/cpp/core/src/languages/data/punjabi.c +80 -0
  118. package/cpp/core/src/languages/data/registry.c +116 -0
  119. package/cpp/core/src/languages/data/romanian.c +93 -0
  120. package/cpp/core/src/languages/data/russian.c +76 -0
  121. package/cpp/core/src/languages/data/samoan.c +47 -0
  122. package/cpp/core/src/languages/data/sanskrit.c +53 -0
  123. package/cpp/core/src/languages/data/scottish-gaelic.c +119 -0
  124. package/cpp/core/src/languages/data/serbian.c +84 -0
  125. package/cpp/core/src/languages/data/shona.c +55 -0
  126. package/cpp/core/src/languages/data/sinhala.c +78 -0
  127. package/cpp/core/src/languages/data/slovak.c +135 -0
  128. package/cpp/core/src/languages/data/slovenian.c +139 -0
  129. package/cpp/core/src/languages/data/sorani.c +55 -0
  130. package/cpp/core/src/languages/data/spanish.c +84 -0
  131. package/cpp/core/src/languages/data/swahili.c +59 -0
  132. package/cpp/core/src/languages/data/swedish.c +60 -0
  133. package/cpp/core/src/languages/data/tagalog.c +75 -0
  134. package/cpp/core/src/languages/data/tamil.c +69 -0
  135. package/cpp/core/src/languages/data/tatar.c +548 -0
  136. package/cpp/core/src/languages/data/telugu.c +54 -0
  137. package/cpp/core/src/languages/data/thai.c +46 -0
  138. package/cpp/core/src/languages/data/tibetan.c +55 -0
  139. package/cpp/core/src/languages/data/tigrinya.c +73 -0
  140. package/cpp/core/src/languages/data/tongan.c +47 -0
  141. package/cpp/core/src/languages/data/turkish.c +100 -0
  142. package/cpp/core/src/languages/data/twi.c +88 -0
  143. package/cpp/core/src/languages/data/ukrainian.c +99 -0
  144. package/cpp/core/src/languages/data/urdu.c +174 -0
  145. package/cpp/core/src/languages/data/vietnamese.c +88 -0
  146. package/cpp/core/src/languages/data/welsh.c +143 -0
  147. package/cpp/core/src/languages/data/wolof.c +51 -0
  148. package/cpp/core/src/languages/data/xhosa.c +56 -0
  149. package/cpp/core/src/languages/data/yoruba.c +93 -0
  150. package/cpp/core/src/languages/data/zulu.c +58 -0
  151. package/cpp/core/src/languages/marks.c +64 -0
  152. package/cpp/core/src/languages/rules.c +63 -0
  153. package/cpp/core/src/languages/rules.h +68 -0
  154. package/cpp/core/src/languages/sanskrit_stemmer.c +50 -0
  155. package/cpp/core/src/languages/scripts.c +143 -0
  156. package/cpp/core/src/languages/slovenian_stemmer.c +46 -0
  157. package/cpp/core/src/languages/snowball/api.c +52 -0
  158. package/cpp/core/src/languages/snowball/api.h +43 -0
  159. package/cpp/core/src/languages/snowball/arabic_stemmer.c +1506 -0
  160. package/cpp/core/src/languages/snowball/arabic_stemmer.h +24 -0
  161. package/cpp/core/src/languages/snowball/armenian_stemmer.c +523 -0
  162. package/cpp/core/src/languages/snowball/armenian_stemmer.h +24 -0
  163. package/cpp/core/src/languages/snowball/basque_stemmer.c +1089 -0
  164. package/cpp/core/src/languages/snowball/basque_stemmer.h +24 -0
  165. package/cpp/core/src/languages/snowball/catalan_stemmer.c +1380 -0
  166. package/cpp/core/src/languages/snowball/catalan_stemmer.h +24 -0
  167. package/cpp/core/src/languages/snowball/czech_stemmer.c +582 -0
  168. package/cpp/core/src/languages/snowball/czech_stemmer.h +24 -0
  169. package/cpp/core/src/languages/snowball/danish_stemmer.c +352 -0
  170. package/cpp/core/src/languages/snowball/danish_stemmer.h +24 -0
  171. package/cpp/core/src/languages/snowball/dutch_stemmer.c +1657 -0
  172. package/cpp/core/src/languages/snowball/dutch_stemmer.h +24 -0
  173. package/cpp/core/src/languages/snowball/english_stemmer.c +1019 -0
  174. package/cpp/core/src/languages/snowball/english_stemmer.h +24 -0
  175. package/cpp/core/src/languages/snowball/esperanto_stemmer.c +716 -0
  176. package/cpp/core/src/languages/snowball/esperanto_stemmer.h +24 -0
  177. package/cpp/core/src/languages/snowball/estonian_stemmer.c +1361 -0
  178. package/cpp/core/src/languages/snowball/estonian_stemmer.h +24 -0
  179. package/cpp/core/src/languages/snowball/finnish_stemmer.c +800 -0
  180. package/cpp/core/src/languages/snowball/finnish_stemmer.h +24 -0
  181. package/cpp/core/src/languages/snowball/french_stemmer.c +1217 -0
  182. package/cpp/core/src/languages/snowball/french_stemmer.h +24 -0
  183. package/cpp/core/src/languages/snowball/german_stemmer.c +567 -0
  184. package/cpp/core/src/languages/snowball/german_stemmer.h +24 -0
  185. package/cpp/core/src/languages/snowball/greek_stemmer.c +3450 -0
  186. package/cpp/core/src/languages/snowball/greek_stemmer.h +24 -0
  187. package/cpp/core/src/languages/snowball/hindi_stemmer.c +325 -0
  188. package/cpp/core/src/languages/snowball/hindi_stemmer.h +24 -0
  189. package/cpp/core/src/languages/snowball/hungarian_stemmer.c +742 -0
  190. package/cpp/core/src/languages/snowball/hungarian_stemmer.h +24 -0
  191. package/cpp/core/src/languages/snowball/indonesian_stemmer.c +443 -0
  192. package/cpp/core/src/languages/snowball/indonesian_stemmer.h +24 -0
  193. package/cpp/core/src/languages/snowball/irish_stemmer.c +428 -0
  194. package/cpp/core/src/languages/snowball/irish_stemmer.h +24 -0
  195. package/cpp/core/src/languages/snowball/italian_stemmer.c +983 -0
  196. package/cpp/core/src/languages/snowball/italian_stemmer.h +24 -0
  197. package/cpp/core/src/languages/snowball/lithuanian_stemmer.c +794 -0
  198. package/cpp/core/src/languages/snowball/lithuanian_stemmer.h +24 -0
  199. package/cpp/core/src/languages/snowball/nepali_stemmer.c +361 -0
  200. package/cpp/core/src/languages/snowball/nepali_stemmer.h +24 -0
  201. package/cpp/core/src/languages/snowball/norwegian_stemmer.c +332 -0
  202. package/cpp/core/src/languages/snowball/norwegian_stemmer.h +24 -0
  203. package/cpp/core/src/languages/snowball/persian_stemmer.c +538 -0
  204. package/cpp/core/src/languages/snowball/persian_stemmer.h +24 -0
  205. package/cpp/core/src/languages/snowball/polish_stemmer.c +501 -0
  206. package/cpp/core/src/languages/snowball/polish_stemmer.h +24 -0
  207. package/cpp/core/src/languages/snowball/portuguese_stemmer.c +866 -0
  208. package/cpp/core/src/languages/snowball/portuguese_stemmer.h +24 -0
  209. package/cpp/core/src/languages/snowball/romanian_stemmer.c +940 -0
  210. package/cpp/core/src/languages/snowball/romanian_stemmer.h +24 -0
  211. package/cpp/core/src/languages/snowball/russian_stemmer.c +598 -0
  212. package/cpp/core/src/languages/snowball/russian_stemmer.h +24 -0
  213. package/cpp/core/src/languages/snowball/serbian_stemmer.c +6765 -0
  214. package/cpp/core/src/languages/snowball/serbian_stemmer.h +24 -0
  215. package/cpp/core/src/languages/snowball/snowball_runtime.h +122 -0
  216. package/cpp/core/src/languages/snowball/spanish_stemmer.c +955 -0
  217. package/cpp/core/src/languages/snowball/spanish_stemmer.h +24 -0
  218. package/cpp/core/src/languages/snowball/swedish_stemmer.c +364 -0
  219. package/cpp/core/src/languages/snowball/swedish_stemmer.h +24 -0
  220. package/cpp/core/src/languages/snowball/tamil_stemmer.c +1305 -0
  221. package/cpp/core/src/languages/snowball/tamil_stemmer.h +24 -0
  222. package/cpp/core/src/languages/snowball/turkish_stemmer.c +1700 -0
  223. package/cpp/core/src/languages/snowball/turkish_stemmer.h +24 -0
  224. package/cpp/core/src/languages/snowball/utilities.c +716 -0
  225. package/cpp/core/src/languages/substitutions.c +131 -0
  226. package/cpp/core/src/languages/swahili_stemmer.c +85 -0
  227. package/cpp/core/src/languages/ukrainian_stemmer.c +168 -0
  228. package/cpp/core/src/locks.c +2 -15
  229. package/cpp/core/src/math/apply.c +44 -0
  230. package/cpp/core/src/math/fdlibm.h +16 -0
  231. package/cpp/core/src/math/inverse.c +242 -0
  232. package/cpp/core/src/math/log.c +90 -0
  233. package/cpp/core/src/math/reduce.c +325 -0
  234. package/cpp/core/src/math/trig.c +188 -0
  235. package/cpp/core/src/math/words.h +45 -0
  236. package/cpp/core/src/thread_yield.h +18 -0
  237. package/cpp/core/src/unicode/decompositions.c +310 -0
  238. package/cpp/core/src/unicode/lowercase.c +172 -0
  239. package/cpp/core/src/unicode/properties.c +214 -0
  240. package/cpp/core/src/workspace.c +5 -1
  241. package/lib/engine/analysis.d.ts +3 -0
  242. package/lib/engine/analysis.js +76 -0
  243. package/lib/engine/core.js +5 -0
  244. package/lib/engine/keyword.d.ts +3 -0
  245. package/lib/engine/keyword.js +25 -0
  246. package/lib/specs/core.nitro.d.ts +1 -0
  247. package/nitrogen/generated/shared/c++/HybridNarsilCoreSpec.cpp +1 -0
  248. package/nitrogen/generated/shared/c++/HybridNarsilCoreSpec.hpp +1 -0
  249. package/package.json +4 -3
  250. package/src/engine/analysis.ts +87 -0
  251. package/src/engine/core.ts +6 -0
  252. package/src/engine/keyword.ts +26 -0
  253. package/src/specs/core.nitro.ts +1 -0
@@ -0,0 +1,155 @@
1
+ #include "select.h"
2
+
3
+ #include "pass.h"
4
+ #include "scratch.h"
5
+
6
+ #include "../../include/narsil_keyword.h"
7
+
8
+ #include <stdint.h>
9
+
10
+ typedef struct {
11
+ int32_t *ordinals;
12
+ double *scores;
13
+ uint32_t size;
14
+ } best_heap;
15
+
16
+ static int ranks_below(const best_heap *heap, uint64_t lhs, uint64_t rhs) {
17
+ if (heap->scores[lhs] != heap->scores[rhs]) { return heap->scores[lhs] < heap->scores[rhs]; }
18
+ return heap->ordinals[lhs] > heap->ordinals[rhs];
19
+ }
20
+
21
+ static void swap_places(const best_heap *heap, uint32_t lhs, uint32_t rhs) {
22
+ int32_t ordinal = heap->ordinals[lhs];
23
+ heap->ordinals[lhs] = heap->ordinals[rhs];
24
+ heap->ordinals[rhs] = ordinal;
25
+ double score = heap->scores[lhs];
26
+ heap->scores[lhs] = heap->scores[rhs];
27
+ heap->scores[rhs] = score;
28
+ }
29
+
30
+ static void sift_best_down(const best_heap *heap, uint32_t root) {
31
+ uint32_t node = root;
32
+ for (;;) {
33
+ uint64_t left = (2 * (uint64_t)node) + 1;
34
+ if (left >= heap->size) { return; }
35
+ uint64_t right = left + 1;
36
+ uint64_t lowest = node;
37
+ if (ranks_below(heap, left, lowest)) { lowest = left; }
38
+ if (right < heap->size && ranks_below(heap, right, lowest)) { lowest = right; }
39
+ if (lowest == node) { return; }
40
+ swap_places(heap, node, (uint32_t)lowest);
41
+ node = (uint32_t)lowest;
42
+ }
43
+ }
44
+
45
+ static void sort_best_first(int32_t *ordinals, double *scores, uint32_t count) {
46
+ best_heap heap = {ordinals, scores, count};
47
+ for (uint32_t root = count / 2; root > 0; root--) { sift_best_down(&heap, root - 1); }
48
+ for (uint32_t size = count; size > 1; size--) {
49
+ swap_places(&heap, 0, size - 1);
50
+ heap.size = size - 1;
51
+ sift_best_down(&heap, 0);
52
+ }
53
+ }
54
+
55
+ static uint32_t offer_score(double *selection, uint32_t size, uint32_t limit, double score) {
56
+ if (size == limit && !(score > selection[0])) { return size; }
57
+ uint32_t node = 0;
58
+ uint32_t grown = size;
59
+ if (size < limit) {
60
+ node = grown++;
61
+ while (node > 0) {
62
+ uint32_t parent = (node - 1) / 2;
63
+ if (!(selection[parent] > score)) { break; }
64
+ selection[node] = selection[parent];
65
+ node = parent;
66
+ }
67
+ } else {
68
+ for (;;) {
69
+ uint64_t left = (2 * (uint64_t)node) + 1;
70
+ if (left >= size) { break; }
71
+ uint64_t right = left + 1;
72
+ uint64_t child = right < size && selection[right] < selection[left] ? right : left;
73
+ if (!(selection[child] < score)) { break; }
74
+ selection[node] = selection[child];
75
+ node = (uint32_t)child;
76
+ }
77
+ }
78
+ selection[node] = score;
79
+ return grown;
80
+ }
81
+
82
+ static double limit_best_score(const keyword_pass *pass, uint32_t kept) {
83
+ double *selection = pass->scratch->selection;
84
+ const double *scores = pass->output->scores;
85
+ uint32_t size = 0;
86
+ for (uint32_t index = 0; index < kept; index++) { size = offer_score(selection, size, pass->limit, scores[index]); }
87
+ return selection[0];
88
+ }
89
+
90
+ double keyword_touched_best_score(const keyword_pass *pass) {
91
+ const keyword_scratch *scratch = pass->scratch;
92
+ double *selection = scratch->selection;
93
+ uint32_t size = 0;
94
+ for (uint32_t index = 0; index < scratch->touched_count; index++) {
95
+ size = offer_score(selection, size, pass->limit, scratch->scores[scratch->touched[index]]);
96
+ }
97
+ return selection[0];
98
+ }
99
+
100
+ void keyword_clear_matched(const keyword_pass *pass) {
101
+ uint32_t words = keyword_words_for(pass->capacity);
102
+ uint32_t *matched = pass->output->matched;
103
+ for (uint32_t word = 0; word < words; word++) { matched[word] = 0; }
104
+ }
105
+
106
+ uint32_t keyword_keep_best(const keyword_pass *pass, uint32_t candidates) {
107
+ narsil_keyword_output *output = pass->output;
108
+ int32_t *ordinals = output->ordinals;
109
+ double *scores = output->scores;
110
+ uint32_t count = candidates;
111
+ if (pass->has_limit && candidates > pass->limit) {
112
+ count = 0;
113
+ if (pass->limit > 0) {
114
+ double lowest = limit_best_score(pass, candidates);
115
+ for (uint32_t index = 0; index < candidates; index++) {
116
+ if (!(scores[index] >= lowest)) { continue; }
117
+ ordinals[count] = ordinals[index];
118
+ scores[count] = scores[index];
119
+ count++;
120
+ }
121
+ }
122
+ }
123
+ sort_best_first(ordinals, scores, count);
124
+ output->count = count;
125
+ return count;
126
+ }
127
+
128
+ uint32_t keyword_select_kept(const keyword_pass *pass) {
129
+ const narsil_keyword_request *request = pass->request;
130
+ const keyword_scratch *scratch = pass->scratch;
131
+ narsil_keyword_output *output = pass->output;
132
+ double terms = request->terms;
133
+ double min_score = request->min_score;
134
+ double required = request->term_match > 0 && terms > 0 ? request->term_match : 0;
135
+ uint32_t kept = 0;
136
+ if (required <= terms) {
137
+ for (uint32_t index = 0; index < scratch->touched_count; index++) {
138
+ uint32_t ordinal = scratch->touched[index];
139
+ if (required > 0 && (double)scratch->covered[ordinal] < required) { continue; }
140
+ double score = scratch->scores[ordinal];
141
+ if (min_score > 0 && !(score >= min_score)) { continue; }
142
+ output->ordinals[kept] = (int32_t)ordinal;
143
+ output->scores[kept] = score;
144
+ kept++;
145
+ }
146
+ }
147
+ if (request->collect) {
148
+ keyword_clear_matched(pass);
149
+ for (uint32_t index = 0; index < kept; index++) {
150
+ keyword_mark_matched(output->matched, (uint32_t)output->ordinals[index]);
151
+ }
152
+ }
153
+ output->total_matched = kept;
154
+ return keyword_keep_best(pass, kept);
155
+ }
@@ -0,0 +1,17 @@
1
+ #ifndef NARSIL_KEYWORD_SELECT_H
2
+ #define NARSIL_KEYWORD_SELECT_H
3
+
4
+ #include "pass.h"
5
+
6
+ #include <stdint.h>
7
+
8
+ uint32_t keyword_select_kept(const keyword_pass *pass);
9
+ uint32_t keyword_keep_best(const keyword_pass *pass, uint32_t candidates);
10
+ double keyword_touched_best_score(const keyword_pass *pass);
11
+ void keyword_clear_matched(const keyword_pass *pass);
12
+
13
+ static inline void keyword_mark_matched(uint32_t *matched, uint32_t ordinal) {
14
+ matched[ordinal >> KEYWORD_WORD_SHIFT] |= 1U << (ordinal & KEYWORD_BIT_MASK);
15
+ }
16
+
17
+ #endif
@@ -0,0 +1,114 @@
1
+ #include "../../include/narsil_core.h"
2
+ #include "../analysis/normalise.h"
3
+ #include "../analysis/text.h"
4
+ #include "rules.h"
5
+
6
+ #include <stddef.h>
7
+ #include <stdint.h>
8
+
9
+ #define MIN_STEMMED_UNITS 4U
10
+ #define LONGER_THAN_THREE 3U
11
+ #define LONGER_THAN_FOUR 4U
12
+ #define LONGER_THAN_FIVE 5U
13
+ #define LONGER_THAN_SIX 6U
14
+ #define NO_REPLACEMENT 0U
15
+ #define CYRILLIC_G 0x0433U
16
+ #define CYRILLIC_IE 0x0435U
17
+ #define CYRILLIC_I 0x0438U
18
+ #define CYRILLIC_SHORT_I 0x0439U
19
+ #define CYRILLIC_KA 0x043AU
20
+ #define CYRILLIC_EN 0x043DU
21
+ #define CYRILLIC_HA 0x0445U
22
+ #define CYRILLIC_HARD_SIGN 0x044AU
23
+ #define CYRILLIC_YA 0x044FU
24
+ #define COUNT_OF(array) (sizeof(array) / sizeof((array)[0]))
25
+
26
+ typedef struct {
27
+ size_t longer_than;
28
+ const uint16_t *suffix;
29
+ size_t dropped;
30
+ uint16_t replacement;
31
+ } suffix_rule;
32
+
33
+ static const suffix_rule leading_plural_rules[] = {
34
+ {LONGER_THAN_FIVE, u"ища", 3, NO_REPLACEMENT},
35
+ };
36
+
37
+ static const suffix_rule definite_article_rules[] = {
38
+ {LONGER_THAN_SIX, u"ият", 3, NO_REPLACEMENT}, {LONGER_THAN_FIVE, u"ът", 2, NO_REPLACEMENT},
39
+ {LONGER_THAN_FIVE, u"то", 2, NO_REPLACEMENT}, {LONGER_THAN_FIVE, u"те", 2, NO_REPLACEMENT},
40
+ {LONGER_THAN_FIVE, u"та", 2, NO_REPLACEMENT}, {LONGER_THAN_FIVE, u"ия", 2, NO_REPLACEMENT},
41
+ {LONGER_THAN_FOUR, u"ят", 2, NO_REPLACEMENT},
42
+ };
43
+
44
+ static const suffix_rule plural_rules[] = {
45
+ {LONGER_THAN_SIX, u"овци", 3, NO_REPLACEMENT}, {LONGER_THAN_SIX, u"ове", 3, NO_REPLACEMENT},
46
+ {LONGER_THAN_SIX, u"еве", 3, CYRILLIC_SHORT_I}, {LONGER_THAN_FIVE, u"ища", 3, NO_REPLACEMENT},
47
+ {LONGER_THAN_FIVE, u"та", 2, NO_REPLACEMENT}, {LONGER_THAN_FIVE, u"ци", 2, CYRILLIC_KA},
48
+ {LONGER_THAN_FIVE, u"зи", 2, CYRILLIC_G},
49
+ };
50
+
51
+ static const suffix_rule late_plural_rules[] = {
52
+ {LONGER_THAN_FOUR, u"си", 2, CYRILLIC_HA},
53
+ {LONGER_THAN_FOUR, u"и", 1, NO_REPLACEMENT},
54
+ };
55
+
56
+ static const suffix_rule vowel_rules[] = {
57
+ {LONGER_THAN_THREE, u"я", 1, NO_REPLACEMENT},
58
+ {LONGER_THAN_THREE, u"а", 1, NO_REPLACEMENT},
59
+ {LONGER_THAN_THREE, u"о", 1, NO_REPLACEMENT},
60
+ {LONGER_THAN_THREE, u"е", 1, NO_REPLACEMENT},
61
+ };
62
+
63
+ static const suffix_rule en_rules[] = {
64
+ {LONGER_THAN_FOUR, u"ен", 2, CYRILLIC_EN},
65
+ };
66
+
67
+ static int apply_first(narsil_text *word, const suffix_rule *rules, size_t rule_count, int *applied) {
68
+ *applied = 0;
69
+ for (size_t i = 0; i < rule_count; i++) {
70
+ if (word->length <= rules[i].longer_than || !narsil_rule_ends_with(word, rules[i].suffix)) { continue; }
71
+ *applied = 1;
72
+ word->length -= rules[i].dropped;
73
+ return rules[i].replacement == NO_REPLACEMENT ? NARSIL_OK : narsil_text_push(word, rules[i].replacement);
74
+ }
75
+ return NARSIL_OK;
76
+ }
77
+
78
+ static int is_plural_in_e_and_i(const narsil_text *word) {
79
+ return word->length > LONGER_THAN_FIVE && word->units[word->length - 1] == CYRILLIC_I &&
80
+ word->units[word->length - 3] == CYRILLIC_IE;
81
+ }
82
+
83
+ static int plural(narsil_text *word) {
84
+ int applied = 0;
85
+ int status = apply_first(word, plural_rules, COUNT_OF(plural_rules), &applied);
86
+ if (status != NARSIL_OK || applied) { return status; }
87
+ if (is_plural_in_e_and_i(word)) {
88
+ uint16_t kept = word->units[word->length - 2];
89
+ word->length -= 3;
90
+ status = narsil_text_push(word, CYRILLIC_YA);
91
+ return status == NARSIL_OK ? narsil_text_push(word, kept) : status;
92
+ }
93
+ return apply_first(word, late_plural_rules, COUNT_OF(late_plural_rules), &applied);
94
+ }
95
+
96
+ int narsil_bulgarian_stem(const uint16_t *units, size_t length, narsil_text *out, narsil_normalise_scratch *scratch) {
97
+ (void)scratch;
98
+ int applied = 0;
99
+ int status = narsil_text_assign(out, units, length);
100
+ if (status != NARSIL_OK || length < MIN_STEMMED_UNITS) { return status; }
101
+ status = apply_first(out, leading_plural_rules, COUNT_OF(leading_plural_rules), &applied);
102
+ if (status == NARSIL_OK) {
103
+ status = apply_first(out, definite_article_rules, COUNT_OF(definite_article_rules), &applied);
104
+ }
105
+ if (status == NARSIL_OK) { status = plural(out); }
106
+ if (status == NARSIL_OK) { status = apply_first(out, vowel_rules, COUNT_OF(vowel_rules), &applied); }
107
+ if (status == NARSIL_OK) { status = apply_first(out, en_rules, COUNT_OF(en_rules), &applied); }
108
+ if (status == NARSIL_OK && out->length > LONGER_THAN_FIVE && out->units[out->length - 2] == CYRILLIC_HARD_SIGN) {
109
+ uint16_t last = out->units[out->length - 1];
110
+ out->length -= 2;
111
+ status = narsil_text_push(out, last);
112
+ }
113
+ return status;
114
+ }
@@ -0,0 +1,54 @@
1
+ #include "../../analysis/languages.h"
2
+ #include "declarations.h"
3
+
4
+ #include <stddef.h>
5
+ #include <stdint.h>
6
+
7
+ static const uint16_t stop_word_units[321] = {
8
+ 97, 105, 97, 106, 111, 97, 115, 97, 115, 110, 106, 235, 97, 116, 97, 97, 116, 106, 101, 97, 116, 111, 97, 116, 121,
9
+ 98, 114, 101, 110, 100, 97, 99, 105, 108, 97, 99, 105, 108, 105, 99, 105, 108, 235, 116, 100, 101, 114, 105, 100, 104,
10
+ 101, 100, 105, 115, 97, 100, 111, 101, 101, 100, 104, 101, 103, 106, 97, 116, 235, 103, 106, 105, 116, 104, 97, 115,
11
+ 104, 116, 117, 103, 106, 105, 116, 104, 235, 105, 105, 109, 105, 109, 101, 105, 115, 104, 116, 101, 106, 97, 110, 235,
12
+ 106, 97, 115, 104, 116, 235, 106, 111, 110, 235, 106, 111, 116, 101, 106, 117, 106, 117, 97, 106, 107, 97, 107, 97,
13
+ 109, 107, 97, 110, 235, 107, 101, 107, 101, 109, 105, 107, 101, 110, 105, 107, 106, 111, 107, 117, 107, 117, 114, 107,
14
+ 121, 107, 235, 116, 97, 107, 235, 116, 111, 107, 235, 116, 117, 108, 97, 114, 116, 109, 98, 105, 109, 101, 109, 105,
15
+ 100, 105, 115, 109, 111, 115, 109, 235, 110, 100, 235, 114, 110, 100, 235, 114, 109, 106, 101, 116, 110, 101, 110,
16
+ 103, 97, 110, 106, 235, 110, 117, 107, 110, 235, 110, 235, 110, 111, 115, 101, 112, 97, 112, 97, 107, 112, 97, 114,
17
+ 97, 112, 97, 115, 112, 97, 115, 116, 97, 106, 112, 111, 114, 112, 111, 115, 104, 116, 235, 112, 114, 101, 106, 112,
18
+ 235, 114, 113, 235, 115, 97, 115, 97, 106, 115, 104, 117, 109, 235, 115, 105, 115, 105, 112, 97, 115, 116, 97, 110,
19
+ 105, 116, 101, 116, 101, 107, 116, 105, 116, 105, 106, 116, 106, 101, 116, 235, 114, 116, 121, 114, 101, 116, 235,
20
+ 117, 117, 110, 235, 118, 101, 116, 101, 110, 118, 101, 116, 235, 118, 101, 116, 235, 109, 121, 116, 231, 100, 111,
21
+ 231, 102, 97, 114, 235, 235, 115, 104, 116, 235,
22
+ };
23
+
24
+ static const uint32_t stop_word_offsets[92] = {
25
+ 0, 2, 5, 7, 12, 15, 19, 22, 25, 31, 35, 39, 44, 48, 51, 55, 57, 58, 62, 67, 77, 83, 84, 86, 89, 94, 98, 104, 108, 112,
26
+ 114, 118, 120, 123, 127, 129, 133, 137, 140, 142, 145, 147, 151, 155, 159, 163, 166, 168, 173, 176, 178, 182, 190,
27
+ 192, 195, 198, 201, 203, 206, 209, 211, 214, 218, 221, 227, 230, 236, 240, 243, 245, 247, 250, 255, 257, 262, 266,
28
+ 268, 271, 273, 276, 282, 286, 288, 289, 292, 297, 301, 306, 308, 311, 316, 321,
29
+ };
30
+
31
+ static const uint32_t keep_ranges[14] = {
32
+ 48, 57, 65, 90, 97, 122, 199, 199, 203, 203, 231, 231, 235, 235,
33
+ };
34
+
35
+ const narsil_language narsil_language_albanian = {
36
+ .name = "albanian",
37
+ .revision = "1",
38
+ .stop_word_units = stop_word_units,
39
+ .stop_word_offsets = stop_word_offsets,
40
+ .stop_word_count = 91,
41
+ .ascii_keep = {0x03FF000000000000ULL, 0x07FFFFFE07FFFFFEULL},
42
+ .keep_ranges = keep_ranges,
43
+ .keep_range_count = 7,
44
+ .splits_code_points = 0,
45
+ .strips_possessive = 0,
46
+ .normalises_diacritics = 0,
47
+ .min_token_length = 1,
48
+ .ngram_size = 0,
49
+ .normalise = NULL,
50
+ .stem_by_rules = NULL,
51
+ .create_snowball = NULL,
52
+ .snowball_stem = NULL,
53
+ .close_snowball = NULL,
54
+ };
@@ -0,0 +1,93 @@
1
+ #include "../../analysis/languages.h"
2
+ #include "declarations.h"
3
+
4
+ #include <stddef.h>
5
+ #include <stdint.h>
6
+
7
+ static const uint16_t stop_word_units[889] = {
8
+ 4609, 4616, 4721, 4757, 4637, 4609, 4617, 4609, 4621, 4609, 4756, 4723, 4614, 4752, 4614, 4752, 4813, 4614, 4753,
9
+ 4614, 4758, 4637, 4616, 4614, 4752, 4616, 4614, 4752, 4813, 4616, 4614, 4753, 4616, 4620, 4622, 4733, 4616, 4635,
10
+ 4755, 4728, 4813, 4637, 4616, 4635, 4757, 4763, 4813, 4637, 4616, 4752, 4826, 4613, 4616, 4773, 4843, 4757, 4851,
11
+ 4757, 4849, 4616, 4826, 4609, 4616, 4826, 4613, 4618, 4614, 4757, 4619, 4845, 4620, 4619, 4620, 4622, 4733, 4621,
12
+ 4841, 4632, 4614, 4753, 4632, 4614, 4753, 4757, 4632, 4614, 4755, 4728, 4813, 4632, 4614, 4755, 4728, 4813, 4757,
13
+ 4632, 4614, 4757, 4635, 4616, 4721, 4635, 4616, 4725, 4635, 4755, 4728, 4813, 4637, 4635, 4755, 4728, 4813, 4757,
14
+ 4637, 4635, 4757, 4635, 4757, 4637, 4635, 4757, 4763, 4813, 4637, 4635, 4853, 4648, 4877, 4637, 4757, 4874, 4828,
15
+ 4637, 4651, 4659, 4733, 4609, 4757, 4651, 4661, 4613, 4757, 4651, 4661, 4669, 4757, 4656, 4638, 4753, 4757, 4656,
16
+ 4771, 4725, 4658, 4614, 4753, 4658, 4614, 4757, 4658, 4614, 4757, 4755, 4658, 4621, 4658, 4707, 4621, 4658, 4758,
17
+ 4653, 4659, 4616, 4659, 4845, 4614, 4757, 4661, 4616, 4614, 4752, 4661, 4616, 4635, 4755, 4728, 4813, 4637, 4661,
18
+ 4616, 4826, 4609, 4661, 4637, 4662, 4661, 4720, 4763, 4673, 4901, 4653, 4704, 4609, 4756, 4723, 4813, 4704, 4614,
19
+ 4752, 4704, 4614, 4753, 4704, 4619, 4845, 4704, 4620, 4619, 4704, 4620, 4622, 4733, 4704, 4633, 4617, 4704, 4633,
20
+ 4617, 4637, 4704, 4634, 4621, 4704, 4634, 4733, 4617, 4704, 4634, 4872, 4707, 4704, 4635, 4672, 4853, 4704, 4635,
21
+ 4755, 4728, 4813, 4637, 4704, 4653, 4779, 4723, 4704, 4656, 4638, 4753, 4704, 4661, 4720, 4672, 4653, 4704, 4672,
22
+ 4653, 4704, 4720, 4616, 4845, 4704, 4720, 4616, 4845, 4637, 4704, 4720, 4632, 4616, 4776, 4720, 4704, 4720, 4632,
23
+ 4659, 4659, 4845, 4704, 4723, 4733, 4704, 4747, 4619, 4704, 4752, 4657, 4704, 4752, 4826, 4609, 4704, 4752, 4826,
24
+ 4613, 4704, 4773, 4752, 4826, 4609, 4704, 4773, 4757, 4848, 4826, 4613, 4704, 4777, 4621, 4704, 4811, 4755, 4704,
25
+ 4813, 4661, 4901, 4704, 4826, 4613, 4704, 4826, 4613, 4637, 4704, 4826, 4613, 4755, 4706, 4614, 4757, 4706, 4614,
26
+ 4757, 4637, 4706, 4843, 4757, 4661, 4707, 4617, 4707, 4899, 4637, 4709, 4616, 4811, 4621, 4709, 4622, 4709, 4731,
27
+ 4709, 4825, 4710, 4723, 4720, 4707, 4616, 4720, 4709, 4622, 4720, 4776, 4755, 4808, 4752, 4720, 4872, 4616, 4920,
28
+ 4720, 4872, 4621, 4927, 4621, 4720, 4904, 4635, 4650, 4725, 4755, 4757, 4725, 4733, 4877, 4653, 4747, 4619, 4752,
29
+ 4704, 4648, 4733, 4752, 4704, 4649, 4752, 4704, 4653, 4752, 4813, 4752, 4872, 4653, 4752, 4872, 4654, 4733, 4755,
30
+ 4755, 4725, 4755, 4728, 4813, 4768, 4609, 4757, 4768, 4616, 4768, 4617, 4768, 4659, 4656, 4704, 4768, 4659, 4661,
31
+ 4704, 4811, 4621, 4768, 4661, 4648, 4853, 4720, 4811, 4621, 4768, 4661, 4723, 4813, 4656, 4811, 4621, 4768, 4661,
32
+ 4723, 4813, 4672, 4811, 4621, 4768, 4661, 4872, 4752, 4824, 4705, 4768, 4661, 4872, 4757, 4829, 4704, 4811, 4621,
33
+ 4768, 4661, 4936, 4619, 4874, 4768, 4709, 4651, 4653, 4720, 4811, 4621, 4768, 4757, 4720, 4768, 4757, 4730, 4768,
34
+ 4757, 4848, 4614, 4752, 4768, 4757, 4848, 4763, 4768, 4757, 4849, 4768, 4757, 4849, 4757, 4768, 4757, 4850, 4725,
35
+ 4768, 4757, 4851, 4757, 4853, 4768, 4757, 4923, 4653, 4773, 4661, 4776, 4773, 4661, 4778, 4848, 4653, 4661, 4773,
36
+ 4661, 4779, 4609, 4757, 4773, 4707, 4781, 4613, 4773, 4707, 4781, 4669, 4773, 4752, 4826, 4613, 4773, 4752, 4826,
37
+ 4613, 4637, 4773, 4752, 4826, 4613, 4753, 4773, 4752, 4826, 4613, 4757, 4773, 4752, 4848, 4614, 4752, 4773, 4755,
38
+ 4757, 4720, 4773, 4757, 4787, 4773, 4757, 4787, 4757, 4773, 4757, 4848, 4773, 4757, 4848, 4614, 4752, 4755, 4773,
39
+ 4757, 4848, 4720, 4755, 4872, 4649, 4725, 4773, 4757, 4848, 4752, 4826, 4613, 4773, 4757, 4848, 4872, 4616, 4921,
40
+ 4725, 4773, 4757, 4848, 4872, 4755, 4773, 4757, 4850, 4609, 4637, 4773, 4757, 4850, 4613, 4773, 4757, 4850, 4614,
41
+ 4753, 4773, 4757, 4850, 4614, 4757, 4773, 4757, 4851, 4661, 4648, 4849, 4725, 4773, 4757, 4866, 4773, 4826, 4609,
42
+ 4773, 4869, 4877, 4776, 4609, 4616, 4725, 4776, 4614, 4752, 4776, 4614, 4752, 4813, 4776, 4620, 4619, 4776, 4620,
43
+ 4622, 4733, 4776, 4752, 4826, 4609, 4776, 4768, 4661, 4653, 4776, 4768, 4757, 4851, 4757, 4853, 4776, 4768, 4757,
44
+ 4853, 4776, 4773, 4752, 4826, 4609, 4776, 4773, 4752, 4826, 4613, 4776, 4826, 4613, 4776, 4826, 4613, 4637, 4776,
45
+ 4826, 4843, 4779, 4621, 4614, 4752, 4808, 4653, 4808, 4677, 4725, 4808, 4845, 4808, 4845, 4637, 4808, 4848, 4813,
46
+ 4661, 4901, 4840, 4614, 4752, 4840, 4614, 4752, 4733, 4757, 4840, 4614, 4752, 4813, 4840, 4614, 4753, 4725, 4840,
47
+ 4616, 4813, 4637, 4840, 4620, 4619, 4840, 4620, 4619, 4728, 4813, 4757, 4840, 4620, 4619, 4813, 4757, 4840, 4634,
48
+ 4614, 4753, 4725, 4840, 4634, 4733, 4616, 4813, 4757, 4840, 4634, 4872, 4765, 4840, 4635, 4755, 4728, 4813, 4637,
49
+ 4840, 4635, 4843, 4757, 4661, 4840, 4635, 4845, 4704, 4621, 4901, 4840, 4720, 4616, 4843, 4840, 4840, 4720, 4616,
50
+ 4843, 4841, 4840, 4752, 4704, 4648, 4813, 4757, 4840, 4752, 4872, 4649, 4840, 4755, 4757, 4720, 4840, 4768, 4757,
51
+ 4672, 4921, 4840, 4826, 4609, 4840, 4826, 4613, 4843, 4616, 4843, 4617, 4843, 4619, 4728, 4813, 4843, 4619, 4728,
52
+ 4813, 4757, 4843, 4621, 4614, 4752, 4843, 4757, 4720, 4843, 4757, 4730, 4845, 4613, 4845, 4613, 4637, 4845, 4613,
53
+ 4733, 4813, 4845, 4613, 4757, 4845, 4613, 4757, 4753, 4845, 4613, 4757, 4757, 4637, 4845, 4614, 4753, 4704, 4723,
54
+ 4621, 4845, 4614, 4755, 4617, 4845, 4792, 4813, 4874, 4828, 4755, 4875, 4653, 4877, 4757,
55
+ };
56
+
57
+ static const uint32_t stop_word_offsets[229] = {
58
+ 0, 5, 7, 9, 12, 14, 17, 19, 22, 25, 29, 32, 36, 42, 48, 52, 59, 62, 65, 68, 70, 72, 75, 77, 80, 84, 89, 95, 98, 101,
59
+ 104, 109, 115, 117, 120, 125, 129, 134, 139, 143, 147, 151, 154, 157, 160, 164, 166, 169, 172, 174, 178, 182, 189,
60
+ 193, 195, 199, 202, 207, 210, 213, 216, 219, 223, 226, 230, 233, 237, 241, 245, 251, 255, 259, 264, 267, 271, 276,
61
+ 282, 288, 291, 294, 297, 301, 305, 310, 316, 319, 322, 326, 329, 333, 337, 340, 344, 348, 350, 353, 357, 359, 361,
62
+ 363, 365, 368, 371, 376, 380, 385, 389, 393, 396, 398, 402, 405, 408, 410, 413, 417, 418, 420, 423, 426, 428, 430,
63
+ 434, 440, 447, 454, 461, 467, 475, 480, 487, 490, 493, 498, 502, 505, 509, 513, 518, 522, 525, 531, 536, 540, 544,
64
+ 548, 553, 558, 563, 568, 572, 575, 579, 582, 588, 596, 602, 609, 614, 619, 623, 628, 633, 640, 643, 646, 649, 653,
65
+ 656, 660, 663, 667, 671, 675, 681, 685, 690, 695, 698, 702, 705, 709, 711, 714, 716, 719, 721, 724, 727, 732, 736,
66
+ 740, 744, 747, 753, 758, 763, 769, 773, 779, 784, 790, 795, 800, 806, 810, 814, 819, 822, 825, 827, 829, 833, 838,
67
+ 842, 845, 848, 850, 853, 857, 860, 864, 869, 875, 879, 882, 885, 887, 889,
68
+ };
69
+
70
+ static const uint32_t keep_ranges[10] = {
71
+ 48, 57, 65, 90, 97, 122, 4608, 4959, 4969, 4988,
72
+ };
73
+
74
+ const narsil_language narsil_language_amharic = {
75
+ .name = "amharic",
76
+ .revision = "1",
77
+ .stop_word_units = stop_word_units,
78
+ .stop_word_offsets = stop_word_offsets,
79
+ .stop_word_count = 228,
80
+ .ascii_keep = {0x03FF000000000000ULL, 0x07FFFFFE07FFFFFEULL},
81
+ .keep_ranges = keep_ranges,
82
+ .keep_range_count = 5,
83
+ .splits_code_points = 0,
84
+ .strips_possessive = 0,
85
+ .normalises_diacritics = 0,
86
+ .min_token_length = 1,
87
+ .ngram_size = 0,
88
+ .normalise = NULL,
89
+ .stem_by_rules = NULL,
90
+ .create_snowball = NULL,
91
+ .snowball_stem = NULL,
92
+ .close_snowball = NULL,
93
+ };
@@ -0,0 +1,146 @@
1
+ #include "../../analysis/languages.h"
2
+ #include "declarations.h"
3
+ #include "../snowball/arabic_stemmer.h"
4
+
5
+ #include <stddef.h>
6
+ #include <stdint.h>
7
+
8
+ static const uint16_t stop_word_units[1653] = {
9
+ 1570, 1590, 1570, 1605, 1610, 1606, 1570, 1607, 1570, 1607, 1575, 1570, 1610, 1571, 1571, 1576, 1571, 1580, 1604,
10
+ 1571, 1580, 1605, 1593, 1571, 1582, 1571, 1582, 1584, 1571, 1589, 1576, 1581, 1571, 1590, 1581, 1609, 1571, 1601,
11
+ 1571, 1602, 1576, 1604, 1571, 1602, 1604, 1571, 1603, 1579, 1585, 1571, 1604, 1575, 1571, 1605, 1571, 1605, 1575,
12
+ 1571, 1605, 1575, 1605, 1603, 1571, 1605, 1587, 1609, 1571, 1606, 1571, 1606, 1575, 1571, 1606, 1578, 1571, 1606,
13
+ 1578, 1605, 1571, 1606, 1578, 1605, 1575, 1571, 1606, 1578, 1606, 1571, 1606, 1588, 1571, 1571, 1606, 1609, 1571,
14
+ 1608, 1571, 1608, 1588, 1603, 1571, 1608, 1604, 1574, 1603, 1571, 1608, 1604, 1574, 1603, 1605, 1571, 1608, 1604,
15
+ 1575, 1569, 1571, 1608, 1604, 1575, 1604, 1603, 1571, 1608, 1607, 1571, 1610, 1571, 1610, 1575, 1571, 1610, 1575,
16
+ 1606, 1571, 1610, 1590, 1575, 1571, 1610, 1606, 1571, 1610, 1606, 1605, 1575, 1573, 1584, 1573, 1584, 1575, 1573,
17
+ 1584, 1605, 1575, 1573, 1584, 1606, 1573, 1604, 1575, 1573, 1604, 1609, 1573, 1604, 1610, 1603, 1573, 1604, 1610,
18
+ 1603, 1605, 1573, 1604, 1610, 1603, 1605, 1575, 1573, 1604, 1610, 1603, 1606, 1573, 1605, 1575, 1573, 1606, 1573,
19
+ 1606, 1605, 1575, 1573, 1610, 1573, 1610, 1575, 1603, 1573, 1610, 1575, 1603, 1605, 1573, 1610, 1575, 1603, 1605,
20
+ 1575, 1573, 1610, 1575, 1603, 1606, 1573, 1610, 1575, 1606, 1575, 1573, 1610, 1575, 1607, 1573, 1610, 1575, 1607,
21
+ 1575, 1573, 1610, 1575, 1607, 1605, 1573, 1610, 1575, 1607, 1605, 1575, 1573, 1610, 1575, 1607, 1606, 1573, 1610,
22
+ 1575, 1610, 1573, 1610, 1607, 1575, 1575, 1576, 1578, 1583, 1571, 1575, 1579, 1585, 1575, 1580, 1604, 1575, 1581,
23
+ 1583, 1575, 1582, 1585, 1609, 1575, 1582, 1604, 1608, 1604, 1602, 1575, 1584, 1575, 1575, 1585, 1576, 1593, 1577,
24
+ 1575, 1585, 1578, 1583, 1575, 1587, 1578, 1581, 1575, 1604, 1575, 1591, 1575, 1585, 1575, 1593, 1575, 1583, 1577,
25
+ 1575, 1593, 1604, 1606, 1578, 1575, 1601, 1575, 1603, 1579, 1585, 1575, 1603, 1583, 1575, 1604, 1571, 1604, 1575,
26
+ 1569, 1575, 1604, 1571, 1604, 1609, 1575, 1604, 1575, 1575, 1604, 1575, 1582, 1610, 1585, 1577, 1575, 1604, 1575,
27
+ 1606, 1575, 1604, 1575, 1608, 1604, 1575, 1604, 1575, 1608, 1604, 1609, 1575, 1604, 1578, 1609, 1575, 1604, 1578,
28
+ 1610, 1575, 1604, 1579, 1575, 1606, 1610, 1575, 1604, 1579, 1575, 1606, 1610, 1577, 1575, 1604, 1584, 1575, 1578,
29
+ 1610, 1575, 1604, 1584, 1609, 1575, 1604, 1584, 1610, 1575, 1604, 1584, 1610, 1606, 1575, 1604, 1587, 1575, 1576,
30
+ 1602, 1575, 1604, 1601, 1575, 1604, 1604, 1575, 1574, 1610, 1575, 1604, 1604, 1575, 1578, 1610, 1575, 1604, 1604,
31
+ 1578, 1575, 1606, 1575, 1604, 1604, 1578, 1610, 1575, 1575, 1604, 1604, 1578, 1610, 1606, 1575, 1604, 1604, 1584,
32
+ 1575, 1606, 1575, 1604, 1604, 1584, 1610, 1606, 1575, 1604, 1604, 1608, 1575, 1578, 1610, 1575, 1604, 1605, 1575,
33
+ 1590, 1610, 1575, 1604, 1605, 1602, 1576, 1604, 1575, 1604, 1608, 1602, 1578, 1575, 1604, 1609, 1575, 1604, 1610,
34
+ 1608, 1605, 1575, 1605, 1575, 1575, 1605, 1575, 1605, 1575, 1605, 1587, 1575, 1606, 1575, 1606, 1576, 1585, 1609,
35
+ 1575, 1606, 1602, 1604, 1576, 1575, 1606, 1607, 1575, 1606, 1607, 1575, 1575, 1608, 1575, 1608, 1604, 1575, 1610,
36
+ 1575, 1610, 1575, 1585, 1575, 1610, 1575, 1605, 1575, 1610, 1590, 1575, 1576, 1576, 1574, 1587, 1576, 1575, 1578,
37
+ 1576, 1575, 1587, 1605, 1576, 1575, 1606, 1576, 1582, 1576, 1585, 1587, 1576, 1587, 1576, 1587, 1576, 1576, 1576,
38
+ 1588, 1603, 1604, 1576, 1590, 1593, 1576, 1591, 1570, 1606, 1576, 1593, 1583, 1576, 1593, 1590, 1576, 1603, 1576,
39
+ 1603, 1605, 1576, 1603, 1605, 1575, 1576, 1603, 1606, 1576, 1604, 1576, 1604, 1607, 1576, 1604, 1609, 1576, 1605,
40
+ 1575, 1576, 1605, 1575, 1584, 1575, 1576, 1605, 1606, 1576, 1606, 1576, 1606, 1575, 1576, 1607, 1576, 1607, 1575,
41
+ 1576, 1610, 1576, 1610, 1583, 1576, 1610, 1606, 1578, 1575, 1606, 1578, 1575, 1606, 1603, 1578, 1576, 1583, 1604,
42
+ 1578, 1580, 1575, 1607, 1578, 1581, 1578, 1578, 1581, 1608, 1604, 1578, 1604, 1602, 1575, 1569, 1578, 1604, 1603,
43
+ 1578, 1604, 1603, 1605, 1578, 1604, 1603, 1605, 1575, 1578, 1605, 1578, 1607, 1578, 1610, 1578, 1610, 1606, 1578,
44
+ 1610, 1606, 1603, 1579, 1604, 1575, 1579, 1577, 1579, 1605, 1579, 1605, 1577, 1580, 1593, 1604, 1580, 1604, 1604,
45
+ 1580, 1605, 1610, 1593, 1580, 1610, 1585, 1581, 1575, 1585, 1581, 1575, 1588, 1575, 1581, 1575, 1604, 1610, 1575,
46
+ 1581, 1575, 1610, 1581, 1576, 1584, 1575, 1581, 1578, 1609, 1581, 1584, 1575, 1585, 1581, 1585, 1609, 1581, 1587,
47
+ 1576, 1581, 1605, 1581, 1608, 1575, 1604, 1609, 1581, 1608, 1604, 1581, 1610, 1581, 1610, 1579, 1581, 1610, 1579,
48
+ 1605, 1575, 1581, 1610, 1606, 1582, 1604, 1575, 1582, 1604, 1575, 1604, 1583, 1608, 1606, 1583, 1608, 1606, 1603,
49
+ 1584, 1575, 1584, 1575, 1578, 1584, 1575, 1603, 1584, 1575, 1606, 1584, 1575, 1606, 1603, 1584, 1604, 1603, 1584,
50
+ 1604, 1603, 1605, 1584, 1604, 1603, 1605, 1575, 1584, 1604, 1603, 1606, 1584, 1607, 1584, 1608, 1584, 1608, 1575,
51
+ 1584, 1608, 1575, 1578, 1575, 1584, 1608, 1575, 1578, 1610, 1584, 1610, 1584, 1610, 1578, 1584, 1610, 1606, 1584,
52
+ 1610, 1606, 1603, 1585, 1575, 1581, 1585, 1576, 1585, 1580, 1593, 1585, 1608, 1610, 1583, 1603, 1585, 1610, 1579,
53
+ 1586, 1610, 1575, 1585, 1577, 1587, 1575, 1569, 1587, 1575, 1569, 1605, 1575, 1587, 1576, 1581, 1575, 1606, 1587,
54
+ 1585, 1593, 1575, 1606, 1587, 1606, 1577, 1587, 1606, 1608, 1575, 1578, 1587, 1608, 1601, 1587, 1608, 1609, 1588,
55
+ 1576, 1607, 1588, 1578, 1575, 1606, 1588, 1582, 1589, 1575, 1588, 1585, 1593, 1589, 1575, 1585, 1589, 1576, 1575,
56
+ 1581, 1589, 1601, 1585, 1589, 1607, 1590, 1583, 1590, 1605, 1606, 1591, 1575, 1602, 1591, 1575, 1604, 1605, 1575,
57
+ 1591, 1601, 1602, 1591, 1602, 1592, 1604, 1593, 1575, 1583, 1593, 1575, 1605, 1593, 1575, 1605, 1575, 1593, 1575,
58
+ 1605, 1577, 1593, 1576, 1585, 1593, 1583, 1575, 1593, 1583, 1577, 1593, 1583, 1583, 1593, 1583, 1587, 1593, 1583,
59
+ 1605, 1593, 1587, 1609, 1593, 1588, 1585, 1593, 1588, 1585, 1577, 1593, 1604, 1593, 1604, 1602, 1593, 1604, 1609,
60
+ 1593, 1604, 1610, 1603, 1593, 1604, 1610, 1607, 1593, 1604, 1610, 1607, 1575, 1593, 1605, 1575, 1593, 1606, 1593,
61
+ 1606, 1583, 1593, 1606, 1583, 1605, 1575, 1593, 1608, 1590, 1593, 1610, 1606, 1594, 1583, 1575, 1594, 1610, 1585,
62
+ 1601, 1601, 1573, 1606, 1601, 1575, 1606, 1601, 1602, 1591, 1601, 1604, 1575, 1606, 1601, 1608, 1601, 1608, 1602,
63
+ 1601, 1609, 1601, 1610, 1601, 1610, 1605, 1601, 1610, 1605, 1575, 1601, 1610, 1607, 1601, 1610, 1607, 1575, 1602,
64
+ 1575, 1604, 1602, 1575, 1605, 1602, 1576, 1604, 1602, 1583, 1602, 1591, 1602, 1604, 1605, 1575, 1602, 1608, 1577,
65
+ 1603, 1571, 1606, 1603, 1571, 1606, 1605, 1575, 1603, 1571, 1610, 1603, 1571, 1610, 1606, 1603, 1575, 1583, 1603,
66
+ 1575, 1606, 1603, 1575, 1606, 1578, 1603, 1582, 1603, 1584, 1575, 1603, 1584, 1604, 1603, 1603, 1585, 1576, 1603,
67
+ 1604, 1603, 1604, 1575, 1603, 1604, 1575, 1607, 1605, 1575, 1603, 1604, 1578, 1575, 1603, 1604, 1605, 1603, 1604,
68
+ 1605, 1575, 1603, 1604, 1610, 1603, 1605, 1575, 1603, 1604, 1610, 1607, 1605, 1575, 1603, 1605, 1603, 1605, 1575,
69
+ 1603, 1610, 1603, 1610, 1578, 1603, 1610, 1601, 1603, 1610, 1601, 1605, 1575, 1604, 1574, 1606, 1604, 1575, 1604,
70
+ 1575, 1578, 1604, 1575, 1587, 1610, 1605, 1575, 1604, 1583, 1606, 1604, 1583, 1609, 1604, 1587, 1578, 1604, 1587,
71
+ 1578, 1605, 1604, 1587, 1578, 1605, 1575, 1604, 1587, 1578, 1606, 1604, 1587, 1606, 1604, 1587, 1606, 1575, 1604,
72
+ 1593, 1604, 1604, 1593, 1605, 1585, 1604, 1602, 1575, 1569, 1604, 1603, 1604, 1603, 1605, 1604, 1603, 1605, 1575,
73
+ 1604, 1603, 1606, 1604, 1603, 1606, 1605, 1575, 1604, 1603, 1610, 1604, 1603, 1610, 1604, 1575, 1604, 1604, 1575,
74
+ 1605, 1605, 1604, 1605, 1604, 1605, 1575, 1604, 1605, 1575, 1584, 1575, 1604, 1606, 1604, 1606, 1575, 1604, 1607,
75
+ 1604, 1607, 1575, 1604, 1608, 1604, 1608, 1603, 1575, 1604, 1577, 1604, 1608, 1604, 1575, 1604, 1608, 1605, 1575,
76
+ 1604, 1610, 1604, 1610, 1578, 1604, 1610, 1587, 1604, 1610, 1587, 1575, 1604, 1610, 1587, 1578, 1604, 1610, 1587,
77
+ 1578, 1575, 1604, 1610, 1587, 1608, 1575, 1605, 1575, 1605, 1575, 1575, 1606, 1601, 1603, 1605, 1575, 1576, 1585,
78
+ 1581, 1605, 1575, 1583, 1575, 1605, 1605, 1575, 1584, 1575, 1605, 1575, 1586, 1575, 1604, 1605, 1575, 1601, 1578,
79
+ 1574, 1605, 1575, 1610, 1608, 1605, 1578, 1609, 1605, 1579, 1604, 1605, 1584, 1605, 1587, 1575, 1569, 1605, 1593,
80
+ 1605, 1593, 1575, 1584, 1605, 1602, 1575, 1576, 1604, 1605, 1603, 1575, 1606, 1603, 1605, 1603, 1575, 1606, 1603,
81
+ 1605, 1605, 1603, 1575, 1606, 1603, 1605, 1575, 1605, 1603, 1575, 1606, 1603, 1606, 1605, 1604, 1610, 1575, 1585,
82
+ 1605, 1604, 1610, 1608, 1606, 1605, 1605, 1575, 1605, 1605, 1606, 1605, 1606, 1605, 1606, 1584, 1605, 1606, 1607,
83
+ 1575, 1605, 1607, 1605, 1607, 1605, 1575, 1606, 1581, 1606, 1606, 1581, 1608, 1606, 1582, 1606, 1593, 1605, 1606,
84
+ 1593, 1605, 1575, 1606, 1601, 1587, 1606, 1601, 1587, 1607, 1606, 1607, 1575, 1610, 1577, 1607, 1572, 1604, 1575,
85
+ 1569, 1607, 1575, 1607, 1575, 1572, 1605, 1607, 1575, 1578, 1575, 1606, 1607, 1575, 1578, 1607, 1607, 1575, 1578,
86
+ 1610, 1607, 1575, 1578, 1610, 1606, 1607, 1575, 1603, 1607, 1575, 1607, 1606, 1575, 1607, 1576, 1607, 1580, 1607,
87
+ 1584, 1575, 1607, 1584, 1575, 1606, 1607, 1584, 1607, 1607, 1584, 1610, 1607, 1584, 1610, 1606, 1607, 1603, 1584,
88
+ 1575, 1607, 1604, 1607, 1604, 1575, 1607, 1604, 1605, 1607, 1605, 1607, 1605, 1575, 1607, 1606, 1607, 1606, 1575,
89
+ 1607, 1606, 1575, 1603, 1607, 1606, 1575, 1604, 1603, 1607, 1608, 1607, 1610, 1607, 1610, 1575, 1607, 1610, 1578,
90
+ 1607, 1610, 1607, 1575, 1578, 1608, 1608, 54, 1608, 1573, 1606, 1608, 1575, 1608, 1575, 1581, 1583, 1608, 1575, 1590,
91
+ 1575, 1601, 1608, 1575, 1590, 1575, 1601, 1578, 1608, 1575, 1603, 1583, 1608, 1575, 1606, 1608, 1575, 1607, 1575,
92
+ 1608, 1575, 1608, 1590, 1581, 1608, 1585, 1575, 1569, 1603, 1608, 1588, 1603, 1575, 1606, 1608, 1601, 1610, 1608,
93
+ 1602, 1575, 1604, 1608, 1602, 1575, 1604, 1578, 1608, 1602, 1583, 1608, 1602, 1601, 1608, 1603, 1575, 1606, 1608,
94
+ 1603, 1575, 1606, 1578, 1608, 1604, 1575, 1608, 1604, 1605, 1608, 1605, 1606, 1608, 1607, 1608, 1608, 1607, 1610,
95
+ 1608, 1610, 1608, 1610, 1603, 1571, 1606, 1610, 1603, 1608, 1606, 1610, 1605, 1603, 1606, 1610, 1608, 1605,
96
+ };
97
+
98
+ static const uint32_t stop_word_offsets[461] = {
99
+ 0, 2, 6, 8, 11, 13, 14, 16, 19, 23, 25, 28, 32, 36, 38, 42, 45, 49, 52, 54, 57, 62, 66, 68, 71, 74, 78, 83, 87, 91,
100
+ 94, 96, 100, 105, 111, 116, 122, 125, 127, 130, 134, 138, 141, 146, 148, 151, 155, 158, 161, 164, 168, 173, 179, 184,
101
+ 187, 189, 193, 195, 199, 204, 210, 215, 220, 224, 229, 234, 240, 245, 249, 252, 253, 258, 261, 264, 267, 271, 277,
102
+ 280, 285, 289, 295, 299, 304, 309, 311, 315, 318, 324, 329, 332, 339, 343, 348, 354, 358, 362, 368, 375, 381, 385,
103
+ 389, 394, 400, 403, 409, 415, 421, 427, 433, 439, 445, 452, 458, 464, 469, 472, 477, 480, 484, 487, 489, 494, 499,
104
+ 502, 506, 508, 511, 513, 517, 521, 525, 526, 529, 532, 536, 539, 541, 544, 546, 550, 554, 557, 561, 564, 567, 569,
105
+ 572, 576, 579, 581, 584, 587, 590, 595, 598, 600, 603, 605, 608, 610, 613, 616, 619, 623, 627, 631, 634, 638, 643,
106
+ 646, 650, 655, 657, 659, 661, 664, 668, 673, 675, 678, 681, 684, 688, 691, 694, 698, 703, 706, 710, 713, 717, 720,
107
+ 723, 725, 730, 733, 735, 738, 743, 746, 749, 753, 756, 760, 762, 765, 768, 771, 775, 778, 782, 787, 791, 793, 795,
108
+ 798, 803, 808, 810, 813, 816, 820, 823, 825, 828, 833, 836, 841, 844, 849, 854, 859, 862, 867, 870, 873, 876, 880,
109
+ 884, 887, 890, 894, 897, 899, 901, 904, 907, 912, 915, 917, 919, 922, 925, 929, 933, 936, 939, 942, 945, 948, 951,
110
+ 954, 957, 961, 963, 966, 969, 973, 977, 982, 985, 987, 990, 995, 998, 1001, 1004, 1007, 1008, 1011, 1014, 1017, 1021,
111
+ 1023, 1026, 1028, 1030, 1033, 1037, 1040, 1044, 1047, 1050, 1053, 1055, 1057, 1061, 1064, 1067, 1072, 1075, 1079,
112
+ 1082, 1085, 1089, 1091, 1094, 1098, 1101, 1103, 1106, 1112, 1116, 1119, 1123, 1129, 1135, 1137, 1140, 1142, 1145,
113
+ 1148, 1153, 1156, 1158, 1161, 1167, 1170, 1173, 1176, 1180, 1185, 1189, 1192, 1196, 1199, 1203, 1207, 1209, 1212,
114
+ 1216, 1219, 1224, 1227, 1232, 1237, 1239, 1242, 1247, 1249, 1252, 1254, 1257, 1259, 1265, 1269, 1273, 1275, 1278,
115
+ 1281, 1285, 1289, 1294, 1299, 1301, 1307, 1312, 1317, 1321, 1326, 1331, 1335, 1338, 1341, 1343, 1347, 1349, 1353,
116
+ 1358, 1363, 1369, 1376, 1382, 1387, 1392, 1395, 1398, 1400, 1403, 1407, 1409, 1413, 1416, 1419, 1421, 1424, 1428,
117
+ 1431, 1435, 1440, 1445, 1447, 1451, 1456, 1460, 1464, 1469, 1472, 1477, 1479, 1481, 1484, 1488, 1491, 1494, 1498,
118
+ 1502, 1504, 1507, 1510, 1512, 1515, 1517, 1520, 1524, 1529, 1531, 1533, 1536, 1539, 1544, 1545, 1547, 1550, 1552,
119
+ 1556, 1561, 1567, 1571, 1574, 1578, 1583, 1588, 1593, 1596, 1600, 1605, 1608, 1611, 1615, 1620, 1623, 1626, 1629,
120
+ 1632, 1635, 1637, 1642, 1646, 1650, 1653,
121
+ };
122
+
123
+ static const uint32_t keep_ranges[12] = {
124
+ 48, 57, 65, 90, 97, 122, 1569, 1641, 1646, 1747, 1776, 1785,
125
+ };
126
+
127
+ const narsil_language narsil_language_arabic = {
128
+ .name = "arabic",
129
+ .revision = "d9b491d016b4caf6",
130
+ .stop_word_units = stop_word_units,
131
+ .stop_word_offsets = stop_word_offsets,
132
+ .stop_word_count = 460,
133
+ .ascii_keep = {0x03FF000000000000ULL, 0x07FFFFFE07FFFFFEULL},
134
+ .keep_ranges = keep_ranges,
135
+ .keep_range_count = 6,
136
+ .splits_code_points = 0,
137
+ .strips_possessive = 0,
138
+ .normalises_diacritics = 0,
139
+ .min_token_length = 1,
140
+ .ngram_size = 0,
141
+ .normalise = NULL,
142
+ .stem_by_rules = NULL,
143
+ .create_snowball = arabic_create_env,
144
+ .snowball_stem = arabic_stem,
145
+ .close_snowball = arabic_close_env,
146
+ };
@@ -0,0 +1,46 @@
1
+ #include "../../analysis/languages.h"
2
+ #include "declarations.h"
3
+ #include "../snowball/armenian_stemmer.h"
4
+
5
+ #include <stddef.h>
6
+ #include <stdint.h>
7
+
8
+ static const uint16_t stop_word_units[126] = {
9
+ 1377, 1397, 1380, 1377, 1397, 1388, 1377, 1397, 1398, 1377, 1397, 1405, 1380, 1400, 1410, 1380, 1400, 1410, 1412,
10
+ 1381, 1396, 1381, 1398, 1381, 1398, 1412, 1381, 1405, 1381, 1412, 1383, 1383, 1387, 1383, 1387, 1398, 1383, 1387,
11
+ 1398, 1412, 1383, 1387, 1408, 1383, 1387, 1412, 1383, 1408, 1384, 1405, 1407, 1385, 1387, 1387, 1398, 1387, 1405,
12
+ 1391, 1387, 1408, 1391, 1377, 1396, 1392, 1377, 1396, 1377, 1408, 1392, 1381, 1407, 1392, 1381, 1407, 1400, 1396,
13
+ 1381, 1398, 1412, 1396, 1381, 1403, 1396, 1387, 1398, 1398, 1377, 1398, 1377, 1415, 1398, 1408, 1377, 1398, 1408,
14
+ 1377, 1398, 1412, 1400, 1408, 1400, 1408, 1384, 1400, 1408, 1400, 1398, 1412, 1400, 1408, 1402, 1381, 1405, 1400,
15
+ 1410, 1400, 1410, 1396, 1402, 1387, 1407, 1387, 1406, 1408, 1377, 1415,
16
+ };
17
+
18
+ static const uint32_t stop_word_offsets[46] = {
19
+ 0, 3, 6, 9, 12, 15, 19, 21, 23, 26, 28, 30, 31, 33, 36, 40, 43, 46, 48, 51, 52, 53, 55, 58, 60, 63, 68, 71, 75, 79,
20
+ 82, 84, 85, 87, 90, 93, 98, 100, 103, 108, 113, 115, 118, 122, 125, 126,
21
+ };
22
+
23
+ static const uint32_t keep_ranges[10] = {
24
+ 48, 57, 65, 90, 97, 122, 1329, 1366, 1377, 1415,
25
+ };
26
+
27
+ const narsil_language narsil_language_armenian = {
28
+ .name = "armenian",
29
+ .revision = "6d99ac3501d5d369",
30
+ .stop_word_units = stop_word_units,
31
+ .stop_word_offsets = stop_word_offsets,
32
+ .stop_word_count = 45,
33
+ .ascii_keep = {0x03FF000000000000ULL, 0x07FFFFFE07FFFFFEULL},
34
+ .keep_ranges = keep_ranges,
35
+ .keep_range_count = 5,
36
+ .splits_code_points = 0,
37
+ .strips_possessive = 0,
38
+ .normalises_diacritics = 0,
39
+ .min_token_length = 1,
40
+ .ngram_size = 0,
41
+ .normalise = NULL,
42
+ .stem_by_rules = NULL,
43
+ .create_snowball = armenian_create_env,
44
+ .snowball_stem = armenian_stem,
45
+ .close_snowball = armenian_close_env,
46
+ };