Debian Codegraph @

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

raw
1 /*!
2 * Lunr languages, `Hungarian` 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.hu = function() {
57 this.pipeline.reset();
58 this.pipeline.add(
59 lunr.hu.trimmer,
60 lunr.hu.stopWordFilter,
61 lunr.hu.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.hu.stemmer)
70 }
71 };
72
73 /* lunr trimmer function */
74 lunr.hu.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.hu.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.hu.wordCharacters);
76
77 lunr.Pipeline.registerFunction(lunr.hu.trimmer, 'trimmer-hu');
78
79 /* lunr stemmer function */
80 lunr.hu.stemmer = (function() {
81 /* create the wrapped stemmer object */
82 var Among = lunr.stemmerSupport.Among,
83 SnowballProgram = lunr.stemmerSupport.SnowballProgram,
84 st = new function HungarianStemmer() {
85 var a_0 = [new Among("cs", -1, -1), new Among("dzs", -1, -1),
86 new Among("gy", -1, -1), new Among("ly", -1, -1),
87 new Among("ny", -1, -1), new Among("sz", -1, -1),
88 new Among("ty", -1, -1), new Among("zs", -1, -1)
89 ],
90 a_1 = [
91 new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2)
92 ],
93 a_2 = [
94 new Among("bb", -1, -1), new Among("cc", -1, -1),
95 new Among("dd", -1, -1), new Among("ff", -1, -1),
96 new Among("gg", -1, -1), new Among("jj", -1, -1),
97 new Among("kk", -1, -1), new Among("ll", -1, -1),
98 new Among("mm", -1, -1), new Among("nn", -1, -1),
99 new Among("pp", -1, -1), new Among("rr", -1, -1),
100 new Among("ccs", -1, -1), new Among("ss", -1, -1),
101 new Among("zzs", -1, -1), new Among("tt", -1, -1),
102 new Among("vv", -1, -1), new Among("ggy", -1, -1),
103 new Among("lly", -1, -1), new Among("nny", -1, -1),
104 new Among("tty", -1, -1), new Among("ssz", -1, -1),
105 new Among("zz", -1, -1)
106 ],
107 a_3 = [new Among("al", -1, 1),
108 new Among("el", -1, 2)
109 ],
110 a_4 = [new Among("ba", -1, -1),
111 new Among("ra", -1, -1), new Among("be", -1, -1),
112 new Among("re", -1, -1), new Among("ig", -1, -1),
113 new Among("nak", -1, -1), new Among("nek", -1, -1),
114 new Among("val", -1, -1), new Among("vel", -1, -1),
115 new Among("ul", -1, -1), new Among("n\u00E1l", -1, -1),
116 new Among("n\u00E9l", -1, -1), new Among("b\u00F3l", -1, -1),
117 new Among("r\u00F3l", -1, -1), new Among("t\u00F3l", -1, -1),
118 new Among("b\u00F5l", -1, -1), new Among("r\u00F5l", -1, -1),
119 new Among("t\u00F5l", -1, -1), new Among("\u00FCl", -1, -1),
120 new Among("n", -1, -1), new Among("an", 19, -1),
121 new Among("ban", 20, -1), new Among("en", 19, -1),
122 new Among("ben", 22, -1), new Among("k\u00E9ppen", 22, -1),
123 new Among("on", 19, -1), new Among("\u00F6n", 19, -1),
124 new Among("k\u00E9pp", -1, -1), new Among("kor", -1, -1),
125 new Among("t", -1, -1), new Among("at", 29, -1),
126 new Among("et", 29, -1), new Among("k\u00E9nt", 29, -1),
127 new Among("ank\u00E9nt", 32, -1), new Among("enk\u00E9nt", 32, -1),
128 new Among("onk\u00E9nt", 32, -1), new Among("ot", 29, -1),
129 new Among("\u00E9rt", 29, -1), new Among("\u00F6t", 29, -1),
130 new Among("hez", -1, -1), new Among("hoz", -1, -1),
131 new Among("h\u00F6z", -1, -1), new Among("v\u00E1", -1, -1),
132 new Among("v\u00E9", -1, -1)
133 ],
134 a_5 = [new Among("\u00E1n", -1, 2),
135 new Among("\u00E9n", -1, 1), new Among("\u00E1nk\u00E9nt", -1, 3)
136 ],
137 a_6 = [
138 new Among("stul", -1, 2), new Among("astul", 0, 1),
139 new Among("\u00E1stul", 0, 3), new Among("st\u00FCl", -1, 2),
140 new Among("est\u00FCl", 3, 1), new Among("\u00E9st\u00FCl", 3, 4)
141 ],
142 a_7 = [
143 new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2)
144 ],
145 a_8 = [
146 new Among("k", -1, 7), new Among("ak", 0, 4),
147 new Among("ek", 0, 6), new Among("ok", 0, 5),
148 new Among("\u00E1k", 0, 1), new Among("\u00E9k", 0, 2),
149 new Among("\u00F6k", 0, 3)
150 ],
151 a_9 = [new Among("\u00E9i", -1, 7),
152 new Among("\u00E1\u00E9i", 0, 6), new Among("\u00E9\u00E9i", 0, 5),
153 new Among("\u00E9", -1, 9), new Among("k\u00E9", 3, 4),
154 new Among("ak\u00E9", 4, 1), new Among("ek\u00E9", 4, 1),
155 new Among("ok\u00E9", 4, 1), new Among("\u00E1k\u00E9", 4, 3),
156 new Among("\u00E9k\u00E9", 4, 2), new Among("\u00F6k\u00E9", 4, 1),
157 new Among("\u00E9\u00E9", 3, 8)
158 ],
159 a_10 = [new Among("a", -1, 18),
160 new Among("ja", 0, 17), new Among("d", -1, 16),
161 new Among("ad", 2, 13), new Among("ed", 2, 13),
162 new Among("od", 2, 13), new Among("\u00E1d", 2, 14),
163 new Among("\u00E9d", 2, 15), new Among("\u00F6d", 2, 13),
164 new Among("e", -1, 18), new Among("je", 9, 17),
165 new Among("nk", -1, 4), new Among("unk", 11, 1),
166 new Among("\u00E1nk", 11, 2), new Among("\u00E9nk", 11, 3),
167 new Among("\u00FCnk", 11, 1), new Among("uk", -1, 8),
168 new Among("juk", 16, 7), new Among("\u00E1juk", 17, 5),
169 new Among("\u00FCk", -1, 8), new Among("j\u00FCk", 19, 7),
170 new Among("\u00E9j\u00FCk", 20, 6), new Among("m", -1, 12),
171 new Among("am", 22, 9), new Among("em", 22, 9),
172 new Among("om", 22, 9), new Among("\u00E1m", 22, 10),
173 new Among("\u00E9m", 22, 11), new Among("o", -1, 18),
174 new Among("\u00E1", -1, 19), new Among("\u00E9", -1, 20)
175 ],
176 a_11 = [
177 new Among("id", -1, 10), new Among("aid", 0, 9),
178 new Among("jaid", 1, 6), new Among("eid", 0, 9),
179 new Among("jeid", 3, 6), new Among("\u00E1id", 0, 7),
180 new Among("\u00E9id", 0, 8), new Among("i", -1, 15),
181 new Among("ai", 7, 14), new Among("jai", 8, 11),
182 new Among("ei", 7, 14), new Among("jei", 10, 11),
183 new Among("\u00E1i", 7, 12), new Among("\u00E9i", 7, 13),
184 new Among("itek", -1, 24), new Among("eitek", 14, 21),
185 new Among("jeitek", 15, 20), new Among("\u00E9itek", 14, 23),
186 new Among("ik", -1, 29), new Among("aik", 18, 26),
187 new Among("jaik", 19, 25), new Among("eik", 18, 26),
188 new Among("jeik", 21, 25), new Among("\u00E1ik", 18, 27),
189 new Among("\u00E9ik", 18, 28), new Among("ink", -1, 20),
190 new Among("aink", 25, 17), new Among("jaink", 26, 16),
191 new Among("eink", 25, 17), new Among("jeink", 28, 16),
192 new Among("\u00E1ink", 25, 18), new Among("\u00E9ink", 25, 19),
193 new Among("aitok", -1, 21), new Among("jaitok", 32, 20),
194 new Among("\u00E1itok", -1, 22), new Among("im", -1, 5),
195 new Among("aim", 35, 4), new Among("jaim", 36, 1),
196 new Among("eim", 35, 4), new Among("jeim", 38, 1),
197 new Among("\u00E1im", 35, 2), new Among("\u00E9im", 35, 3)
198 ],
199 g_v = [
200 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 52, 14
201 ],
202 I_p1, sbp = new SnowballProgram();
203 this.setCurrent = function(word) {
204 sbp.setCurrent(word);
205 };
206 this.getCurrent = function() {
207 return sbp.getCurrent();
208 };
209
210 function r_mark_regions() {
211 var v_1 = sbp.cursor,
212 v_2;
213 I_p1 = sbp.limit;
214 if (sbp.in_grouping(g_v, 97, 252)) {
215 while (true) {
216 v_2 = sbp.cursor;
217 if (sbp.out_grouping(g_v, 97, 252)) {
218 sbp.cursor = v_2;
219 if (!sbp.find_among(a_0, 8)) {
220 sbp.cursor = v_2;
221 if (v_2 < sbp.limit)
222 sbp.cursor++;
223 }
224 I_p1 = sbp.cursor;
225 return;
226 }
227 sbp.cursor = v_2;
228 if (v_2 >= sbp.limit) {
229 I_p1 = v_2;
230 return;
231 }
232 sbp.cursor++;
233 }
234 }
235 sbp.cursor = v_1;
236 if (sbp.out_grouping(g_v, 97, 252)) {
237 while (!sbp.in_grouping(g_v, 97, 252)) {
238 if (sbp.cursor >= sbp.limit)
239 return;
240 sbp.cursor++;
241 }
242 I_p1 = sbp.cursor;
243 }
244 }
245
246 function r_R1() {
247 return I_p1 <= sbp.cursor;
248 }
249
250 function r_v_ending() {
251 var among_var;
252 sbp.ket = sbp.cursor;
253 among_var = sbp.find_among_b(a_1, 2);
254 if (among_var) {
255 sbp.bra = sbp.cursor;
256 if (r_R1()) {
257 switch (among_var) {
258 case 1:
259 sbp.slice_from("a");
260 break;
261 case 2:
262 sbp.slice_from("e");
263 break;
264 }
265 }
266 }
267 }
268
269 function r_double() {
270 var v_1 = sbp.limit - sbp.cursor;
271 if (!sbp.find_among_b(a_2, 23))
272 return false;
273 sbp.cursor = sbp.limit - v_1;
274 return true;
275 }
276
277 function r_undouble() {
278 if (sbp.cursor > sbp.limit_backward) {
279 sbp.cursor--;
280 sbp.ket = sbp.cursor;
281 var c = sbp.cursor - 1;
282 if (sbp.limit_backward <= c && c <= sbp.limit) {
283 sbp.cursor = c;
284 sbp.bra = c;
285 sbp.slice_del();
286 }
287 }
288 }
289
290 function r_instrum() {
291 var among_var;
292 sbp.ket = sbp.cursor;
293 among_var = sbp.find_among_b(a_3, 2);
294 if (among_var) {
295 sbp.bra = sbp.cursor;
296 if (r_R1()) {
297 if (among_var == 1 || among_var == 2)
298 if (!r_double())
299 return;
300 sbp.slice_del();
301 r_undouble();
302 }
303 }
304 }
305
306 function r_case() {
307 sbp.ket = sbp.cursor;
308 if (sbp.find_among_b(a_4, 44)) {
309 sbp.bra = sbp.cursor;
310 if (r_R1()) {
311 sbp.slice_del();
312 r_v_ending();
313 }
314 }
315 }
316
317 function r_case_special() {
318 var among_var;
319 sbp.ket = sbp.cursor;
320 among_var = sbp.find_among_b(a_5, 3);
321 if (among_var) {
322 sbp.bra = sbp.cursor;
323 if (r_R1()) {
324 switch (among_var) {
325 case 1:
326 sbp.slice_from("e");
327 break;
328 case 2:
329 case 3:
330 sbp.slice_from("a");
331 break;
332 }
333 }
334 }
335 }
336
337 function r_case_other() {
338 var among_var;
339 sbp.ket = sbp.cursor;
340 among_var = sbp.find_among_b(a_6, 6);
341 if (among_var) {
342 sbp.bra = sbp.cursor;
343 if (r_R1()) {
344 switch (among_var) {
345 case 1:
346 case 2:
347 sbp.slice_del();
348 break;
349 case 3:
350 sbp.slice_from("a");
351 break;
352 case 4:
353 sbp.slice_from("e");
354 break;
355 }
356 }
357 }
358 }
359
360 function r_factive() {
361 var among_var;
362 sbp.ket = sbp.cursor;
363 among_var = sbp.find_among_b(a_7, 2);
364 if (among_var) {
365 sbp.bra = sbp.cursor;
366 if (r_R1()) {
367 if (among_var == 1 || among_var == 2)
368 if (!r_double())
369 return;
370 sbp.slice_del();
371 r_undouble()
372 }
373 }
374 }
375
376 function r_plural() {
377 var among_var;
378 sbp.ket = sbp.cursor;
379 among_var = sbp.find_among_b(a_8, 7);
380 if (among_var) {
381 sbp.bra = sbp.cursor;
382 if (r_R1()) {
383 switch (among_var) {
384 case 1:
385 sbp.slice_from("a");
386 break;
387 case 2:
388 sbp.slice_from("e");
389 break;
390 case 3:
391 case 4:
392 case 5:
393 case 6:
394 case 7:
395 sbp.slice_del();
396 break;
397 }
398 }
399 }
400 }
401
402 function r_owned() {
403 var among_var;
404 sbp.ket = sbp.cursor;
405 among_var = sbp.find_among_b(a_9, 12);
406 if (among_var) {
407 sbp.bra = sbp.cursor;
408 if (r_R1()) {
409 switch (among_var) {
410 case 1:
411 case 4:
412 case 7:
413 case 9:
414 sbp.slice_del();
415 break;
416 case 2:
417 case 5:
418 case 8:
419 sbp.slice_from("e");
420 break;
421 case 3:
422 case 6:
423 sbp.slice_from("a");
424 break;
425 }
426 }
427 }
428 }
429
430 function r_sing_owner() {
431 var among_var;
432 sbp.ket = sbp.cursor;
433 among_var = sbp.find_among_b(a_10, 31);
434 if (among_var) {
435 sbp.bra = sbp.cursor;
436 if (r_R1()) {
437 switch (among_var) {
438 case 1:
439 case 4:
440 case 7:
441 case 8:
442 case 9:
443 case 12:
444 case 13:
445 case 16:
446 case 17:
447 case 18:
448 sbp.slice_del();
449 break;
450 case 2:
451 case 5:
452 case 10:
453 case 14:
454 case 19:
455 sbp.slice_from("a");
456 break;
457 case 3:
458 case 6:
459 case 11:
460 case 15:
461 case 20:
462 sbp.slice_from("e");
463 break;
464 }
465 }
466 }
467 }
468
469 function r_plur_owner() {
470 var among_var;
471 sbp.ket = sbp.cursor;
472 among_var = sbp.find_among_b(a_11, 42);
473 if (among_var) {
474 sbp.bra = sbp.cursor;
475 if (r_R1()) {
476 switch (among_var) {
477 case 1:
478 case 4:
479 case 5:
480 case 6:
481 case 9:
482 case 10:
483 case 11:
484 case 14:
485 case 15:
486 case 16:
487 case 17:
488 case 20:
489 case 21:
490 case 24:
491 case 25:
492 case 26:
493 case 29:
494 sbp.slice_del();
495 break;
496 case 2:
497 case 7:
498 case 12:
499 case 18:
500 case 22:
501 case 27:
502 sbp.slice_from("a");
503 break;
504 case 3:
505 case 8:
506 case 13:
507 case 19:
508 case 23:
509 case 28:
510 sbp.slice_from("e");
511 break;
512 }
513 }
514 }
515 }
516 this.stem = function() {
517 var v_1 = sbp.cursor;
518 r_mark_regions();
519 sbp.limit_backward = v_1;
520 sbp.cursor = sbp.limit;
521 r_instrum();
522 sbp.cursor = sbp.limit;
523 r_case();
524 sbp.cursor = sbp.limit;
525 r_case_special();
526 sbp.cursor = sbp.limit;
527 r_case_other();
528 sbp.cursor = sbp.limit;
529 r_factive();
530 sbp.cursor = sbp.limit;
531 r_owned();
532 sbp.cursor = sbp.limit;
533 r_sing_owner();
534 sbp.cursor = sbp.limit;
535 r_plur_owner();
536 sbp.cursor = sbp.limit;
537 r_plural();
538 return true;
539 }
540 };
541
542 /* and return a function that stems a word for the current locale */
543 return function(token) {
544 // for lunr version 2
545 if (typeof token.update === "function") {
546 return token.update(function(word) {
547 st.setCurrent(word);
548 st.stem();
549 return st.getCurrent();
550 })
551 } else { // for lunr version <= 1
552 st.setCurrent(token);
553 st.stem();
554 return st.getCurrent();
555 }
556 }
557 })();
558
559 lunr.Pipeline.registerFunction(lunr.hu.stemmer, 'stemmer-hu');
560
561 lunr.hu.stopWordFilter = lunr.generateStopWordFilter('a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amíg annak arra arról az azok azon azonban azt aztán azután azzal azért be belül benne bár cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyéb egész ehhez ekkor el ellen elsõ elég elõ elõször elõtt emilyen ennek erre ez ezek ezen ezt ezzel ezért fel felé hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismét ison itt jobban jó jól kell kellett keressünk keresztül ki kívül között közül legalább legyen lehet lehetett lenne lenni lesz lett maga magát majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miért most már más másik még míg nagy nagyobb nagyon ne nekem neki nem nincs néha néhány nélkül olyan ott pedig persze rá s saját sem semmi sok sokat sokkal szemben szerint szinte számára talán tehát teljes tovább továbbá több ugyanis utolsó után utána vagy vagyis vagyok valaki valami valamint való van vannak vele vissza viszont volna volt voltak voltam voltunk által általában át én éppen és így õ õk õket össze úgy új újabb újra'.split(' '));
562
563 lunr.Pipeline.registerFunction(lunr.hu.stopWordFilter, 'stopWordFilter-hu');
564 };
565 }))