diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b6b62218..0a0452589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +### Added +- Add site-wide search toggle. +- Add support for Lunr search. [#48](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/48) +- Add support for Algolia search. [#48](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/48) + ### Changed - New installation and upgrade instructions. +- Absolutely position navigation menu instead of sticking it to the top. +- Visually hide "Menu" label. +- Improve alignment of menu toggle when search is enabled. ### Fixed - Fix `border-bottom` for Gist line numbers. diff --git a/README.md b/README.md index 4b62a1a97..07408be17 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,13 @@ with a few enhancements thrown in for good measure: 3. [Text](#text) 4. [Navigation](#navigation) 5. [Pagination](#pagination) - 6. [Author](#author) - 7. [Reading Time](#reading-time) - 8. [Comments (via Disqus)](#comments-via-disqus) - 9. [Google Analytics](#google-analytics) + 6. [Search](#search) + 1. [Lunr (default)](#lunr-default) + 2. [Algolia](#algolia) + 7. [Author](#author) + 8. [Reading Time](#reading-time) + 9. [Comments (via Disqus)](#comments-via-disqus) + 10. [Google Analytics](#google-analytics) 5. [Layouts](#layouts) 1. [`layout: default`](#layout-default) 2. [`layout: post`](#layout-post) @@ -63,9 +66,6 @@ with a few enhancements thrown in for good measure: 8. [Contributing](#contributing) 1. [Pull Requests](#pull-requests) 9. [Credits](#credits) - 1. [Creator](#creator) - 2. [Icons + Demo Images:](#icons--demo-images) - 3. [Other:](#other) 10. [License](#license) ## Installation @@ -402,6 +402,67 @@ add the following front matter: paginate: true ``` +### Search + +To enable site-wide search add `search: true` to your `_config.yml`. + +#### Lunr (default) + +The default search uses [**Lunr**](https://lunrjs.com/) to build a search index of all your documents. This method is 100% compatible with sites hosted on GitHub Pages. + +**Note:** Only the first 50 words of a post or page's body content is added to the Lunr search index. Setting `search_full_content` to `true` in your `_config.yml` will override this and could impact page load performance. + +#### Algolia + +For faster and more relevant search: + +1. Add the [`jekyll-algolia`](https://github.com/algolia/jekyll-algolia) gem to your `Gemfile`, in the `:jekyll_plugins` section. + + ```ruby + group :jekyll_plugins do + gem "jekyll-feed" + gem "jekyll-seo-tag" + gem "jekyll-sitemap" + gem "jekyll-paginate" + gem "jekyll-algolia" + end + ``` + + Once this is done, download all dependencies by running `bundle install`. + +2. Switch search providers from `lunr` to `algolia` in your `_config.yml` file: + + ```yaml + search_provider: algolia + ``` + +3. Add the following Algolia credentials to your `_config.yml` file. *If you don't have an Algolia account, you can open a free [Community plan](https://www.algolia.com/users/sign_up/hacker). Once signed in, you can grab your credentials from [your dashboard](https://www.algolia.com/licensing).* + + ```yaml + algolia: + application_id: # YOUR_APPLICATION_ID + index_name: # YOUR_INDEX_NAME + search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY + powered_by: # true (default), false + ``` + +4. Once your credentials are setup, you can run the indexing with the following command: + + ``` + ALGOLIA_API_KEY=your_admin_api_key bundle exec jekyll algolia + ``` + + For Windows users you will have to use `set` to assigned the `ALGOLIA_API_KEY` environment variable. + + ``` + set ALGOLIA_API_KEY=your_admin_api_key + bundle exec jekyll algolia + ``` + + Note that `ALGOLIA_API_KEY` should be set to your admin API key. + +To use the Algolia search with GitHub Pages hosted sites follow [this deployment guide](https://community.algolia.com/jekyll-algolia/github-pages.html). Or this guide for [deploying on Netlify](https://community.algolia.com/jekyll-algolia/netlify.html). + ### Author Author information is used as meta data for post "by lines" and propagates the diff --git a/_config.yml b/_config.yml index 18da4f186..7431bef11 100644 --- a/_config.yml +++ b/_config.yml @@ -26,6 +26,14 @@ author: twitter_username: github_username: logo: # path of site logo, e.g. "/assets/images/logo.png" +search: # true, false (default) +search_full_content: false # true, false (default) +search_provider: # lunr (default), algolia +algolia: + application_id: # YOUR_APPLICATION_ID + index_name: # YOUR_INDEX_NAME + search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY + powered_by: # true (default), false # Build settings markdown: kramdown diff --git a/_data/theme.yml b/_data/theme.yml index 89242ea15..1e82c26fd 100644 --- a/_data/theme.yml +++ b/_data/theme.yml @@ -8,6 +8,9 @@ t: skip_content: "Skip to content" skip_footer: "Skip to footer" menu: "Menu" + search: "Search" + results_found: "Result(s) found" + search_placeholder_text: "Enter your search term..." home: "Home" newer: "Newer" older: "Older" diff --git a/_includes/scripts.html b/_includes/scripts.html index 85a2a216b..08bbe61f3 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -2,4 +2,15 @@ {% include google-analytics.html %} {% endif %} - \ No newline at end of file + + + +{% if site.search %} + {%- assign search_provider = site.search_provider | default: "lunr" -%} + {%- case search_provider -%} + {%- when "lunr" -%} + {% include search/lunr-search-scripts.html %} + {%- when "algolia" -%} + {% include search/algolia-search-scripts.html %} + {%- endcase -%} +{% endif %} diff --git a/_includes/search-form.html b/_includes/search-form.html new file mode 100644 index 000000000..7c2cfebc1 --- /dev/null +++ b/_includes/search-form.html @@ -0,0 +1,13 @@ +
=q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"é")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"è")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){return w()||(W.cursor=W.limit,f()||(W.cursor=W.limit,m()))?(W.cursor=W.limit,W.ket=W.cursor,void(W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"ç")&&(W.bra=W.cursor,W.slice_from("c"))))):(W.cursor=W.limit,void _())}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],P=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.hu.min.js b/assets/javascripts/lunr/lunr.hu.min.js new file mode 100644 index 000000000..e43979928 --- /dev/null +++ b/assets/javascripts/lunr/lunr.hu.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Hungarian` 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,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(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.hu=function(){this.pipeline.reset(),this.pipeline.add(e.hu.trimmer,e.hu.stopWordFilter,e.hu.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hu.stemmer))},e.hu.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.hu.trimmer=e.trimmerSupport.generateTrimmer(e.hu.wordCharacters),e.Pipeline.registerFunction(e.hu.trimmer,"trimmer-hu"),e.hu.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,n=L.cursor;if(b=L.limit,L.in_grouping(W,97,252))for(;;){if(e=L.cursor,L.out_grouping(W,97,252))return L.cursor=e,L.find_among(g,8)||(L.cursor=e,e=L.limit)return void(b=e);L.cursor++}if(L.cursor=n,L.out_grouping(W,97,252)){for(;!L.in_grouping(W,97,252);){if(L.cursor>=L.limit)return;L.cursor++}b=L.cursor}}function i(){return b<=L.cursor}function a(){var e;if(L.ket=L.cursor,e=L.find_among_b(h,2),e&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e")}}function t(){var e=L.limit-L.cursor;return!!L.find_among_b(p,23)&&(L.cursor=L.limit-e,!0)}function s(){if(L.cursor>L.limit_backward){L.cursor--,L.ket=L.cursor;var e=L.cursor-1;L.limit_backward<=e&&e<=L.limit&&(L.cursor=e,L.bra=e,L.slice_del())}}function c(){var e;if(L.ket=L.cursor,e=L.find_among_b(_,2),e&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function o(){L.ket=L.cursor,L.find_among_b(y,44)&&(L.bra=L.cursor,i()&&(L.slice_del(),a()))}function w(){var e;if(L.ket=L.cursor,e=L.find_among_b(z,3),e&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("e");break;case 2:case 3:L.slice_from("a")}}function l(){var e;if(L.ket=L.cursor,e=L.find_among_b(v,6),e&&(L.bra=L.cursor,i()))switch(e){case 1:case 2:L.slice_del();break;case 3:L.slice_from("a");break;case 4:L.slice_from("e")}}function u(){var e;if(L.ket=L.cursor,e=L.find_among_b(j,2),e&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function m(){var e;if(L.ket=L.cursor,e=L.find_among_b(C,7),e&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e");break;case 3:case 4:case 5:case 6:case 7:L.slice_del()}}function k(){var e;if(L.ket=L.cursor,e=L.find_among_b(P,12),e&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 9:L.slice_del();break;case 2:case 5:case 8:L.slice_from("e");break;case 3:case 6:L.slice_from("a")}}function f(){var e;if(L.ket=L.cursor,e=L.find_among_b(F,31),e&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 8:case 9:case 12:case 13:case 16:case 17:case 18:L.slice_del();break;case 2:case 5:case 10:case 14:case 19:L.slice_from("a");break;case 3:case 6:case 11:case 15:case 20:L.slice_from("e")}}function d(){var e;if(L.ket=L.cursor,e=L.find_among_b(S,42),e&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 5:case 6:case 9:case 10:case 11:case 14:case 15:case 16:case 17:case 20:case 21:case 24:case 25:case 26:case 29:L.slice_del();break;case 2:case 7:case 12:case 18:case 22:case 27:L.slice_from("a");break;case 3:case 8:case 13:case 19:case 23:case 28:L.slice_from("e")}}var b,g=[new n("cs",-1,-1),new n("dzs",-1,-1),new n("gy",-1,-1),new n("ly",-1,-1),new n("ny",-1,-1),new n("sz",-1,-1),new n("ty",-1,-1),new n("zs",-1,-1)],h=[new n("á",-1,1),new n("é",-1,2)],p=[new n("bb",-1,-1),new n("cc",-1,-1),new n("dd",-1,-1),new n("ff",-1,-1),new n("gg",-1,-1),new n("jj",-1,-1),new n("kk",-1,-1),new n("ll",-1,-1),new n("mm",-1,-1),new n("nn",-1,-1),new n("pp",-1,-1),new n("rr",-1,-1),new n("ccs",-1,-1),new n("ss",-1,-1),new n("zzs",-1,-1),new n("tt",-1,-1),new n("vv",-1,-1),new n("ggy",-1,-1),new n("lly",-1,-1),new n("nny",-1,-1),new n("tty",-1,-1),new n("ssz",-1,-1),new n("zz",-1,-1)],_=[new n("al",-1,1),new n("el",-1,2)],y=[new n("ba",-1,-1),new n("ra",-1,-1),new n("be",-1,-1),new n("re",-1,-1),new n("ig",-1,-1),new n("nak",-1,-1),new n("nek",-1,-1),new n("val",-1,-1),new n("vel",-1,-1),new n("ul",-1,-1),new n("nál",-1,-1),new n("nél",-1,-1),new n("ból",-1,-1),new n("ról",-1,-1),new n("tól",-1,-1),new n("bõl",-1,-1),new n("rõl",-1,-1),new n("tõl",-1,-1),new n("ül",-1,-1),new n("n",-1,-1),new n("an",19,-1),new n("ban",20,-1),new n("en",19,-1),new n("ben",22,-1),new n("képpen",22,-1),new n("on",19,-1),new n("ön",19,-1),new n("képp",-1,-1),new n("kor",-1,-1),new n("t",-1,-1),new n("at",29,-1),new n("et",29,-1),new n("ként",29,-1),new n("anként",32,-1),new n("enként",32,-1),new n("onként",32,-1),new n("ot",29,-1),new n("ért",29,-1),new n("öt",29,-1),new n("hez",-1,-1),new n("hoz",-1,-1),new n("höz",-1,-1),new n("vá",-1,-1),new n("vé",-1,-1)],z=[new n("án",-1,2),new n("én",-1,1),new n("ánként",-1,3)],v=[new n("stul",-1,2),new n("astul",0,1),new n("ástul",0,3),new n("stül",-1,2),new n("estül",3,1),new n("éstül",3,4)],j=[new n("á",-1,1),new n("é",-1,2)],C=[new n("k",-1,7),new n("ak",0,4),new n("ek",0,6),new n("ok",0,5),new n("ák",0,1),new n("ék",0,2),new n("ök",0,3)],P=[new n("éi",-1,7),new n("áéi",0,6),new n("ééi",0,5),new n("é",-1,9),new n("ké",3,4),new n("aké",4,1),new n("eké",4,1),new n("oké",4,1),new n("áké",4,3),new n("éké",4,2),new n("öké",4,1),new n("éé",3,8)],F=[new n("a",-1,18),new n("ja",0,17),new n("d",-1,16),new n("ad",2,13),new n("ed",2,13),new n("od",2,13),new n("ád",2,14),new n("éd",2,15),new n("öd",2,13),new n("e",-1,18),new n("je",9,17),new n("nk",-1,4),new n("unk",11,1),new n("ánk",11,2),new n("énk",11,3),new n("ünk",11,1),new n("uk",-1,8),new n("juk",16,7),new n("ájuk",17,5),new n("ük",-1,8),new n("jük",19,7),new n("éjük",20,6),new n("m",-1,12),new n("am",22,9),new n("em",22,9),new n("om",22,9),new n("ám",22,10),new n("ém",22,11),new n("o",-1,18),new n("á",-1,19),new n("é",-1,20)],S=[new n("id",-1,10),new n("aid",0,9),new n("jaid",1,6),new n("eid",0,9),new n("jeid",3,6),new n("áid",0,7),new n("éid",0,8),new n("i",-1,15),new n("ai",7,14),new n("jai",8,11),new n("ei",7,14),new n("jei",10,11),new n("ái",7,12),new n("éi",7,13),new n("itek",-1,24),new n("eitek",14,21),new n("jeitek",15,20),new n("éitek",14,23),new n("ik",-1,29),new n("aik",18,26),new n("jaik",19,25),new n("eik",18,26),new n("jeik",21,25),new n("áik",18,27),new n("éik",18,28),new n("ink",-1,20),new n("aink",25,17),new n("jaink",26,16),new n("eink",25,17),new n("jeink",28,16),new n("áink",25,18),new n("éink",25,19),new n("aitok",-1,21),new n("jaitok",32,20),new n("áitok",-1,22),new n("im",-1,5),new n("aim",35,4),new n("jaim",36,1),new n("eim",35,4),new n("jeim",38,1),new n("áim",35,2),new n("éim",35,3)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,52,14],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var n=L.cursor;return e(),L.limit_backward=n,L.cursor=L.limit,c(),L.cursor=L.limit,o(),L.cursor=L.limit,w(),L.cursor=L.limit,l(),L.cursor=L.limit,u(),L.cursor=L.limit,k(),L.cursor=L.limit,f(),L.cursor=L.limit,d(),L.cursor=L.limit,m(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.hu.stemmer,"stemmer-hu"),e.hu.stopWordFilter=e.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(" ")),e.Pipeline.registerFunction(e.hu.stopWordFilter,"stopWordFilter-hu")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.it.min.js b/assets/javascripts/lunr/lunr.it.min.js new file mode 100644 index 000000000..156c86aa5 --- /dev/null +++ b/assets/javascripts/lunr/lunr.it.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Italian` 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,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(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.it=function(){this.pipeline.reset(),this.pipeline.add(e.it.trimmer,e.it.stopWordFilter,e.it.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.it.stemmer))},e.it.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.it.trimmer=e.trimmerSupport.generateTrimmer(e.it.wordCharacters),e.Pipeline.registerFunction(e.it.trimmer,"trimmer-it"),e.it.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!x.eq_s(1,e)||(x.ket=x.cursor,!x.in_grouping(W,97,249)))&&(x.slice_from(r),x.cursor=n,!0)}function i(){for(var r,n,i,o,t=x.cursor;;){if(x.bra=x.cursor,r=x.find_among(h,7))switch(x.ket=x.cursor,r){case 1:x.slice_from("à");continue;case 2:x.slice_from("è");continue;case 3:x.slice_from("ì");continue;case 4:x.slice_from("ò");continue;case 5:x.slice_from("ù");continue;case 6:x.slice_from("qU");continue;case 7:if(x.cursor>=x.limit)break;x.cursor++;continue}break}for(x.cursor=t;;)for(n=x.cursor;;){if(i=x.cursor,x.in_grouping(W,97,249)){if(x.bra=x.cursor,o=x.cursor,e("u","U",i))break;if(x.cursor=o,e("i","I",i))break}if(x.cursor=i,x.cursor>=x.limit)return void(x.cursor=n);x.cursor++}}function o(e){if(x.cursor=e,!x.in_grouping(W,97,249))return!1;for(;!x.out_grouping(W,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function t(){if(x.in_grouping(W,97,249)){var e=x.cursor;if(x.out_grouping(W,97,249)){for(;!x.in_grouping(W,97,249);){if(x.cursor>=x.limit)return o(e);x.cursor++}return!0}return o(e)}return!1}function s(){var e,r=x.cursor;if(!t()){if(x.cursor=r,!x.out_grouping(W,97,249))return;if(e=x.cursor,x.out_grouping(W,97,249)){for(;!x.in_grouping(W,97,249);){if(x.cursor>=x.limit)return x.cursor=e,void(x.in_grouping(W,97,249)&&x.cursor =x.limit)return;x.cursor++}k=x.cursor}function a(){for(;!x.in_grouping(W,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}for(;!x.out_grouping(W,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function u(){var e=x.cursor;k=x.limit,p=k,g=k,s(),x.cursor=e,a()&&(p=x.cursor,a()&&(g=x.cursor))}function c(){for(var e;;){if(x.bra=x.cursor,e=x.find_among(q,3),!e)break;switch(x.ket=x.cursor,e){case 1:x.slice_from("i");break;case 2:x.slice_from("u");break;case 3:if(x.cursor>=x.limit)return;x.cursor++}}}function w(){return k<=x.cursor}function l(){return p<=x.cursor}function m(){return g<=x.cursor}function f(){var e;if(x.ket=x.cursor,x.find_among_b(C,37)&&(x.bra=x.cursor,e=x.find_among_b(z,5),e&&w()))switch(e){case 1:x.slice_del();break;case 2:x.slice_from("e")}}function v(){var e;if(x.ket=x.cursor,e=x.find_among_b(S,51),!e)return!1;switch(x.bra=x.cursor,e){case 1:if(!m())return!1;x.slice_del();break;case 2:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del());break;case 3:if(!m())return!1;x.slice_from("log");break;case 4:if(!m())return!1;x.slice_from("u");break;case 5:if(!m())return!1;x.slice_from("ente");break;case 6:if(!w())return!1;x.slice_del();break;case 7:if(!l())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(P,4),e&&(x.bra=x.cursor,m()&&(x.slice_del(),1==e&&(x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&x.slice_del()))));break;case 8:if(!m())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(F,3),e&&(x.bra=x.cursor,1==e&&m()&&x.slice_del());break;case 9:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del())))}return!0}function b(){var e,r;x.cursor>=k&&(r=x.limit_backward,x.limit_backward=k,x.ket=x.cursor,e=x.find_among_b(y,87),e&&(x.bra=x.cursor,1==e&&x.slice_del()),x.limit_backward=r)}function d(){var e=x.limit-x.cursor;return x.ket=x.cursor,x.in_grouping_b(L,97,242)&&(x.bra=x.cursor,w()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(1,"i")&&(x.bra=x.cursor,w())))?void x.slice_del():void(x.cursor=x.limit-e)}function _(){d(),x.ket=x.cursor,x.eq_s_b(1,"h")&&(x.bra=x.cursor,x.in_grouping_b(U,99,103)&&w()&&x.slice_del())}var g,p,k,h=[new r("",-1,7),new r("qu",0,6),new r("á",0,1),new r("é",0,2),new r("í",0,3),new r("ó",0,4),new r("ú",0,5)],q=[new r("",-1,3),new r("I",0,1),new r("U",0,2)],C=[new r("la",-1,-1),new r("cela",0,-1),new r("gliela",0,-1),new r("mela",0,-1),new r("tela",0,-1),new r("vela",0,-1),new r("le",-1,-1),new r("cele",6,-1),new r("gliele",6,-1),new r("mele",6,-1),new r("tele",6,-1),new r("vele",6,-1),new r("ne",-1,-1),new r("cene",12,-1),new r("gliene",12,-1),new r("mene",12,-1),new r("sene",12,-1),new r("tene",12,-1),new r("vene",12,-1),new r("ci",-1,-1),new r("li",-1,-1),new r("celi",20,-1),new r("glieli",20,-1),new r("meli",20,-1),new r("teli",20,-1),new r("veli",20,-1),new r("gli",20,-1),new r("mi",-1,-1),new r("si",-1,-1),new r("ti",-1,-1),new r("vi",-1,-1),new r("lo",-1,-1),new r("celo",31,-1),new r("glielo",31,-1),new r("melo",31,-1),new r("telo",31,-1),new r("velo",31,-1)],z=[new r("ando",-1,1),new r("endo",-1,1),new r("ar",-1,2),new r("er",-1,2),new r("ir",-1,2)],P=[new r("ic",-1,-1),new r("abil",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],F=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],S=[new r("ica",-1,1),new r("logia",-1,3),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,9),new r("anza",-1,1),new r("enza",-1,5),new r("ice",-1,1),new r("atrice",7,1),new r("iche",-1,1),new r("logie",-1,3),new r("abile",-1,1),new r("ibile",-1,1),new r("usione",-1,4),new r("azione",-1,2),new r("uzione",-1,4),new r("atore",-1,2),new r("ose",-1,1),new r("ante",-1,1),new r("mente",-1,1),new r("amente",19,7),new r("iste",-1,1),new r("ive",-1,9),new r("anze",-1,1),new r("enze",-1,5),new r("ici",-1,1),new r("atrici",25,1),new r("ichi",-1,1),new r("abili",-1,1),new r("ibili",-1,1),new r("ismi",-1,1),new r("usioni",-1,4),new r("azioni",-1,2),new r("uzioni",-1,4),new r("atori",-1,2),new r("osi",-1,1),new r("anti",-1,1),new r("amenti",-1,6),new r("imenti",-1,6),new r("isti",-1,1),new r("ivi",-1,9),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,6),new r("imento",-1,6),new r("ivo",-1,9),new r("ità",-1,8),new r("istà",-1,1),new r("istè",-1,1),new r("istì",-1,1)],y=[new r("isca",-1,1),new r("enda",-1,1),new r("ata",-1,1),new r("ita",-1,1),new r("uta",-1,1),new r("ava",-1,1),new r("eva",-1,1),new r("iva",-1,1),new r("erebbe",-1,1),new r("irebbe",-1,1),new r("isce",-1,1),new r("ende",-1,1),new r("are",-1,1),new r("ere",-1,1),new r("ire",-1,1),new r("asse",-1,1),new r("ate",-1,1),new r("avate",16,1),new r("evate",16,1),new r("ivate",16,1),new r("ete",-1,1),new r("erete",20,1),new r("irete",20,1),new r("ite",-1,1),new r("ereste",-1,1),new r("ireste",-1,1),new r("ute",-1,1),new r("erai",-1,1),new r("irai",-1,1),new r("isci",-1,1),new r("endi",-1,1),new r("erei",-1,1),new r("irei",-1,1),new r("assi",-1,1),new r("ati",-1,1),new r("iti",-1,1),new r("eresti",-1,1),new r("iresti",-1,1),new r("uti",-1,1),new r("avi",-1,1),new r("evi",-1,1),new r("ivi",-1,1),new r("isco",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("Yamo",-1,1),new r("iamo",-1,1),new r("avamo",-1,1),new r("evamo",-1,1),new r("ivamo",-1,1),new r("eremo",-1,1),new r("iremo",-1,1),new r("assimo",-1,1),new r("ammo",-1,1),new r("emmo",-1,1),new r("eremmo",54,1),new r("iremmo",54,1),new r("immo",-1,1),new r("ano",-1,1),new r("iscano",58,1),new r("avano",58,1),new r("evano",58,1),new r("ivano",58,1),new r("eranno",-1,1),new r("iranno",-1,1),new r("ono",-1,1),new r("iscono",65,1),new r("arono",65,1),new r("erono",65,1),new r("irono",65,1),new r("erebbero",-1,1),new r("irebbero",-1,1),new r("assero",-1,1),new r("essero",-1,1),new r("issero",-1,1),new r("ato",-1,1),new r("ito",-1,1),new r("uto",-1,1),new r("avo",-1,1),new r("evo",-1,1),new r("ivo",-1,1),new r("ar",-1,1),new r("ir",-1,1),new r("erà",-1,1),new r("irà",-1,1),new r("erò",-1,1),new r("irò",-1,1)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2,1],L=[17,65,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2],U=[17],x=new n;this.setCurrent=function(e){x.setCurrent(e)},this.getCurrent=function(){return x.getCurrent()},this.stem=function(){var e=x.cursor;return i(),x.cursor=e,u(),x.limit_backward=e,x.cursor=x.limit,f(),x.cursor=x.limit,v()||(x.cursor=x.limit,b()),x.cursor=x.limit,_(),x.cursor=x.limit_backward,c(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.it.stemmer,"stemmer-it"),e.it.stopWordFilter=e.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(" ")),e.Pipeline.registerFunction(e.it.stopWordFilter,"stopWordFilter-it")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.ja.min.js b/assets/javascripts/lunr/lunr.ja.min.js new file mode 100644 index 000000000..5f254ebe9 --- /dev/null +++ b/assets/javascripts/lunr/lunr.ja.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n = 0; n--)if (/\S/.test(o.charAt(n))) { o = o.substring(0, n + 1); break } for (a = [], s = o.length, c = 0, l = 0; c <= s; c++)if (u = o.charAt(c), m = c - l, u.match(/\s/) || c == s) { if (m > 0) for (p = t.segment(o.slice(l, c)).filter(function (e) { return !!e }), f = l, n = 0; n < p.length; n++)r ? a.push(new e.Token(p[n], { position: [f, p[n].length], index: a.length })) : a.push(p[n]), f += p[n].length; l = c + 1 } return a }, e.ja.stemmer = function () { return function (e) { return e } }(), e.Pipeline.registerFunction(e.ja.stemmer, "stemmer-ja"), e.ja.wordCharacters = "一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9", e.ja.trimmer = e.trimmerSupport.generateTrimmer(e.ja.wordCharacters), e.Pipeline.registerFunction(e.ja.trimmer, "trimmer-ja"), e.ja.stopWordFilter = e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")), e.Pipeline.registerFunction(e.ja.stopWordFilter, "stopWordFilter-ja"), e.jp = e.ja, e.Pipeline.registerFunction(e.jp.stemmer, "stemmer-jp"), e.Pipeline.registerFunction(e.jp.trimmer, "trimmer-jp"), e.Pipeline.registerFunction(e.jp.stopWordFilter, "stopWordFilter-jp") } }); diff --git a/assets/javascripts/lunr/lunr.min.js b/assets/javascripts/lunr/lunr.min.js new file mode 100644 index 000000000..fd1f80e3c --- /dev/null +++ b/assets/javascripts/lunr/lunr.min.js @@ -0,0 +1,6 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.1.5 + * Copyright (C) 2017 Oliver Nightingale + * @license MIT + */ +!function () { var e = function (t) { var r = new e.Builder; return r.pipeline.add(e.trimmer, e.stopWordFilter, e.stemmer), r.searchPipeline.add(e.stemmer), t.call(r, r), r.build() }; e.version = "2.1.5", e.utils = {}, e.utils.warn = function (e) { return function (t) { e.console && console.warn && console.warn(t) } }(this), e.utils.asString = function (e) { return void 0 === e || null === e ? "" : e.toString() }, e.FieldRef = function (e, t, r) { this.docRef = e, this.fieldName = t, this._stringValue = r }, e.FieldRef.joiner = "/", e.FieldRef.fromString = function (t) { var r = t.indexOf(e.FieldRef.joiner); if (-1 === r) throw "malformed field ref string"; var i = t.slice(0, r), n = t.slice(r + 1); return new e.FieldRef(n, i, t) }, e.FieldRef.prototype.toString = function () { return void 0 == this._stringValue && (this._stringValue = this.fieldName + e.FieldRef.joiner + this.docRef), this._stringValue }, e.idf = function (e, t) { var r = 0; for (var i in e) "_index" != i && (r += Object.keys(e[i]).length); var n = (t - r + .5) / (r + .5); return Math.log(1 + Math.abs(n)) }, e.Token = function (e, t) { this.str = e || "", this.metadata = t || {} }, e.Token.prototype.toString = function () { return this.str }, e.Token.prototype.update = function (e) { return this.str = e(this.str, this.metadata), this }, e.Token.prototype.clone = function (t) { return t = t || function (e) { return e }, new e.Token(t(this.str, this.metadata), this.metadata) }, e.tokenizer = function (t) { if (null == t || void 0 == t) return []; if (Array.isArray(t)) return t.map(function (t) { return new e.Token(e.utils.asString(t).toLowerCase()) }); for (var r = t.toString().trim().toLowerCase(), i = r.length, n = [], s = 0, o = 0; i >= s; s++) { var a = r.charAt(s), u = s - o; (a.match(e.tokenizer.separator) || s == i) && (u > 0 && n.push(new e.Token(r.slice(o, s), { position: [o, u], index: n.length })), o = s + 1) } return n }, e.tokenizer.separator = /[\s\-]+/, e.Pipeline = function () { this._stack = [] }, e.Pipeline.registeredFunctions = Object.create(null), e.Pipeline.registerFunction = function (t, r) { r in this.registeredFunctions && e.utils.warn("Overwriting existing registered function: " + r), t.label = r, e.Pipeline.registeredFunctions[t.label] = t }, e.Pipeline.warnIfFunctionNotRegistered = function (t) { var r = t.label && t.label in this.registeredFunctions; r || e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n", t) }, e.Pipeline.load = function (t) { var r = new e.Pipeline; return t.forEach(function (t) { var i = e.Pipeline.registeredFunctions[t]; if (!i) throw new Error("Cannot load unregistered function: " + t); r.add(i) }), r }, e.Pipeline.prototype.add = function () { var t = Array.prototype.slice.call(arguments); t.forEach(function (t) { e.Pipeline.warnIfFunctionNotRegistered(t), this._stack.push(t) }, this) }, e.Pipeline.prototype.after = function (t, r) { e.Pipeline.warnIfFunctionNotRegistered(r); var i = this._stack.indexOf(t); if (-1 == i) throw new Error("Cannot find existingFn"); i += 1, this._stack.splice(i, 0, r) }, e.Pipeline.prototype.before = function (t, r) { e.Pipeline.warnIfFunctionNotRegistered(r); var i = this._stack.indexOf(t); if (-1 == i) throw new Error("Cannot find existingFn"); this._stack.splice(i, 0, r) }, e.Pipeline.prototype.remove = function (e) { var t = this._stack.indexOf(e); -1 != t && this._stack.splice(t, 1) }, e.Pipeline.prototype.run = function (e) { for (var t = this._stack.length, r = 0; t > r; r++) { var i = this._stack[r]; e = e.reduce(function (t, r, n) { var s = i(r, n, e); return void 0 === s || "" === s ? t : t.concat(s) }, []) } return e }, e.Pipeline.prototype.runString = function (t) { var r = new e.Token(t); return this.run([r]).map(function (e) { return e.toString() }) }, e.Pipeline.prototype.reset = function () { this._stack = [] }, e.Pipeline.prototype.toJSON = function () { return this._stack.map(function (t) { return e.Pipeline.warnIfFunctionNotRegistered(t), t.label }) }, e.Vector = function (e) { this._magnitude = 0, this.elements = e || [] }, e.Vector.prototype.positionForIndex = function (e) { if (0 == this.elements.length) return 0; for (var t = 0, r = this.elements.length / 2, i = r - t, n = Math.floor(i / 2), s = this.elements[2 * n]; i > 1 && (e > s && (t = n), s > e && (r = n), s != e);)i = r - t, n = t + Math.floor(i / 2), s = this.elements[2 * n]; return s == e ? 2 * n : s > e ? 2 * n : e > s ? 2 * (n + 1) : void 0 }, e.Vector.prototype.insert = function (e, t) { this.upsert(e, t, function () { throw "duplicate index" }) }, e.Vector.prototype.upsert = function (e, t, r) { this._magnitude = 0; var i = this.positionForIndex(e); this.elements[i] == e ? this.elements[i + 1] = r(this.elements[i + 1], t) : this.elements.splice(i, 0, e, t) }, e.Vector.prototype.magnitude = function () { if (this._magnitude) return this._magnitude; for (var e = 0, t = this.elements.length, r = 1; t > r; r += 2) { var i = this.elements[r]; e += i * i } return this._magnitude = Math.sqrt(e) }, e.Vector.prototype.dot = function (e) { for (var t = 0, r = this.elements, i = e.elements, n = r.length, s = i.length, o = 0, a = 0, u = 0, l = 0; n > u && s > l;)o = r[u], a = i[l], a > o ? u += 2 : o > a ? l += 2 : o == a && (t += r[u + 1] * i[l + 1], u += 2, l += 2); return t }, e.Vector.prototype.similarity = function (e) { return this.dot(e) / (this.magnitude() * e.magnitude()) }, e.Vector.prototype.toArray = function () { for (var e = new Array(this.elements.length / 2), t = 1, r = 0; t < this.elements.length; t += 2, r++)e[r] = this.elements[t]; return e }, e.Vector.prototype.toJSON = function () { return this.elements }, e.stemmer = function () { var e = { ational: "ate", tional: "tion", enci: "ence", anci: "ance", izer: "ize", bli: "ble", alli: "al", entli: "ent", eli: "e", ousli: "ous", ization: "ize", ation: "ate", ator: "ate", alism: "al", iveness: "ive", fulness: "ful", ousness: "ous", aliti: "al", iviti: "ive", biliti: "ble", logi: "log" }, t = { icate: "ic", ative: "", alize: "al", iciti: "ic", ical: "ic", ful: "", ness: "" }, r = "[^aeiou]", i = "[aeiouy]", n = r + "[^aeiouy]*", s = i + "[aeiou]*", o = "^(" + n + ")?" + s + n, a = "^(" + n + ")?" + s + n + "(" + s + ")?$", u = "^(" + n + ")?" + s + n + s + n, l = "^(" + n + ")?" + i, d = new RegExp(o), h = new RegExp(u), c = new RegExp(a), f = new RegExp(l), p = /^(.+?)(ss|i)es$/, y = /^(.+?)([^s])s$/, m = /^(.+?)eed$/, v = /^(.+?)(ed|ing)$/, g = /.$/, x = /(at|bl|iz)$/, w = new RegExp("([^aeiouylsz])\\1$"), k = new RegExp("^" + n + i + "[^aeiouwxy]$"), Q = /^(.+?[^aeiou])y$/, L = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/, T = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/, S = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, b = /^(.+?)(s|t)(ion)$/, P = /^(.+?)e$/, E = /ll$/, I = new RegExp("^" + n + i + "[^aeiouwxy]$"), O = function (r) { var i, n, s, o, a, u, l; if (r.length < 3) return r; if (s = r.substr(0, 1), "y" == s && (r = s.toUpperCase() + r.substr(1)), o = p, a = y, o.test(r) ? r = r.replace(o, "$1$2") : a.test(r) && (r = r.replace(a, "$1$2")), o = m, a = v, o.test(r)) { var O = o.exec(r); o = d, o.test(O[1]) && (o = g, r = r.replace(o, "")) } else if (a.test(r)) { var O = a.exec(r); i = O[1], a = f, a.test(i) && (r = i, a = x, u = w, l = k, a.test(r) ? r += "e" : u.test(r) ? (o = g, r = r.replace(o, "")) : l.test(r) && (r += "e")) } if (o = Q, o.test(r)) { var O = o.exec(r); i = O[1], r = i + "i" } if (o = L, o.test(r)) { var O = o.exec(r); i = O[1], n = O[2], o = d, o.test(i) && (r = i + e[n]) } if (o = T, o.test(r)) { var O = o.exec(r); i = O[1], n = O[2], o = d, o.test(i) && (r = i + t[n]) } if (o = S, a = b, o.test(r)) { var O = o.exec(r); i = O[1], o = h, o.test(i) && (r = i) } else if (a.test(r)) { var O = a.exec(r); i = O[1] + O[2], a = h, a.test(i) && (r = i) } if (o = P, o.test(r)) { var O = o.exec(r); i = O[1], o = h, a = c, u = I, (o.test(i) || a.test(i) && !u.test(i)) && (r = i) } return o = E, a = h, o.test(r) && a.test(r) && (o = g, r = r.replace(o, "")), "y" == s && (r = s.toLowerCase() + r.substr(1)), r }; return function (e) { return e.update(O) } }(), e.Pipeline.registerFunction(e.stemmer, "stemmer"), e.generateStopWordFilter = function (e) { var t = e.reduce(function (e, t) { return e[t] = t, e }, {}); return function (e) { return e && t[e.toString()] !== e.toString() ? e : void 0 } }, e.stopWordFilter = e.generateStopWordFilter(["a", "able", "about", "across", "after", "all", "almost", "also", "am", "among", "an", "and", "any", "are", "as", "at", "be", "because", "been", "but", "by", "can", "cannot", "could", "dear", "did", "do", "does", "either", "else", "ever", "every", "for", "from", "get", "got", "had", "has", "have", "he", "her", "hers", "him", "his", "how", "however", "i", "if", "in", "into", "is", "it", "its", "just", "least", "let", "like", "likely", "may", "me", "might", "most", "must", "my", "neither", "no", "nor", "not", "of", "off", "often", "on", "only", "or", "other", "our", "own", "rather", "said", "say", "says", "she", "should", "since", "so", "some", "than", "that", "the", "their", "them", "then", "there", "these", "they", "this", "tis", "to", "too", "twas", "us", "wants", "was", "we", "were", "what", "when", "where", "which", "while", "who", "whom", "why", "will", "with", "would", "yet", "you", "your"]), e.Pipeline.registerFunction(e.stopWordFilter, "stopWordFilter"), e.trimmer = function (e) { return e.update(function (e) { return e.replace(/^\W+/, "").replace(/\W+$/, "") }) }, e.Pipeline.registerFunction(e.trimmer, "trimmer"), e.TokenSet = function () { this["final"] = !1, this.edges = {}, this.id = e.TokenSet._nextId, e.TokenSet._nextId += 1 }, e.TokenSet._nextId = 1, e.TokenSet.fromArray = function (t) { for (var r = new e.TokenSet.Builder, i = 0, n = t.length; n > i; i++)r.insert(t[i]); return r.finish(), r.root }, e.TokenSet.fromClause = function (t) { return "editDistance" in t ? e.TokenSet.fromFuzzyString(t.term, t.editDistance) : e.TokenSet.fromString(t.term) }, e.TokenSet.fromFuzzyString = function (t, r) { for (var i = new e.TokenSet, n = [{ node: i, editsRemaining: r, str: t }]; n.length;) { var s = n.pop(); if (s.str.length > 0) { var o, a = s.str.charAt(0); a in s.node.edges ? o = s.node.edges[a] : (o = new e.TokenSet, s.node.edges[a] = o), 1 == s.str.length ? o["final"] = !0 : n.push({ node: o, editsRemaining: s.editsRemaining, str: s.str.slice(1) }) } if (s.editsRemaining > 0 && s.str.length > 1) { var u, a = s.str.charAt(1); a in s.node.edges ? u = s.node.edges[a] : (u = new e.TokenSet, s.node.edges[a] = u), s.str.length <= 2 ? u["final"] = !0 : n.push({ node: u, editsRemaining: s.editsRemaining - 1, str: s.str.slice(2) }) } if (s.editsRemaining > 0 && 1 == s.str.length && (s.node["final"] = !0), s.editsRemaining > 0 && s.str.length >= 1) { if ("*" in s.node.edges) var l = s.node.edges["*"]; else { var l = new e.TokenSet; s.node.edges["*"] = l } 1 == s.str.length ? l["final"] = !0 : n.push({ node: l, editsRemaining: s.editsRemaining - 1, str: s.str.slice(1) }) } if (s.editsRemaining > 0) { if ("*" in s.node.edges) var d = s.node.edges["*"]; else { var d = new e.TokenSet; s.node.edges["*"] = d } 0 == s.str.length ? d["final"] = !0 : n.push({ node: d, editsRemaining: s.editsRemaining - 1, str: s.str }) } if (s.editsRemaining > 0 && s.str.length > 1) { var h, c = s.str.charAt(0), f = s.str.charAt(1); f in s.node.edges ? h = s.node.edges[f] : (h = new e.TokenSet, s.node.edges[f] = h), 1 == s.str.length ? h["final"] = !0 : n.push({ node: h, editsRemaining: s.editsRemaining - 1, str: c + s.str.slice(2) }) } } return i }, e.TokenSet.fromString = function (t) { for (var r = new e.TokenSet, i = r, n = !1, s = 0, o = t.length; o > s; s++) { var a = t[s], u = s == o - 1; if ("*" == a) n = !0, r.edges[a] = r, r["final"] = u; else { var l = new e.TokenSet; l["final"] = u, r.edges[a] = l, r = l, n && (r.edges["*"] = i) } } return i }, e.TokenSet.prototype.toArray = function () { for (var e = [], t = [{ prefix: "", node: this }]; t.length;) { var r = t.pop(), i = Object.keys(r.node.edges), n = i.length; r.node["final"] && e.push(r.prefix); for (var s = 0; n > s; s++) { var o = i[s]; t.push({ prefix: r.prefix.concat(o), node: r.node.edges[o] }) } } return e }, e.TokenSet.prototype.toString = function () { if (this._str) return this._str; for (var e = this["final"] ? "1" : "0", t = Object.keys(this.edges).sort(), r = t.length, i = 0; r > i; i++) { var n = t[i], s = this.edges[n]; e = e + n + s.id } return e }, e.TokenSet.prototype.intersect = function (t) { for (var r = new e.TokenSet, i = void 0, n = [{ qNode: t, output: r, node: this }]; n.length;) { i = n.pop(); for (var s = Object.keys(i.qNode.edges), o = s.length, a = Object.keys(i.node.edges), u = a.length, l = 0; o > l; l++)for (var d = s[l], h = 0; u > h; h++) { var c = a[h]; if (c == d || "*" == d) { var f = i.node.edges[c], p = i.qNode.edges[d], y = f["final"] && p["final"], m = void 0; c in i.output.edges ? (m = i.output.edges[c], m["final"] = m["final"] || y) : (m = new e.TokenSet, m["final"] = y, i.output.edges[c] = m), n.push({ qNode: p, output: m, node: f }) } } } return r }, e.TokenSet.Builder = function () { this.previousWord = "", this.root = new e.TokenSet, this.uncheckedNodes = [], this.minimizedNodes = {} }, e.TokenSet.Builder.prototype.insert = function (t) { var r, i = 0; if (t < this.previousWord) throw new Error("Out of order word insertion"); for (var n = 0; n < t.length && n < this.previousWord.length && t[n] == this.previousWord[n]; n++)i++; this.minimize(i), r = 0 == this.uncheckedNodes.length ? this.root : this.uncheckedNodes[this.uncheckedNodes.length - 1].child; for (var n = i; n < t.length; n++) { var s = new e.TokenSet, o = t[n]; r.edges[o] = s, this.uncheckedNodes.push({ parent: r, "char": o, child: s }), r = s } r["final"] = !0, this.previousWord = t }, e.TokenSet.Builder.prototype.finish = function () { this.minimize(0) }, e.TokenSet.Builder.prototype.minimize = function (e) { for (var t = this.uncheckedNodes.length - 1; t >= e; t--) { var r = this.uncheckedNodes[t], i = r.child.toString(); i in this.minimizedNodes ? r.parent.edges[r["char"]] = this.minimizedNodes[i] : (r.child._str = i, this.minimizedNodes[i] = r.child), this.uncheckedNodes.pop() } }, e.Index = function (e) { this.invertedIndex = e.invertedIndex, this.fieldVectors = e.fieldVectors, this.tokenSet = e.tokenSet, this.fields = e.fields, this.pipeline = e.pipeline }, e.Index.prototype.search = function (t) { return this.query(function (r) { var i = new e.QueryParser(t, r); i.parse() }) }, e.Index.prototype.query = function (t) { var r = new e.Query(this.fields), i = Object.create(null), n = Object.create(null), s = Object.create(null); t.call(r, r); for (var o = 0; o < r.clauses.length; o++) { var a = r.clauses[o], u = null; u = a.usePipeline ? this.pipeline.runString(a.term) : [a.term]; for (var l = 0; l < u.length; l++) { var d = u[l]; a.term = d; for (var h = e.TokenSet.fromClause(a), c = this.tokenSet.intersect(h).toArray(), f = 0; f < c.length; f++)for (var p = c[f], y = this.invertedIndex[p], m = y._index, v = 0; v < a.fields.length; v++) { var g = a.fields[v], x = y[g], w = Object.keys(x), k = p + "/" + g; if (void 0 === n[g] && (n[g] = new e.Vector), n[g].upsert(m, 1 * a.boost, function (e, t) { return e + t }), !s[k]) { for (var Q = 0; Q < w.length; Q++) { var L, T = w[Q], S = new e.FieldRef(T, g), b = x[T]; void 0 === (L = i[S]) ? i[S] = new e.MatchData(p, g, b) : L.add(p, g, b) } s[k] = !0 } } } } for (var P = Object.keys(i), E = [], I = Object.create(null), o = 0; o < P.length; o++) { var O, F = e.FieldRef.fromString(P[o]), R = F.docRef, _ = this.fieldVectors[F], N = n[F.fieldName].similarity(_); if (void 0 !== (O = I[R])) O.score += N, O.matchData.combine(i[F]); else { var C = { ref: R, score: N, matchData: i[F] }; I[R] = C, E.push(C) } } return E.sort(function (e, t) { return t.score - e.score }) }, e.Index.prototype.toJSON = function () { var t = Object.keys(this.invertedIndex).sort().map(function (e) { return [e, this.invertedIndex[e]] }, this), r = Object.keys(this.fieldVectors).map(function (e) { return [e, this.fieldVectors[e].toJSON()] }, this); return { version: e.version, fields: this.fields, fieldVectors: r, invertedIndex: t, pipeline: this.pipeline.toJSON() } }, e.Index.load = function (t) { var r = {}, i = {}, n = t.fieldVectors, s = {}, o = t.invertedIndex, a = new e.TokenSet.Builder, u = e.Pipeline.load(t.pipeline); t.version != e.version && e.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + e.version + "' does not match serialized index '" + t.version + "'"); for (var l = 0; l < n.length; l++) { var d = n[l], h = d[0], c = d[1]; i[h] = new e.Vector(c) } for (var l = 0; l < o.length; l++) { var d = o[l], f = d[0], p = d[1]; a.insert(f), s[f] = p } return a.finish(), r.fields = t.fields, r.fieldVectors = i, r.invertedIndex = s, r.tokenSet = a.root, r.pipeline = u, new e.Index(r) }, e.Builder = function () { this._ref = "id", this._fields = [], this.invertedIndex = Object.create(null), this.fieldTermFrequencies = {}, this.fieldLengths = {}, this.tokenizer = e.tokenizer, this.pipeline = new e.Pipeline, this.searchPipeline = new e.Pipeline, this.documentCount = 0, this._b = .75, this._k1 = 1.2, this.termIndex = 0, this.metadataWhitelist = [] }, e.Builder.prototype.ref = function (e) { this._ref = e }, e.Builder.prototype.field = function (e) { this._fields.push(e) }, e.Builder.prototype.b = function (e) { 0 > e ? this._b = 0 : e > 1 ? this._b = 1 : this._b = e }, e.Builder.prototype.k1 = function (e) { this._k1 = e }, e.Builder.prototype.add = function (t) { var r = t[this._ref]; this.documentCount += 1; for (var i = 0; i < this._fields.length; i++) { var n = this._fields[i], s = t[n], o = this.tokenizer(s), a = this.pipeline.run(o), u = new e.FieldRef(r, n), l = Object.create(null); this.fieldTermFrequencies[u] = l, this.fieldLengths[u] = 0, this.fieldLengths[u] += a.length; for (var d = 0; d < a.length; d++) { var h = a[d]; if (void 0 == l[h] && (l[h] = 0), l[h] += 1, void 0 == this.invertedIndex[h]) { var c = Object.create(null); c._index = this.termIndex, this.termIndex += 1; for (var f = 0; f < this._fields.length; f++)c[this._fields[f]] = Object.create(null); this.invertedIndex[h] = c } void 0 == this.invertedIndex[h][n][r] && (this.invertedIndex[h][n][r] = Object.create(null)); for (var p = 0; p < this.metadataWhitelist.length; p++) { var y = this.metadataWhitelist[p], m = h.metadata[y]; void 0 == this.invertedIndex[h][n][r][y] && (this.invertedIndex[h][n][r][y] = []), this.invertedIndex[h][n][r][y].push(m) } } } }, e.Builder.prototype.calculateAverageFieldLengths = function () { for (var t = Object.keys(this.fieldLengths), r = t.length, i = {}, n = {}, s = 0; r > s; s++) { var o = e.FieldRef.fromString(t[s]), a = o.fieldName; n[a] || (n[a] = 0), n[a] += 1, i[a] || (i[a] = 0), i[a] += this.fieldLengths[o] } for (var s = 0; s < this._fields.length; s++) { var a = this._fields[s]; i[a] = i[a] / n[a] } this.averageFieldLength = i }, e.Builder.prototype.createFieldVectors = function () { for (var t = {}, r = Object.keys(this.fieldTermFrequencies), i = r.length, n = Object.create(null), s = 0; i > s; s++) { for (var o = e.FieldRef.fromString(r[s]), a = o.fieldName, u = this.fieldLengths[o], l = new e.Vector, d = this.fieldTermFrequencies[o], h = Object.keys(d), c = h.length, f = 0; c > f; f++) { var p, y, m, v = h[f], g = d[v], x = this.invertedIndex[v]._index; void 0 === n[v] ? (p = e.idf(this.invertedIndex[v], this.documentCount), n[v] = p) : p = n[v], y = p * ((this._k1 + 1) * g) / (this._k1 * (1 - this._b + this._b * (u / this.averageFieldLength[a])) + g), m = Math.round(1e3 * y) / 1e3, l.insert(x, m) } t[o] = l } this.fieldVectors = t }, e.Builder.prototype.createTokenSet = function () { this.tokenSet = e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort()) }, e.Builder.prototype.build = function () { return this.calculateAverageFieldLengths(), this.createFieldVectors(), this.createTokenSet(), new e.Index({ invertedIndex: this.invertedIndex, fieldVectors: this.fieldVectors, tokenSet: this.tokenSet, fields: this._fields, pipeline: this.searchPipeline }) }, e.Builder.prototype.use = function (e) { var t = Array.prototype.slice.call(arguments, 1); t.unshift(this), e.apply(this, t) }, e.MatchData = function (e, t, r) { for (var i = Object.create(null), n = Object.keys(r), s = 0; s < n.length; s++) { var o = n[s]; i[o] = r[o].slice() } this.metadata = Object.create(null), this.metadata[e] = Object.create(null), this.metadata[e][t] = i }, e.MatchData.prototype.combine = function (e) { for (var t = Object.keys(e.metadata), r = 0; r < t.length; r++) { var i = t[r], n = Object.keys(e.metadata[i]); void 0 == this.metadata[i] && (this.metadata[i] = Object.create(null)); for (var s = 0; s < n.length; s++) { var o = n[s], a = Object.keys(e.metadata[i][o]); void 0 == this.metadata[i][o] && (this.metadata[i][o] = Object.create(null)); for (var u = 0; u < a.length; u++) { var l = a[u]; void 0 == this.metadata[i][o][l] ? this.metadata[i][o][l] = e.metadata[i][o][l] : this.metadata[i][o][l] = this.metadata[i][o][l].concat(e.metadata[i][o][l]) } } } }, e.MatchData.prototype.add = function (e, t, r) { if (!(e in this.metadata)) return this.metadata[e] = Object.create(null), void (this.metadata[e][t] = r); if (!(t in this.metadata[e])) return void (this.metadata[e][t] = r); for (var i = Object.keys(r), n = 0; n < i.length; n++) { var s = i[n]; s in this.metadata[e][t] ? this.metadata[e][t][s] = this.metadata[e][t][s].concat(r[s]) : this.metadata[e][t][s] = r[s] } }, e.Query = function (e) { this.clauses = [], this.allFields = e }, e.Query.wildcard = new String("*"), e.Query.wildcard.NONE = 0, e.Query.wildcard.LEADING = 1, e.Query.wildcard.TRAILING = 2, e.Query.prototype.clause = function (t) { return "fields" in t || (t.fields = this.allFields), "boost" in t || (t.boost = 1), "usePipeline" in t || (t.usePipeline = !0), "wildcard" in t || (t.wildcard = e.Query.wildcard.NONE), t.wildcard & e.Query.wildcard.LEADING && t.term.charAt(0) != e.Query.wildcard && (t.term = "*" + t.term), t.wildcard & e.Query.wildcard.TRAILING && t.term.slice(-1) != e.Query.wildcard && (t.term = "" + t.term + "*"), this.clauses.push(t), this }, e.Query.prototype.term = function (e, t) { var r = t || {}; return r.term = e, this.clause(r), this }, e.QueryParseError = function (e, t, r) { this.name = "QueryParseError", this.message = e, this.start = t, this.end = r }, e.QueryParseError.prototype = new Error, e.QueryLexer = function (e) { this.lexemes = [], this.str = e, this.length = e.length, this.pos = 0, this.start = 0, this.escapeCharPositions = [] }, e.QueryLexer.prototype.run = function () { for (var t = e.QueryLexer.lexText; t;)t = t(this) }, e.QueryLexer.prototype.sliceString = function () { for (var e = [], t = this.start, r = this.pos, i = 0; i < this.escapeCharPositions.length; i++)r = this.escapeCharPositions[i], e.push(this.str.slice(t, r)), t = r + 1; return e.push(this.str.slice(t, this.pos)), this.escapeCharPositions.length = 0, e.join("") }, e.QueryLexer.prototype.emit = function (e) { this.lexemes.push({ type: e, str: this.sliceString(), start: this.start, end: this.pos }), this.start = this.pos }, e.QueryLexer.prototype.escapeCharacter = function () { this.escapeCharPositions.push(this.pos - 1), this.pos += 1 }, e.QueryLexer.prototype.next = function () { if (this.pos >= this.length) return e.QueryLexer.EOS; var t = this.str.charAt(this.pos); return this.pos += 1, t }, e.QueryLexer.prototype.width = function () { return this.pos - this.start }, e.QueryLexer.prototype.ignore = function () { this.start == this.pos && (this.pos += 1), this.start = this.pos }, e.QueryLexer.prototype.backup = function () { this.pos -= 1 }, e.QueryLexer.prototype.acceptDigitRun = function () { var t, r; do t = this.next(), r = t.charCodeAt(0); while (r > 47 && 58 > r); t != e.QueryLexer.EOS && this.backup() }, e.QueryLexer.prototype.more = function () { return this.pos < this.length }, e.QueryLexer.EOS = "EOS", e.QueryLexer.FIELD = "FIELD", e.QueryLexer.TERM = "TERM", e.QueryLexer.EDIT_DISTANCE = "EDIT_DISTANCE", e.QueryLexer.BOOST = "BOOST", e.QueryLexer.lexField = function (t) { return t.backup(), t.emit(e.QueryLexer.FIELD), t.ignore(), e.QueryLexer.lexText }, e.QueryLexer.lexTerm = function (t) { return t.width() > 1 && (t.backup(), t.emit(e.QueryLexer.TERM)), t.ignore(), t.more() ? e.QueryLexer.lexText : void 0 }, e.QueryLexer.lexEditDistance = function (t) { return t.ignore(), t.acceptDigitRun(), t.emit(e.QueryLexer.EDIT_DISTANCE), e.QueryLexer.lexText }, e.QueryLexer.lexBoost = function (t) { return t.ignore(), t.acceptDigitRun(), t.emit(e.QueryLexer.BOOST), e.QueryLexer.lexText }, e.QueryLexer.lexEOS = function (t) { t.width() > 0 && t.emit(e.QueryLexer.TERM) }, e.QueryLexer.termSeparator = e.tokenizer.separator, e.QueryLexer.lexText = function (t) { for (; ;) { var r = t.next(); if (r == e.QueryLexer.EOS) return e.QueryLexer.lexEOS; if (92 != r.charCodeAt(0)) { if (":" == r) return e.QueryLexer.lexField; if ("~" == r) return t.backup(), t.width() > 0 && t.emit(e.QueryLexer.TERM), e.QueryLexer.lexEditDistance; if ("^" == r) return t.backup(), t.width() > 0 && t.emit(e.QueryLexer.TERM), e.QueryLexer.lexBoost; if (r.match(e.QueryLexer.termSeparator)) return e.QueryLexer.lexTerm } else t.escapeCharacter() } }, e.QueryParser = function (t, r) { this.lexer = new e.QueryLexer(t), this.query = r, this.currentClause = {}, this.lexemeIdx = 0 }, e.QueryParser.prototype.parse = function () { this.lexer.run(), this.lexemes = this.lexer.lexemes; for (var t = e.QueryParser.parseFieldOrTerm; t;)t = t(this); return this.query }, e.QueryParser.prototype.peekLexeme = function () { return this.lexemes[this.lexemeIdx] }, e.QueryParser.prototype.consumeLexeme = function () { var e = this.peekLexeme(); return this.lexemeIdx += 1, e }, e.QueryParser.prototype.nextClause = function () { var e = this.currentClause; this.query.clause(e), this.currentClause = {} }, e.QueryParser.parseFieldOrTerm = function (t) { var r = t.peekLexeme(); if (void 0 != r) switch (r.type) { case e.QueryLexer.FIELD: return e.QueryParser.parseField; case e.QueryLexer.TERM: return e.QueryParser.parseTerm; default: var i = "expected either a field or a term, found " + r.type; throw r.str.length >= 1 && (i += " with value '" + r.str + "'"), new e.QueryParseError(i, r.start, r.end) } }, e.QueryParser.parseField = function (t) { var r = t.consumeLexeme(); if (void 0 != r) { if (-1 == t.query.allFields.indexOf(r.str)) { var i = t.query.allFields.map(function (e) { return "'" + e + "'" }).join(", "), n = "unrecognised field '" + r.str + "', possible fields: " + i; throw new e.QueryParseError(n, r.start, r.end) } t.currentClause.fields = [r.str]; var s = t.peekLexeme(); if (void 0 == s) { var n = "expecting term, found nothing"; throw new e.QueryParseError(n, r.start, r.end) } switch (s.type) { case e.QueryLexer.TERM: return e.QueryParser.parseTerm; default: var n = "expecting term, found '" + s.type + "'"; throw new e.QueryParseError(n, s.start, s.end) } } }, e.QueryParser.parseTerm = function (t) { var r = t.consumeLexeme(); if (void 0 != r) { t.currentClause.term = r.str.toLowerCase(), -1 != r.str.indexOf("*") && (t.currentClause.usePipeline = !1); var i = t.peekLexeme(); if (void 0 == i) return void t.nextClause(); switch (i.type) { case e.QueryLexer.TERM: return t.nextClause(), e.QueryParser.parseTerm; case e.QueryLexer.FIELD: return t.nextClause(), e.QueryParser.parseField; case e.QueryLexer.EDIT_DISTANCE: return e.QueryParser.parseEditDistance; case e.QueryLexer.BOOST: return e.QueryParser.parseBoost; default: var n = "Unexpected lexeme type '" + i.type + "'"; throw new e.QueryParseError(n, i.start, i.end) } } }, e.QueryParser.parseEditDistance = function (t) { var r = t.consumeLexeme(); if (void 0 != r) { var i = parseInt(r.str, 10); if (isNaN(i)) { var n = "edit distance must be numeric"; throw new e.QueryParseError(n, r.start, r.end) } t.currentClause.editDistance = i; var s = t.peekLexeme(); if (void 0 == s) return void t.nextClause(); switch (s.type) { case e.QueryLexer.TERM: return t.nextClause(), e.QueryParser.parseTerm; case e.QueryLexer.FIELD: return t.nextClause(), e.QueryParser.parseField; case e.QueryLexer.EDIT_DISTANCE: return e.QueryParser.parseEditDistance; case e.QueryLexer.BOOST: return e.QueryParser.parseBoost; default: var n = "Unexpected lexeme type '" + s.type + "'"; throw new e.QueryParseError(n, s.start, s.end) } } }, e.QueryParser.parseBoost = function (t) { var r = t.consumeLexeme(); if (void 0 != r) { var i = parseInt(r.str, 10); if (isNaN(i)) { var n = "boost must be numeric"; throw new e.QueryParseError(n, r.start, r.end) } t.currentClause.boost = i; var s = t.peekLexeme(); if (void 0 == s) return void t.nextClause(); switch (s.type) { case e.QueryLexer.TERM: return t.nextClause(), e.QueryParser.parseTerm; case e.QueryLexer.FIELD: return t.nextClause(), e.QueryParser.parseField; case e.QueryLexer.EDIT_DISTANCE: return e.QueryParser.parseEditDistance; case e.QueryLexer.BOOST: return e.QueryParser.parseBoost; default: var n = "Unexpected lexeme type '" + s.type + "'"; throw new e.QueryParseError(n, s.start, s.end) } } }, function (e, t) { "function" == typeof define && define.amd ? define(t) : "object" == typeof exports ? module.exports = t() : e.lunr = t() }(this, function () { return e }) }(); diff --git a/assets/javascripts/lunr/lunr.multi.min.js b/assets/javascripts/lunr/lunr.multi.min.js new file mode 100644 index 000000000..d3dbc860c --- /dev/null +++ b/assets/javascripts/lunr/lunr.multi.min.js @@ -0,0 +1 @@ +!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var i=Array.prototype.slice.call(arguments),t=i.join("-"),r="",n=[],s=[],p=0;p =w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a =a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(u,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(m,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,u=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],m=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.pt.min.js b/assets/javascripts/lunr/lunr.pt.min.js new file mode 100644 index 000000000..d34842d52 --- /dev/null +++ b/assets/javascripts/lunr/lunr.pt.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Portuguese` 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,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(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.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(L,97,250)){for(;!z.in_grouping(L,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(L,97,250))for(;!z.out_grouping(L,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(L,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(L,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(L,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(L,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(L,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("ã");continue;case 2:z.slice_from("õ");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,e=z.find_among_b(F,45),!e)return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,e=z.find_among_b(y,7),e&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e,r;if(z.ket=z.cursor,e=z.find_among_b(W,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,r=z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){return l()||(z.cursor=z.limit,f())?(z.cursor=z.limit,z.ket=z.cursor,void(z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del())))):(z.cursor=z.limit,void d())}var h,b,g,k=[new r("",-1,3),new r("ã",0,1),new r("õ",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("ível",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("ância",-1,1),new r("ência",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logía",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("ável",-1,1),new r("ível",-1,1),new r("ución",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aça~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("ências",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logías",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aço~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("áreis",73,1),new r("éreis",73,1),new r("íreis",73,1),new r("ásseis",73,1),new r("ésseis",73,1),new r("ísseis",73,1),new r("áveis",73,1),new r("íeis",73,1),new r("aríeis",84,1),new r("eríeis",84,1),new r("iríeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("áramos",90,1),new r("éramos",90,1),new r("íramos",90,1),new r("ávamos",90,1),new r("íamos",90,1),new r("aríamos",95,1),new r("eríamos",95,1),new r("iríamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("ássemos",99,1),new r("êssemos",99,1),new r("íssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("ámos",-1,1),new r("arás",-1,1),new r("erás",-1,1),new r("irás",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("ará",-1,1),new r("erá",-1,1),new r("irá",-1,1)],y=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("á",-1,1),new r("í",-1,1),new r("ó",-1,1)],W=[new r("e",-1,1),new r("ç",-1,2),new r("é",-1,1),new r("ê",-1,1)],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.ro.min.js b/assets/javascripts/lunr/lunr.ro.min.js new file mode 100644 index 000000000..b8b889d7c --- /dev/null +++ b/assets/javascripts/lunr/lunr.ro.min.js @@ -0,0 +1,18 @@ +/*! + * 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-Za-z",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)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("ul",-1,1),new i("elor",-1,3),new i("ilor",-1,4),new i("iilor",14,4)],P=[new i("icala",-1,4),new i("iciva",-1,4),new i("ativa",-1,5),new i("itiva",-1,6),new i("icale",-1,4),new i("aţiune",-1,5),new i("iţiune",-1,6),new i("atoare",-1,5),new i("itoare",-1,6),new i("ătoare",-1,5),new i("icitate",-1,4),new i("abilitate",-1,1),new i("ibilitate",-1,2),new i("ivitate",-1,3),new i("icive",-1,4),new i("ative",-1,5),new i("itive",-1,6),new i("icali",-1,4),new i("atori",-1,5),new i("icatori",18,4),new i("itori",-1,6),new i("ători",-1,5),new i("icitati",-1,4),new i("abilitati",-1,1),new i("ivitati",-1,3),new i("icivi",-1,4),new i("ativi",-1,5),new i("itivi",-1,6),new i("icităi",-1,4),new i("abilităi",-1,1),new i("ivităi",-1,3),new i("icităţi",-1,4),new i("abilităţi",-1,1),new i("ivităţi",-1,3),new i("ical",-1,4),new i("ator",-1,5),new i("icator",35,4),new i("itor",-1,6),new i("ător",-1,5),new i("iciv",-1,4),new i("ativ",-1,5),new i("itiv",-1,6),new i("icală",-1,4),new i("icivă",-1,4),new i("ativă",-1,5),new i("itivă",-1,6)],F=[new i("ica",-1,1),new i("abila",-1,1),new i("ibila",-1,1),new i("oasa",-1,1),new i("ata",-1,1),new i("ita",-1,1),new i("anta",-1,1),new i("ista",-1,3),new i("uta",-1,1),new i("iva",-1,1),new i("ic",-1,1),new i("ice",-1,1),new i("abile",-1,1),new i("ibile",-1,1),new i("isme",-1,3),new i("iune",-1,2),new i("oase",-1,1),new i("ate",-1,1),new i("itate",17,1),new i("ite",-1,1),new i("ante",-1,1),new i("iste",-1,3),new i("ute",-1,1),new i("ive",-1,1),new i("ici",-1,1),new i("abili",-1,1),new i("ibili",-1,1),new i("iuni",-1,2),new i("atori",-1,1),new i("osi",-1,1),new i("ati",-1,1),new i("itati",30,1),new i("iti",-1,1),new i("anti",-1,1),new i("isti",-1,3),new i("uti",-1,1),new i("işti",-1,3),new i("ivi",-1,1),new i("ităi",-1,1),new i("oşi",-1,1),new i("ităţi",-1,1),new i("abil",-1,1),new i("ibil",-1,1),new i("ism",-1,3),new i("ator",-1,1),new i("os",-1,1),new i("at",-1,1),new i("it",-1,1),new i("ant",-1,1),new i("ist",-1,3),new i("ut",-1,1),new i("iv",-1,1),new i("ică",-1,1),new i("abilă",-1,1),new i("ibilă",-1,1),new i("oasă",-1,1),new i("ată",-1,1),new i("ită",-1,1),new i("antă",-1,1),new i("istă",-1,3),new i("ută",-1,1),new i("ivă",-1,1)],q=[new i("ea",-1,1),new i("ia",-1,1),new i("esc",-1,1),new i("ăsc",-1,1),new i("ind",-1,1),new i("ând",-1,1),new i("are",-1,1),new i("ere",-1,1),new i("ire",-1,1),new i("âre",-1,1),new i("se",-1,2),new i("ase",10,1),new i("sese",10,2),new i("ise",10,1),new i("use",10,1),new i("âse",10,1),new i("eşte",-1,1),new i("ăşte",-1,1),new i("eze",-1,1),new i("ai",-1,1),new i("eai",19,1),new i("iai",19,1),new i("sei",-1,2),new i("eşti",-1,1),new i("ăşti",-1,1),new i("ui",-1,1),new i("ezi",-1,1),new i("âi",-1,1),new i("aşi",-1,1),new i("seşi",-1,2),new i("aseşi",29,1),new i("seseşi",29,2),new i("iseşi",29,1),new i("useşi",29,1),new i("âseşi",29,1),new i("işi",-1,1),new i("uşi",-1,1),new i("âşi",-1,1),new i("aţi",-1,2),new i("eaţi",38,1),new i("iaţi",38,1),new i("eţi",-1,2),new i("iţi",-1,2),new i("âţi",-1,2),new i("arăţi",-1,1),new i("serăţi",-1,2),new i("aserăţi",45,1),new i("seserăţi",45,2),new i("iserăţi",45,1),new i("userăţi",45,1),new i("âserăţi",45,1),new i("irăţi",-1,1),new i("urăţi",-1,1),new i("ârăţi",-1,1),new i("am",-1,1),new i("eam",54,1),new i("iam",54,1),new i("em",-1,2),new i("asem",57,1),new i("sesem",57,2),new i("isem",57,1),new i("usem",57,1),new i("âsem",57,1),new i("im",-1,2),new i("âm",-1,2),new i("ăm",-1,2),new i("arăm",65,1),new i("serăm",65,2),new i("aserăm",67,1),new i("seserăm",67,2),new i("iserăm",67,1),new i("userăm",67,1),new i("âserăm",67,1),new i("irăm",65,1),new i("urăm",65,1),new i("ârăm",65,1),new i("au",-1,1),new i("eau",76,1),new i("iau",76,1),new i("indu",-1,1),new i("ându",-1,1),new i("ez",-1,1),new i("ească",-1,1),new i("ară",-1,1),new i("seră",-1,2),new i("aseră",84,1),new i("seseră",84,2),new i("iseră",84,1),new i("useră",84,1),new i("âseră",84,1),new i("iră",-1,1),new i("ură",-1,1),new i("âră",-1,1),new i("ează",-1,1)],S=[new i("a",-1,1),new i("e",-1,1),new i("ie",1,1),new i("i",-1,1),new i("ă",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,2,32,0,0,4],W=new r;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,c(),W.limit_backward=e,W.cursor=W.limit,f(),W.cursor=W.limit,d(),W.cursor=W.limit,_||(W.cursor=W.limit,b(),W.cursor=W.limit),v(),W.cursor=W.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.ro.stemmer,"stemmer-ro"),e.ro.stopWordFilter=e.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(" ")),e.Pipeline.registerFunction(e.ro.stopWordFilter,"stopWordFilter-ro")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.ru.min.js b/assets/javascripts/lunr/lunr.ru.min.js new file mode 100644 index 000000000..314eb9398 --- /dev/null +++ b/assets/javascripts/lunr/lunr.ru.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Russian` 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,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(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.ru=function(){this.pipeline.reset(),this.pipeline.add(e.ru.trimmer,e.ru.stopWordFilter,e.ru.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ru.stemmer))},e.ru.wordCharacters="Ѐ-҄҇-ԯᴫᵸⷠ-ⷿꙀ-ꚟ︮︯",e.ru.trimmer=e.trimmerSupport.generateTrimmer(e.ru.wordCharacters),e.Pipeline.registerFunction(e.ru.trimmer,"trimmer-ru"),e.ru.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,t=new function(){function e(){for(;!y.in_grouping(S,1072,1103);){if(y.cursor>=y.limit)return!1;y.cursor++}return!0}function t(){for(;!y.out_grouping(S,1072,1103);){if(y.cursor>=y.limit)return!1;y.cursor++}return!0}function w(){b=y.limit,_=b,e()&&(b=y.cursor,t()&&e()&&t()&&(_=y.cursor))}function i(){return _<=y.cursor}function u(e,n){var r,t;if(y.ket=y.cursor,r=y.find_among_b(e,n)){switch(y.bra=y.cursor,r){case 1:if(t=y.limit-y.cursor,!y.eq_s_b(1,"а")&&(y.cursor=y.limit-t,!y.eq_s_b(1,"я")))return!1;case 2:y.slice_del()}return!0}return!1}function o(){return u(h,9)}function s(e,n){var r;return y.ket=y.cursor,r=y.find_among_b(e,n),!!r&&(y.bra=y.cursor,1==r&&y.slice_del(),!0)}function c(){return s(g,26)}function f(){return!!c()&&(u(C,8),!0)}function m(){return s(k,2)}function l(){return u(P,46)}function a(){s(F,36)}function p(){var e;y.ket=y.cursor,e=y.find_among_b(q,2),e&&(y.bra=y.cursor,i()&&1==e&&y.slice_del())}function d(){var e;if(y.ket=y.cursor,e=y.find_among_b(v,4))switch(y.bra=y.cursor,e){case 1:if(y.slice_del(),y.ket=y.cursor,!y.eq_s_b(1,"н"))break;y.bra=y.cursor;case 2:if(!y.eq_s_b(1,"н"))break;case 3:y.slice_del()}}var _,b,h=[new n("в",-1,1),new n("ив",0,2),new n("ыв",0,2),new n("вши",-1,1),new n("ивши",3,2),new n("ывши",3,2),new n("вшись",-1,1),new n("ившись",6,2),new n("ывшись",6,2)],g=[new n("ее",-1,1),new n("ие",-1,1),new n("ое",-1,1),new n("ые",-1,1),new n("ими",-1,1),new n("ыми",-1,1),new n("ей",-1,1),new n("ий",-1,1),new n("ой",-1,1),new n("ый",-1,1),new n("ем",-1,1),new n("им",-1,1),new n("ом",-1,1),new n("ым",-1,1),new n("его",-1,1),new n("ого",-1,1),new n("ему",-1,1),new n("ому",-1,1),new n("их",-1,1),new n("ых",-1,1),new n("ею",-1,1),new n("ою",-1,1),new n("ую",-1,1),new n("юю",-1,1),new n("ая",-1,1),new n("яя",-1,1)],C=[new n("ем",-1,1),new n("нн",-1,1),new n("вш",-1,1),new n("ивш",2,2),new n("ывш",2,2),new n("щ",-1,1),new n("ющ",5,1),new n("ующ",6,2)],k=[new n("сь",-1,1),new n("ся",-1,1)],P=[new n("ла",-1,1),new n("ила",0,2),new n("ыла",0,2),new n("на",-1,1),new n("ена",3,2),new n("ете",-1,1),new n("ите",-1,2),new n("йте",-1,1),new n("ейте",7,2),new n("уйте",7,2),new n("ли",-1,1),new n("или",10,2),new n("ыли",10,2),new n("й",-1,1),new n("ей",13,2),new n("уй",13,2),new n("л",-1,1),new n("ил",16,2),new n("ыл",16,2),new n("ем",-1,1),new n("им",-1,2),new n("ым",-1,2),new n("н",-1,1),new n("ен",22,2),new n("ло",-1,1),new n("ило",24,2),new n("ыло",24,2),new n("но",-1,1),new n("ено",27,2),new n("нно",27,1),new n("ет",-1,1),new n("ует",30,2),new n("ит",-1,2),new n("ыт",-1,2),new n("ют",-1,1),new n("уют",34,2),new n("ят",-1,2),new n("ны",-1,1),new n("ены",37,2),new n("ть",-1,1),new n("ить",39,2),new n("ыть",39,2),new n("ешь",-1,1),new n("ишь",-1,2),new n("ю",-1,2),new n("ую",44,2)],F=[new n("а",-1,1),new n("ев",-1,1),new n("ов",-1,1),new n("е",-1,1),new n("ие",3,1),new n("ье",3,1),new n("и",-1,1),new n("еи",6,1),new n("ии",6,1),new n("ами",6,1),new n("ями",6,1),new n("иями",10,1),new n("й",-1,1),new n("ей",12,1),new n("ией",13,1),new n("ий",12,1),new n("ой",12,1),new n("ам",-1,1),new n("ем",-1,1),new n("ием",18,1),new n("ом",-1,1),new n("ям",-1,1),new n("иям",21,1),new n("о",-1,1),new n("у",-1,1),new n("ах",-1,1),new n("ях",-1,1),new n("иях",26,1),new n("ы",-1,1),new n("ь",-1,1),new n("ю",-1,1),new n("ию",30,1),new n("ью",30,1),new n("я",-1,1),new n("ия",33,1),new n("ья",33,1)],q=[new n("ост",-1,1),new n("ость",-1,1)],v=[new n("ейше",-1,1),new n("н",-1,2),new n("ейш",-1,1),new n("ь",-1,3)],S=[33,65,8,232],y=new r;this.setCurrent=function(e){y.setCurrent(e)},this.getCurrent=function(){return y.getCurrent()},this.stem=function(){return w(),y.cursor=y.limit,!(y.cursor=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor s||e>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor >1),f=0,l=o 0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if(s=_.substring_i,s<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o =0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if(s=_.substring_i,s<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.sv.min.js b/assets/javascripts/lunr/lunr.sv.min.js new file mode 100644 index 000000000..044fad1f1 --- /dev/null +++ b/assets/javascripts/lunr/lunr.sv.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Swedish` 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,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(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.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/lunr.tr.min.js b/assets/javascripts/lunr/lunr.tr.min.js new file mode 100644 index 000000000..2f327a83f --- /dev/null +++ b/assets/javascripts/lunr/lunr.tr.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Turkish` 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(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if("undefined"==typeof r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=function(){var i=r.stemmerSupport.Among,e=r.stemmerSupport.SnowballProgram,n=new function(){function r(r,i,e){for(;;){var n=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(r,i,e)){Dr.cursor=Dr.limit-n;break}if(Dr.cursor=Dr.limit-n,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function n(){var i,e;i=Dr.limit-Dr.cursor,r(Wr,97,305);for(var n=0;n Dr.limit_backward&&(Dr.cursor--,e=Dr.limit-Dr.cursor,i()))?(Dr.cursor=Dr.limit-e,!0):(Dr.cursor=Dr.limit-n,r()?(Dr.cursor=Dr.limit-n,!1):(Dr.cursor=Dr.limit-n,!(Dr.cursor<=Dr.limit_backward)&&(Dr.cursor--,!!i()&&(Dr.cursor=Dr.limit-n,!0))))}function u(r){return t(r,function(){return Dr.in_grouping_b(Wr,97,305)})}function o(){return u(function(){return Dr.eq_s_b(1,"n")})}function s(){return u(function(){return Dr.eq_s_b(1,"s")})}function c(){return u(function(){return Dr.eq_s_b(1,"y")})}function l(){return t(function(){return Dr.in_grouping_b(Lr,105,305)},function(){return Dr.out_grouping_b(Wr,97,305)})}function a(){return Dr.find_among_b(ur,10)&&l()}function m(){return n()&&Dr.in_grouping_b(Lr,105,305)&&s()}function d(){return Dr.find_among_b(or,2)}function f(){return n()&&Dr.in_grouping_b(Lr,105,305)&&c()}function b(){return n()&&Dr.find_among_b(sr,4)}function w(){return n()&&Dr.find_among_b(cr,4)&&o()}function _(){return n()&&Dr.find_among_b(lr,2)&&c()}function k(){return n()&&Dr.find_among_b(ar,2)}function p(){return n()&&Dr.find_among_b(mr,4)}function g(){return n()&&Dr.find_among_b(dr,2)}function y(){return n()&&Dr.find_among_b(fr,4)}function z(){return n()&&Dr.find_among_b(br,2)}function h(){return n()&&Dr.find_among_b(wr,2)&&c()}function v(){return Dr.eq_s_b(2,"ki")}function q(){return n()&&Dr.find_among_b(_r,2)&&o()}function C(){return n()&&Dr.find_among_b(kr,4)&&c()}function P(){return n()&&Dr.find_among_b(pr,4)}function F(){return n()&&Dr.find_among_b(gr,4)&&c()}function S(){return Dr.find_among_b(yr,4)}function W(){return n()&&Dr.find_among_b(zr,2)}function L(){return n()&&Dr.find_among_b(hr,4)}function x(){return n()&&Dr.find_among_b(vr,8)}function A(){return Dr.find_among_b(qr,2)}function E(){return n()&&Dr.find_among_b(Cr,32)&&c()}function j(){return Dr.find_among_b(Pr,8)&&c()}function T(){return n()&&Dr.find_among_b(Fr,4)&&c()}function Z(){return Dr.eq_s_b(3,"ken")&&c()}function B(){var r=Dr.limit-Dr.cursor;return!(T()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,Z()))))}function D(){if(A()){var r=Dr.limit-Dr.cursor;if(S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T())return!1}return!0}function G(){if(W()){Dr.bra=Dr.cursor,Dr.slice_del();var r=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,x()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,T()||(Dr.cursor=Dr.limit-r)))),nr=!1,!1}return!0}function H(){if(!L())return!0;var r=Dr.limit-Dr.cursor;return!E()&&(Dr.cursor=Dr.limit-r,!j())}function I(){var r,i=Dr.limit-Dr.cursor;return!(S()||(Dr.cursor=Dr.limit-i,F()||(Dr.cursor=Dr.limit-i,P()||(Dr.cursor=Dr.limit-i,C()))))||(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,T()||(Dr.cursor=Dr.limit-r),!1)}function J(){var r,i=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,nr=!0,B()&&(Dr.cursor=Dr.limit-i,D()&&(Dr.cursor=Dr.limit-i,G()&&(Dr.cursor=Dr.limit-i,H()&&(Dr.cursor=Dr.limit-i,I()))))){if(Dr.cursor=Dr.limit-i,!x())return;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T()||(Dr.cursor=Dr.limit-r)}Dr.bra=Dr.cursor,Dr.slice_del()}function K(){var r,i,e,n;if(Dr.ket=Dr.cursor,v()){if(r=Dr.limit-Dr.cursor,p())return Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,a()&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))),!0;if(Dr.cursor=Dr.limit-r,w()){if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,e=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-e,!m()&&(Dr.cursor=Dr.limit-e,!K())))return!0;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}return!0}if(Dr.cursor=Dr.limit-r,g()){if(n=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-n,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-n,!K())return!1;return!0}}return!1}function M(r){if(Dr.ket=Dr.cursor,!g()&&(Dr.cursor=Dr.limit-r,!k()))return!1;var i=Dr.limit-Dr.cursor;if(d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-i,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-i,!K())return!1;return!0}function N(r){if(Dr.ket=Dr.cursor,!z()&&(Dr.cursor=Dr.limit-r,!b()))return!1;var i=Dr.limit-Dr.cursor;return!(!m()&&(Dr.cursor=Dr.limit-i,!d()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)}function O(){var r,i=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,!(!w()&&(Dr.cursor=Dr.limit-i,!h()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,!(!W()||(Dr.bra=Dr.cursor,Dr.slice_del(),!K()))||(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!(a()||(Dr.cursor=Dr.limit-r,m()||(Dr.cursor=Dr.limit-r,K())))||(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)))}function Q(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,!p()&&(Dr.cursor=Dr.limit-e,!f()&&(Dr.cursor=Dr.limit-e,!_())))return!1;if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,a())Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()||(Dr.cursor=Dr.limit-i);else if(Dr.cursor=Dr.limit-r,!W())return!0;return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,K(),!0}function R(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,W())return Dr.bra=Dr.cursor,Dr.slice_del(),void K();if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,q())if(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-r,!m())){if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!W())return;if(Dr.bra=Dr.cursor,Dr.slice_del(),!K())return}Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}else if(Dr.cursor=Dr.limit-e,!M(e)&&(Dr.cursor=Dr.limit-e,!N(e))){if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,y())return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,i=Dr.limit-Dr.cursor,void(a()?(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())):(Dr.cursor=Dr.limit-i,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,K())));if(Dr.cursor=Dr.limit-e,!O()){if(Dr.cursor=Dr.limit-e,d())return Dr.bra=Dr.cursor,void Dr.slice_del();Dr.cursor=Dr.limit-e,K()||(Dr.cursor=Dr.limit-e,Q()||(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,(a()||(Dr.cursor=Dr.limit-e,m()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))))}}}function U(){var r;if(Dr.ket=Dr.cursor,r=Dr.find_among_b(Sr,4))switch(Dr.bra=Dr.cursor,r){case 1:Dr.slice_from("p");break;case 2:Dr.slice_from("ç");break;case 3:Dr.slice_from("t");break;case 4:Dr.slice_from("k")}}function V(){for(;;){var r=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(Wr,97,305)){Dr.cursor=Dr.limit-r;break}if(Dr.cursor=Dr.limit-r,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function X(r,i,e){if(Dr.cursor=Dr.limit-r,V()){var n=Dr.limit-Dr.cursor;if(!Dr.eq_s_b(1,i)&&(Dr.cursor=Dr.limit-n,!Dr.eq_s_b(1,e)))return!0;Dr.cursor=Dr.limit-r;var t=Dr.cursor;return Dr.insert(Dr.cursor,Dr.cursor,e),Dr.cursor=t,!1}return!0}function Y(){var r=Dr.limit-Dr.cursor;(Dr.eq_s_b(1,"d")||(Dr.cursor=Dr.limit-r,Dr.eq_s_b(1,"g")))&&X(r,"a","ı")&&X(r,"e","i")&&X(r,"o","u")&&X(r,"ö","ü")}function $(){for(var r,i=Dr.cursor,e=2;;){for(r=Dr.cursor;!Dr.in_grouping(Wr,97,305);){if(Dr.cursor>=Dr.limit)return Dr.cursor=r,!(e>0)&&(Dr.cursor=i,!0);Dr.cursor++}e--}}function rr(r,i,e){for(;!Dr.eq_s(i,e);){if(Dr.cursor>=Dr.limit)return!0;Dr.cursor++}return tr=i,tr!=Dr.limit||(Dr.cursor=r,!1)}function ir(){var r=Dr.cursor;return!rr(r,2,"ad")||(Dr.cursor=r,!rr(r,5,"soyad"))}function er(){var r=Dr.cursor;return!ir()&&(Dr.limit_backward=r,Dr.cursor=Dr.limit,Y(),Dr.cursor=Dr.limit,U(),!0)}var nr,tr,ur=[new i("m",-1,-1),new i("n",-1,-1),new i("miz",-1,-1),new i("niz",-1,-1),new i("muz",-1,-1),new i("nuz",-1,-1),new i("müz",-1,-1),new i("nüz",-1,-1),new i("mız",-1,-1),new i("nız",-1,-1)],or=[new i("leri",-1,-1),new i("ları",-1,-1)],sr=[new i("ni",-1,-1),new i("nu",-1,-1),new i("nü",-1,-1),new i("nı",-1,-1)],cr=[new i("in",-1,-1),new i("un",-1,-1),new i("ün",-1,-1),new i("ın",-1,-1)],lr=[new i("a",-1,-1),new i("e",-1,-1)],ar=[new i("na",-1,-1),new i("ne",-1,-1)],mr=[new i("da",-1,-1),new i("ta",-1,-1),new i("de",-1,-1),new i("te",-1,-1)],dr=[new i("nda",-1,-1),new i("nde",-1,-1)],fr=[new i("dan",-1,-1),new i("tan",-1,-1),new i("den",-1,-1),new i("ten",-1,-1)],br=[new i("ndan",-1,-1),new i("nden",-1,-1)],wr=[new i("la",-1,-1),new i("le",-1,-1)],_r=[new i("ca",-1,-1),new i("ce",-1,-1)],kr=[new i("im",-1,-1),new i("um",-1,-1),new i("üm",-1,-1),new i("ım",-1,-1)],pr=[new i("sin",-1,-1),new i("sun",-1,-1),new i("sün",-1,-1),new i("sın",-1,-1)],gr=[new i("iz",-1,-1),new i("uz",-1,-1),new i("üz",-1,-1),new i("ız",-1,-1)],yr=[new i("siniz",-1,-1),new i("sunuz",-1,-1),new i("sünüz",-1,-1),new i("sınız",-1,-1)],zr=[new i("lar",-1,-1),new i("ler",-1,-1)],hr=[new i("niz",-1,-1),new i("nuz",-1,-1),new i("nüz",-1,-1),new i("nız",-1,-1)],vr=[new i("dir",-1,-1),new i("tir",-1,-1),new i("dur",-1,-1),new i("tur",-1,-1),new i("dür",-1,-1),new i("tür",-1,-1),new i("dır",-1,-1),new i("tır",-1,-1)],qr=[new i("casına",-1,-1),new i("cesine",-1,-1)],Cr=[new i("di",-1,-1),new i("ti",-1,-1),new i("dik",-1,-1),new i("tik",-1,-1),new i("duk",-1,-1),new i("tuk",-1,-1),new i("dük",-1,-1),new i("tük",-1,-1),new i("dık",-1,-1),new i("tık",-1,-1),new i("dim",-1,-1),new i("tim",-1,-1),new i("dum",-1,-1),new i("tum",-1,-1),new i("düm",-1,-1),new i("tüm",-1,-1),new i("dım",-1,-1),new i("tım",-1,-1),new i("din",-1,-1),new i("tin",-1,-1),new i("dun",-1,-1),new i("tun",-1,-1),new i("dün",-1,-1),new i("tün",-1,-1),new i("dın",-1,-1),new i("tın",-1,-1),new i("du",-1,-1),new i("tu",-1,-1),new i("dü",-1,-1),new i("tü",-1,-1),new i("dı",-1,-1),new i("tı",-1,-1)],Pr=[new i("sa",-1,-1),new i("se",-1,-1),new i("sak",-1,-1),new i("sek",-1,-1),new i("sam",-1,-1),new i("sem",-1,-1),new i("san",-1,-1),new i("sen",-1,-1)],Fr=[new i("miş",-1,-1),new i("muş",-1,-1),new i("müş",-1,-1),new i("mış",-1,-1)],Sr=[new i("b",-1,1),new i("c",-1,2),new i("d",-1,3),new i("ğ",-1,4)],Wr=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],Lr=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],xr=[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],Ar=[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],Er=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],jr=[17],Tr=[65],Zr=[65],Br=[["a",xr,97,305],["e",Ar,101,252],["ı",Er,97,305],["i",jr,101,105],["o",Tr,111,117],["ö",Zr,246,252],["u",Tr,111,117]],Dr=new e;this.setCurrent=function(r){Dr.setCurrent(r)},this.getCurrent=function(){return Dr.getCurrent()},this.stem=function(){return!!($()&&(Dr.limit_backward=Dr.cursor,Dr.cursor=Dr.limit,J(),Dr.cursor=Dr.limit,nr&&(R(),Dr.cursor=Dr.limit_backward,er())))}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir biri birkaç birkez birçok birşey birşeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunları bunların bunu bunun burada böyle böylece da daha dahi de defa değil diye diğer doksan dokuz dolayı dolayısıyla dört edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiği ettiğini eğer gibi göre halen hangi hatta hem henüz hep hepsi her herhangi herkesin hiç hiçbir iki ile ilgili ise itibaren itibariyle için işte kadar karşın katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kırk milyar milyon mu mü mı nasıl ne neden nedenle nerde nerede nereye niye niçin o olan olarak oldu olduklarını olduğu olduğunu olmadı olmadığı olmak olması olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onları onların onu onun otuz oysa pek rağmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafından trilyon tüm var vardı ve veya ya yani yapacak yapmak yaptı yaptıkları yaptığı yaptığını yapılan yapılması yapıyor yedi yerine yetmiş yine yirmi yoksa yüz zaten çok çünkü öyle üzere üç şey şeyden şeyi şeyler şu şuna şunda şundan şunları şunu şöyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}}); \ No newline at end of file diff --git a/assets/javascripts/main.js b/assets/javascripts/main.js index 8303e814d..6fe62c548 100644 --- a/assets/javascripts/main.js +++ b/assets/javascripts/main.js @@ -55,3 +55,13 @@ myMenu.addEventListener('click', function() { toggleClassMenu(); animateMenuItems(); }, false); + +// Search toggle +$(".search-toggle").on("click", function() { + $(".search-content").toggleClass("is--visible"); + $(".initial-content").toggleClass("is--hidden"); + // set focus on input + setTimeout(function() { + $("#search").focus(); + }, 400); +}); diff --git a/assets/javascripts/search-data.json b/assets/javascripts/search-data.json new file mode 100644 index 000000000..9e87ff41f --- /dev/null +++ b/assets/javascripts/search-data.json @@ -0,0 +1,27 @@ +--- +layout: null +sitemap: false +--- + +var store = [ + {%- for c in site.collections -%} + {%- if forloop.last -%} + {%- assign l = true -%} + {%- endif -%} + {%- assign docs = c.docs | where_exp: 'doc', 'doc.search != false' -%} + {%- for doc in docs -%} + { + "title": {{ doc.title | jsonify }}, + "excerpt": + {%- if site.search_full_content == true -%} + {{ doc.content | strip_html | strip_newlines | jsonify }}, + {%- else -%} + {{ doc.content | strip_html | strip_newlines | truncatewords: 50 | jsonify }}, + {%- endif -%} + "categories": {{ doc.categories | jsonify }}, + "tags": {{ doc.tags | jsonify }}, + "url": {{ doc.url | absolute_url | jsonify }} + } {%- unless forloop.last and l -%}, {%- endunless -%} + {%- endfor -%} + {%- endfor -%} +] diff --git a/docs/_config.yml b/docs/_config.yml index c0240f6d9..9f2350de1 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -25,6 +25,14 @@ logo: /assets/icons/basically-basic-logo-light.svg google_analytics: UA-2011187-6 disqus: shortname: basically-basic-theme +search: true +search_full_content: true +search_provider: lunr +algolia: + application_id: # YOUR_APPLICATION_ID + index_name: # YOUR_INDEX_NAME + search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY + powered_by: # true (default), false # Conversion markdown: kramdown diff --git a/docs/_data/theme.yml b/docs/_data/theme.yml index 89242ea15..1e82c26fd 100644 --- a/docs/_data/theme.yml +++ b/docs/_data/theme.yml @@ -8,6 +8,9 @@ t: skip_content: "Skip to content" skip_footer: "Skip to footer" menu: "Menu" + search: "Search" + results_found: "Result(s) found" + search_placeholder_text: "Enter your search term..." home: "Home" newer: "Newer" older: "Older" diff --git a/example/Gemfile b/example/Gemfile index 304c1ef13..737ee617c 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -9,6 +9,7 @@ group :jekyll_plugins do gem "jekyll-seo-tag" gem "jekyll-sitemap" gem "jekyll-paginate" + gem "jekyll-algolia" end -gem "wdm", "~> 0.1.0" if Gem.win_platform? \ No newline at end of file +gem "wdm", "~> 0.1.0" if Gem.win_platform? diff --git a/example/_config.yml b/example/_config.yml index e6227338c..d83cdce57 100644 --- a/example/_config.yml +++ b/example/_config.yml @@ -26,6 +26,14 @@ author: twitter_username: Towlette_Pettetucci github_username: Towlette_Pettetucci logo: /assets/icons/basically-basic-logo-light.svg +search: true +search_full_content: true +search_provider: algolia +algolia: + application_id: QB6HVGBSBA + index_name: basically-basic + search_only_api_key: 9d5014e5bbc77372547bce778dfa5663 + powered_by: # true (default), false # Liquid liquid: