Debian Codegraph @

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

raw
1 /*!
2 * Lunr languages, `Italian` 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.it = function() {
57 this.pipeline.reset();
58 this.pipeline.add(
59 lunr.it.trimmer,
60 lunr.it.stopWordFilter,
61 lunr.it.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.it.stemmer)
70 }
71 };
72
73 /* lunr trimmer function */
74 lunr.it.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.it.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.it.wordCharacters);
76
77 lunr.Pipeline.registerFunction(lunr.it.trimmer, 'trimmer-it');
78
79 /* lunr stemmer function */
80 lunr.it.stemmer = (function() {
81 /* create the wrapped stemmer object */
82 var Among = lunr.stemmerSupport.Among,
83 SnowballProgram = lunr.stemmerSupport.SnowballProgram,
84 st = new function ItalianStemmer() {
85 var a_0 = [new Among("", -1, 7), new Among("qu", 0, 6),
86 new Among("\u00E1", 0, 1), new Among("\u00E9", 0, 2),
87 new Among("\u00ED", 0, 3), new Among("\u00F3", 0, 4),
88 new Among("\u00FA", 0, 5)
89 ],
90 a_1 = [new Among("", -1, 3),
91 new Among("I", 0, 1), new Among("U", 0, 2)
92 ],
93 a_2 = [
94 new Among("la", -1, -1), new Among("cela", 0, -1),
95 new Among("gliela", 0, -1), new Among("mela", 0, -1),
96 new Among("tela", 0, -1), new Among("vela", 0, -1),
97 new Among("le", -1, -1), new Among("cele", 6, -1),
98 new Among("gliele", 6, -1), new Among("mele", 6, -1),
99 new Among("tele", 6, -1), new Among("vele", 6, -1),
100 new Among("ne", -1, -1), new Among("cene", 12, -1),
101 new Among("gliene", 12, -1), new Among("mene", 12, -1),
102 new Among("sene", 12, -1), new Among("tene", 12, -1),
103 new Among("vene", 12, -1), new Among("ci", -1, -1),
104 new Among("li", -1, -1), new Among("celi", 20, -1),
105 new Among("glieli", 20, -1), new Among("meli", 20, -1),
106 new Among("teli", 20, -1), new Among("veli", 20, -1),
107 new Among("gli", 20, -1), new Among("mi", -1, -1),
108 new Among("si", -1, -1), new Among("ti", -1, -1),
109 new Among("vi", -1, -1), new Among("lo", -1, -1),
110 new Among("celo", 31, -1), new Among("glielo", 31, -1),
111 new Among("melo", 31, -1), new Among("telo", 31, -1),
112 new Among("velo", 31, -1)
113 ],
114 a_3 = [new Among("ando", -1, 1),
115 new Among("endo", -1, 1), new Among("ar", -1, 2),
116 new Among("er", -1, 2), new Among("ir", -1, 2)
117 ],
118 a_4 = [
119 new Among("ic", -1, -1), new Among("abil", -1, -1),
120 new Among("os", -1, -1), new Among("iv", -1, 1)
121 ],
122 a_5 = [
123 new Among("ic", -1, 1), new Among("abil", -1, 1),
124 new Among("iv", -1, 1)
125 ],
126 a_6 = [new Among("ica", -1, 1),
127 new Among("logia", -1, 3), new Among("osa", -1, 1),
128 new Among("ista", -1, 1), new Among("iva", -1, 9),
129 new Among("anza", -1, 1), new Among("enza", -1, 5),
130 new Among("ice", -1, 1), new Among("atrice", 7, 1),
131 new Among("iche", -1, 1), new Among("logie", -1, 3),
132 new Among("abile", -1, 1), new Among("ibile", -1, 1),
133 new Among("usione", -1, 4), new Among("azione", -1, 2),
134 new Among("uzione", -1, 4), new Among("atore", -1, 2),
135 new Among("ose", -1, 1), new Among("ante", -1, 1),
136 new Among("mente", -1, 1), new Among("amente", 19, 7),
137 new Among("iste", -1, 1), new Among("ive", -1, 9),
138 new Among("anze", -1, 1), new Among("enze", -1, 5),
139 new Among("ici", -1, 1), new Among("atrici", 25, 1),
140 new Among("ichi", -1, 1), new Among("abili", -1, 1),
141 new Among("ibili", -1, 1), new Among("ismi", -1, 1),
142 new Among("usioni", -1, 4), new Among("azioni", -1, 2),
143 new Among("uzioni", -1, 4), new Among("atori", -1, 2),
144 new Among("osi", -1, 1), new Among("anti", -1, 1),
145 new Among("amenti", -1, 6), new Among("imenti", -1, 6),
146 new Among("isti", -1, 1), new Among("ivi", -1, 9),
147 new Among("ico", -1, 1), new Among("ismo", -1, 1),
148 new Among("oso", -1, 1), new Among("amento", -1, 6),
149 new Among("imento", -1, 6), new Among("ivo", -1, 9),
150 new Among("it\u00E0", -1, 8), new Among("ist\u00E0", -1, 1),
151 new Among("ist\u00E8", -1, 1), new Among("ist\u00EC", -1, 1)
152 ],
153 a_7 = [
154 new Among("isca", -1, 1), new Among("enda", -1, 1),
155 new Among("ata", -1, 1), new Among("ita", -1, 1),
156 new Among("uta", -1, 1), new Among("ava", -1, 1),
157 new Among("eva", -1, 1), new Among("iva", -1, 1),
158 new Among("erebbe", -1, 1), new Among("irebbe", -1, 1),
159 new Among("isce", -1, 1), new Among("ende", -1, 1),
160 new Among("are", -1, 1), new Among("ere", -1, 1),
161 new Among("ire", -1, 1), new Among("asse", -1, 1),
162 new Among("ate", -1, 1), new Among("avate", 16, 1),
163 new Among("evate", 16, 1), new Among("ivate", 16, 1),
164 new Among("ete", -1, 1), new Among("erete", 20, 1),
165 new Among("irete", 20, 1), new Among("ite", -1, 1),
166 new Among("ereste", -1, 1), new Among("ireste", -1, 1),
167 new Among("ute", -1, 1), new Among("erai", -1, 1),
168 new Among("irai", -1, 1), new Among("isci", -1, 1),
169 new Among("endi", -1, 1), new Among("erei", -1, 1),
170 new Among("irei", -1, 1), new Among("assi", -1, 1),
171 new Among("ati", -1, 1), new Among("iti", -1, 1),
172 new Among("eresti", -1, 1), new Among("iresti", -1, 1),
173 new Among("uti", -1, 1), new Among("avi", -1, 1),
174 new Among("evi", -1, 1), new Among("ivi", -1, 1),
175 new Among("isco", -1, 1), new Among("ando", -1, 1),
176 new Among("endo", -1, 1), new Among("Yamo", -1, 1),
177 new Among("iamo", -1, 1), new Among("avamo", -1, 1),
178 new Among("evamo", -1, 1), new Among("ivamo", -1, 1),
179 new Among("eremo", -1, 1), new Among("iremo", -1, 1),
180 new Among("assimo", -1, 1), new Among("ammo", -1, 1),
181 new Among("emmo", -1, 1), new Among("eremmo", 54, 1),
182 new Among("iremmo", 54, 1), new Among("immo", -1, 1),
183 new Among("ano", -1, 1), new Among("iscano", 58, 1),
184 new Among("avano", 58, 1), new Among("evano", 58, 1),
185 new Among("ivano", 58, 1), new Among("eranno", -1, 1),
186 new Among("iranno", -1, 1), new Among("ono", -1, 1),
187 new Among("iscono", 65, 1), new Among("arono", 65, 1),
188 new Among("erono", 65, 1), new Among("irono", 65, 1),
189 new Among("erebbero", -1, 1), new Among("irebbero", -1, 1),
190 new Among("assero", -1, 1), new Among("essero", -1, 1),
191 new Among("issero", -1, 1), new Among("ato", -1, 1),
192 new Among("ito", -1, 1), new Among("uto", -1, 1),
193 new Among("avo", -1, 1), new Among("evo", -1, 1),
194 new Among("ivo", -1, 1), new Among("ar", -1, 1),
195 new Among("ir", -1, 1), new Among("er\u00E0", -1, 1),
196 new Among("ir\u00E0", -1, 1), new Among("er\u00F2", -1, 1),
197 new Among("ir\u00F2", -1, 1)
198 ],
199 g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0,
200 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1
201 ],
202 g_AEIO = [17, 65, 0, 0, 0, 0,
203 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2
204 ],
205 g_CG = [17],
206 I_p2, I_p1, I_pV, sbp = new SnowballProgram();
207 this.setCurrent = function(word) {
208 sbp.setCurrent(word);
209 };
210 this.getCurrent = function() {
211 return sbp.getCurrent();
212 };
213
214 function habr1(c1, c2, v_1) {
215 if (sbp.eq_s(1, c1)) {
216 sbp.ket = sbp.cursor;
217 if (sbp.in_grouping(g_v, 97, 249)) {
218 sbp.slice_from(c2);
219 sbp.cursor = v_1;
220 return true;
221 }
222 }
223 return false;
224 }
225
226 function r_prelude() {
227 var among_var, v_1 = sbp.cursor,
228 v_2, v_3, v_4;
229 while (true) {
230 sbp.bra = sbp.cursor;
231 among_var = sbp.find_among(a_0, 7);
232 if (among_var) {
233 sbp.ket = sbp.cursor;
234 switch (among_var) {
235 case 1:
236 sbp.slice_from("\u00E0");
237 continue;
238 case 2:
239 sbp.slice_from("\u00E8");
240 continue;
241 case 3:
242 sbp.slice_from("\u00EC");
243 continue;
244 case 4:
245 sbp.slice_from("\u00F2");
246 continue;
247 case 5:
248 sbp.slice_from("\u00F9");
249 continue;
250 case 6:
251 sbp.slice_from("qU");
252 continue;
253 case 7:
254 if (sbp.cursor >= sbp.limit)
255 break;
256 sbp.cursor++;
257 continue;
258 }
259 }
260 break;
261 }
262 sbp.cursor = v_1;
263 while (true) {
264 v_2 = sbp.cursor;
265 while (true) {
266 v_3 = sbp.cursor;
267 if (sbp.in_grouping(g_v, 97, 249)) {
268 sbp.bra = sbp.cursor;
269 v_4 = sbp.cursor;
270 if (habr1("u", "U", v_3))
271 break;
272 sbp.cursor = v_4;
273 if (habr1("i", "I", v_3))
274 break;
275 }
276 sbp.cursor = v_3;
277 if (sbp.cursor >= sbp.limit) {
278 sbp.cursor = v_2;
279 return;
280 }
281 sbp.cursor++;
282 }
283 }
284 }
285
286 function habr2(v_1) {
287 sbp.cursor = v_1;
288 if (!sbp.in_grouping(g_v, 97, 249))
289 return false;
290 while (!sbp.out_grouping(g_v, 97, 249)) {
291 if (sbp.cursor >= sbp.limit)
292 return false;
293 sbp.cursor++;
294 }
295 return true;
296 }
297
298 function habr3() {
299 if (sbp.in_grouping(g_v, 97, 249)) {
300 var v_1 = sbp.cursor;
301 if (sbp.out_grouping(g_v, 97, 249)) {
302 while (!sbp.in_grouping(g_v, 97, 249)) {
303 if (sbp.cursor >= sbp.limit)
304 return habr2(v_1);
305 sbp.cursor++;
306 }
307 return true;
308 }
309 return habr2(v_1);
310 }
311 return false;
312 }
313
314 function habr4() {
315 var v_1 = sbp.cursor,
316 v_2;
317 if (!habr3()) {
318 sbp.cursor = v_1;
319 if (!sbp.out_grouping(g_v, 97, 249))
320 return;
321 v_2 = sbp.cursor;
322 if (sbp.out_grouping(g_v, 97, 249)) {
323 while (!sbp.in_grouping(g_v, 97, 249)) {
324 if (sbp.cursor >= sbp.limit) {
325 sbp.cursor = v_2;
326 if (sbp.in_grouping(g_v, 97, 249) &&
327 sbp.cursor < sbp.limit)
328 sbp.cursor++;
329 return;
330 }
331 sbp.cursor++;
332 }
333 I_pV = sbp.cursor;
334 return;
335 }
336 sbp.cursor = v_2;
337 if (!sbp.in_grouping(g_v, 97, 249) || sbp.cursor >= sbp.limit)
338 return;
339 sbp.cursor++;
340 }
341 I_pV = sbp.cursor;
342 }
343
344 function habr5() {
345 while (!sbp.in_grouping(g_v, 97, 249)) {
346 if (sbp.cursor >= sbp.limit)
347 return false;
348 sbp.cursor++;
349 }
350 while (!sbp.out_grouping(g_v, 97, 249)) {
351 if (sbp.cursor >= sbp.limit)
352 return false;
353 sbp.cursor++;
354 }
355 return true;
356 }
357
358 function r_mark_regions() {
359 var v_1 = sbp.cursor;
360 I_pV = sbp.limit;
361 I_p1 = I_pV;
362 I_p2 = I_pV;
363 habr4();
364 sbp.cursor = v_1;
365 if (habr5()) {
366 I_p1 = sbp.cursor;
367 if (habr5())
368 I_p2 = sbp.cursor;
369 }
370 }
371
372 function r_postlude() {
373 var among_var;
374 while (true) {
375 sbp.bra = sbp.cursor;
376 among_var = sbp.find_among(a_1, 3);
377 if (!among_var)
378 break;
379 sbp.ket = sbp.cursor;
380 switch (among_var) {
381 case 1:
382 sbp.slice_from("i");
383 break;
384 case 2:
385 sbp.slice_from("u");
386 break;
387 case 3:
388 if (sbp.cursor >= sbp.limit)
389 return;
390 sbp.cursor++;
391 break;
392 }
393 }
394 }
395
396 function r_RV() {
397 return I_pV <= sbp.cursor;
398 }
399
400 function r_R1() {
401 return I_p1 <= sbp.cursor;
402 }
403
404 function r_R2() {
405 return I_p2 <= sbp.cursor;
406 }
407
408 function r_attached_pronoun() {
409 var among_var;
410 sbp.ket = sbp.cursor;
411 if (sbp.find_among_b(a_2, 37)) {
412 sbp.bra = sbp.cursor;
413 among_var = sbp.find_among_b(a_3, 5);
414 if (among_var && r_RV()) {
415 switch (among_var) {
416 case 1:
417 sbp.slice_del();
418 break;
419 case 2:
420 sbp.slice_from("e");
421 break;
422 }
423 }
424 }
425 }
426
427 function r_standard_suffix() {
428 var among_var;
429 sbp.ket = sbp.cursor;
430 among_var = sbp.find_among_b(a_6, 51);
431 if (!among_var)
432 return false;
433 sbp.bra = sbp.cursor;
434 switch (among_var) {
435 case 1:
436 if (!r_R2())
437 return false;
438 sbp.slice_del();
439 break;
440 case 2:
441 if (!r_R2())
442 return false;
443 sbp.slice_del();
444 sbp.ket = sbp.cursor;
445 if (sbp.eq_s_b(2, "ic")) {
446 sbp.bra = sbp.cursor;
447 if (r_R2())
448 sbp.slice_del();
449 }
450 break;
451 case 3:
452 if (!r_R2())
453 return false;
454 sbp.slice_from("log");
455 break;
456 case 4:
457 if (!r_R2())
458 return false;
459 sbp.slice_from("u");
460 break;
461 case 5:
462 if (!r_R2())
463 return false;
464 sbp.slice_from("ente");
465 break;
466 case 6:
467 if (!r_RV())
468 return false;
469 sbp.slice_del();
470 break;
471 case 7:
472 if (!r_R1())
473 return false;
474 sbp.slice_del();
475 sbp.ket = sbp.cursor;
476 among_var = sbp.find_among_b(a_4, 4);
477 if (among_var) {
478 sbp.bra = sbp.cursor;
479 if (r_R2()) {
480 sbp.slice_del();
481 if (among_var == 1) {
482 sbp.ket = sbp.cursor;
483 if (sbp.eq_s_b(2, "at")) {
484 sbp.bra = sbp.cursor;
485 if (r_R2())
486 sbp.slice_del();
487 }
488 }
489 }
490 }
491 break;
492 case 8:
493 if (!r_R2())
494 return false;
495 sbp.slice_del();
496 sbp.ket = sbp.cursor;
497 among_var = sbp.find_among_b(a_5, 3);
498 if (among_var) {
499 sbp.bra = sbp.cursor;
500 if (among_var == 1)
501 if (r_R2())
502 sbp.slice_del();
503 }
504 break;
505 case 9:
506 if (!r_R2())
507 return false;
508 sbp.slice_del();
509 sbp.ket = sbp.cursor;
510 if (sbp.eq_s_b(2, "at")) {
511 sbp.bra = sbp.cursor;
512 if (r_R2()) {
513 sbp.slice_del();
514 sbp.ket = sbp.cursor;
515 if (sbp.eq_s_b(2, "ic")) {
516 sbp.bra = sbp.cursor;
517 if (r_R2())
518 sbp.slice_del();
519 }
520 }
521 }
522 break;
523 }
524 return true;
525 }
526
527 function r_verb_suffix() {
528 var among_var, v_1;
529 if (sbp.cursor >= I_pV) {
530 v_1 = sbp.limit_backward;
531 sbp.limit_backward = I_pV;
532 sbp.ket = sbp.cursor;
533 among_var = sbp.find_among_b(a_7, 87);
534 if (among_var) {
535 sbp.bra = sbp.cursor;
536 if (among_var == 1)
537 sbp.slice_del();
538 }
539 sbp.limit_backward = v_1;
540 }
541 }
542
543 function habr6() {
544 var v_1 = sbp.limit - sbp.cursor;
545 sbp.ket = sbp.cursor;
546 if (sbp.in_grouping_b(g_AEIO, 97, 242)) {
547 sbp.bra = sbp.cursor;
548 if (r_RV()) {
549 sbp.slice_del();
550 sbp.ket = sbp.cursor;
551 if (sbp.eq_s_b(1, "i")) {
552 sbp.bra = sbp.cursor;
553 if (r_RV()) {
554 sbp.slice_del();
555 return;
556 }
557 }
558 }
559 }
560 sbp.cursor = sbp.limit - v_1;
561 }
562
563 function r_vowel_suffix() {
564 habr6();
565 sbp.ket = sbp.cursor;
566 if (sbp.eq_s_b(1, "h")) {
567 sbp.bra = sbp.cursor;
568 if (sbp.in_grouping_b(g_CG, 99, 103))
569 if (r_RV())
570 sbp.slice_del();
571 }
572 }
573 this.stem = function() {
574 var v_1 = sbp.cursor;
575 r_prelude();
576 sbp.cursor = v_1;
577 r_mark_regions();
578 sbp.limit_backward = v_1;
579 sbp.cursor = sbp.limit;
580 r_attached_pronoun();
581 sbp.cursor = sbp.limit;
582 if (!r_standard_suffix()) {
583 sbp.cursor = sbp.limit;
584 r_verb_suffix();
585 }
586 sbp.cursor = sbp.limit;
587 r_vowel_suffix();
588 sbp.cursor = sbp.limit_backward;
589 r_postlude();
590 return true;
591 }
592 };
593
594 /* and return a function that stems a word for the current locale */
595 return function(token) {
596 // for lunr version 2
597 if (typeof token.update === "function") {
598 return token.update(function(word) {
599 st.setCurrent(word);
600 st.stem();
601 return st.getCurrent();
602 })
603 } else { // for lunr version <= 1
604 st.setCurrent(token);
605 st.stem();
606 return st.getCurrent();
607 }
608 }
609 })();
610
611 lunr.Pipeline.registerFunction(lunr.it.stemmer, 'stemmer-it');
612
613 lunr.it.stopWordFilter = lunr.generateStopWordFilter('a abbia abbiamo abbiano abbiate ad agl agli ai al all alla alle allo anche avemmo avendo avesse avessero avessi avessimo aveste avesti avete aveva avevamo avevano avevate avevi avevo avrai avranno avrebbe avrebbero avrei avremmo avremo avreste avresti avrete avrà avrò avuta avute avuti avuto c che chi ci coi col come con contro cui da dagl dagli dai dal dall dalla dalle dallo degl degli dei del dell della delle dello di dov dove e ebbe ebbero ebbi ed era erano eravamo eravate eri ero essendo faccia facciamo facciano facciate faccio facemmo facendo facesse facessero facessi facessimo faceste facesti faceva facevamo facevano facevate facevi facevo fai fanno farai faranno farebbe farebbero farei faremmo faremo fareste faresti farete farà farò fece fecero feci fosse fossero fossi fossimo foste fosti fu fui fummo furono gli ha hai hanno ho i il in io l la le lei li lo loro lui ma mi mia mie miei mio ne negl negli nei nel nell nella nelle nello noi non nostra nostre nostri nostro o per perché più quale quanta quante quanti quanto quella quelle quelli quello questa queste questi questo sarai saranno sarebbe sarebbero sarei saremmo saremo sareste saresti sarete sarà sarò se sei si sia siamo siano siate siete sono sta stai stando stanno starai staranno starebbe starebbero starei staremmo staremo stareste staresti starete starà starò stava stavamo stavano stavate stavi stavo stemmo stesse stessero stessi stessimo steste stesti stette stettero stetti stia stiamo stiano stiate sto su sua sue sugl sugli sui sul sull sulla sulle sullo suo suoi ti tra tu tua tue tuo tuoi tutti tutto un una uno vi voi vostra vostre vostri vostro è'.split(' '));
614
615 lunr.Pipeline.registerFunction(lunr.it.stopWordFilter, 'stopWordFilter-it');
616 };
617 }))