Debian Codegraph @

mkdocs/contrib/search/lunr-language/lunr.ro.js

raw
1 /*!
2 * Lunr languages, `Romanian` language
3 * https://github.com/MihaiValentin/lunr-languages
4 *
5 * Copyright 2014, Mihai Valentin
6 * http://www.mozilla.org/MPL/
7 */
8 /*!
9 * based on
10 * Snowball JavaScript Library v0.3
11 * http://code.google.com/p/urim/
12 * http://snowball.tartarus.org/
13 *
14 * Copyright 2010, Oleg Mazko
15 * http://www.mozilla.org/MPL/
16 */
17
18 /**
19 * export the module via AMD, CommonJS or as a browser global
20 * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
21 */
22 ;
23 (function(root, factory) {
24 if (typeof define === 'function' && define.amd) {
25 // AMD. Register as an anonymous module.
26 define(factory)
27 } else if (typeof exports === 'object') {
28 /**
29 * Node. Does not work with strict CommonJS, but
30 * only CommonJS-like environments that support module.exports,
31 * like Node.
32 */
33 module.exports = factory()
34 } else {
35 // Browser globals (root is window)
36 factory()(root.lunr);
37 }
38 }(this, function() {
39 /**
40 * Just return a value to define the module export.
41 * This example returns an object, but the module
42 * can return a function as the exported value.
43 */
44 return function(lunr) {
45 /* throw error if lunr is not yet included */
46 if ('undefined' === typeof lunr) {
47 throw new Error('Lunr is not present. Please include / require Lunr before this script.');
48 }
49
50 /* throw error if lunr stemmer support is not yet included */
51 if ('undefined' === typeof lunr.stemmerSupport) {
52 throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
53 }
54
55 /* register specific locale function */
56 lunr.ro = function() {
57 this.pipeline.reset();
58 this.pipeline.add(
59 lunr.ro.trimmer,
60 lunr.ro.stopWordFilter,
61 lunr.ro.stemmer
62 );
63
64 // for lunr version 2
65 // this is necessary so that every searched word is also stemmed before
66 // in lunr <= 1 this is not needed, as it is done using the normal pipeline
67 if (this.searchPipeline) {
68 this.searchPipeline.reset();
69 this.searchPipeline.add(lunr.ro.stemmer)
70 }
71 };
72
73 /* lunr trimmer function */
74 lunr.ro.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
75 lunr.ro.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.ro.wordCharacters);
76
77 lunr.Pipeline.registerFunction(lunr.ro.trimmer, 'trimmer-ro');
78
79 /* lunr stemmer function */
80 lunr.ro.stemmer = (function() {
81 /* create the wrapped stemmer object */
82 var Among = lunr.stemmerSupport.Among,
83 SnowballProgram = lunr.stemmerSupport.SnowballProgram,
84 st = new function RomanianStemmer() {
85 var a_0 = [new Among("", -1, 3), new Among("I", 0, 1), new Among("U", 0, 2)],
86 a_1 = [
87 new Among("ea", -1, 3), new Among("a\u0163ia", -1, 7),
88 new Among("aua", -1, 2), new Among("iua", -1, 4),
89 new Among("a\u0163ie", -1, 7), new Among("ele", -1, 3),
90 new Among("ile", -1, 5), new Among("iile", 6, 4),
91 new Among("iei", -1, 4), new Among("atei", -1, 6),
92 new Among("ii", -1, 4), new Among("ului", -1, 1),
93 new Among("ul", -1, 1), new Among("elor", -1, 3),
94 new Among("ilor", -1, 4), new Among("iilor", 14, 4)
95 ],
96 a_2 = [
97 new Among("icala", -1, 4), new Among("iciva", -1, 4),
98 new Among("ativa", -1, 5), new Among("itiva", -1, 6),
99 new Among("icale", -1, 4), new Among("a\u0163iune", -1, 5),
100 new Among("i\u0163iune", -1, 6), new Among("atoare", -1, 5),
101 new Among("itoare", -1, 6), new Among("\u0103toare", -1, 5),
102 new Among("icitate", -1, 4), new Among("abilitate", -1, 1),
103 new Among("ibilitate", -1, 2), new Among("ivitate", -1, 3),
104 new Among("icive", -1, 4), new Among("ative", -1, 5),
105 new Among("itive", -1, 6), new Among("icali", -1, 4),
106 new Among("atori", -1, 5), new Among("icatori", 18, 4),
107 new Among("itori", -1, 6), new Among("\u0103tori", -1, 5),
108 new Among("icitati", -1, 4), new Among("abilitati", -1, 1),
109 new Among("ivitati", -1, 3), new Among("icivi", -1, 4),
110 new Among("ativi", -1, 5), new Among("itivi", -1, 6),
111 new Among("icit\u0103i", -1, 4), new Among("abilit\u0103i", -1, 1),
112 new Among("ivit\u0103i", -1, 3),
113 new Among("icit\u0103\u0163i", -1, 4),
114 new Among("abilit\u0103\u0163i", -1, 1),
115 new Among("ivit\u0103\u0163i", -1, 3), new Among("ical", -1, 4),
116 new Among("ator", -1, 5), new Among("icator", 35, 4),
117 new Among("itor", -1, 6), new Among("\u0103tor", -1, 5),
118 new Among("iciv", -1, 4), new Among("ativ", -1, 5),
119 new Among("itiv", -1, 6), new Among("ical\u0103", -1, 4),
120 new Among("iciv\u0103", -1, 4), new Among("ativ\u0103", -1, 5),
121 new Among("itiv\u0103", -1, 6)
122 ],
123 a_3 = [new Among("ica", -1, 1),
124 new Among("abila", -1, 1), new Among("ibila", -1, 1),
125 new Among("oasa", -1, 1), new Among("ata", -1, 1),
126 new Among("ita", -1, 1), new Among("anta", -1, 1),
127 new Among("ista", -1, 3), new Among("uta", -1, 1),
128 new Among("iva", -1, 1), new Among("ic", -1, 1),
129 new Among("ice", -1, 1), new Among("abile", -1, 1),
130 new Among("ibile", -1, 1), new Among("isme", -1, 3),
131 new Among("iune", -1, 2), new Among("oase", -1, 1),
132 new Among("ate", -1, 1), new Among("itate", 17, 1),
133 new Among("ite", -1, 1), new Among("ante", -1, 1),
134 new Among("iste", -1, 3), new Among("ute", -1, 1),
135 new Among("ive", -1, 1), new Among("ici", -1, 1),
136 new Among("abili", -1, 1), new Among("ibili", -1, 1),
137 new Among("iuni", -1, 2), new Among("atori", -1, 1),
138 new Among("osi", -1, 1), new Among("ati", -1, 1),
139 new Among("itati", 30, 1), new Among("iti", -1, 1),
140 new Among("anti", -1, 1), new Among("isti", -1, 3),
141 new Among("uti", -1, 1), new Among("i\u015Fti", -1, 3),
142 new Among("ivi", -1, 1), new Among("it\u0103i", -1, 1),
143 new Among("o\u015Fi", -1, 1), new Among("it\u0103\u0163i", -1, 1),
144 new Among("abil", -1, 1), new Among("ibil", -1, 1),
145 new Among("ism", -1, 3), new Among("ator", -1, 1),
146 new Among("os", -1, 1), new Among("at", -1, 1),
147 new Among("it", -1, 1), new Among("ant", -1, 1),
148 new Among("ist", -1, 3), new Among("ut", -1, 1),
149 new Among("iv", -1, 1), new Among("ic\u0103", -1, 1),
150 new Among("abil\u0103", -1, 1), new Among("ibil\u0103", -1, 1),
151 new Among("oas\u0103", -1, 1), new Among("at\u0103", -1, 1),
152 new Among("it\u0103", -1, 1), new Among("ant\u0103", -1, 1),
153 new Among("ist\u0103", -1, 3), new Among("ut\u0103", -1, 1),
154 new Among("iv\u0103", -1, 1)
155 ],
156 a_4 = [new Among("ea", -1, 1),
157 new Among("ia", -1, 1), new Among("esc", -1, 1),
158 new Among("\u0103sc", -1, 1), new Among("ind", -1, 1),
159 new Among("\u00E2nd", -1, 1), new Among("are", -1, 1),
160 new Among("ere", -1, 1), new Among("ire", -1, 1),
161 new Among("\u00E2re", -1, 1), new Among("se", -1, 2),
162 new Among("ase", 10, 1), new Among("sese", 10, 2),
163 new Among("ise", 10, 1), new Among("use", 10, 1),
164 new Among("\u00E2se", 10, 1), new Among("e\u015Fte", -1, 1),
165 new Among("\u0103\u015Fte", -1, 1), new Among("eze", -1, 1),
166 new Among("ai", -1, 1), new Among("eai", 19, 1),
167 new Among("iai", 19, 1), new Among("sei", -1, 2),
168 new Among("e\u015Fti", -1, 1), new Among("\u0103\u015Fti", -1, 1),
169 new Among("ui", -1, 1), new Among("ezi", -1, 1),
170 new Among("\u00E2i", -1, 1), new Among("a\u015Fi", -1, 1),
171 new Among("se\u015Fi", -1, 2), new Among("ase\u015Fi", 29, 1),
172 new Among("sese\u015Fi", 29, 2), new Among("ise\u015Fi", 29, 1),
173 new Among("use\u015Fi", 29, 1),
174 new Among("\u00E2se\u015Fi", 29, 1), new Among("i\u015Fi", -1, 1),
175 new Among("u\u015Fi", -1, 1), new Among("\u00E2\u015Fi", -1, 1),
176 new Among("a\u0163i", -1, 2), new Among("ea\u0163i", 38, 1),
177 new Among("ia\u0163i", 38, 1), new Among("e\u0163i", -1, 2),
178 new Among("i\u0163i", -1, 2), new Among("\u00E2\u0163i", -1, 2),
179 new Among("ar\u0103\u0163i", -1, 1),
180 new Among("ser\u0103\u0163i", -1, 2),
181 new Among("aser\u0103\u0163i", 45, 1),
182 new Among("seser\u0103\u0163i", 45, 2),
183 new Among("iser\u0103\u0163i", 45, 1),
184 new Among("user\u0103\u0163i", 45, 1),
185 new Among("\u00E2ser\u0103\u0163i", 45, 1),
186 new Among("ir\u0103\u0163i", -1, 1),
187 new Among("ur\u0103\u0163i", -1, 1),
188 new Among("\u00E2r\u0103\u0163i", -1, 1), new Among("am", -1, 1),
189 new Among("eam", 54, 1), new Among("iam", 54, 1),
190 new Among("em", -1, 2), new Among("asem", 57, 1),
191 new Among("sesem", 57, 2), new Among("isem", 57, 1),
192 new Among("usem", 57, 1), new Among("\u00E2sem", 57, 1),
193 new Among("im", -1, 2), new Among("\u00E2m", -1, 2),
194 new Among("\u0103m", -1, 2), new Among("ar\u0103m", 65, 1),
195 new Among("ser\u0103m", 65, 2), new Among("aser\u0103m", 67, 1),
196 new Among("seser\u0103m", 67, 2), new Among("iser\u0103m", 67, 1),
197 new Among("user\u0103m", 67, 1),
198 new Among("\u00E2ser\u0103m", 67, 1),
199 new Among("ir\u0103m", 65, 1), new Among("ur\u0103m", 65, 1),
200 new Among("\u00E2r\u0103m", 65, 1), new Among("au", -1, 1),
201 new Among("eau", 76, 1), new Among("iau", 76, 1),
202 new Among("indu", -1, 1), new Among("\u00E2ndu", -1, 1),
203 new Among("ez", -1, 1), new Among("easc\u0103", -1, 1),
204 new Among("ar\u0103", -1, 1), new Among("ser\u0103", -1, 2),
205 new Among("aser\u0103", 84, 1), new Among("seser\u0103", 84, 2),
206 new Among("iser\u0103", 84, 1), new Among("user\u0103", 84, 1),
207 new Among("\u00E2ser\u0103", 84, 1), new Among("ir\u0103", -1, 1),
208 new Among("ur\u0103", -1, 1), new Among("\u00E2r\u0103", -1, 1),
209 new Among("eaz\u0103", -1, 1)
210 ],
211 a_5 = [new Among("a", -1, 1),
212 new Among("e", -1, 1), new Among("ie", 1, 1),
213 new Among("i", -1, 1), new Among("\u0103", -1, 1)
214 ],
215 g_v = [17, 65,
216 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4
217 ],
218 B_standard_suffix_removed, I_p2, I_p1, I_pV, sbp = new SnowballProgram();
219 this.setCurrent = function(word) {
220 sbp.setCurrent(word);
221 };
222 this.getCurrent = function() {
223 return sbp.getCurrent();
224 };
225
226 function habr1(c1, c2) {
227 if (sbp.eq_s(1, c1)) {
228 sbp.ket = sbp.cursor;
229 if (sbp.in_grouping(g_v, 97, 259))
230 sbp.slice_from(c2);
231 }
232 }
233
234 function r_prelude() {
235 var v_1, v_2;
236 while (true) {
237 v_1 = sbp.cursor;
238 if (sbp.in_grouping(g_v, 97, 259)) {
239 v_2 = sbp.cursor;
240 sbp.bra = v_2;
241 habr1("u", "U");
242 sbp.cursor = v_2;
243 habr1("i", "I");
244 }
245 sbp.cursor = v_1;
246 if (sbp.cursor >= sbp.limit) {
247 break;
248 }
249 sbp.cursor++;
250 }
251 }
252
253 function habr2() {
254 if (sbp.out_grouping(g_v, 97, 259)) {
255 while (!sbp.in_grouping(g_v, 97, 259)) {
256 if (sbp.cursor >= sbp.limit)
257 return true;
258 sbp.cursor++;
259 }
260 return false;
261 }
262 return true;
263 }
264
265 function habr3() {
266 if (sbp.in_grouping(g_v, 97, 259)) {
267 while (!sbp.out_grouping(g_v, 97, 259)) {
268 if (sbp.cursor >= sbp.limit)
269 return true;
270 sbp.cursor++;
271 }
272 }
273 return false;
274 }
275
276 function habr4() {
277 var v_1 = sbp.cursor,
278 v_2, v_3;
279 if (sbp.in_grouping(g_v, 97, 259)) {
280 v_2 = sbp.cursor;
281 if (habr2()) {
282 sbp.cursor = v_2;
283 if (!habr3()) {
284 I_pV = sbp.cursor;
285 return;
286 }
287 } else {
288 I_pV = sbp.cursor;
289 return;
290 }
291 }
292 sbp.cursor = v_1;
293 if (sbp.out_grouping(g_v, 97, 259)) {
294 v_3 = sbp.cursor;
295 if (habr2()) {
296 sbp.cursor = v_3;
297 if (sbp.in_grouping(g_v, 97, 259) && sbp.cursor < sbp.limit)
298 sbp.cursor++;
299 }
300 I_pV = sbp.cursor;
301 }
302 }
303
304 function habr5() {
305 while (!sbp.in_grouping(g_v, 97, 259)) {
306 if (sbp.cursor >= sbp.limit)
307 return false;
308 sbp.cursor++;
309 }
310 while (!sbp.out_grouping(g_v, 97, 259)) {
311 if (sbp.cursor >= sbp.limit)
312 return false;
313 sbp.cursor++;
314 }
315 return true;
316 }
317
318 function r_mark_regions() {
319 var v_1 = sbp.cursor;
320 I_pV = sbp.limit;
321 I_p1 = I_pV;
322 I_p2 = I_pV;
323 habr4();
324 sbp.cursor = v_1;
325 if (habr5()) {
326 I_p1 = sbp.cursor;
327 if (habr5())
328 I_p2 = sbp.cursor;
329 }
330 }
331
332 function r_postlude() {
333 var among_var;
334 while (true) {
335 sbp.bra = sbp.cursor;
336 among_var = sbp.find_among(a_0, 3);
337 if (among_var) {
338 sbp.ket = sbp.cursor;
339 switch (among_var) {
340 case 1:
341 sbp.slice_from("i");
342 continue;
343 case 2:
344 sbp.slice_from("u");
345 continue;
346 case 3:
347 if (sbp.cursor >= sbp.limit)
348 break;
349 sbp.cursor++;
350 continue;
351 }
352 }
353 break;
354 }
355 }
356
357 function r_RV() {
358 return I_pV <= sbp.cursor;
359 }
360
361 function r_R1() {
362 return I_p1 <= sbp.cursor;
363 }
364
365 function r_R2() {
366 return I_p2 <= sbp.cursor;
367 }
368
369 function r_step_0() {
370 var among_var, v_1;
371 sbp.ket = sbp.cursor;
372 among_var = sbp.find_among_b(a_1, 16);
373 if (among_var) {
374 sbp.bra = sbp.cursor;
375 if (r_R1()) {
376 switch (among_var) {
377 case 1:
378 sbp.slice_del();
379 break;
380 case 2:
381 sbp.slice_from("a");
382 break;
383 case 3:
384 sbp.slice_from("e");
385 break;
386 case 4:
387 sbp.slice_from("i");
388 break;
389 case 5:
390 v_1 = sbp.limit - sbp.cursor;
391 if (!sbp.eq_s_b(2, "ab")) {
392 sbp.cursor = sbp.limit - v_1;
393 sbp.slice_from("i");
394 }
395 break;
396 case 6:
397 sbp.slice_from("at");
398 break;
399 case 7:
400 sbp.slice_from("a\u0163i");
401 break;
402 }
403 }
404 }
405 }
406
407 function r_combo_suffix() {
408 var among_var, v_1 = sbp.limit - sbp.cursor;
409 sbp.ket = sbp.cursor;
410 among_var = sbp.find_among_b(a_2, 46);
411 if (among_var) {
412 sbp.bra = sbp.cursor;
413 if (r_R1()) {
414 switch (among_var) {
415 case 1:
416 sbp.slice_from("abil");
417 break;
418 case 2:
419 sbp.slice_from("ibil");
420 break;
421 case 3:
422 sbp.slice_from("iv");
423 break;
424 case 4:
425 sbp.slice_from("ic");
426 break;
427 case 5:
428 sbp.slice_from("at");
429 break;
430 case 6:
431 sbp.slice_from("it");
432 break;
433 }
434 B_standard_suffix_removed = true;
435 sbp.cursor = sbp.limit - v_1;
436 return true;
437 }
438 }
439 return false;
440 }
441
442 function r_standard_suffix() {
443 var among_var, v_1;
444 B_standard_suffix_removed = false;
445 while (true) {
446 v_1 = sbp.limit - sbp.cursor;
447 if (!r_combo_suffix()) {
448 sbp.cursor = sbp.limit - v_1;
449 break;
450 }
451 }
452 sbp.ket = sbp.cursor;
453 among_var = sbp.find_among_b(a_3, 62);
454 if (among_var) {
455 sbp.bra = sbp.cursor;
456 if (r_R2()) {
457 switch (among_var) {
458 case 1:
459 sbp.slice_del();
460 break;
461 case 2:
462 if (sbp.eq_s_b(1, "\u0163")) {
463 sbp.bra = sbp.cursor;
464 sbp.slice_from("t");
465 }
466 break;
467 case 3:
468 sbp.slice_from("ist");
469 break;
470 }
471 B_standard_suffix_removed = true;
472 }
473 }
474 }
475
476 function r_verb_suffix() {
477 var among_var, v_1, v_2;
478 if (sbp.cursor >= I_pV) {
479 v_1 = sbp.limit_backward;
480 sbp.limit_backward = I_pV;
481 sbp.ket = sbp.cursor;
482 among_var = sbp.find_among_b(a_4, 94);
483 if (among_var) {
484 sbp.bra = sbp.cursor;
485 switch (among_var) {
486 case 1:
487 v_2 = sbp.limit - sbp.cursor;
488 if (!sbp.out_grouping_b(g_v, 97, 259)) {
489 sbp.cursor = sbp.limit - v_2;
490 if (!sbp.eq_s_b(1, "u"))
491 break;
492 }
493 case 2:
494 sbp.slice_del();
495 break;
496 }
497 }
498 sbp.limit_backward = v_1;
499 }
500 }
501
502 function r_vowel_suffix() {
503 var among_var;
504 sbp.ket = sbp.cursor;
505 among_var = sbp.find_among_b(a_5, 5);
506 if (among_var) {
507 sbp.bra = sbp.cursor;
508 if (r_RV() && among_var == 1)
509 sbp.slice_del();
510 }
511 }
512 this.stem = function() {
513 var v_1 = sbp.cursor;
514 r_prelude();
515 sbp.cursor = v_1;
516 r_mark_regions();
517 sbp.limit_backward = v_1;
518 sbp.cursor = sbp.limit;
519 r_step_0();
520 sbp.cursor = sbp.limit;
521 r_standard_suffix();
522 sbp.cursor = sbp.limit;
523 if (!B_standard_suffix_removed) {
524 sbp.cursor = sbp.limit;
525 r_verb_suffix();
526 sbp.cursor = sbp.limit;
527 }
528 r_vowel_suffix();
529 sbp.cursor = sbp.limit_backward;
530 r_postlude();
531 return true;
532 }
533 };
534
535 /* and return a function that stems a word for the current locale */
536 return function(token) {
537 // for lunr version 2
538 if (typeof token.update === "function") {
539 return token.update(function(word) {
540 st.setCurrent(word);
541 st.stem();
542 return st.getCurrent();
543 })
544 } else { // for lunr version <= 1
545 st.setCurrent(token);
546 st.stem();
547 return st.getCurrent();
548 }
549 }
550 })();
551
552 lunr.Pipeline.registerFunction(lunr.ro.stemmer, 'stemmer-ro');
553
554 lunr.ro.stopWordFilter = lunr.generateStopWordFilter('acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ale alea altceva altcineva am ar are asemenea asta astea astăzi asupra au avea avem aveţi azi aş aşadar aţi bine bucur bună ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curând curînd când cât câte câtva câţi cînd cît cîte cîtva cîţi că căci cărei căror cărui către da dacă dar datorită dată dau de deci deja deoarece departe deşi din dinaintea dintr- dintre doi doilea două drept după dă ea ei el ele eram este eu eşti face fata fi fie fiecare fii fim fiu fiţi frumos fără graţie halbă iar ieri la le li lor lui lângă lîngă mai mea mei mele mereu meu mi mie mine mult multă mulţi mulţumesc mâine mîine mă ne nevoie nici nicăieri nimeni nimeri nimic nişte noastre noastră noi noroc nostru nouă noştri nu opt ori oricare orice oricine oricum oricând oricât oricînd oricît oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puţin puţina puţină până pînă rog sa sale sau se spate spre sub sunt suntem sunteţi sută sînt sîntem sînteţi să săi său ta tale te timp tine toate toată tot totuşi toţi trei treia treilea tu tăi tău un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastră voi vostru vouă voştri vreme vreo vreun vă zece zero zi zice îi îl îmi împotriva în înainte înaintea încotro încât încît între întrucât întrucît îţi ăla ălea ăsta ăstea ăştia şapte şase şi ştiu ţi ţie'.split(' '));
555
556 lunr.Pipeline.registerFunction(lunr.ro.stopWordFilter, 'stopWordFilter-ro');
557 };
558 }))