2021-02-18 21:44:01 +01:00
/ * !
* Lunr languages , ` Dutch ` 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
}
2021-02-18 22:21:36 +01:00
console . warn (
'[Lunr Languages] Please use the "nl" instead of the "du". The "nl" code is the standard code for Dutch language, and "du" will be removed in the next major versions.'
) ;
2021-02-18 21:44:01 +01:00
/* register specific locale function */
2021-02-18 22:21:36 +01:00
lunr . du = function ( ) {
2021-02-18 21:44:01 +01:00
this . pipeline . reset ( ) ;
this . pipeline . add (
lunr . du . trimmer ,
lunr . du . stopWordFilter ,
lunr . du . 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 . du . stemmer ) ;
2021-02-18 21:44:01 +01:00
}
} ;
/* lunr trimmer function */
2021-02-18 22:21:36 +01:00
lunr . du . 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 . du . trimmer = lunr . trimmerSupport . generateTrimmer (
lunr . du . wordCharacters
) ;
2021-02-18 21:44:01 +01:00
2021-02-18 22:21:36 +01:00
lunr . Pipeline . registerFunction ( lunr . du . trimmer , "trimmer-du" ) ;
2021-02-18 21:44:01 +01:00
/* lunr stemmer function */
2021-02-18 22:21:36 +01:00
lunr . du . 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 DutchStemmer ( ) {
var a _0 = [
new Among ( "" , - 1 , 6 ) ,
new Among ( "\u00E1" , 0 , 1 ) ,
new Among ( "\u00E4" , 0 , 1 ) ,
new Among ( "\u00E9" , 0 , 2 ) ,
new Among ( "\u00EB" , 0 , 2 ) ,
new Among ( "\u00ED" , 0 , 3 ) ,
new Among ( "\u00EF" , 0 , 3 ) ,
new Among ( "\u00F3" , 0 , 4 ) ,
new Among ( "\u00F6" , 0 , 4 ) ,
new Among ( "\u00FA" , 0 , 5 ) ,
new Among ( "\u00FC" , 0 , 5 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _1 = [
new Among ( "" , - 1 , 3 ) ,
new Among ( "I" , 0 , 2 ) ,
new Among ( "Y" , 0 , 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
a _2 = [
2021-02-18 22:21:36 +01:00
new Among ( "dd" , - 1 , - 1 ) ,
new Among ( "kk" , - 1 , - 1 ) ,
new Among ( "tt" , - 1 , - 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
a _3 = [
new Among ( "ene" , - 1 , 2 ) ,
new Among ( "se" , - 1 , 3 ) ,
new Among ( "en" , - 1 , 2 ) ,
new Among ( "heden" , 2 , 1 ) ,
new Among ( "s" , - 1 , 3 ) ,
2021-02-18 21:44:01 +01:00
] ,
a _4 = [
2021-02-18 22:21:36 +01:00
new Among ( "end" , - 1 , 1 ) ,
new Among ( "ig" , - 1 , 2 ) ,
new Among ( "ing" , - 1 , 1 ) ,
new Among ( "lijk" , - 1 , 3 ) ,
new Among ( "baar" , - 1 , 4 ) ,
new Among ( "bar" , - 1 , 5 ) ,
2021-02-18 21:44:01 +01:00
] ,
a _5 = [
2021-02-18 22:21:36 +01:00
new Among ( "aa" , - 1 , - 1 ) ,
new Among ( "ee" , - 1 , - 1 ) ,
new Among ( "oo" , - 1 , - 1 ) ,
new Among ( "uu" , - 1 , - 1 ) ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
g _v = [ 17 , 65 , 16 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 128 ] ,
g _v _I = [
1 ,
0 ,
0 ,
17 ,
65 ,
16 ,
1 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
0 ,
128 ,
2021-02-18 21:44:01 +01:00
] ,
2021-02-18 22:21:36 +01:00
g _v _j = [ 17 , 67 , 16 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 128 ] ,
I _p2 ,
I _p1 ,
B _e _found ,
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 _prelude ( ) {
2021-02-18 22:21:36 +01:00
var among _var ,
v _1 = sbp . cursor ,
v _2 ,
v _3 ;
2021-02-18 21:44:01 +01:00
while ( true ) {
sbp . bra = sbp . cursor ;
among _var = sbp . find _among ( a _0 , 11 ) ;
if ( among _var ) {
sbp . ket = sbp . cursor ;
switch ( among _var ) {
case 1 :
sbp . slice _from ( "a" ) ;
continue ;
case 2 :
sbp . slice _from ( "e" ) ;
continue ;
case 3 :
sbp . slice _from ( "i" ) ;
continue ;
case 4 :
sbp . slice _from ( "o" ) ;
continue ;
case 5 :
sbp . slice _from ( "u" ) ;
continue ;
case 6 :
2021-02-18 22:21:36 +01:00
if ( sbp . cursor >= sbp . limit ) break ;
2021-02-18 21:44:01 +01:00
sbp . cursor ++ ;
continue ;
}
}
break ;
}
sbp . cursor = v _1 ;
sbp . bra = v _1 ;
if ( sbp . eq _s ( 1 , "y" ) ) {
sbp . ket = sbp . cursor ;
sbp . slice _from ( "Y" ) ;
2021-02-18 22:21:36 +01:00
} else sbp . cursor = v _1 ;
2021-02-18 21:44:01 +01:00
while ( true ) {
v _2 = sbp . cursor ;
if ( sbp . in _grouping ( g _v , 97 , 232 ) ) {
v _3 = sbp . cursor ;
sbp . bra = v _3 ;
if ( sbp . eq _s ( 1 , "i" ) ) {
sbp . ket = sbp . cursor ;
if ( sbp . in _grouping ( g _v , 97 , 232 ) ) {
sbp . slice _from ( "I" ) ;
sbp . cursor = v _2 ;
}
} else {
sbp . cursor = v _3 ;
if ( sbp . eq _s ( 1 , "y" ) ) {
sbp . ket = sbp . cursor ;
sbp . slice _from ( "Y" ) ;
sbp . cursor = v _2 ;
2021-02-18 22:21:36 +01:00
} else if ( habr1 ( v _2 ) ) break ;
2021-02-18 21:44:01 +01:00
}
2021-02-18 22:21:36 +01:00
} else if ( habr1 ( v _2 ) ) break ;
2021-02-18 21:44:01 +01:00
}
}
function habr1 ( v _1 ) {
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 ++ ;
return false ;
}
function r _mark _regions ( ) {
I _p1 = sbp . limit ;
I _p2 = I _p1 ;
if ( ! habr2 ( ) ) {
I _p1 = sbp . cursor ;
2021-02-18 22:21:36 +01:00
if ( I _p1 < 3 ) I _p1 = 3 ;
if ( ! habr2 ( ) ) I _p2 = sbp . cursor ;
2021-02-18 21:44:01 +01:00
}
}
function habr2 ( ) {
while ( ! sbp . in _grouping ( g _v , 97 , 232 ) ) {
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 ++ ;
}
while ( ! sbp . out _grouping ( g _v , 97 , 232 ) ) {
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 _postlude ( ) {
var among _var ;
while ( true ) {
sbp . bra = sbp . cursor ;
among _var = sbp . find _among ( a _1 , 3 ) ;
if ( among _var ) {
sbp . ket = sbp . cursor ;
switch ( among _var ) {
case 1 :
sbp . slice _from ( "y" ) ;
break ;
case 2 :
sbp . slice _from ( "i" ) ;
break ;
case 3 :
2021-02-18 22:21:36 +01:00
if ( sbp . cursor >= sbp . limit ) return ;
2021-02-18 21:44:01 +01:00
sbp . cursor ++ ;
break ;
}
}
}
}
function r _R1 ( ) {
return I _p1 <= sbp . cursor ;
}
function r _R2 ( ) {
return I _p2 <= sbp . cursor ;
}
function r _undouble ( ) {
var v _1 = sbp . limit - sbp . cursor ;
if ( sbp . find _among _b ( a _2 , 3 ) ) {
sbp . cursor = sbp . limit - v _1 ;
sbp . ket = sbp . cursor ;
if ( sbp . cursor > sbp . limit _backward ) {
sbp . cursor -- ;
sbp . bra = sbp . cursor ;
sbp . slice _del ( ) ;
}
}
}
function r _e _ending ( ) {
var v _1 ;
B _e _found = false ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 1 , "e" ) ) {
sbp . bra = sbp . cursor ;
if ( r _R1 ( ) ) {
v _1 = sbp . limit - sbp . cursor ;
if ( sbp . out _grouping _b ( g _v , 97 , 232 ) ) {
sbp . cursor = sbp . limit - v _1 ;
sbp . slice _del ( ) ;
B _e _found = true ;
r _undouble ( ) ;
}
}
}
}
function r _en _ending ( ) {
var v _1 ;
if ( r _R1 ( ) ) {
v _1 = sbp . limit - sbp . cursor ;
if ( sbp . out _grouping _b ( g _v , 97 , 232 ) ) {
sbp . cursor = sbp . limit - v _1 ;
if ( ! sbp . eq _s _b ( 3 , "gem" ) ) {
sbp . cursor = sbp . limit - v _1 ;
sbp . slice _del ( ) ;
r _undouble ( ) ;
}
}
}
}
function r _standard _suffix ( ) {
2021-02-18 22:21:36 +01:00
var among _var ,
v _1 = sbp . limit - sbp . cursor ,
v _2 ,
v _3 ,
v _4 ,
v _5 ,
v _6 ;
2021-02-18 21:44:01 +01:00
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _3 , 5 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
switch ( among _var ) {
case 1 :
2021-02-18 22:21:36 +01:00
if ( r _R1 ( ) ) sbp . slice _from ( "heid" ) ;
2021-02-18 21:44:01 +01:00
break ;
case 2 :
r _en _ending ( ) ;
break ;
case 3 :
if ( r _R1 ( ) && sbp . out _grouping _b ( g _v _j , 97 , 232 ) )
sbp . slice _del ( ) ;
break ;
}
}
sbp . cursor = sbp . limit - v _1 ;
r _e _ending ( ) ;
sbp . cursor = sbp . limit - v _1 ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 4 , "heid" ) ) {
sbp . bra = sbp . cursor ;
if ( r _R2 ( ) ) {
v _2 = sbp . limit - sbp . cursor ;
if ( ! sbp . eq _s _b ( 1 , "c" ) ) {
sbp . cursor = sbp . limit - v _2 ;
sbp . slice _del ( ) ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 2 , "en" ) ) {
sbp . bra = sbp . cursor ;
r _en _ending ( ) ;
}
}
}
}
sbp . cursor = sbp . limit - v _1 ;
sbp . ket = sbp . cursor ;
among _var = sbp . find _among _b ( a _4 , 6 ) ;
if ( among _var ) {
sbp . bra = sbp . cursor ;
switch ( among _var ) {
case 1 :
if ( r _R2 ( ) ) {
sbp . slice _del ( ) ;
v _3 = sbp . limit - sbp . cursor ;
sbp . ket = sbp . cursor ;
if ( sbp . eq _s _b ( 2 , "ig" ) ) {
sbp . bra = sbp . cursor ;
if ( r _R2 ( ) ) {
v _4 = sbp . limit - sbp . cursor ;
if ( ! sbp . eq _s _b ( 1 , "e" ) ) {
sbp . cursor = sbp . limit - v _4 ;
sbp . slice _del ( ) ;
break ;
}
}
}
sbp . cursor = sbp . limit - v _3 ;
r _undouble ( ) ;
}
break ;
case 2 :
if ( r _R2 ( ) ) {
v _5 = sbp . limit - sbp . cursor ;
if ( ! sbp . eq _s _b ( 1 , "e" ) ) {
sbp . cursor = sbp . limit - v _5 ;
sbp . slice _del ( ) ;
}
}
break ;
case 3 :
if ( r _R2 ( ) ) {
sbp . slice _del ( ) ;
r _e _ending ( ) ;
}
break ;
case 4 :
2021-02-18 22:21:36 +01:00
if ( r _R2 ( ) ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
break ;
case 5 :
2021-02-18 22:21:36 +01:00
if ( r _R2 ( ) && B _e _found ) sbp . slice _del ( ) ;
2021-02-18 21:44:01 +01:00
break ;
}
}
sbp . cursor = sbp . limit - v _1 ;
if ( sbp . out _grouping _b ( g _v _I , 73 , 232 ) ) {
v _6 = sbp . limit - sbp . cursor ;
2021-02-18 22:21:36 +01:00
if (
sbp . find _among _b ( a _5 , 4 ) &&
sbp . out _grouping _b ( g _v , 97 , 232 )
) {
2021-02-18 21:44:01 +01:00
sbp . cursor = sbp . limit - v _6 ;
sbp . ket = sbp . cursor ;
if ( sbp . cursor > sbp . limit _backward ) {
sbp . cursor -- ;
sbp . bra = sbp . cursor ;
sbp . slice _del ( ) ;
}
}
}
}
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 _prelude ( ) ;
sbp . cursor = v _1 ;
r _mark _regions ( ) ;
sbp . limit _backward = v _1 ;
sbp . cursor = sbp . limit ;
r _standard _suffix ( ) ;
sbp . cursor = sbp . limit _backward ;
r _postlude ( ) ;
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 . du . stemmer , "stemmer-du" ) ;
2021-02-18 21:44:01 +01:00
2021-02-18 22:21:36 +01:00
lunr . du . stopWordFilter = lunr . generateStopWordFilter (
" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou" . split (
" "
)
) ;
2021-02-18 21:44:01 +01:00
2021-02-18 22:21:36 +01:00
lunr . Pipeline . registerFunction ( lunr . du . stopWordFilter , "stopWordFilter-du" ) ;
2021-02-18 21:44:01 +01:00
} ;
2021-02-18 22:21:36 +01:00
} ) ;