datat.fi/assets/javascripts/lunr/lunr.ro.min.js

18 lines
11 KiB
JavaScript
Raw Normal View History

/*!
* Lunr languages, `Romanian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if("undefined"==typeof e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){W.eq_s(1,e)&&(W.ket=W.cursor,W.in_grouping(y,97,259)&&W.slice_from(i))}function n(){for(var i,r;;){if(i=W.cursor,W.in_grouping(y,97,259)&&(r=W.cursor,W.bra=r,e("u","U"),W.cursor=r,e("i","I")),W.cursor=i,W.cursor>=W.limit)break;W.cursor++}}function t(){if(W.out_grouping(y,97,259)){for(;!W.in_grouping(y,97,259);){if(W.cursor>=W.limit)return!0;W.cursor++}return!1}return!0}function a(){if(W.in_grouping(y,97,259))for(;!W.out_grouping(y,97,259);){if(W.cursor>=W.limit)return!0;W.cursor++}return!1}function o(){var e,i,r=W.cursor;if(W.in_grouping(y,97,259)){if(e=W.cursor,!t())return void(h=W.cursor);if(W.cursor=e,!a())return void(h=W.cursor)}W.cursor=r,W.out_grouping(y,97,259)&&(i=W.cursor,t()&&(W.cursor=i,W.in_grouping(y,97,259)&&W.cursor<W.limit&&W.cursor++),h=W.cursor)}function u(){for(;!W.in_grouping(y,97,259);){if(W.cursor>=W.limit)return!1;W.cursor++}for(;!W.out_grouping(y,97,259);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function c(){var e=W.cursor;h=W.limit,k=h,g=h,o(),W.cursor=e,u()&&(k=W.cursor,u()&&(g=W.cursor))}function s(){for(var e;;){if(W.bra=W.cursor,e=W.find_among(z,3))switch(W.ket=W.cursor,e){case 1:W.slice_from("i");continue;case 2:W.slice_from("u");continue;case 3:if(W.cursor>=W.limit)break;W.cursor++;continue}break}}function w(){return h<=W.cursor}function m(){return k<=W.cursor}function l(){return g<=W.cursor}function f(){var e,i;if(W.ket=W.cursor,e=W.find_among_b(C,16),e&&(W.bra=W.cursor,m()))switch(e){case 1:W.slice_del();break;case 2:W.slice_from("a");break;case 3:W.slice_from("e");break;case 4:W.slice_from("i");break;case 5:i=W.limit-W.cursor,W.eq_s_b(2,"ab")||(W.cursor=W.limit-i,W.slice_from("i"));break;case 6:W.slice_from("at");break;case 7:W.slice_from("aţi")}}function p(){var e,i=W.limit-W.cursor;if(W.ket=W.cursor,e=W.find_among_b(P,46),e&&(W.bra=W.cursor,m())){switch(e){case 1:W.slice_from("abil");break;case 2:W.slice_from("ibil");break;case 3:W.slice_from("iv");break;case 4:W.slice_from("ic");break;case 5:W.slice_from("at");break;case 6:W.slice_from("it")}return _=!0,W.cursor=W.limit-i,!0}return!1}function d(){var e,i;for(_=!1;;)if(i=W.limit-W.cursor,!p()){W.cursor=W.limit-i;break}if(W.ket=W.cursor,e=W.find_among_b(F,62),e&&(W.bra=W.cursor,l())){switch(e){case 1:W.slice_del();break;case 2:W.eq_s_b(1,"ţ")&&(W.bra=W.cursor,W.slice_from("t"));break;case 3:W.slice_from("ist")}_=!0}}function b(){var e,i,r;if(W.cursor>=h){if(i=W.limit_backward,W.limit_backward=h,W.ket=W.cursor,e=W.find_among_b(q,94))switch(W.bra=W.cursor,e){case 1:if(r=W.limit-W.cursor,!W.out_grouping_b(y,97,259)&&(W.cursor=W.limit-r,!W.eq_s_b(1,"u")))break;case 2:W.slice_del()}W.limit_backward=i}}function v(){var e;W.ket=W.cursor,e=W.find_among_b(S,5),e&&(W.bra=W.cursor,w()&&1==e&&W.slice_del())}var _,g,k,h,z=[new i("",-1,3),new i("I",0,1),new i("U",0,2)],C=[new i("ea",-1,3),new i("aţia",-1,7),new i("aua",-1,2),new i("iua",-1,4),new i("aţie",-1,7),new i("ele",-1,3),new i("ile",-1,5),new i("iile",6,4),new i("iei",-1,4),new i("atei",-1,6),new i("ii",-1,4),new i("ului",-1,1),new i