2021-02-18 21:44:01 +01:00
/ * !
* Lunr languages , ` Finnish ` 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/
* /
/ * *
* export the module via AMD , CommonJS or as a browser global
* Export code from https : //github.com/umdjs/umd/blob/master/returnExports.js
* /
2021-02-18 22:21:36 +01:00
( function ( root , factory ) {
if ( typeof define === "function" && define . amd ) {
2021-02-18 21:44:01 +01:00
// AMD. Register as an anonymous module.
2021-02-18 22:21:36 +01:00
define ( factory ) ;
} else if ( typeof exports === "object" ) {
2021-02-18 21:44:01 +01:00
/ * *
* Node . Does not work with strict CommonJS , but
* only CommonJS - like environments that support module . exports ,
* like Node .
* /
2021-02-18 22:21:36 +01:00
module . exports = factory ( ) ;
2021-02-18 21:44:01 +01:00
} else {
// Browser globals (root is window)
factory ( ) ( root . lunr ) ;
}
2021-02-18 22:21:36 +01:00
} ) ( this , function ( ) {
2021-02-18 21:44:01 +01:00
/ * *
* Just return a value to define the module export .
* This example returns an object , but the module
* can return a function as the exported value .
* /
2021-02-18 22:21:36 +01:00
return function ( lunr ) {
2021-02-18 21:44:01 +01:00
/* throw error if lunr is not yet included */
2021-02-18 22:21:36 +01:00
if ( "undefined" === typeof lunr ) {
throw new Error (
"Lunr is not present. Please include / require Lunr before this script."
) ;
2021-02-18 21:44:01 +01:00
}
/* throw error if lunr stemmer support is not yet included */
2021-02-18 22:21:36 +01:00
if ( "undefined" === typeof lunr . stemmerSupport ) {
throw new Error (
"Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script."
) ;
2021-02-18 21:44:01 +01:00
}
/* register specific locale function */
2021-02-18 22:21:36 +01:00
lunr . fi = function ( ) {
2021-02-18 21:44:01 +01:00
this . pipeline . reset ( ) ;
this . pipeline . add (
lunr . fi . trimmer ,
lunr . fi . stopWordFilter ,
lunr . fi . stemmer
) ;
// for lunr version 2
// this is necessary so that every searched word is also stemmed before
// in lunr <= 1 this is not needed, as it is done using the normal pipeline
if ( this . searchPipeline ) {
this . searchPipeline . reset ( ) ;
2021-02-18 22:21:36 +01:00
this . searchPipeline . add ( lunr . fi . stemmer ) ;
2021-02-18 21:44:01 +01:00
}
} ;
/* lunr trimmer function */
2021-02-18 22:21:36 +01:00
lunr . fi . wordCharacters =
"A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A" ;
lunr . fi . trimmer = lunr . trimmerSupport . generateTrimmer (
lunr . fi . wordCharacters
) ;
2021-02-18 21:44:01 +01:00
2021-02-18 22:21:36 +01:00
lunr . Pipeline . registerFunction ( lunr . fi . trimmer , "trimmer-fi" ) ;
2021-02-18 21:44:01 +01:00
/* lunr stemmer function */
2021-02-18 22:21:36 +01:00
lunr . fi . stemmer = ( function ( ) {
2021-02-18 21:44:01 +01:00
/* create the wrapped stemmer object */
var Among = lunr . stemmerSupport . Among ,
SnowballProgram = lunr . stemmerSupport . SnowballProgram ,
2021-02-18 22:21:36 +01:00
st = new ( function FinnishStemmer ( ) {
var a _0 = [
new Among ( "pa" , - 1 , 1 ) ,
new Among ( "sti" , - 1 , 2 ) ,
new Among ( "kaan" , - 1 , 1 ) ,
new Among ( "han" , - 1 , 1 ) ,
new Among ( "kin" , - 1 , 1 ) ,
new Among ( "h\u00E4n" , - 1 , 1 ) ,
new Among ( "k\u00E4\u00E4n" , - 1 , 1 ) ,
new Among ( "ko" , - 1 , 1 ) ,
new Among ( "p\u00E4" , - 1 , 1 ) ,
new Among ( "k\u00F6" , - 1 , 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
a _1 = [
2021-02-18 22:21:36 +01:00
new Among ( "lla" , - 1 , - 1 ) ,
new Among ( "na" , - 1 , - 1 ) ,
new Among ( "ssa" , - 1 , - 1 ) ,
new Among ( "ta" , - 1 , - 1 ) ,
new Among ( "lta" , 3 , - 1 ) ,
new Among ( "sta" , 3 , - 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
a _2 = [
2021-02-18 22:21:36 +01:00
new Among ( "ll\u00E4" , - 1 , - 1 ) ,
new Among ( "n\u00E4" , - 1 , - 1 ) ,
new Among ( "ss\u00E4" , - 1 , - 1 ) ,
new Among ( "t\u00E4" , - 1 , - 1 ) ,
new Among ( "lt\u00E4" , 3 , - 1 ) ,
new Among ( "st\u00E4" , 3 , - 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _3 = [ new Among ( "lle" , - 1 , - 1 ) , new Among ( "ine" , - 1 , - 1 ) ] ,
2021-02-18 21:44:01 +01:00
a _4 = [
2021-02-18 22:21:36 +01:00
new Among ( "nsa" , - 1 , 3 ) ,
new Among ( "mme" , - 1 , 3 ) ,
new Among ( "nne" , - 1 , 3 ) ,
new Among ( "ni" , - 1 , 2 ) ,
new Among ( "si" , - 1 , 1 ) ,
new Among ( "an" , - 1 , 4 ) ,
new Among ( "en" , - 1 , 6 ) ,
new Among ( "\u00E4n" , - 1 , 5 ) ,
new Among ( "ns\u00E4" , - 1 , 3 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _5 = [
new Among ( "aa" , - 1 , - 1 ) ,
new Among ( "ee" , - 1 , - 1 ) ,
new Among ( "ii" , - 1 , - 1 ) ,
new Among ( "oo" , - 1 , - 1 ) ,
new Among ( "uu" , - 1 , - 1 ) ,
2021-02-18 21:44:01 +01:00
new Among ( "\u00E4\u00E4" , - 1 , - 1 ) ,
2021-02-18 22:21:36 +01:00
new Among ( "\u00F6\u00F6" , - 1 , - 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _6 = [
new Among ( "a" , - 1 , 8 ) ,
new Among ( "lla" , 0 , - 1 ) ,
new Among ( "na" , 0 , - 1 ) ,
new Among ( "ssa" , 0 , - 1 ) ,
new Among ( "ta" , 0 , - 1 ) ,
new Among ( "lta" , 4 , - 1 ) ,
new Among ( "sta" , 4 , - 1 ) ,
new Among ( "tta" , 4 , 9 ) ,
new Among ( "lle" , - 1 , - 1 ) ,
new Among ( "ine" , - 1 , - 1 ) ,
new Among ( "ksi" , - 1 , - 1 ) ,
new Among ( "n" , - 1 , 7 ) ,
new Among ( "han" , 11 , 1 ) ,
new Among ( "den" , 11 , - 1 , r _VI ) ,
new Among ( "seen" , 11 , - 1 , r _LONG ) ,
new Among ( "hen" , 11 , 2 ) ,
new Among ( "tten" , 11 , - 1 , r _VI ) ,
new Among ( "hin" , 11 , 3 ) ,
new Among ( "siin" , 11 , - 1 , r _VI ) ,
new Among ( "hon" , 11 , 4 ) ,
new Among ( "h\u00E4n" , 11 , 5 ) ,
new Among ( "h\u00F6n" , 11 , 6 ) ,
new Among ( "\u00E4" , - 1 , 8 ) ,
new Among ( "ll\u00E4" , 22 , - 1 ) ,
new Among ( "n\u00E4" , 22 , - 1 ) ,
new Among ( "ss\u00E4" , 22 , - 1 ) ,
new Among ( "t\u00E4" , 22 , - 1 ) ,
new Among ( "lt\u00E4" , 26 , - 1 ) ,
new Among ( "st\u00E4" , 26 , - 1 ) ,
new Among ( "tt\u00E4" , 26 , 9 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _7 = [
new Among ( "eja" , - 1 , - 1 ) ,
new Among ( "mma" , - 1 , 1 ) ,
new Among ( "imma" , 1 , - 1 ) ,
new Among ( "mpa" , - 1 , 1 ) ,
new Among ( "impa" , 3 , - 1 ) ,
new Among ( "mmi" , - 1 , 1 ) ,
new Among ( "immi" , 5 , - 1 ) ,
new Among ( "mpi" , - 1 , 1 ) ,
new Among ( "impi" , 7 , - 1 ) ,
new Among ( "ej\u00E4" , - 1 , - 1 ) ,
new Among ( "mm\u00E4" , - 1 , 1 ) ,
new Among ( "imm\u00E4" , 10 , - 1 ) ,
new Among ( "mp\u00E4" , - 1 , 1 ) ,
new Among ( "imp\u00E4" , 12 , - 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _8 = [ new Among ( "i" , - 1 , - 1 ) , new Among ( "j" , - 1 , - 1 ) ] ,
a _9 = [ new Among ( "mma" , - 1 , 1 ) , new Among ( "imma" , 0 , - 1 ) ] ,
g _AEI = [ 17 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 8 ] ,
g _V1 = [
17 ,
65 ,
16 ,
1 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
8 ,
0 ,
32 ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
g _V2 = [
17 ,
65 ,
16 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
8 ,
0 ,
32 ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
g _particle _end = [
17 ,
97 ,
24 ,
1 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
8 ,
0 ,
32 ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
B _ending _removed ,
S _x ,
I _p2 ,
I _p1 ,
sbp = new SnowballProgram ( ) ;
this . setCurrent = function ( word ) {
2021-02-18 21:44:01 +01:00
sbp . setCurrent ( word ) ;
} ;
2021-02-18 22:21:36 +01:00
this . getCurrent = function ( ) {
2021-02-18 21:44:01 +01:00
return sbp . getCurrent ( ) ;
} ;
function r _mark _regions ( ) {
I _p1 = sbp . limit ;
I _p2 = I _p1 ;
if ( ! habr1 ( ) ) {
I _p1 = sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( ! habr1 ( ) ) I _p2 = sbp . cursor ;
2021-02-18 21:44:01 +01:00
}
}
function habr1 ( ) {
var v _1 ;
while ( true ) {
v _1 = sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( sbp . in _grouping ( g _V1 , 97 , 246 ) ) break ;
2021-02-18 21:44:01 +01:00
sbp . cursor = v _1 ;
2021-02-18 22:21:36 +01:00
if ( v _1 >= sbp . limit ) return true ;
2021-02-18 21:44:01 +01:00
sbp . cursor ++ ;
}
sbp . cursor = v _1 ;
while ( ! sbp . out _grouping ( g _V1 , 97 , 246 ) ) {
2021-02-18 22:21:36 +01:00
if ( sbp . cursor >= sbp . limit ) return true ;
2021-02-18 21:44:01 +01:00
sbp . cursor ++ ;
}
return false ;
}
function r _R2 ( ) {
return I _p2 <= sbp . cursor ;
}
function r _particle _etc ( ) {
var among _var , v _1 ;
if ( sbp . cursor >= I _p1 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p1 ;
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _0 , 10 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
sbp . limit _backward = v _1 ;
switch ( among _var ) {
case 1 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . in _grouping _b ( g _particle _end , 97 , 246 ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 2 :
2021-02-18 22:21:36 +01:00
if ( ! r _R2 ( ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
}
sbp . slice _del ( ) ;
2021-02-18 22:21:36 +01:00
} else sbp . limit _backward = v _1 ;
2021-02-18 21:44:01 +01:00
}
}
function r _possessive ( ) {
var among _var , v _1 , v _2 ;
if ( sbp . cursor >= I _p1 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p1 ;
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _4 , 9 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
sbp . limit _backward = v _1 ;
switch ( among _var ) {
case 1 :
v _2 = sbp . limit - sbp . cursor ;
if ( ! sbp . eq _s _b ( 1 , "k" ) ) {
sbp . cursor = sbp . limit - v _2 ;
sbp . slice _del ( ) ;
}
break ;
case 2 :
sbp . slice _del ( ) ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 3 , "kse" ) ) {
sbp . bra = sbp . cursor ;
sbp . slice _from ( "ksi" ) ;
}
break ;
case 3 :
sbp . slice _del ( ) ;
break ;
case 4 :
2021-02-18 22:21:36 +01:00
if ( sbp . find _among _b ( a _1 , 6 ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
break ;
case 5 :
2021-02-18 22:21:36 +01:00
if ( sbp . find _among _b ( a _2 , 6 ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
break ;
case 6 :
2021-02-18 22:21:36 +01:00
if ( sbp . find _among _b ( a _3 , 2 ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
break ;
}
2021-02-18 22:21:36 +01:00
} else sbp . limit _backward = v _1 ;
2021-02-18 21:44:01 +01:00
}
}
function r _LONG ( ) {
return sbp . find _among _b ( a _5 , 7 ) ;
}
function r _VI ( ) {
return sbp . eq _s _b ( 1 , "i" ) && sbp . in _grouping _b ( g _V2 , 97 , 246 ) ;
}
function r _case _ending ( ) {
var among _var , v _1 , v _2 ;
if ( sbp . cursor >= I _p1 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p1 ;
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _6 , 30 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
sbp . limit _backward = v _1 ;
switch ( among _var ) {
case 1 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . eq _s _b ( 1 , "a" ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 2 :
case 9 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . eq _s _b ( 1 , "e" ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 3 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . eq _s _b ( 1 , "i" ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 4 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . eq _s _b ( 1 , "o" ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 5 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . eq _s _b ( 1 , "\u00E4" ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 6 :
2021-02-18 22:21:36 +01:00
if ( ! sbp . eq _s _b ( 1 , "\u00F6" ) ) return ;
2021-02-18 21:44:01 +01:00
break ;
case 7 :
v _2 = sbp . limit - sbp . cursor ;
if ( ! r _LONG ( ) ) {
sbp . cursor = sbp . limit - v _2 ;
if ( ! sbp . eq _s _b ( 2 , "ie" ) ) {
sbp . cursor = sbp . limit - v _2 ;
break ;
}
}
sbp . cursor = sbp . limit - v _2 ;
if ( sbp . cursor <= sbp . limit _backward ) {
sbp . cursor = sbp . limit - v _2 ;
break ;
}
sbp . cursor -- ;
sbp . bra = sbp . cursor ;
break ;
case 8 :
2021-02-18 22:21:36 +01:00
if (
! sbp . in _grouping _b ( g _V1 , 97 , 246 ) ||
! sbp . out _grouping _b ( g _V1 , 97 , 246 )
)
2021-02-18 21:44:01 +01:00
return ;
break ;
}
sbp . slice _del ( ) ;
B _ending _removed = true ;
2021-02-18 22:21:36 +01:00
} else sbp . limit _backward = v _1 ;
2021-02-18 21:44:01 +01:00
}
}
function r _other _endings ( ) {
var among _var , v _1 , v _2 ;
if ( sbp . cursor >= I _p2 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p2 ;
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _7 , 14 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
sbp . limit _backward = v _1 ;
if ( among _var == 1 ) {
v _2 = sbp . limit - sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( sbp . eq _s _b ( 2 , "po" ) ) return ;
2021-02-18 21:44:01 +01:00
sbp . cursor = sbp . limit - v _2 ;
}
sbp . slice _del ( ) ;
2021-02-18 22:21:36 +01:00
} else sbp . limit _backward = v _1 ;
2021-02-18 21:44:01 +01:00
}
}
function r _i _plural ( ) {
var v _1 ;
if ( sbp . cursor >= I _p1 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p1 ;
sbp . ket = sbp . cursor ;
if ( sbp . find _among _b ( a _8 , 2 ) ) {
sbp . bra = sbp . cursor ;
sbp . limit _backward = v _1 ;
sbp . slice _del ( ) ;
2021-02-18 22:21:36 +01:00
} else sbp . limit _backward = v _1 ;
2021-02-18 21:44:01 +01:00
}
}
function r _t _plural ( ) {
var among _var , v _1 , v _2 , v _3 , v _4 , v _5 ;
if ( sbp . cursor >= I _p1 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p1 ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 1 , "t" ) ) {
sbp . bra = sbp . cursor ;
v _2 = sbp . limit - sbp . cursor ;
if ( sbp . in _grouping _b ( g _V1 , 97 , 246 ) ) {
sbp . cursor = sbp . limit - v _2 ;
sbp . slice _del ( ) ;
sbp . limit _backward = v _1 ;
v _3 = sbp . limit - sbp . cursor ;
if ( sbp . cursor >= I _p2 ) {
sbp . cursor = I _p2 ;
v _4 = sbp . limit _backward ;
sbp . limit _backward = sbp . cursor ;
sbp . cursor = sbp . limit - v _3 ;
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _9 , 2 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
sbp . limit _backward = v _4 ;
if ( among _var == 1 ) {
v _5 = sbp . limit - sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( sbp . eq _s _b ( 2 , "po" ) ) return ;
2021-02-18 21:44:01 +01:00
sbp . cursor = sbp . limit - v _5 ;
}
sbp . slice _del ( ) ;
return ;
}
}
}
}
sbp . limit _backward = v _1 ;
}
}
function r _tidy ( ) {
var v _1 , v _2 , v _3 , v _4 ;
if ( sbp . cursor >= I _p1 ) {
v _1 = sbp . limit _backward ;
sbp . limit _backward = I _p1 ;
v _2 = sbp . limit - sbp . cursor ;
if ( r _LONG ( ) ) {
sbp . cursor = sbp . limit - v _2 ;
sbp . ket = sbp . cursor ;
if ( sbp . cursor > sbp . limit _backward ) {
sbp . cursor -- ;
sbp . bra = sbp . cursor ;
sbp . slice _del ( ) ;
}
}
sbp . cursor = sbp . limit - v _2 ;
sbp . ket = sbp . cursor ;
if ( sbp . in _grouping _b ( g _AEI , 97 , 228 ) ) {
sbp . bra = sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( sbp . out _grouping _b ( g _V1 , 97 , 246 ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
}
sbp . cursor = sbp . limit - v _2 ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 1 , "j" ) ) {
sbp . bra = sbp . cursor ;
v _3 = sbp . limit - sbp . cursor ;
if ( ! sbp . eq _s _b ( 1 , "o" ) ) {
sbp . cursor = sbp . limit - v _3 ;
2021-02-18 22:21:36 +01:00
if ( sbp . eq _s _b ( 1 , "u" ) ) sbp . slice _del ( ) ;
} else sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
}
sbp . cursor = sbp . limit - v _2 ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 1 , "o" ) ) {
sbp . bra = sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( sbp . eq _s _b ( 1 , "j" ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
}
sbp . cursor = sbp . limit - v _2 ;
sbp . limit _backward = v _1 ;
while ( true ) {
v _4 = sbp . limit - sbp . cursor ;
if ( sbp . out _grouping _b ( g _V1 , 97 , 246 ) ) {
sbp . cursor = sbp . limit - v _4 ;
break ;
}
sbp . cursor = sbp . limit - v _4 ;
2021-02-18 22:21:36 +01:00
if ( sbp . cursor <= sbp . limit _backward ) return ;
2021-02-18 21:44:01 +01:00
sbp . cursor -- ;
}
sbp . ket = sbp . cursor ;
if ( sbp . cursor > sbp . limit _backward ) {
sbp . cursor -- ;
sbp . bra = sbp . cursor ;
S _x = sbp . slice _to ( ) ;
2021-02-18 22:21:36 +01:00
if ( sbp . eq _v _b ( S _x ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
}
}
}
2021-02-18 22:21:36 +01:00
this . stem = function ( ) {
2021-02-18 21:44:01 +01:00
var v _1 = sbp . cursor ;
r _mark _regions ( ) ;
B _ending _removed = false ;
sbp . limit _backward = v _1 ;
sbp . cursor = sbp . limit ;
r _particle _etc ( ) ;
sbp . cursor = sbp . limit ;
r _possessive ( ) ;
sbp . cursor = sbp . limit ;
r _case _ending ( ) ;
sbp . cursor = sbp . limit ;
r _other _endings ( ) ;
sbp . cursor = sbp . limit ;
if ( B _ending _removed ) {
r _i _plural ( ) ;
sbp . cursor = sbp . limit ;
} else {
sbp . cursor = sbp . limit ;
r _t _plural ( ) ;
sbp . cursor = sbp . limit ;
}
r _tidy ( ) ;
return true ;
2021-02-18 22:21:36 +01:00
} ;
} ) ( ) ;
2021-02-18 21:44:01 +01:00
/* and return a function that stems a word for the current locale */
2021-02-18 22:21:36 +01:00
return function ( token ) {
2021-02-18 21:44:01 +01:00
// for lunr version 2
if ( typeof token . update === "function" ) {
2021-02-18 22:21:36 +01:00
return token . update ( function ( word ) {
2021-02-18 21:44:01 +01:00
st . setCurrent ( word ) ;
st . stem ( ) ;
return st . getCurrent ( ) ;
2021-02-18 22:21:36 +01:00
} ) ;
} else {
// for lunr version <= 1
2021-02-18 21:44:01 +01:00
st . setCurrent ( token ) ;
st . stem ( ) ;
return st . getCurrent ( ) ;
}
2021-02-18 22:21:36 +01:00
} ;
2021-02-18 21:44:01 +01:00
} ) ( ) ;
2021-02-18 22:21:36 +01:00
lunr . Pipeline . registerFunction ( lunr . fi . stemmer , "stemmer-fi" ) ;
2021-02-18 21:44:01 +01:00
2021-02-18 22:21:36 +01:00
lunr . fi . stopWordFilter = lunr . generateStopWordFilter (
"ei eivät emme en et ette että he heidän heidät heihin heille heillä heiltä heissä heistä heitä hän häneen hänelle hänellä häneltä hänen hänessä hänestä hänet häntä itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillä keiltä keinä keissä keistä keitä keneen keneksi kenelle kenellä keneltä kenen kenenä kenessä kenestä kenet ketkä ketkä ketä koska kuin kuka kun me meidän meidät meihin meille meillä meiltä meissä meistä meitä mihin miksi mikä mille millä miltä minkä minkä minua minulla minulle minulta minun minussa minusta minut minuun minä minä missä mistä mitkä mitä mukaan mutta ne niiden niihin niiksi niille niillä niiltä niin niin niinä niissä niistä niitä noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt näiden näihin näiksi näille näillä näiltä näinä näissä näistä näitä nämä ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekä sen siihen siinä siitä siksi sille sillä sillä siltä sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinä sinä sitä tai te teidän teidät teihin teille teillä teiltä teissä teistä teitä tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tähän täksi tälle tällä tältä tämä tämän tänä tässä tästä tätä vaan vai vaikka yli" . split (
" "
)
) ;
2021-02-18 21:44:01 +01:00
2021-02-18 22:21:36 +01:00
lunr . Pipeline . registerFunction ( lunr . fi . stopWordFilter , "stopWordFilter-fi" ) ;
2021-02-18 21:44:01 +01:00
} ;
2021-02-18 22:21:36 +01:00
} ) ;