1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-10-03 08:31:50 +02:00

ADD v0.7.0-rev2 (preview)

This commit is contained in:
Thomas Wilkerling
2019-11-12 21:10:45 +01:00
parent 9852a70028
commit 6693992d43
75 changed files with 1681 additions and 1128 deletions

View File

@@ -3,7 +3,8 @@
["conditional-compile", { ["conditional-compile", {
"define": { "define": {
"DEBUG": false, "DEBUG": false,
"PROFILER": true, "PROFILER": false,
"POLYFILL": true,
"SUPPORT_WORKER": true, "SUPPORT_WORKER": true,
"SUPPORT_ENCODER": true, "SUPPORT_ENCODER": true,
"SUPPORT_CACHE": true, "SUPPORT_CACHE": true,
@@ -17,7 +18,7 @@
"SUPPORT_PAGINATION": true, "SUPPORT_PAGINATION": true,
"SUPPORT_OPERATOR": true, "SUPPORT_OPERATOR": true,
"SUPPORT_CALLBACK": true, "SUPPORT_CALLBACK": true,
"USE_POLYFILL": true "SUPPORT_LANG": false
} }
}], }],
"babel-plugin-minify-constant-folding", "babel-plugin-minify-constant-folding",
@@ -38,6 +39,7 @@
], ],
"ignore": [ "ignore": [
"config.js", "config.js",
"bundle.js",
"export.js" "export.js"
], ],
"minified": true, "minified": true,

View File

@@ -13,6 +13,7 @@
<h2></h2> <h2></h2>
### FlexSearch v0.7.0 (Beta) ### FlexSearch v0.7.0 (Beta)
=======
Beta is now available. Please test the new version and post back issues and suggestions. The Beta will pushed to the master branch in 2 weeks. Beta is now available. Please test the new version and post back issues and suggestions. The Beta will pushed to the master branch in 2 weeks.

View File

@@ -5,14 +5,15 @@
* Licence: Apache-2.0 * Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function(){'use strict';var v;Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],f=1,d,g,h;f<b;f++){d=a[f];g=Object.keys(d);h=g.length;for(var e=0,p;e<h;e++)p=g[e],c[p]=d[p]}return c});function x(a){return"string"===typeof a}function z(a){return"function"===typeof a}function A(a){for(var b=Array(a),c=0;c<a;c++)b[c]=C();return b}function C(){return Object.create(null)}function F(a,b){for(var c=0,f=b.length;c<f;c+=2)a=a.replace(b[c],b[c+1]);return a};var G={encode:function(a){return a.toLowerCase()},o:"strict",split:/[\W_]+/,cache:!1,async:!1,s:!1,l:!1,m:!1,f:9,threshold:0,depth:0},H=0;function I(a){if(!(this instanceof I))return new I(a);var b=a&&a.id;this.id=b||0===b?b:H++;this.init(a);J(this,"index",function(){return Object.keys(this.a)});J(this,"length",function(){return this.index.length})}v=I.prototype; (function(){'use strict';var v;Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],e=1,d,h,g;e<b;e++){d=a[e];h=Object.keys(d);g=h.length;for(var f=0,p;f<g;f++)p=h[f],c[p]=d[p]}return c});function w(a){return"string"===typeof a}function y(a){for(var b=Array(a),c=0;c<a;c++)b[c]=z();return b}function z(){return Object.create(null)}function B(a,b){for(var c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a};var C=/[\W_]+/;var G={encode:function(a){if(a=a.toLowerCase())if(a&&this.g&&(a=B(a,this.g)),this.h&&1<a.length&&(a=B(a,this.h)),a&&(C||""===C)&&(a=a.split(C),this.filter)){for(var b=this.filter,c=a.length,e=[],d=0,h=0;d<c;d++){var g=a[d];g&&!b[g]&&(e[h++]=g)}a=e}return a},tokenize:"strict",cache:!1,async:!1,worker:!1,rtl:!1,doc:!1,resolution:9,threshold:0,depth:0},H=0,I={},J={};
v.init=function(a){this.c=[];var b;this.i||(a?a=Object.assign({},G,a):a=G);if(a){this.h=a.tokenize;this.split=x(b=a.split)?new RegExp(b,"g"):b;this.l=a.rtl;this.threshold=a.threshold;this.f=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.h&&a.depth||0;this.i=a.encode;(b=a.matcher)&&this.addMatcher(b,!0);var c=a.lang;if((b=c||a.filter)&&b.constructor===Array){for(var f=C(),d=0;d<b.length;d++)f[b[d]]=1;b=f}this.filter=b;if(a=b=c||a.stemmer){a=b;c=Object.keys(a);b=c.length; function K(a){if(!(this instanceof K))return new K(a);var b=a&&a.id;this.id=b||0===b?b:H++;this.init(a);L(this,"index",function(){return Object.keys(this.a)});L(this,"length",function(){return this.index.length})}K.registerCharset=function(a,b){J[a]=b;return K};K.registerLanguage=function(a,b){J[a]=b;return K};v=K.prototype;
f=Array(2*b);for(var g=d=0;d<b;d++){var h=c[d];f[g++]=new RegExp(h+"(?!\\b)"+h+"(\\b)","g");f[g++]=a[h]}a=f}this.j=a}this.g=A(this.f-(this.threshold||0));this.b=C();this.a={};return this};v.addMatcher=function(a,b){var c=Object.keys(a),f=c.length;b&&(this.c=Array(2*f));for(var d=b=0;b<f;b++){var g=c[b];this.c[d++]=new RegExp(g,"g");this.c[d++]=a[g]}return this}; v.init=function(a){var b;this.encode||(a?a=Object.assign({},G,a):a=G);if(a){var c=a.charset,e=a.lang;this.j=(w(c)?J[c].l:c&&c.l)||a.tokenize;this.i=w(b=a.rtl||c)?J[b].i:c&&c.i||b;this.threshold=a.threshold;this.f=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.j&&a.depth||0;this.encode=w(b=a.encode||c)?J[-1===b.indexOf(":")?b+":default":b].encode:c&&c.encode||b;this.g=(b=a.matcher||e)&&M(w(b)?I[b].g:e&&e.g||b,!1);if(c=b=a.filter||e){c=w(b)?I[b].filter:e&&e.filter||b;
v.add=function(a,b,c,f,d){if(b&&x(b)&&(a||0===a)){if(this.a[a]&&!f)return this.update(a,b);if(!d&&c)return this.add(a,b,null,f,!0),c(),this;b=this.encode(b);if(!b.length)return this;b=K(this,b);c=C();c._ctx=C();f=b.length;d=this.threshold;for(var g=this.depth,h=this.f,e=this.g,p=this.l,q=0;q<f;q++){var n=b[q];if(n){var l=n.length,m=(p?q+1:f-q)/f,r="";switch(this.h){case "reverse":case "both":for(var k=l;--k;)r=n[k]+r,L(e,c,r,a,p?1:(l-k)/l,m,d,h-1);r="";case "forward":for(k=0;k<l;k++)r+=n[k],L(e,c, for(var d=z(),h=0,g=c.length;h<g;h++)d[c[h]]=1;c=d}this.filter=c;this.h=(b=a.stemmer||e)&&M(w(b)?I[b].h:e&&e.h||b,!0)}this.c=y(this.f-(this.threshold||0));this.b=z();this.a={};return this};
r,a,p?(k+1)/l:1,m,d,h-1);break;case "full":for(k=0;k<l;k++)for(var t=(p?k+1:l-k)/l,u=l;u>k;u--)r=n.substring(k,u),L(e,c,r,a,t,m,d,h-1);break;default:if(l=L(e,c,n,a,1,m,d,h-1),g&&1<f&&l>=d)for(l=c._ctx[n]||(c._ctx[n]=C()),n=this.b[n]||(this.b[n]=A(h-(d||0))),m=q-g,r=q+g+1,0>m&&(m=0),r>f&&(r=f);m<r;m++)m!==q&&L(n,l,b[m],a,0,h-(m<q?q-m:m-q),d,h-1)}}}this.a[a]=1}return this};v.update=function(a,b,c){this.a[a]&&x(b)&&(this.remove(a),this.add(a,b,c,!0));return this}; v.add=function(a,b,c,e,d){if(b&&w(b)&&(a||0===a)){if(this.a[a]&&!e)return this.update(a,b);if(!d&&c)return this.add(a,b,null,e,!0),c(),this;b=this.encode(b);if(!b.length)return this;c=z();c._ctx=z();e=b.length;d=this.threshold;for(var h=this.depth,g=this.f,f=this.c,p=this.i,l=0;l<e;l++){var q=b[l];if(q){var m=q.length,n=(p?l+1:e-l)/e,r="";switch(this.j){case "reverse":case "both":for(var k=m;--k;)r=q[k]+r,N(f,c,r,a,p?1:(m-k)/m,n,d,g-1);r="";case "forward":for(k=0;k<m;k++)r+=q[k],N(f,c,r,a,p?(k+1)/
v.remove=function(a,b,c){if(this.a[a]){if(!c&&b)return this.remove(a,null,!0),b(),this;for(b=0;b<this.f-(this.threshold||0);b++)M(this.g[b],a);this.depth&&M(this.b,a);delete this.a[a]}return this}; m:1,n,d,g-1);break;case "full":for(k=0;k<m;k++)for(var t=(p?k+1:m-k)/m,u=m;u>k;u--)r=q.substring(k,u),N(f,c,r,a,t,n,d,g-1);break;default:if(m=N(f,c,q,a,1,n,d,g-1),h&&1<e&&m>=d)for(m=c._ctx[q]||(c._ctx[q]=z()),q=this.b[q]||(this.b[q]=y(g-(d||0))),n=l-h,r=l+h+1,0>n&&(n=0),r>e&&(r=e);n<r;n++)n!==l&&N(q,m,b[n],a,0,g-(n<l?l-n:n-l),d,g-1)}}}this.a[a]=1}return this};v.update=function(a,b,c){this.a[a]&&w(b)&&(this.remove(a),this.add(a,b,c,!0));return this};
v.search=function(a,b,c,f){b&&z(b)?(c=b,b=1E3):b||0===b||(b=1E3);var d=[],g=a;if("object"===typeof a){var h=!1;b=a.limit;var e=a.threshold;var p=!1;a=a.query}e||(e=this.threshold||0);if(!f&&c)return c(this.search(g,b,null,!0)),this;if(!a||!x(a))return d;g=this.encode(a);if(!g.length)return d;c=K(this,g);f=c.length;g=!0;a=[];var q=C(),n,l=0;1<f&&(this.depth?n=!0:c.sort(P));var m;if(!n||(m=this.b))for(var r=this.f;l<f;l++){var k=c[l];if(k){if(n){if(!t)if(m[k]){var t=k;q[k]=1}else if(!p)return d;if(p&& v.remove=function(a,b,c){if(this.a[a]){if(!c&&b)return this.remove(a,null,!0),b(),this;for(b=0;b<this.f-(this.threshold||0);b++)O(this.c[b],a);this.depth&&O(this.b,a);delete this.a[a]}return this};
l===f-1&&!a.length)n=!1,k=t||k,q[k]=0;else if(!t)continue}if(!q[k]){var u=[],D=!1,N=0;if(t=n?m[t]:this.g)for(var O,E=0;E<r-e;E++)if(O=t[E]&&t[E][k])u[N++]=O,D=!0;if(D)t=k,a[a.length]=1<N?u.concat.apply([],u):u[0];else{g=!1;break}q[k]=1}}}else g=!1;if(g)a:{d=[];!0===h?(h="0",e=""):e=h&&h.split(":");p=a.length;if(1<p){n=C();t=0;r=!0;g=0;var y;for(e&&(2===e.length?e=!1:e=y=parseInt(e[0],10));t<p;t++)if(q=t===p-1,m=a[t],f=m.length){if(r)if(w){l=w.length;for(c=0;c<l;c++)n["@"+w[c]]=1;var w=null;r=!1}else{w= v.search=function(a,b,c,e){b&&"function"===typeof b?(c=b,b=1E3):b||0===b||(b=1E3);var d=[],h=a;if("object"===typeof a){var g=!1;b=a.limit;var f=a.threshold;var p=!1;a=a.query}f||(f=this.threshold||0);if(!e&&c)return c(this.search(h,b,null,!0)),this;if(!a||!w(a))return d;h=this.encode(a);if(!h.length)return d;c=h;e=c.length;h=!0;a=[];var l=z(),q,m=0;1<e&&(this.depth?q=!0:c.sort(R));var n;if(!q||(n=this.b))for(var r=this.f;m<e;m++){var k=c[m];if(k){if(q){if(!t)if(n[k]){var t=k;l[k]=1}else if(!p)return d;
m;continue}k=!1;for(c=0;c<f;c++)if(l=m[c],u="@"+l,(D=n[u]||0)&&D===t){if(q){if(!y||--y<g)if(d[g++]=l,b&&g===b){d=Q(h,g+(e||0),d);break a}}else n[u]=t+1;k=!0}if(!k)break}else{d=Q(h,B,m);break a}w&&(d=w)}else p&&(d=a[0],e&&(e=parseInt(e[0],10)));if(b){w=d.length;e&&e>w&&(e=0);y=e||0;var B=y+b;B<w?d=d.slice(y,B):(B=0,y&&(d=d.slice(y)))}d=Q(h,B,d)}return d};v.clear=function(){return this.destroy().init()};v.destroy=function(){this.g=this.b=this.a=null;return this}; if(p&&m===e-1&&!a.length)q=!1,k=t||k,l[k]=0;else if(!t)continue}if(!l[k]){var u=[],E=!1,P=0;if(t=q?n[t]:this.c)for(var Q,F=0;F<r-f;F++)if(Q=t[F]&&t[F][k])u[P++]=Q,E=!0;if(E)t=k,a[a.length]=1<P?u.concat.apply([],u):u[0];else{h=!1;break}l[k]=1}}}else h=!1;if(h)a:{d=[];!0===g?(g="0",f=""):f=g&&g.split(":");p=a.length;if(1<p){q=z();t=0;r=!0;h=0;var A;for(f&&(2===f.length?f=!1:f=A=parseInt(f[0],10));t<p;t++)if(l=t===p-1,n=a[t],e=n.length){if(r)if(x){m=x.length;for(c=0;c<m;c++)q["@"+x[c]]=1;var x=null;
function J(a,b,c){Object.defineProperty(a,b,{get:c})}function L(a,b,c,f,d,g,h,e){if(b[c])return b[c];d=d?(e-(h||e/1.5))*g+(h||e/1.5)*d:g;b[c]=d;d>=h&&(a=a[e-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=f);return d}function M(a,b){if(a)for(var c=Object.keys(a),f=0,d=c.length;f<d;f++){var g=c[f],h=a[g];if(h)for(var e=0,p=h.length;e<p;e++)if(h[e]===b){1===p?delete a[g]:h.splice(e,1);break}else"object"===typeof h[e]&&M(h[e],b)}} r=!1}else{x=n;continue}k=!1;for(c=0;c<e;c++)if(m=n[c],u="@"+m,(E=q[u]||0)&&E===t){if(l){if(!A||--A<h)if(d[h++]=m,b&&h===b){d=S(g,h+(f||0),d);break a}}else q[u]=t+1;k=!0}if(!k)break}else{d=S(g,D,n);break a}x&&(d=x)}else p&&(d=a[0],f&&(f=parseInt(f[0],10)));if(b){x=d.length;f&&f>x&&(f=0);A=f||0;var D=A+b;D<x?d=d.slice(A,D):(D=0,A&&(d=d.slice(A)))}d=S(g,D,d)}return d};v.clear=function(){return this.destroy().init()};v.destroy=function(){this.c=this.b=this.a=null;return this};
v.encode=function(a){a&&this.i&&(a=this.i(a));a&&this.c.length&&(a=F(a,this.c));a&&this.j&&(a=F(a,this.j));return a};function K(a,b){b=z(a.h)?a.h(b):b.split(a.split);if(a.filter){a=a.filter;for(var c=b.length,f=z(a),d=[],g=0,h=0;g<c;g++){var e=b[g];e&&(f&&a(e)||!f&&!a[e])&&(d[h++]=e)}b=d}return b}function P(a,b){return b.length-a.length}function Q(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return I}):"object"===typeof a.exports?a.module.exports=I:a.FlexSearch=I})();}).call(this); function L(a,b,c){Object.defineProperty(a,b,{get:c})}function N(a,b,c,e,d,h,g,f){if(b[c])return b[c];d=d?(f-(g||f/1.5))*h+(g||f/1.5)*d:h;b[c]=d;d>=g&&(a=a[f-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d}function O(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var h=c[e],g=a[h];if(g)for(var f=0,p=g.length;f<p;f++)if(g[f]===b){1===p?delete a[h]:g.splice(f,1);break}else"object"===typeof g[f]&&O(g[f],b)}}
function M(a,b){for(var c=Object.keys(a),e=c.length,d=[],h="",g=0,f=0,p;f<e;f++){var l=c[f];(p=a[l])?(d[g++]=new RegExp(b?"(?!\\b)"+l+"(\\b)":l,"g"),d[g++]=p):h+=(h?"|":"")+l}h&&(d[g++]=new RegExp(b?"(?!\\b)("+h+")(\\b)":"("+h+")","g"),d[g]="");return d}function R(a,b){return b.length-a.length}function S(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return K}):"object"===typeof a.exports?a.module.exports=K:a.FlexSearch=K})();}).call(this);

View File

@@ -5,25 +5,25 @@
* Licence: Apache-2.0 * Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function(){'use strict';Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],f=1,d,h,e;f<b;f++){d=a[f];h=Object.keys(d);e=h.length;for(var g=0,l;g<e;g++)l=h[g],c[l]=d[l]}return c});window.requestAnimationFrame||(window.requestAnimationFrame=window.setTimeout);window.cancelAnimationFrame||(window.cancelAnimationFrame=window.clearTimeout);window.Promise||(window.Promise=function(){function a(b){this.b=null;var c=this;b(function(f){c.b&&(c.b(f),c.b=null)})}a.prototype.then=function(b){this.b=b};return a}());function w(a){return"string"===typeof a}function y(a){return a.constructor===Array}function z(a){return"function"===typeof a}function A(a){return"object"===typeof a}function B(a){for(var b=Array(a),c=0;c<a;c++)b[c]=G();return b}function G(){return Object.create(null)}function I(a,b){for(var c=0,f=b.length;c<f;c+=2)a=a.replace(b[c],b[c+1]);return a};var L={memory:{encode:"extra",f:"strict",threshold:0,c:1},speed:{encode:"icase",f:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",f:"full",threshold:1,c:3},score:{encode:"extra",f:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,c:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,c:9,depth:1}};var M={encode:function(a){return a.toLowerCase()},f:"strict",split:/[\W_]+/,cache:!1,async:!1,v:!1,o:!1,a:!1,c:9,threshold:0,depth:0},aa=0,N={};function P(a){if(!(this instanceof P))return new P(a);var b=a&&a.id;this.id=b||0===b?b:aa++;this.init(a);Q(this,"index",function(){return Object.keys(this.b)});Q(this,"length",function(){return this.index.length})}P.registerCharset=function(a,b,c,f){a=N[a]||(N[a]={});a.j=b;a.split=c;a.o=f;return P}; (function(){'use strict';Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],f=1,d,g,e;f<b;f++){d=a[f];g=Object.keys(d);e=g.length;for(var h=0,k;h<e;h++)k=g[h],c[k]=d[k]}return c});window.requestAnimationFrame||(window.requestAnimationFrame=window.setTimeout);window.cancelAnimationFrame||(window.cancelAnimationFrame=window.clearTimeout);window.Promise||(window.Promise=function(){function a(b){this.a=null;var c=this;b(function(f){c.a&&(c.a(f),c.a=null)})}a.prototype.then=function(b){this.a=b};return a}());function q(a){return"string"===typeof a}function x(a){return a.constructor===Array}function z(a){return"object"===typeof a}function A(a){for(var b=Array(a),c=0;c<a;c++)b[c]=B();return b}function B(){return Object.create(null)}function F(a,b){for(var c=0,f=b.length;c<f&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function H(a){return new RegExp(a,"g")}function J(a){for(var b="",c="",f=0,d=a.length,g=void 0;f<d;f++)(g=a[f])!==c&&(b+=c=g);return b}
P.registerLanguage=function(a,b,c,f){a=N[a]||(N[a]={});a.filter=b;a.s=c;a.h=f;return P}; function K(a,b,c,f){if(b&&(c&&b&&(b=F(b,c)),b&&a.l&&(b=F(b,a.l)),a.m&&1<b.length&&(b=F(b,a.m)),b&&(f||""===f)&&(b=b.split(f),a.filter))){a=a.filter;c=b.length;f=[];for(var d=0,g=0;d<c;d++){var e=b[d];e&&!a[e]&&(f[g++]=e)}b=f}return b};var N={memory:{encode:"extra",f:"strict",threshold:0,c:1},speed:{encode:"icase",f:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",f:"full",threshold:1,c:3},score:{encode:"extra",f:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,c:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,c:9,depth:1}};var ba={encode:aa,b:!1},ca=/[\W_]+/;function aa(a){return K(this,a.toLowerCase(),!1,ca)};var da={encode:aa,tokenize:"strict",cache:!1,async:!1,worker:!1,rtl:!1,doc:!1,resolution:9,threshold:0,depth:0},ea=0,O={},P={};function Q(a){if(!(this instanceof Q))return new Q(a);var b=a&&a.id;this.id=b||0===b?b:ea++;this.init(a);fa(this,"index",function(){return Object.keys(this.g)});fa(this,"length",function(){return this.index.length})}Q.registerCharset=function(a,b){P[a]=b;return Q};Q.registerLanguage=function(a,b){P[a]=b;return Q};
P.prototype.init=function(a){this.h=[];var b;if(w(a))a=L[a];else if(b=a.preset)a=Object.assign({},L[b],a);this.j||(a?a=Object.assign({},M,a):a=M);if(a){var c=a.charset,f=a.lang;this.m=a.tokenize;this.split=w(b=c||a.split)?N[b]?N[b].split:new RegExp(b,"g"):b;this.o=w(b=c||a.rtl)?N[b].o:b;this.async=a.async;this.threshold=a.threshold;this.c=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.m&&a.depth||0;this.j=w(b=c||a.encode)?N[-1===b.indexOf(":")?b+":default":b].encode: Q.prototype.init=function(a){var b;if(q(a))a=N[a];else if(b=a.preset)a=Object.assign({},N[b],a);this.encode||(a?a=Object.assign({},da,a):a=da);if(a){this.async=a.async;var c=a.charset,f=a.lang;this.o=(q(c)?P[c].f:c&&c.f)||a.tokenize;this.b=q(b=a.rtl||c)?P[b].b:c&&c.b||b;this.threshold=a.threshold;this.c=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.o&&a.depth||0;this.encode=q(b=a.encode||c)?P[-1===b.indexOf(":")?b+":default":b].encode:c&&c.encode||b;this.l=(b=a.matcher||
b;if(c=b=f||a.matcher){b=w(b)?N[b].h:b;c=Object.keys(b);var d=c.length;for(var h=Array(2*d),e=0,g=0;e<d;e++){var l=c[e];h[g++]=new RegExp(l,"g");h[g++]=b[l]}c=h}this.h=c;if(c=b=f||a.filter)for(b=w(b)?N[b].filter:b,c=G(),d=0;d<b.length;d++)c[b[d]]=1;this.filter=c;if(f=b=f||a.stemmer){f=w(b)?N[b].s:b;c=Object.keys(f);d=c.length;h=Array(2*d);for(g=e=0;e<d;e++)l=c[e],h[g++]=new RegExp(l+"(?!\\b)"+l+"(\\b)","g"),h[g++]=f[l];f=h}this.s=f;(this.a=d=(b=a.doc)&&R(b))&&(a.doc=null)}this.l=B(this.c-(this.threshold|| f)&&ha(q(b)?O[b].l:f&&f.l||b,!1);if(c=b=a.filter||f){c=q(b)?O[b].filter:f&&f.filter||b;var d=B();for(var g=0,e=c.length;g<e;g++)d[c[g]]=1;c=d}this.filter=c;this.m=(b=a.stemmer||f)&&ha(q(b)?O[b].m:f&&f.m||b,!0);(this.a=d=(b=a.doc)&&ia(b))&&(a.doc=null)}this.j=A(this.c-(this.threshold||0));this.h=B();this.g={};if(d){this.i=B();b=d.index={};f=d.keys=[];c=d.field;g=d.store;x(d.id)||(d.id=d.id.split(":"));if(g){e=B();if(q(g))e[g]=1;else if(x(g))for(var h=0;h<g.length;h++)e[g[h]]=1;else z(g)&&(e=g);d.store=
0));this.g=G();this.b={};if(d){this.i=G();f=d.index={};b=d.keys=[];c=d.field;h=d.store;y(d.id)||(d.id=d.id.split(":"));if(h){e=G();if(w(h))e[h]=1;else if(y(h))for(g=0;g<h.length;g++)e[h[g]]=1;else A(h)&&(e=h);d.store=e}if(c){if(!y(c))if(A(c)){var q=c;d.field=c=Object.keys(c)}else d.field=c=[c];for(d=0;d<c.length;d++)h=c[d],y(h)||(q&&(a=q[h]),b[d]=h,c[d]=h.split(":")),f[h]=new P(a)}}return this}; e}if(c){if(!x(c))if(z(c)){var k=c;d.field=c=Object.keys(c)}else d.field=c=[c];for(d=0;d<c.length;d++)g=c[d],x(g)||(k&&(a=k[g]),f[d]=g,c[d]=g.split(":")),b[g]=new Q(a)}}return this};function ia(a){var b=B(),c;for(c in a)if(a.hasOwnProperty(c)){var f=a[c];b[c]=x(f)?f.slice(0):z(f)?ia(f):f}return b}
function R(a){var b=G(),c;for(c in a)if(a.hasOwnProperty(c)){var f=a[c];b[c]=y(f)?f.slice(0):A(f)?R(f):f}return b} Q.prototype.add=function(a,b,c,f,d){if(this.a&&z(a))return S(this,"add",a,b);if(b&&q(b)&&(a||0===a)){if(this.g[a]&&!f)return this.update(a,b);if(!d){if(this.async){var g=this;d=new Promise(function(C){setTimeout(function(){g.add(a,b,null,f,!0);g=null;C()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,f,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=b;d=B();d._ctx=B();for(var e=c.length,h=this.threshold,k=this.depth,p=this.c,n=this.j,m=this.b,l=0;l<e;l++){var r=
P.prototype.add=function(a,b,c,f,d){if(this.a&&A(a))return U(this,"add",a,b);if(b&&w(b)&&(a||0===a)){if(this.b[a]&&!f)return this.update(a,b);if(!d){if(this.async){var h=this;d=new Promise(function(C){setTimeout(function(){h.add(a,b,null,f,!0);h=null;C()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,f,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.f(b);d=G();d._ctx=G();for(var e=c.length,g=this.threshold,l=this.depth,q=this.c,n=this.l,m=this.o,k=0;k<e;k++){var p= c[l];if(r){var v=r.length,w=(m?l+1:e-l)/e,t="";switch(this.o){case "reverse":case "both":for(var u=v;--u;)t=r[u]+t,T(n,d,t,a,m?1:(v-u)/v,w,h,p-1);t="";case "forward":for(u=0;u<v;u++)t+=r[u],T(n,d,t,a,m?(u+1)/v:1,w,h,p-1);break;case "full":for(u=0;u<v;u++)for(var M=(m?u+1:v-u)/v,I=v;I>u;I--)t=r.substring(u,I),T(n,d,t,a,M,w,h,p-1);break;default:if(v=T(n,d,r,a,1,w,h,p-1),k&&1<e&&v>=h)for(v=d._ctx[r]||(d._ctx[r]=B()),r=this.h[r]||(this.h[r]=A(p-(h||0))),w=l-k,t=l+k+1,0>w&&(w=0),t>e&&(t=e);w<t;w++)w!==
c[k];if(p){var u=p.length,v=(m?k+1:e-k)/e,r="";switch(this.m){case "reverse":case "both":for(var t=u;--t;)r=p[t]+r,V(n,d,r,a,m?1:(u-t)/u,v,g,q-1);r="";case "forward":for(t=0;t<u;t++)r+=p[t],V(n,d,r,a,m?(t+1)/u:1,v,g,q-1);break;case "full":for(t=0;t<u;t++)for(var K=(m?t+1:u-t)/u,H=u;H>t;H--)r=p.substring(t,H),V(n,d,r,a,K,v,g,q-1);break;default:if(u=V(n,d,p,a,1,v,g,q-1),l&&1<e&&u>=g)for(u=d._ctx[p]||(d._ctx[p]=G()),p=this.g[p]||(this.g[p]=B(q-(g||0))),v=k-l,r=k+l+1,0>v&&(v=0),r>e&&(r=e);v<r;v++)v!== l&&T(r,v,c[w],a,0,p-(w<l?l-w:w-l),h,p-1)}}}this.g[a]=1}return this};
k&&V(p,u,c[v],a,0,q-(v<k?k-v:v-k),g,q-1)}}}this.b[a]=1}return this}; function S(a,b,c,f){if(x(c)){var d=c.length;if(d--){for(var g=0;g<d;g++)S(a,b,c[g]);return S(a,b,c[d],f)}}else{var e=a.a.index,h=a.a.keys,k=a.a.tag;g=a.a.store;var p;var n=a.a.id;d=c;for(var m=0;m<n.length;m++)d=d[n[m]];if("remove"===b&&(delete a.i[d],n=h.length,n--)){for(a=0;a<n;a++)e[h[a]].remove(d);return e[h[n]].remove(d,f)}if(k){for(p=0;p<k.length;p++){var l=k[p];var r=c;n=l.split(":");for(m=0;m<n.length;m++)r=r[n[m]];r="@"+r}p=a.s[l];p=p[r]||(p[r]=[])}n=a.a.field;k=0;for(l=n.length;k<l;k++){m=
function U(a,b,c,f){if(y(c)){var d=c.length;if(d--){for(var h=0;h<d;h++)U(a,b,c[h]);return U(a,b,c[d],f)}}else{var e=a.a.index,g=a.a.keys,l=a.a.tag;h=a.a.store;var q;var n=a.a.id;d=c;for(var m=0;m<n.length;m++)d=d[n[m]];if("remove"===b&&(delete a.i[d],n=g.length,n--)){for(a=0;a<n;a++)e[g[a]].remove(d);return e[g[n]].remove(d,f)}if(l){for(q=0;q<l.length;q++){var k=l[q];var p=c;n=k.split(":");for(m=0;m<n.length;m++)p=p[n[m]];p="@"+p}q=a.u[k];q=q[p]||(q[p]=[])}n=a.a.field;l=0;for(k=n.length;l<k;l++){m= n[k];r=c;for(var v=0;v<m.length;v++)r=r[m[v]];m=e[h[k]];"add"===b?m.add(d,r,k===l-1&&f):m.update(d,r,k===l-1&&f)}if(g){f=Object.keys(g);b=B();for(e=0;e<f.length;e++)if(h=f[e],g[h])for(h=h.split(":"),k=n=void 0,l=0;l<h.length;l++)r=h[l],n=(n||c)[r],k=(k||b)[r]=n;c=b}p&&(p[p.length]=c);a.i[d]=c}return a}Q.prototype.update=function(a,b,c){if(this.a&&z(a))return S(this,"update",a,b);this.g[a]&&q(b)&&(this.remove(a),this.add(a,b,c,!0));return this};
n[l];p=c;for(var u=0;u<m.length;u++)p=p[m[u]];m=e[g[l]];"add"===b?m.add(d,p,l===k-1&&f):m.update(d,p,l===k-1&&f)}if(h){f=Object.keys(h);b=G();for(e=0;e<f.length;e++)if(g=f[e],h[g])for(g=g.split(":"),l=n=void 0,k=0;k<g.length;k++)p=g[k],n=(n||c)[p],l=(l||b)[p]=n;c=b}q&&(q[q.length]=c);a.i[d]=c}return a}P.prototype.update=function(a,b,c){if(this.a&&A(a))return U(this,"update",a,b);this.b[a]&&w(b)&&(this.remove(a),this.add(a,b,c,!0));return this}; Q.prototype.remove=function(a,b,c){if(this.a&&z(a))return S(this,"remove",a,b);if(this.g[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var f=this;c=new Promise(function(d){setTimeout(function(){f.remove(a,null,!0);f=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.c-(this.threshold||0);b++)U(this.j[b],a);this.depth&&U(this.h,a);delete this.g[a]}return this};var X;
P.prototype.remove=function(a,b,c){if(this.a&&A(a))return U(this,"remove",a,b);if(this.b[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var f=this;c=new Promise(function(d){setTimeout(function(){f.remove(a,null,!0);f=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.c-(this.threshold||0);b++)W(this.l[b],a);this.depth&&W(this.g,a);delete this.b[a]}return this};var X; function Y(a,b,c,f,d,g,e,h){c=ja(c,d,!1,b,e,h);if(g){g=c.page;var k=c.next;c=c.result}b=c;a=a.i;c=b.length;d=Array(c);for(e=0;e<c;e++)d[e]=a[b[e]];c=d;f&&("function"!==typeof f&&(X=f.split(":"),1<X.length?f=ka:(X=X[0],f=la)),c.sort(f));return c=Z(g,k,c)}
function Y(a,b,c,f,d,h,e,g){c=ba(c,d,!1,b,e,g);if(h){h=c.page;var l=c.next;c=c.result}b=c;a=a.i;c=b.length;d=Array(c);for(e=0;e<c;e++)d[e]=a[b[e]];c=d;f&&(z(f)||(X=f.split(":"),1<X.length?f=ca:(X=X[0],f=da)),c.sort(f));return c=Z(h,l,c)} Q.prototype.search=function(a,b,c,f){if(z(b)){if(x(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&"function"===typeof b?(c=b,b=1E3):b||0===b||(b=1E3);var g=[],e=a;if(z(a)&&!x(a)){c||(c=a.callback)&&(e.callback=null);var h=a.sort;var k=!1;b=a.limit;var p=a.threshold;var n=!1;a=a.query}if(this.a){p=this.a.index;var m=e.bool||"or";n=e.field;var l=m,r,v;if(n)x(n)||(n=[n]);else if(x(e)){var w=e;n=[];l=[];for(var t=0;t<e.length;t++){var u=e[t];a=u.bool||m;n[t]=u.field;l[t]=
P.prototype.search=function(a,b,c,f){if(A(b)){if(y(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&z(b)?(c=b,b=1E3):b||0===b||(b=1E3);var h=[],e=a;if(A(a)&&!y(a)){c||(c=a.callback)&&(e.callback=null);var g=a.sort;var l=!1;b=a.limit;var q=a.threshold;var n=!1;a=a.query}if(this.a){q=this.a.index;var m=e.bool||"or";n=e.field;var k=m,p,u;if(n)y(n)||(n=[n]);else if(y(e)){var v=e;n=[];k=[];for(var r=0;r<e.length;r++){var t=e[r];a=t.bool||m;n[r]=t.field;k[r]=a;"not"===a?p=!0: a;"not"===a?r=!0:"and"===a&&(v=!0)}}else n=this.a.keys;m=n.length;for(t=0;t<m;t++)w&&(e=w[t]),k&&!q(e)&&(e.page=null,e.limit=0),g[t]=p[n[t]].search(e,0);if(c)return c(Y(this,l,g,h,b,k,v,r));if(this.async){var M=this;return new Promise(function(V){Promise.all(g).then(function(pa){V(Y(M,l,pa,h,b,k,v,r))})})}return Y(this,l,g,h,b,k,v,r)}p||(p=this.threshold||0);if(!f){if(this.async&&"function"!==typeof importScripts){var I=this;p=new Promise(function(V){setTimeout(function(){V(I.search(e,b,null,!0));
"and"===a&&(u=!0)}}else n=this.a.keys;m=n.length;for(r=0;r<m;r++)v&&(e=v[r]),l&&!w(e)&&(e.page=null,e.limit=0),h[r]=q[n[r]].search(e,0);if(c)return c(Y(this,k,h,g,b,l,u,p));if(this.async){var K=this;return new Promise(function(S){Promise.all(h).then(function(ea){S(Y(K,k,ea,g,b,l,u,p))})})}return Y(this,k,h,g,b,l,u,p)}q||(q=this.threshold||0);if(!f){if(this.async&&"function"!==typeof importScripts){var H=this;q=new Promise(function(S){setTimeout(function(){S(H.search(e,b,null,!0));H=null})});if(c)q.then(c); I=null})});if(c)p.then(c);else return p;return this}if(c)return c(this.search(e,b,null,!0)),this}if(!a||!q(a))return g;e=a;e=this.encode(e);if(!e.length)return g;c=e;w=c.length;a=!0;f=[];d=B();var C=0;1<w&&(this.depth?m=!0:c.sort(ma));if(!m||(t=this.h))for(var W=this.c;C<w;C++){var y=c[C];if(y){if(m){if(!u)if(t[y])u=y,d[y]=1;else if(!n)return g;if(n&&C===w-1&&!f.length)m=!1,y=u||y,d[y]=0;else if(!u)continue}if(!d[y]){var G=[],D=!1,L=0;if(u=m?t[u]:this.j)for(var R=void 0,E=0;E<W-p;E++)if(R=u[E]&&u[E][y])G[L++]=
else return q;return this}if(c)return c(this.search(e,b,null,!0)),this}if(!a||!w(a))return h;e=a;e=this.encode(e);if(!e.length)return h;c=this.f(e);v=c.length;a=!0;f=[];d=G();var C=0;1<v&&(this.depth?m=!0:c.sort(fa));if(!m||(r=this.g))for(var T=this.c;C<v;C++){var x=c[C];if(x){if(m){if(!t)if(r[x])t=x,d[x]=1;else if(!n)return h;if(n&&C===v-1&&!f.length)m=!1,x=t||x,d[x]=0;else if(!t)continue}if(!d[x]){var F=[],D=!1,J=0;if(t=m?r[t]:this.l)for(var O=void 0,E=0;E<T-q;E++)if(O=t[E]&&t[E][x])F[J++]=O,D= R,D=!0;if(D)u=y,f[f.length]=1<L?G.concat.apply([],G):G[0];else{a=!1;break}d[y]=1}}}else a=!1;a&&(g=ja(f,b,k));return g};Q.prototype.clear=function(){return this.destroy().init()};Q.prototype.destroy=function(){this.j=this.h=this.g=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.i=null}return this};function fa(a,b,c){Object.defineProperty(a,b,{get:c})}
!0;if(D)t=x,f[f.length]=1<J?F.concat.apply([],F):F[0];else{a=!1;break}d[x]=1}}}else a=!1;a&&(h=ba(f,b,l));return h};P.prototype.clear=function(){return this.destroy().init()};P.prototype.destroy=function(){this.l=this.g=this.b=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.i=null}return this};function Q(a,b,c){Object.defineProperty(a,b,{get:c})} function T(a,b,c,f,d,g,e,h){if(b[c])return b[c];d=d?(h-(e||h/1.5))*g+(e||h/1.5)*d:g;b[c]=d;d>=e&&(a=a[h-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=f);return d}function U(a,b){if(a)for(var c=Object.keys(a),f=0,d=c.length;f<d;f++){var g=c[f],e=a[g];if(e)for(var h=0,k=e.length;h<k;h++)if(e[h]===b){1===k?delete a[g]:e.splice(h,1);break}else z(e[h])&&U(e[h],b)}}
function V(a,b,c,f,d,h,e,g){if(b[c])return b[c];d=d?(g-(e||g/1.5))*h+(e||g/1.5)*d:h;b[c]=d;d>=e&&(a=a[g-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=f);return d}function W(a,b){if(a)for(var c=Object.keys(a),f=0,d=c.length;f<d;f++){var h=c[f],e=a[h];if(e)for(var g=0,l=e.length;g<l;g++)if(e[g]===b){1===l?delete a[h]:e.splice(g,1);break}else A(e[g])&&W(e[g],b)}}P.prototype.encode=function(a){a&&this.j&&(a=this.j(a));a&&this.h.length&&(a=I(a,this.h));a&&this.s&&(a=I(a,this.s));return a}; function ha(a,b){for(var c=Object.keys(a),f=c.length,d=[],g="",e=0,h=0,k;h<f;h++){var p=c[h];(k=a[p])?(d[e++]=H(b?"(?!\\b)"+p+"(\\b)":p),d[e++]=k):g+=(g?"|":"")+p}g&&(d[e++]=H(b?"(?!\\b)("+g+")(\\b)":"("+g+")"),d[e]="");return d}function ma(a,b){return b.length-a.length}function la(a,b){return a[X]-b[X]}function ka(a,b){for(var c=X.length,f=0;f<c;f++)a=a[X[f]],b=b[X[f]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}
P.prototype.f=function(a){a=y(a)?a:z(this.m)?this.m(a):a.split(this.split);if(this.filter){for(var b=this.filter,c=a.length,f=z(b),d=[],h=0,e=0;h<c;h++){var g=a[h];g&&(f&&b(g)||!f&&!b[g])&&(d[e++]=g)}a=d}return a};function fa(a,b){return b.length-a.length}function da(a,b){return a[X]-b[X]}function ca(a,b){for(var c=X.length,f=0;f<c;f++)a=a[X[f]],b=b[X[f]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c} function ja(a,b,c,f,d,g){var e=[];if(!0===c){c="0";var h=""}else h=c&&c.split(":");var k=a.length;if(1<k){var p=B(),n,m=0,l,r=!0,v=0,w;h&&(2===h.length?h=!1:h=w=parseInt(h[0],10));if(g){for(n=B();m<k;m++)if("not"===f[m]){var t=a[m];var u=t.length;for(l=0;l<u;l++)n["@"+t[l]]=1}else var M=m+1;if("undefined"===typeof M)return Z(c,E,e);m=0}else var I=q(f)&&f;for(var C;m<k;m++){var W=m===(M||k)-1;if(!I||!m)if((l=I||f&&f[m])&&"and"!==l)if("or"===l)C=!1;else continue;else C=d=!0;t=a[m];if(u=t.length){if(r)if(D){r=
function ba(a,b,c,f,d,h){var e=[];if(!0===c){c="0";var g=""}else g=c&&c.split(":");var l=a.length;if(1<l){var q=G(),n,m=0,k,p=!0,u=0,v;g&&(2===g.length?g=!1:g=v=parseInt(g[0],10));if(h){for(n=G();m<l;m++)if("not"===f[m]){var r=a[m];var t=r.length;for(k=0;k<t;k++)n["@"+r[k]]=1}else var K=m+1;if("undefined"===typeof K)return Z(c,E,e);m=0}else var H=w(f)&&f;for(var C;m<l;m++){var T=m===(K||l)-1;if(!H||!m)if((k=H||f&&f[m])&&"and"!==k)if("or"===k)C=!1;else continue;else C=d=!0;r=a[m];if(t=r.length){if(p)if(D){p= D.length;for(l=0;l<r;l++){var y=D[l];var G="@"+y;g&&n[G]||(p[G]=1,d||(e[v++]=y))}var D=null;r=!1}else{D=t;continue}G=!1;for(l=0;l<u;l++){y=t[l];var L="@"+y,R=d?p[L]||0:m;if(!(!R||g&&n[L]||!d&&p[L])&&R===m){if(W){if(!w||--w<v)if(e[v++]=y,b&&v===b)return Z(c,v+(h||0),e)}else p[L]=m+1;G=!0}}if(C&&!G)break}else if(C)return Z(c,E,t)}if(D)if(a=D.length,g)for(l=h?parseInt(h,10):0;l<a;l++)g=D[l],n["@"+g]||(e[v++]=g);else e=D}else!k||f&&"not"===f[0]||(e=a[0],h&&(h=parseInt(h[0],10)));if(b){n=e.length;h&&h>
D.length;for(k=0;k<p;k++){var x=D[k];var F="@"+x;h&&n[F]||(q[F]=1,d||(e[u++]=x))}var D=null;p=!1}else{D=r;continue}F=!1;for(k=0;k<t;k++){x=r[k];var J="@"+x,O=d?q[J]||0:m;if(!(!O||h&&n[J]||!d&&q[J])&&O===m){if(T){if(!v||--v<u)if(e[u++]=x,b&&u===b)return Z(c,u+(g||0),e)}else q[J]=m+1;F=!0}}if(C&&!F)break}else if(C)return Z(c,E,r)}if(D)if(a=D.length,h)for(k=g?parseInt(g,10):0;k<a;k++)h=D[k],n["@"+h]||(e[u++]=h);else e=D}else!l||f&&"not"===f[0]||(e=a[0],g&&(g=parseInt(g[0],10)));if(b){n=e.length;g&&g> n&&(h=0);h=h||0;var E=h+b;E<n?e=e.slice(h,E):(E=0,h&&(e=e.slice(h)))}return Z(c,E,e)};var oa={encode:na,b:!1},qa=[H("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",H("[\u00e8\u00e9\u00ea\u00eb]"),"e",H("[\u00ec\u00ed\u00ee\u00ef]"),"i",H("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",H("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",H("[\u00fd\u0177\u00ff]"),"y",H("\u00f1"),"n",H("[\u00e7c]"),"k",H("\u00df"),"s",H(" & ")," and ",H("[\\W_]+")," ",H("[^a-z0-9 ]"),""];function na(a,b){b||(b=this);return K(b,a.toLowerCase(),qa," ")};var ra=[H("ae"),"a",H("ai"),"ei",H("ay"),"ei",H("ey"),"ei",H("oe"),"o",H("ue"),"u",H("ie"),"i",H("sz"),"s",H("zs"),"s",H("sh"),"s",H("ck"),"k",H("cc"),"k",H("th"),"t",H("dt"),"t",H("ph"),"f",H("pf"),"f",H("ou"),"o",H("uo"),"u"];function sa(a,b){a&&(a=na(a,this).join(" "),2<a.length&&(a=F(a,ra)),b||(1<a.length&&(a=J(a)),a&&(a=a.split(" "))));return a};var ua={encode:ta,b:!1},va=[/[\W_]+/g," ",/[^a-z0-9 ]/g,""];function ta(a){return K(this,a.toLowerCase(),va," ")};var xa={encode:wa,b:!1},ya=[H("(?!\\b)p"),"b",H("(?!\\b)z"),"s",H("(?!\\b)[cgq]"),"k",H("(?!\\b)n"),"m",H("(?!\\b)d"),"t",H("(?!\\b)[vw]"),"f",H("(?!\\b)[aeiouy]"),""];function wa(a){a&&(a=sa(a,!0),1<a.length&&(a=F(a,ya)),1<a.length&&(a=J(a)),a&&(a=a.split(" ")));return a};var Aa={encode:za,b:!1,f:"strict"},Ba=[/[\W_]+/g," ",/[^a-z ]/g,""];function za(a){a=K(this,a.toLowerCase(),Ba,!1);var b=[];if(a)for(var c=a.split(" "),f=c.length,d=0,g=0;d<f;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){for(var e=a[0],h=Ca(e),k=1;k<a.length;k++){var p=Ca(a[k]);if(p!==h&&(e+=p,h=p,4===e.length))break}b[g++]=(e+"0000").substring(0,4)}return b}
n&&(g=0);g=g||0;var E=g+b;E<n?e=e.slice(g,E):(E=0,g&&(e=e.slice(g)))}return Z(c,E,e)};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return P}):"object"===typeof a.exports?a.module.exports=P:a.FlexSearch=P})();}).call(this); function Ca(a){switch(a){case "b":case "f":case "p":case "v":return 1;case "c":case "g":case "j":case "k":case "q":case "s":case "x":case "z":return 2;case "d":case "t":return 3;case "l":return 4;case "m":case "n":return 5;case "r":return 6}return""};var Ea={encode:Da,b:!0},Fa=/[\W_]+/;function Da(a){return K(this,a,!1,Fa)};var Ha={encode:Ga,b:!1,f:"strict"},Ia=/[\x00-\x7F]/g;function Ga(a){return K(this,a.replace(Ia,""),!1,"")};var Ka={encode:Ja,b:!1},La=/[\W_]+/;function Ja(a){return K(this,a,!1,La)};P["latin:advanced"]={encode:sa,b:!1};P["latin:balance"]=ua;P["latin:default"]=ba;P["latin:extra"]=xa;P["latin:simple"]=oa;P["latin:soundex"]=Aa;P["arabic:default"]=Ea;P["cjk:default"]=Ha;P["cyrillic:default"]=Ka;(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return Q}):"object"===typeof a.exports?a.module.exports=Q:a.FlexSearch=Q})();}).call(this);

View File

@@ -9,8 +9,10 @@
var RELEASE = "browser"; var RELEASE = "browser";
var DEBUG = true; var DEBUG = true;
var PROFILER = false; var PROFILER = false;
var POLYFILL = true;
var SUPPORT_WORKER = true; var SUPPORT_WORKER = true;
var SUPPORT_ENCODER = true; var SUPPORT_ENCODER = true;
var SUPPORT_LANG = true;
var SUPPORT_CACHE = true; var SUPPORT_CACHE = true;
var SUPPORT_ASYNC = true; var SUPPORT_ASYNC = true;
var SUPPORT_PRESET = true; var SUPPORT_PRESET = true;
@@ -22,8 +24,7 @@ var SUPPORT_WHERE = true;
var SUPPORT_PAGINATION = true; var SUPPORT_PAGINATION = true;
var SUPPORT_OPERATOR = true; var SUPPORT_OPERATOR = true;
var SUPPORT_CALLBACK = true; var SUPPORT_CALLBACK = true;
var USE_POLYFILL = true; if (POLYFILL) {
if (USE_POLYFILL) {
Object.assign || (Object.assign = function() { Object.assign || (Object.assign = function() {
var args = arguments; var args = arguments;
var size = args.length; var size = args.length;
@@ -91,6 +92,9 @@ function create_object$$module$src$common() {
function replace$$module$src$common(str, regexp) { function replace$$module$src$common(str, regexp) {
for (var i = 0, len = regexp.length; i < len; i += 2) { for (var i = 0, len = regexp.length; i < len; i += 2) {
str = str.replace(regexp[i], regexp[i + 1]); str = str.replace(regexp[i], regexp[i + 1]);
if (!str) {
break;
}
} }
return str; return str;
} }
@@ -107,10 +111,45 @@ function collapse$$module$src$common(string) {
} }
return final; return final;
} }
function filter$$module$src$common(words, map) {
var length = words.length;
var filtered = [];
for (var i = 0, count = 0; i < length; i++) {
var word = words[i];
if (word && !map[word]) {
filtered[count++] = word;
}
}
return filtered;
}
FlexSearch$$module$src$flexsearch.prototype.pipeline = function(str, normalize, split, _collapse) {
if (str) {
if (normalize && str) {
str = replace$$module$src$common(str, normalize);
}
if (str && this.matcher) {
str = replace$$module$src$common(str, this.matcher);
}
if (this.stemmer && str.length > 1) {
str = replace$$module$src$common(str, this.stemmer);
}
if (_collapse && str.length > 1) {
str = collapse$$module$src$common(str);
}
if (str) {
if (split || split === "") {
var words = str.split(split);
return this.filter ? filter$$module$src$common(words, this.filter) : words;
}
}
}
return str;
};
var module$src$common = {}; var module$src$common = {};
module$src$common.collapse = collapse$$module$src$common; module$src$common.collapse = collapse$$module$src$common;
module$src$common.create_object = create_object$$module$src$common; module$src$common.create_object = create_object$$module$src$common;
module$src$common.create_object_array = create_object_array$$module$src$common; module$src$common.create_object_array = create_object_array$$module$src$common;
module$src$common.filter = filter$$module$src$common;
module$src$common.get_keys = get_keys$$module$src$common; module$src$common.get_keys = get_keys$$module$src$common;
module$src$common.is_array = is_array$$module$src$common; module$src$common.is_array = is_array$$module$src$common;
module$src$common.is_function = is_function$$module$src$common; module$src$common.is_function = is_function$$module$src$common;
@@ -444,124 +483,22 @@ var $jscompDefaultExport$$module$src$presets = {"memory":{encode:SUPPORT_ENCODER
threshold:0, resolution:3, depth:3}, "fast":{encode:"icase", tokenize:"strict", threshold:8, resolution:9, depth:1}}; threshold:0, resolution:3, depth:3}, "fast":{encode:"icase", tokenize:"strict", threshold:8, resolution:9, depth:1}};
var module$src$presets = {}; var module$src$presets = {};
module$src$presets.default = $jscompDefaultExport$$module$src$presets; module$src$presets.default = $jscompDefaultExport$$module$src$presets;
var regex_whitespace$$module$src$lang$latin$simple = regex$$module$src$common("[\\W_]+"); var rtl$$module$src$lang$latin$default = false;
var regex_strip$$module$src$lang$latin$simple = regex$$module$src$common("[^a-z0-9 ]"); var tokenize$$module$src$lang$latin$default = "";
var regex_a$$module$src$lang$latin$simple = regex$$module$src$common("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"); var $jscompDefaultExport$$module$src$lang$latin$default = {encode:encode$$module$src$lang$latin$default, rtl:rtl$$module$src$lang$latin$default};
var regex_e$$module$src$lang$latin$simple = regex$$module$src$common("[\u00e8\u00e9\u00ea\u00eb]"); var split$$module$src$lang$latin$default = /[\W_]+/;
var regex_i$$module$src$lang$latin$simple = regex$$module$src$common("[\u00ec\u00ed\u00ee\u00ef]"); function encode$$module$src$lang$latin$default(str) {
var regex_o$$module$src$lang$latin$simple = regex$$module$src$common("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"); return this.pipeline(str.toLowerCase(), false, split$$module$src$lang$latin$default, false);
var regex_u$$module$src$lang$latin$simple = regex$$module$src$common("[\u00f9\u00fa\u00fb\u00fc\u0171]");
var regex_y$$module$src$lang$latin$simple = regex$$module$src$common("[\u00fd\u0177\u00ff]");
var regex_n$$module$src$lang$latin$simple = regex$$module$src$common("\u00f1");
var regex_c$$module$src$lang$latin$simple = regex$$module$src$common("[\u00e7c]");
var regex_s$$module$src$lang$latin$simple = regex$$module$src$common("\u00df");
var regex_and$$module$src$lang$latin$simple = regex$$module$src$common(" & ");
var regex_pairs_simple$$module$src$lang$latin$simple = [regex_a$$module$src$lang$latin$simple, "a", regex_e$$module$src$lang$latin$simple, "e", regex_i$$module$src$lang$latin$simple, "i", regex_o$$module$src$lang$latin$simple, "o", regex_u$$module$src$lang$latin$simple, "u", regex_y$$module$src$lang$latin$simple, "y", regex_n$$module$src$lang$latin$simple, "n", regex_c$$module$src$lang$latin$simple, "k", regex_s$$module$src$lang$latin$simple, "s", regex_and$$module$src$lang$latin$simple, " and ",
regex_whitespace$$module$src$lang$latin$simple, " ", regex_strip$$module$src$lang$latin$simple, ""];
var $jscompDefaultExport$$module$src$lang$latin$simple = function(str) {
if (!str) {
return str;
} }
return replace$$module$src$common(str.toLowerCase(), regex_pairs_simple$$module$src$lang$latin$simple); var module$src$lang$latin$default = {};
}; module$src$lang$latin$default.default = $jscompDefaultExport$$module$src$lang$latin$default;
var module$src$lang$latin$simple = {}; module$src$lang$latin$default.encode = encode$$module$src$lang$latin$default;
module$src$lang$latin$simple.default = $jscompDefaultExport$$module$src$lang$latin$simple; module$src$lang$latin$default.rtl = rtl$$module$src$lang$latin$default;
var regex_ae$$module$src$lang$latin$advanced = regex$$module$src$common("ae"); module$src$lang$latin$default.tokenize = tokenize$$module$src$lang$latin$default;
var regex_ai$$module$src$lang$latin$advanced = regex$$module$src$common("ai"); var defaults$$module$src$flexsearch = {"encode":encode$$module$src$lang$latin$default, "tokenize":"strict", "cache":false, "async":false, "worker":false, "rtl":false, "doc":false, "resolution":9, "threshold":0, "depth":0};
var regex_ay$$module$src$lang$latin$advanced = regex$$module$src$common("ay");
var regex_ey$$module$src$lang$latin$advanced = regex$$module$src$common("ey");
var regex_oe$$module$src$lang$latin$advanced = regex$$module$src$common("oe");
var regex_ue$$module$src$lang$latin$advanced = regex$$module$src$common("ue");
var regex_ie$$module$src$lang$latin$advanced = regex$$module$src$common("ie");
var regex_sz$$module$src$lang$latin$advanced = regex$$module$src$common("sz");
var regex_zs$$module$src$lang$latin$advanced = regex$$module$src$common("zs");
var regex_ck$$module$src$lang$latin$advanced = regex$$module$src$common("ck");
var regex_cc$$module$src$lang$latin$advanced = regex$$module$src$common("cc");
var regex_sh$$module$src$lang$latin$advanced = regex$$module$src$common("sh");
var regex_th$$module$src$lang$latin$advanced = regex$$module$src$common("th");
var regex_dt$$module$src$lang$latin$advanced = regex$$module$src$common("dt");
var regex_ph$$module$src$lang$latin$advanced = regex$$module$src$common("ph");
var regex_pf$$module$src$lang$latin$advanced = regex$$module$src$common("pf");
var regex_ou$$module$src$lang$latin$advanced = regex$$module$src$common("ou");
var regex_uo$$module$src$lang$latin$advanced = regex$$module$src$common("uo");
var pairs$$module$src$lang$latin$advanced = [regex_ae$$module$src$lang$latin$advanced, "a", regex_ai$$module$src$lang$latin$advanced, "ei", regex_ay$$module$src$lang$latin$advanced, "ei", regex_ey$$module$src$lang$latin$advanced, "ei", regex_oe$$module$src$lang$latin$advanced, "o", regex_ue$$module$src$lang$latin$advanced, "u", regex_ie$$module$src$lang$latin$advanced, "i", regex_sz$$module$src$lang$latin$advanced, "s", regex_zs$$module$src$lang$latin$advanced, "s", regex_sh$$module$src$lang$latin$advanced,
"s", regex_ck$$module$src$lang$latin$advanced, "k", regex_cc$$module$src$lang$latin$advanced, "k", regex_th$$module$src$lang$latin$advanced, "t", regex_dt$$module$src$lang$latin$advanced, "t", regex_ph$$module$src$lang$latin$advanced, "f", regex_pf$$module$src$lang$latin$advanced, "f", regex_ou$$module$src$lang$latin$advanced, "o", regex_uo$$module$src$lang$latin$advanced, "u"];
var $jscompDefaultExport$$module$src$lang$latin$advanced = function(string, _skip_post_processing) {
if (!string) {
return string;
}
string = $jscompDefaultExport$$module$src$lang$latin$simple(string);
if (string.length > 2) {
string = replace$$module$src$common(string, pairs$$module$src$lang$latin$advanced);
}
if (!_skip_post_processing) {
if (string.length > 1) {
string = collapse$$module$src$common(string);
}
}
return string;
};
var module$src$lang$latin$advanced = {};
module$src$lang$latin$advanced.default = $jscompDefaultExport$$module$src$lang$latin$advanced;
var regex_whitespace$$module$src$lang$latin$balance = regex$$module$src$common("[\\W_]+");
var regex_strip$$module$src$lang$latin$balance = regex$$module$src$common("[^a-z0-9 ]");
var pairs$$module$src$lang$latin$balance = [regex_whitespace$$module$src$lang$latin$balance, " ", regex_strip$$module$src$lang$latin$balance, ""];
var $jscompDefaultExport$$module$src$lang$latin$balance = function(str) {
if (!str) {
return str;
}
return collapse$$module$src$common(replace$$module$src$common(str.toLowerCase(), pairs$$module$src$lang$latin$balance));
};
var module$src$lang$latin$balance = {};
module$src$lang$latin$balance.default = $jscompDefaultExport$$module$src$lang$latin$balance;
var soundex_b$$module$src$lang$latin$extra = regex$$module$src$common("p");
var soundex_s$$module$src$lang$latin$extra = regex$$module$src$common("z");
var soundex_k$$module$src$lang$latin$extra = regex$$module$src$common("[cgq]");
var soundex_m$$module$src$lang$latin$extra = regex$$module$src$common("n");
var soundex_t$$module$src$lang$latin$extra = regex$$module$src$common("d");
var soundex_f$$module$src$lang$latin$extra = regex$$module$src$common("[vw]");
var regex_vowel$$module$src$lang$latin$extra = regex$$module$src$common("[aeiouy]");
var regex_pairs_extra$$module$src$lang$latin$extra = [soundex_b$$module$src$lang$latin$extra, "b", soundex_s$$module$src$lang$latin$extra, "s", soundex_k$$module$src$lang$latin$extra, "k", soundex_m$$module$src$lang$latin$extra, "m", soundex_t$$module$src$lang$latin$extra, "t", soundex_f$$module$src$lang$latin$extra, "f", regex_vowel$$module$src$lang$latin$extra, ""];
var $jscompDefaultExport$$module$src$lang$latin$extra = function(str) {
if (!str) {
return str;
}
str = $jscompDefaultExport$$module$src$lang$latin$advanced(str, true);
if (str.length > 1) {
str = str.split(" ");
for (var i = 0; i < str.length; i++) {
var current = str[i];
if (current.length > 1) {
str[i] = current[0] + replace$$module$src$common(current.substring(1), regex_pairs_extra$$module$src$lang$latin$extra);
}
}
str = str.join(" ");
str = collapse$$module$src$common(str);
}
return str;
};
var module$src$lang$latin$extra = {};
module$src$lang$latin$extra.default = $jscompDefaultExport$$module$src$lang$latin$extra;
function encode$$module$src$lang$latin$index(str) {
return str.toLowerCase();
}
var split$$module$src$lang$latin$index = /[\W_]+/;
var rtl$$module$src$lang$latin$index = false;
var advanced$$module$src$lang$latin$index = $jscompDefaultExport$$module$src$lang$latin$advanced;
var balance$$module$src$lang$latin$index = $jscompDefaultExport$$module$src$lang$latin$balance;
var extra$$module$src$lang$latin$index = $jscompDefaultExport$$module$src$lang$latin$extra;
var simple$$module$src$lang$latin$index = $jscompDefaultExport$$module$src$lang$latin$simple;
var module$src$lang$latin$index = {};
module$src$lang$latin$index.advanced = advanced$$module$src$lang$latin$index;
module$src$lang$latin$index.balance = balance$$module$src$lang$latin$index;
module$src$lang$latin$index.encode = encode$$module$src$lang$latin$index;
module$src$lang$latin$index.extra = extra$$module$src$lang$latin$index;
module$src$lang$latin$index.rtl = rtl$$module$src$lang$latin$index;
module$src$lang$latin$index.simple = simple$$module$src$lang$latin$index;
module$src$lang$latin$index.split = split$$module$src$lang$latin$index;
var defaults$$module$src$flexsearch = {encode:encode$$module$src$lang$latin$index, tokenize:"strict", split:split$$module$src$lang$latin$index, cache:false, async:false, worker:false, rtl:false, doc:false, resolution:9, threshold:0, depth:0};
var id_counter$$module$src$flexsearch = 0; var id_counter$$module$src$flexsearch = 0;
var global_lang$$module$src$flexsearch = {}; var global_lang$$module$src$flexsearch = {};
var global_charset$$module$src$flexsearch = {};
function FlexSearch$$module$src$flexsearch(options) { function FlexSearch$$module$src$flexsearch(options) {
if (!(this instanceof FlexSearch$$module$src$flexsearch)) { if (!(this instanceof FlexSearch$$module$src$flexsearch)) {
return new FlexSearch$$module$src$flexsearch(options); return new FlexSearch$$module$src$flexsearch(options);
@@ -576,22 +513,15 @@ function FlexSearch$$module$src$flexsearch(options) {
return this.index.length; return this.index.length;
}); });
} }
FlexSearch$$module$src$flexsearch["registerCharset"] = function(name, encoder, split, rtl) { FlexSearch$$module$src$flexsearch["registerCharset"] = function(name, charset) {
var lang = global_lang$$module$src$flexsearch[name] || (global_lang$$module$src$flexsearch[name] = {}); global_charset$$module$src$flexsearch[name] = charset;
lang.encoder = encoder;
lang.split = split;
lang.rtl = rtl;
return FlexSearch$$module$src$flexsearch; return FlexSearch$$module$src$flexsearch;
}; };
FlexSearch$$module$src$flexsearch["registerLanguage"] = function(name, filter, stemmer, matcher) { FlexSearch$$module$src$flexsearch["registerLanguage"] = function(name, lang) {
var lang = global_lang$$module$src$flexsearch[name] || (global_lang$$module$src$flexsearch[name] = {}); global_charset$$module$src$flexsearch[name] = lang;
lang.filter = filter;
lang.stemmer = stemmer;
lang.matcher = matcher;
return FlexSearch$$module$src$flexsearch; return FlexSearch$$module$src$flexsearch;
}; };
FlexSearch$$module$src$flexsearch.prototype.init = function(options) { FlexSearch$$module$src$flexsearch.prototype.init = function(options) {
this.matcher = [];
var custom; var custom;
var doc; var doc;
if (SUPPORT_PRESET) { if (SUPPORT_PRESET) {
@@ -609,7 +539,7 @@ FlexSearch$$module$src$flexsearch.prototype.init = function(options) {
} }
} }
} }
if (!this.encoder) { if (!this.encode) {
if (options) { if (options) {
options = Object.assign({}, defaults$$module$src$flexsearch, options); options = Object.assign({}, defaults$$module$src$flexsearch, options);
} else { } else {
@@ -634,22 +564,21 @@ FlexSearch$$module$src$flexsearch.prototype.init = function(options) {
} }
this.worker = custom; this.worker = custom;
} }
var charset = options["charset"];
var lang = options["lang"];
this.tokenizer = options["tokenize"];
this.split = is_string$$module$src$common(custom = charset || options["split"]) ? global_lang$$module$src$flexsearch[custom] ? global_lang$$module$src$flexsearch[custom].split : regex$$module$src$common(custom) : custom;
this.rtl = is_string$$module$src$common(custom = charset || options["rtl"]) ? global_lang$$module$src$flexsearch[custom].rtl : custom;
if (SUPPORT_ASYNC) { if (SUPPORT_ASYNC) {
this.async = options["async"]; this.async = options["async"];
this._timer = 0; this.timer = 0;
} }
var charset = options["charset"];
var lang = options["lang"];
this.tokenizer = (is_string$$module$src$common(charset) ? global_charset$$module$src$flexsearch[charset].tokenize : charset && charset.tokenize) || options["tokenize"];
this.rtl = is_string$$module$src$common(custom = options["rtl"] || charset) ? global_charset$$module$src$flexsearch[custom].rtl : charset && charset.rtl || custom;
this.threshold = options["threshold"]; this.threshold = options["threshold"];
this.resolution = (custom = options["resolution"]) <= this.threshold ? this.threshold + 1 : custom; this.resolution = (custom = options["resolution"]) <= this.threshold ? this.threshold + 1 : custom;
this.depth = this.tokenizer === "strict" && options["depth"] || 0; this.depth = this.tokenizer === "strict" && options["depth"] || 0;
this.encoder = is_string$$module$src$common(custom = charset || options["encode"]) ? global_lang$$module$src$flexsearch[custom.indexOf(":") === -1 ? custom + ":default" : custom].encode : custom; this.encode = is_string$$module$src$common(custom = options["encode"] || charset) ? global_charset$$module$src$flexsearch[custom.indexOf(":") === -1 ? custom + ":default" : custom].encode : charset && charset.encode || custom;
this.matcher = (custom = lang || options["matcher"]) && init_matcher$$module$src$flexsearch(is_string$$module$src$common(custom) ? global_lang$$module$src$flexsearch[custom].matcher : custom); this.matcher = (custom = options["matcher"] || lang) && init_stemmer_or_matcher$$module$src$flexsearch(is_string$$module$src$common(custom) ? global_lang$$module$src$flexsearch[custom].matcher : lang && lang.matcher || custom, false);
this.filter = (custom = lang || options["filter"]) && init_filter$$module$src$flexsearch(is_string$$module$src$common(custom) ? global_lang$$module$src$flexsearch[custom].filter : custom); this.filter = (custom = options["filter"] || lang) && init_filter$$module$src$flexsearch(is_string$$module$src$common(custom) ? global_lang$$module$src$flexsearch[custom].filter : lang && lang.filter || custom);
this.stemmer = (custom = lang || options["stemmer"]) && init_stemmer$$module$src$flexsearch(is_string$$module$src$common(custom) ? global_lang$$module$src$flexsearch[custom].stemmer : custom); this.stemmer = (custom = options["stemmer"] || lang) && init_stemmer_or_matcher$$module$src$flexsearch(is_string$$module$src$common(custom) ? global_lang$$module$src$flexsearch[custom].stemmer : lang && lang.stemmer || custom, true);
if (SUPPORT_DOCUMENT) { if (SUPPORT_DOCUMENT) {
this.doc = doc = (custom = options["doc"]) && clone_object$$module$src$flexsearch(custom); this.doc = doc = (custom = options["doc"]) && clone_object$$module$src$flexsearch(custom);
if (doc) { if (doc) {
@@ -761,17 +690,6 @@ function clone_object$$module$src$flexsearch(obj) {
} }
return clone; return clone;
} }
function init_matcher$$module$src$flexsearch(custom) {
var keys = get_keys$$module$src$common(custom);
var length = keys.length;
var matcher = new Array(length * 2);
for (var i = 0, count = 0; i < length; i++) {
var key = keys[i];
matcher[count++] = regex$$module$src$common(key);
matcher[count++] = custom[key];
}
return matcher;
}
FlexSearch$$module$src$flexsearch.prototype.add = function(id, content, callback, _skip_update, _recall) { FlexSearch$$module$src$flexsearch.prototype.add = function(id, content, callback, _skip_update, _recall) {
if (SUPPORT_DOCUMENT && this.doc && is_object$$module$src$common(id)) { if (SUPPORT_DOCUMENT && this.doc && is_object$$module$src$common(id)) {
return this.handle_docs("add", id, content); return this.handle_docs("add", id, content);
@@ -808,7 +726,7 @@ FlexSearch$$module$src$flexsearch.prototype.add = function(id, content, callback
if (!content.length) { if (!content.length) {
return this; return this;
} }
var words = this.tokenize(content); var words = content;
var dupes = create_object$$module$src$common(); var dupes = create_object$$module$src$common();
dupes["_ctx"] = create_object$$module$src$common(); dupes["_ctx"] = create_object$$module$src$common();
var word_length = words.length; var word_length = words.length;
@@ -1199,7 +1117,7 @@ FlexSearch$$module$src$flexsearch.prototype.search = function(query, limit, call
if (!_query.length) { if (!_query.length) {
return result; return result;
} }
var words = this.tokenize(_query); var words = _query;
var length = words.length; var length = words.length;
var found = true; var found = true;
var check = []; var check = [];
@@ -1343,55 +1261,31 @@ function remove_index$$module$src$flexsearch(map, id) {
} }
} }
} }
FlexSearch$$module$src$flexsearch.prototype.encode = function(value) {
if (value && this.encoder) {
value = this.encoder(value);
}
if (value && this.matcher.length) {
value = replace$$module$src$common(value, this.matcher);
}
if (value && this.stemmer) {
value = replace$$module$src$common(value, this.stemmer);
}
return value;
};
FlexSearch$$module$src$flexsearch.prototype.tokenize = function(content) {
var words = is_array$$module$src$common(content) ? content : is_function$$module$src$common(this.tokenizer) ? this.tokenizer(content) : content.split(this.split);
if (this.filter) {
words = filter_words$$module$src$flexsearch(words, this.filter);
}
return words;
};
function filter_words$$module$src$flexsearch(words, fn_or_map) {
var length = words.length;
var has_function = is_function$$module$src$common(fn_or_map);
var filtered = [];
for (var i = 0, count = 0; i < length; i++) {
var word = words[i];
if (word) {
if (has_function && fn_or_map(word) || !has_function && !fn_or_map[word]) {
filtered[count++] = word;
}
}
}
return filtered;
}
function init_filter$$module$src$flexsearch(words) { function init_filter$$module$src$flexsearch(words) {
var final = create_object$$module$src$common(); var final = create_object$$module$src$common();
for (var i = 0; i < words.length; i++) { for (var i = 0, length = words.length; i < length; i++) {
var word = words[i]; final[words[i]] = 1;
final[word] = 1;
} }
return final; return final;
} }
function init_stemmer$$module$src$flexsearch(stem) { function init_stemmer_or_matcher$$module$src$flexsearch(obj, is_stemmer) {
var keys = Object.keys(stem); var keys = get_keys$$module$src$common(obj);
var length = keys.length; var length = keys.length;
var final = new Array(length * 2); var final = [];
for (var i = 0, count = 0; i < length; i++) { var removal = "";
var count = 0;
for (var i = 0, tmp = undefined; i < length; i++) {
var key = keys[i]; var key = keys[i];
final[count++] = regex$$module$src$common(key + "(?!\\b)" + key + "(\\b)"); if (tmp = obj[key]) {
final[count++] = stem[key]; final[count++] = regex$$module$src$common(is_stemmer ? "(?!\\b)" + key + "(\\b)" : key);
final[count++] = tmp;
} else {
removal += (removal ? "|" : "") + key;
}
}
if (removal) {
final[count++] = regex$$module$src$common(is_stemmer ? "(?!\\b)(" + removal + ")(\\b)" : "(" + removal + ")");
final[count] = "";
} }
return final; return final;
} }
@@ -1628,6 +1522,275 @@ function intersect$$module$src$flexsearch(arrays, limit, cursor, suggest, bool,
} }
var module$src$flexsearch = {}; var module$src$flexsearch = {};
module$src$flexsearch.default = FlexSearch$$module$src$flexsearch; module$src$flexsearch.default = FlexSearch$$module$src$flexsearch;
module$src$flexsearch.global_charset = global_charset$$module$src$flexsearch;
module$src$flexsearch.global_lang = global_lang$$module$src$flexsearch;
var rtl$$module$src$lang$latin$simple = false;
var tokenize$$module$src$lang$latin$simple = "";
var $jscompDefaultExport$$module$src$lang$latin$simple = {encode:encode$$module$src$lang$latin$simple, rtl:rtl$$module$src$lang$latin$simple};
var regex_whitespace$$module$src$lang$latin$simple = regex$$module$src$common("[\\W_]+");
var regex_strip$$module$src$lang$latin$simple = regex$$module$src$common("[^a-z0-9 ]");
var regex_a$$module$src$lang$latin$simple = regex$$module$src$common("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]");
var regex_e$$module$src$lang$latin$simple = regex$$module$src$common("[\u00e8\u00e9\u00ea\u00eb]");
var regex_i$$module$src$lang$latin$simple = regex$$module$src$common("[\u00ec\u00ed\u00ee\u00ef]");
var regex_o$$module$src$lang$latin$simple = regex$$module$src$common("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]");
var regex_u$$module$src$lang$latin$simple = regex$$module$src$common("[\u00f9\u00fa\u00fb\u00fc\u0171]");
var regex_y$$module$src$lang$latin$simple = regex$$module$src$common("[\u00fd\u0177\u00ff]");
var regex_n$$module$src$lang$latin$simple = regex$$module$src$common("\u00f1");
var regex_c$$module$src$lang$latin$simple = regex$$module$src$common("[\u00e7c]");
var regex_s$$module$src$lang$latin$simple = regex$$module$src$common("\u00df");
var regex_and$$module$src$lang$latin$simple = regex$$module$src$common(" & ");
var pairs$$module$src$lang$latin$simple = [regex_a$$module$src$lang$latin$simple, "a", regex_e$$module$src$lang$latin$simple, "e", regex_i$$module$src$lang$latin$simple, "i", regex_o$$module$src$lang$latin$simple, "o", regex_u$$module$src$lang$latin$simple, "u", regex_y$$module$src$lang$latin$simple, "y", regex_n$$module$src$lang$latin$simple, "n", regex_c$$module$src$lang$latin$simple, "k", regex_s$$module$src$lang$latin$simple, "s", regex_and$$module$src$lang$latin$simple, " and ", regex_whitespace$$module$src$lang$latin$simple,
" ", regex_strip$$module$src$lang$latin$simple, ""];
function encode$$module$src$lang$latin$simple(str, self) {
self || (self = this);
return self.pipeline(str.toLowerCase(), pairs$$module$src$lang$latin$simple, " ", false);
}
var module$src$lang$latin$simple = {};
module$src$lang$latin$simple.default = $jscompDefaultExport$$module$src$lang$latin$simple;
module$src$lang$latin$simple.encode = encode$$module$src$lang$latin$simple;
module$src$lang$latin$simple.rtl = rtl$$module$src$lang$latin$simple;
module$src$lang$latin$simple.tokenize = tokenize$$module$src$lang$latin$simple;
var rtl$$module$src$lang$latin$advanced = false;
var tokenize$$module$src$lang$latin$advanced = "";
var $jscompDefaultExport$$module$src$lang$latin$advanced = {encode:encode$$module$src$lang$latin$advanced, rtl:rtl$$module$src$lang$latin$advanced};
var regex_ae$$module$src$lang$latin$advanced = regex$$module$src$common("ae");
var regex_ai$$module$src$lang$latin$advanced = regex$$module$src$common("ai");
var regex_ay$$module$src$lang$latin$advanced = regex$$module$src$common("ay");
var regex_ey$$module$src$lang$latin$advanced = regex$$module$src$common("ey");
var regex_oe$$module$src$lang$latin$advanced = regex$$module$src$common("oe");
var regex_ue$$module$src$lang$latin$advanced = regex$$module$src$common("ue");
var regex_ie$$module$src$lang$latin$advanced = regex$$module$src$common("ie");
var regex_sz$$module$src$lang$latin$advanced = regex$$module$src$common("sz");
var regex_zs$$module$src$lang$latin$advanced = regex$$module$src$common("zs");
var regex_ck$$module$src$lang$latin$advanced = regex$$module$src$common("ck");
var regex_cc$$module$src$lang$latin$advanced = regex$$module$src$common("cc");
var regex_sh$$module$src$lang$latin$advanced = regex$$module$src$common("sh");
var regex_th$$module$src$lang$latin$advanced = regex$$module$src$common("th");
var regex_dt$$module$src$lang$latin$advanced = regex$$module$src$common("dt");
var regex_ph$$module$src$lang$latin$advanced = regex$$module$src$common("ph");
var regex_pf$$module$src$lang$latin$advanced = regex$$module$src$common("pf");
var regex_ou$$module$src$lang$latin$advanced = regex$$module$src$common("ou");
var regex_uo$$module$src$lang$latin$advanced = regex$$module$src$common("uo");
var pairs$$module$src$lang$latin$advanced = [regex_ae$$module$src$lang$latin$advanced, "a", regex_ai$$module$src$lang$latin$advanced, "ei", regex_ay$$module$src$lang$latin$advanced, "ei", regex_ey$$module$src$lang$latin$advanced, "ei", regex_oe$$module$src$lang$latin$advanced, "o", regex_ue$$module$src$lang$latin$advanced, "u", regex_ie$$module$src$lang$latin$advanced, "i", regex_sz$$module$src$lang$latin$advanced, "s", regex_zs$$module$src$lang$latin$advanced, "s", regex_sh$$module$src$lang$latin$advanced,
"s", regex_ck$$module$src$lang$latin$advanced, "k", regex_cc$$module$src$lang$latin$advanced, "k", regex_th$$module$src$lang$latin$advanced, "t", regex_dt$$module$src$lang$latin$advanced, "t", regex_ph$$module$src$lang$latin$advanced, "f", regex_pf$$module$src$lang$latin$advanced, "f", regex_ou$$module$src$lang$latin$advanced, "o", regex_uo$$module$src$lang$latin$advanced, "u"];
function encode$$module$src$lang$latin$advanced(str, _skip_postprocessing) {
if (str) {
str = encode$$module$src$lang$latin$simple(str, this).join(" ");
if (str.length > 2) {
str = replace$$module$src$common(str, pairs$$module$src$lang$latin$advanced);
}
if (!_skip_postprocessing) {
if (str.length > 1) {
str = collapse$$module$src$common(str);
}
if (str) {
str = str.split(" ");
}
}
}
return str;
}
var module$src$lang$latin$advanced = {};
module$src$lang$latin$advanced.default = $jscompDefaultExport$$module$src$lang$latin$advanced;
module$src$lang$latin$advanced.encode = encode$$module$src$lang$latin$advanced;
module$src$lang$latin$advanced.rtl = rtl$$module$src$lang$latin$advanced;
module$src$lang$latin$advanced.tokenize = tokenize$$module$src$lang$latin$advanced;
var rtl$$module$src$lang$latin$balance = false;
var tokenize$$module$src$lang$latin$balance = "";
var $jscompDefaultExport$$module$src$lang$latin$balance = {encode:encode$$module$src$lang$latin$balance, rtl:rtl$$module$src$lang$latin$balance};
var regex_whitespace$$module$src$lang$latin$balance = /[\W_]+/g;
var regex_strip$$module$src$lang$latin$balance = /[^a-z0-9 ]/g;
var pairs$$module$src$lang$latin$balance = [regex_whitespace$$module$src$lang$latin$balance, " ", regex_strip$$module$src$lang$latin$balance, ""];
function encode$$module$src$lang$latin$balance(str) {
return this.pipeline(str.toLowerCase(), pairs$$module$src$lang$latin$balance, " ", false);
}
var module$src$lang$latin$balance = {};
module$src$lang$latin$balance.default = $jscompDefaultExport$$module$src$lang$latin$balance;
module$src$lang$latin$balance.encode = encode$$module$src$lang$latin$balance;
module$src$lang$latin$balance.rtl = rtl$$module$src$lang$latin$balance;
module$src$lang$latin$balance.tokenize = tokenize$$module$src$lang$latin$balance;
var rtl$$module$src$lang$latin$extra = false;
var tokenize$$module$src$lang$latin$extra = "";
var $jscompDefaultExport$$module$src$lang$latin$extra = {encode:encode$$module$src$lang$latin$extra, rtl:rtl$$module$src$lang$latin$extra};
var prefix$$module$src$lang$latin$extra = "(?!\\b)";
var soundex_b$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "p");
var soundex_s$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "z");
var soundex_k$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "[cgq]");
var soundex_m$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "n");
var soundex_t$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "d");
var soundex_f$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "[vw]");
var regex_vowel$$module$src$lang$latin$extra = regex$$module$src$common(prefix$$module$src$lang$latin$extra + "[aeiouy]");
var pairs$$module$src$lang$latin$extra = [soundex_b$$module$src$lang$latin$extra, "b", soundex_s$$module$src$lang$latin$extra, "s", soundex_k$$module$src$lang$latin$extra, "k", soundex_m$$module$src$lang$latin$extra, "m", soundex_t$$module$src$lang$latin$extra, "t", soundex_f$$module$src$lang$latin$extra, "f", regex_vowel$$module$src$lang$latin$extra, ""];
function encode$$module$src$lang$latin$extra(str) {
if (str) {
str = encode$$module$src$lang$latin$advanced(str, true);
if (str.length > 1) {
str = replace$$module$src$common(str, pairs$$module$src$lang$latin$extra);
}
if (str.length > 1) {
str = collapse$$module$src$common(str);
}
if (str) {
str = str.split(" ");
}
}
return str;
}
var module$src$lang$latin$extra = {};
module$src$lang$latin$extra.default = $jscompDefaultExport$$module$src$lang$latin$extra;
module$src$lang$latin$extra.encode = encode$$module$src$lang$latin$extra;
module$src$lang$latin$extra.rtl = rtl$$module$src$lang$latin$extra;
module$src$lang$latin$extra.tokenize = tokenize$$module$src$lang$latin$extra;
var rtl$$module$src$lang$latin$soundex = false;
var tokenize$$module$src$lang$latin$soundex = "strict";
var $jscompDefaultExport$$module$src$lang$latin$soundex = {encode:encode$$module$src$lang$latin$soundex, rtl:rtl$$module$src$lang$latin$soundex, tokenize:tokenize$$module$src$lang$latin$soundex};
var regex_whitespace$$module$src$lang$latin$soundex = /[\W_]+/g;
var regex_strip$$module$src$lang$latin$soundex = /[^a-z ]/g;
var pairs$$module$src$lang$latin$soundex = [regex_whitespace$$module$src$lang$latin$soundex, " ", regex_strip$$module$src$lang$latin$soundex, ""];
function encode$$module$src$lang$latin$soundex(str) {
str = this.pipeline(str.toLowerCase(), pairs$$module$src$lang$latin$soundex, false, false);
var result = [];
if (str) {
var words = str.split(" ");
var length = words.length;
for (var x = 0, count = 0; x < length; x++) {
if ((str = words[x]) && (!this.filter || !this.filter[str])) {
var code = str[0];
var previous = getCode$$module$src$lang$latin$soundex(code);
for (var i = 1; i < str.length; i++) {
var current = getCode$$module$src$lang$latin$soundex(str[i]);
if (current !== previous) {
code += current;
previous = current;
if (code.length === 4) {
break;
}
}
}
result[count++] = (code + "0000").substring(0, 4);
}
}
}
return result;
}
function getCode$$module$src$lang$latin$soundex(char) {
switch(char) {
case "b":
case "f":
case "p":
case "v":
return 1;
case "c":
case "g":
case "j":
case "k":
case "q":
case "s":
case "x":
case "z":
return 2;
case "d":
case "t":
return 3;
case "l":
return 4;
case "m":
case "n":
return 5;
case "r":
return 6;
}
return "";
}
var module$src$lang$latin$soundex = {};
module$src$lang$latin$soundex.default = $jscompDefaultExport$$module$src$lang$latin$soundex;
module$src$lang$latin$soundex.encode = encode$$module$src$lang$latin$soundex;
module$src$lang$latin$soundex.rtl = rtl$$module$src$lang$latin$soundex;
module$src$lang$latin$soundex.tokenize = tokenize$$module$src$lang$latin$soundex;
var rtl$$module$src$lang$arabic$default = true;
var tokenize$$module$src$lang$arabic$default = "";
var $jscompDefaultExport$$module$src$lang$arabic$default = {encode:encode$$module$src$lang$arabic$default, rtl:rtl$$module$src$lang$arabic$default};
var split$$module$src$lang$arabic$default = /[\W_]+/;
function encode$$module$src$lang$arabic$default(str) {
return this.pipeline(str, false, split$$module$src$lang$arabic$default, false);
}
var module$src$lang$arabic$default = {};
module$src$lang$arabic$default.default = $jscompDefaultExport$$module$src$lang$arabic$default;
module$src$lang$arabic$default.encode = encode$$module$src$lang$arabic$default;
module$src$lang$arabic$default.rtl = rtl$$module$src$lang$arabic$default;
module$src$lang$arabic$default.tokenize = tokenize$$module$src$lang$arabic$default;
var rtl$$module$src$lang$cjk$default = false;
var tokenize$$module$src$lang$cjk$default = "strict";
var $jscompDefaultExport$$module$src$lang$cjk$default = {encode:encode$$module$src$lang$cjk$default, rtl:rtl$$module$src$lang$cjk$default, tokenize:tokenize$$module$src$lang$cjk$default};
var regex$$module$src$lang$cjk$default = /[\x00-\x7F]/g;
function encode$$module$src$lang$cjk$default(str) {
return this.pipeline(str.replace(regex$$module$src$lang$cjk$default, ""), false, "", false);
}
var module$src$lang$cjk$default = {};
module$src$lang$cjk$default.default = $jscompDefaultExport$$module$src$lang$cjk$default;
module$src$lang$cjk$default.encode = encode$$module$src$lang$cjk$default;
module$src$lang$cjk$default.rtl = rtl$$module$src$lang$cjk$default;
module$src$lang$cjk$default.tokenize = tokenize$$module$src$lang$cjk$default;
var rtl$$module$src$lang$cyrillic$default = false;
var tokenize$$module$src$lang$cyrillic$default = "";
var $jscompDefaultExport$$module$src$lang$cyrillic$default = {encode:encode$$module$src$lang$cyrillic$default, rtl:rtl$$module$src$lang$cyrillic$default};
var split$$module$src$lang$cyrillic$default = /[\W_]+/;
function encode$$module$src$lang$cyrillic$default(str) {
return this.pipeline(str, false, split$$module$src$lang$cyrillic$default, false);
}
var module$src$lang$cyrillic$default = {};
module$src$lang$cyrillic$default.default = $jscompDefaultExport$$module$src$lang$cyrillic$default;
module$src$lang$cyrillic$default.encode = encode$$module$src$lang$cyrillic$default;
module$src$lang$cyrillic$default.rtl = rtl$$module$src$lang$cyrillic$default;
module$src$lang$cyrillic$default.tokenize = tokenize$$module$src$lang$cyrillic$default;
var filter$$module$src$lang$de = ["aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", "bis", "bist", "da", "dadurch", "daher", "darum", "das", "da\u00df", "dass", "dein", "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", "es", "euer", "eure", "f\u00fcr", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", "ich", "ihr", "ihre", "im", "in", "ist", "ja",
"jede", "jedem", "jeden", "jeder", "jedes", "jener", "jenes", "jetzt", "kann", "kannst", "k\u00f6nnen", "k\u00f6nnt", "machen", "mein", "meine", "mit", "mu\u00df", "mu\u00dft", "musst", "m\u00fcssen", "m\u00fc\u00dft", "nach", "nachdem", "nein", "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", "wer", "werde",
"werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "\u00fcber"];
var stemmer$$module$src$lang$de = {"niss":"", "isch":"", "lich":"", "heit":"", "keit":"", "ell":"", "bar":"", "end":"", "ung":"", "est":"", "ern":"", "em":"", "er":"", "en":"", "es":"", "st":"", "ig":"", "ik":"", "e":"", "s":""};
var matcher$$module$src$lang$de = {};
var $jscompDefaultExport$$module$src$lang$de = {filter:filter$$module$src$lang$de, stemmer:stemmer$$module$src$lang$de, matcher:matcher$$module$src$lang$de};
var module$src$lang$de = {};
module$src$lang$de.default = $jscompDefaultExport$$module$src$lang$de;
module$src$lang$de.filter = filter$$module$src$lang$de;
module$src$lang$de.matcher = matcher$$module$src$lang$de;
module$src$lang$de.stemmer = stemmer$$module$src$lang$de;
var filter$$module$src$lang$en = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", "go", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he",
"hed", "her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", "make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", "same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't",
"so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "time", "to", "too", "until", "up", "us", "very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", "would", "wouldn't",
"you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"];
var stemmer$$module$src$lang$en = {"ational":"ate", "iveness":"ive", "fulness":"ful", "ousness":"ous", "ization":"ize", "tional":"tion", "biliti":"ble", "icate":"ic", "ative":"", "alize":"al", "iciti":"ic", "entli":"ent", "ousli":"ous", "alism":"al", "ation":"ate", "aliti":"al", "iviti":"ive", "ement":"", "enci":"ence", "anci":"ance", "izer":"ize", "alli":"al", "ator":"ate", "logi":"log", "ical":"ic", "ance":"", "ence":"", "ness":"", "able":"", "ible":"", "ment":"", "eli":"e", "bli":"ble", "ful":"",
"ant":"", "ent":"", "ism":"", "ate":"", "iti":"", "ous":"", "ive":"", "ize":"", "al":"", "ou":"", "er":"", "ic":""};
var matcher$$module$src$lang$en = {};
var $jscompDefaultExport$$module$src$lang$en = {filter:filter$$module$src$lang$en, stemmer:stemmer$$module$src$lang$en, matcher:matcher$$module$src$lang$en};
var module$src$lang$en = {};
module$src$lang$en.default = $jscompDefaultExport$$module$src$lang$en;
module$src$lang$en.filter = filter$$module$src$lang$en;
module$src$lang$en.matcher = matcher$$module$src$lang$en;
module$src$lang$en.stemmer = stemmer$$module$src$lang$en;
var filter$$module$src$lang$at = ["aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", "bis", "bist", "da", "dadurch", "daher", "darum", "das", "da\u00df", "dass", "dein", "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", "es", "euer", "eure", "f\u00fcr", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", "ich", "ihr", "ihre", "im", "in", "ist", "ja",
"jede", "jedem", "jeden", "jeder", "jedes", "jener", "jenes", "jetzt", "kann", "kannst", "k\u00f6nnen", "k\u00f6nnt", "machen", "mein", "meine", "mit", "mu\u00df", "mu\u00dft", "musst", "m\u00fcssen", "m\u00fc\u00dft", "nach", "nachdem", "nein", "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", "wer", "werde",
"werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "\u00fcber"];
var stemmer$$module$src$lang$at = {"niss":"", "isch":"", "lich":"", "heit":"", "keit":"", "end":"", "ung":"", "est":"", "ern":"", "em":"", "er":"", "en":"", "es":"", "st":"", "ig":"", "ik":"", "e":"", "s":""};
var matcher$$module$src$lang$at = {};
var $jscompDefaultExport$$module$src$lang$at = {filter:filter$$module$src$lang$at, stemmer:stemmer$$module$src$lang$at, matcher:matcher$$module$src$lang$at};
var module$src$lang$at = {};
module$src$lang$at.default = $jscompDefaultExport$$module$src$lang$at;
module$src$lang$at.filter = filter$$module$src$lang$at;
module$src$lang$at.matcher = matcher$$module$src$lang$at;
module$src$lang$at.stemmer = stemmer$$module$src$lang$at;
var filter$$module$src$lang$us = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", "go", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he",
"hed", "her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", "make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", "same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't",
"so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "time", "to", "too", "until", "up", "us", "very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", "would", "wouldn't",
"you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"];
var stemmer$$module$src$lang$us = {"ational":"ate", "iveness":"ive", "fulness":"ful", "ousness":"ous", "ization":"ize", "tional":"tion", "biliti":"ble", "icate":"ic", "ative":"", "alize":"al", "iciti":"ic", "entli":"ent", "ousli":"ous", "alism":"al", "ation":"ate", "aliti":"al", "iviti":"ive", "ement":"", "enci":"ence", "anci":"ance", "izer":"ize", "alli":"al", "ator":"ate", "logi":"log", "ical":"ic", "ance":"", "ence":"", "ness":"", "able":"", "ible":"", "ment":"", "eli":"e", "bli":"ble", "ful":"",
"ant":"", "ent":"", "ism":"", "ate":"", "iti":"", "ous":"", "ive":"", "ize":"", "al":"", "ou":"", "er":"", "ic":""};
var matcher$$module$src$lang$us = {};
var $jscompDefaultExport$$module$src$lang$us = {filter:filter$$module$src$lang$us, stemmer:stemmer$$module$src$lang$us, matcher:matcher$$module$src$lang$us};
var module$src$lang$us = {};
module$src$lang$us.default = $jscompDefaultExport$$module$src$lang$us;
module$src$lang$us.filter = filter$$module$src$lang$us;
module$src$lang$us.matcher = matcher$$module$src$lang$us;
module$src$lang$us.stemmer = stemmer$$module$src$lang$us;
FlexSearch$$module$src$flexsearch.prototype.init; FlexSearch$$module$src$flexsearch.prototype.init;
FlexSearch$$module$src$flexsearch.prototype.search; FlexSearch$$module$src$flexsearch.prototype.search;
FlexSearch$$module$src$flexsearch.prototype.add; FlexSearch$$module$src$flexsearch.prototype.add;
@@ -1640,11 +1803,46 @@ FlexSearch$$module$src$flexsearch.prototype.clear;
FlexSearch$$module$src$flexsearch.prototype.destroy; FlexSearch$$module$src$flexsearch.prototype.destroy;
FlexSearch$$module$src$flexsearch.prototype.export; FlexSearch$$module$src$flexsearch.prototype.export;
FlexSearch$$module$src$flexsearch.prototype.import; FlexSearch$$module$src$flexsearch.prototype.import;
FlexSearch$$module$src$flexsearch.prototype.encode;
FlexSearch$$module$src$flexsearch.prototype.addMatcher;
Promise.prototype.then; Promise.prototype.then;
var module$src$export = {}; var module$src$export = {};
if (SUPPORT_ENCODER) { if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "latin" || SUPPORT_ENCODER.indexOf("latin:advanced") !== -1)) {
global_charset$$module$src$flexsearch["latin:advanced"] = $jscompDefaultExport$$module$src$lang$latin$advanced;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "latin" || SUPPORT_ENCODER.indexOf("latin:balance") !== -1)) {
global_charset$$module$src$flexsearch["latin:balance"] = $jscompDefaultExport$$module$src$lang$latin$balance;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "latin" || SUPPORT_ENCODER.indexOf("latin:default") !== -1)) {
global_charset$$module$src$flexsearch["latin:default"] = $jscompDefaultExport$$module$src$lang$latin$default;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "latin" || SUPPORT_ENCODER.indexOf("latin:extra") !== -1)) {
global_charset$$module$src$flexsearch["latin:extra"] = $jscompDefaultExport$$module$src$lang$latin$extra;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "latin" || SUPPORT_ENCODER.indexOf("latin:simple") !== -1)) {
global_charset$$module$src$flexsearch["latin:simple"] = $jscompDefaultExport$$module$src$lang$latin$simple;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "latin" || SUPPORT_ENCODER.indexOf("latin:soundex") !== -1)) {
global_charset$$module$src$flexsearch["latin:soundex"] = $jscompDefaultExport$$module$src$lang$latin$soundex;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "arabic" || SUPPORT_ENCODER.indexOf("arabic:default") !== -1)) {
global_charset$$module$src$flexsearch["arabic:default"] = $jscompDefaultExport$$module$src$lang$arabic$default;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "cjk" || SUPPORT_ENCODER.indexOf("cjk:default") !== -1)) {
global_charset$$module$src$flexsearch["cjk:default"] = $jscompDefaultExport$$module$src$lang$cjk$default;
}
if (SUPPORT_ENCODER === true || SUPPORT_ENCODER && (SUPPORT_ENCODER === "cyrillic" || SUPPORT_ENCODER.indexOf("cyrillic:default") !== -1)) {
global_charset$$module$src$flexsearch["cyrillic:default"] = $jscompDefaultExport$$module$src$lang$cyrillic$default;
}
if (SUPPORT_LANG === true || SUPPORT_LANG && SUPPORT_LANG.indexOf("de") !== -1) {
global_lang$$module$src$flexsearch["de"] = $jscompDefaultExport$$module$src$lang$de;
}
if (SUPPORT_LANG === true || SUPPORT_LANG && SUPPORT_LANG.indexOf("en") !== -1) {
global_lang$$module$src$flexsearch["en"] = $jscompDefaultExport$$module$src$lang$en;
}
if (SUPPORT_LANG === true || SUPPORT_LANG && SUPPORT_LANG.indexOf("at") !== -1) {
global_lang$$module$src$flexsearch["at"] = $jscompDefaultExport$$module$src$lang$at;
}
if (SUPPORT_LANG === true || SUPPORT_LANG && SUPPORT_LANG.indexOf("us") !== -1) {
global_lang$$module$src$flexsearch["us"] = $jscompDefaultExport$$module$src$lang$us;
} }
(function() { (function() {
var name = "FlexSearch"; var name = "FlexSearch";

View File

@@ -5,33 +5,33 @@
* Licence: Apache-2.0 * Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function(){'use strict';Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],e=1,d,h,f;e<b;e++){d=a[e];h=Object.keys(d);f=h.length;for(var g=0,k;g<f;g++)k=h[g],c[k]=d[k]}return c});window.requestAnimationFrame||(window.requestAnimationFrame=window.setTimeout);window.cancelAnimationFrame||(window.cancelAnimationFrame=window.clearTimeout);window.Promise||(window.Promise=function(){function a(b){this.b=null;var c=this;b(function(e){c.b&&(c.b(e),c.b=null)})}a.prototype.then=function(b){this.b=b};return a}());function w(a){return"string"===typeof a}function y(a){return a.constructor===Array}function A(a){return"function"===typeof a}function C(a){return"object"===typeof a}function F(a){return"undefined"===typeof a}function ba(a){for(var b=Array(a),c=0;c<a;c++)b[c]=G();return b}function G(){return Object.create(null)}function ca(a,b){for(var c=0,e=b.length;c<e;c+=2)a=a.replace(b[c],b[c+1]);return a};K.prototype.export=function(a){var b=!a||F(a.serialize)||a.serialize;if(this.a){var c=!a||F(a.doc)||a.doc,e=!a||F(a.index)||a.index;a=[];var d=0;if(e)for(e=this.a.keys;d<e.length;d++){var h=this.a.index[e[d]];a[d]=[h.j,h.h,Object.keys(h.g)]}c&&(a[d]=this.m)}else a=[this.j,this.h,Object.keys(this.g)];b&&(a=JSON.stringify(a));return a}; (function(){'use strict';Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],e=1,d,g,f;e<b;e++){d=a[e];g=Object.keys(d);f=g.length;for(var h=0,k;h<f;h++)k=g[h],c[k]=d[k]}return c});window.requestAnimationFrame||(window.requestAnimationFrame=window.setTimeout);window.cancelAnimationFrame||(window.cancelAnimationFrame=window.clearTimeout);window.Promise||(window.Promise=function(){function a(b){this.b=null;var c=this;b(function(e){c.b&&(c.b(e),c.b=null)})}a.prototype.then=function(b){this.b=b};return a}());function r(a){return"string"===typeof a}function x(a){return a.constructor===Array}function aa(a){return"function"===typeof a}function z(a){return"object"===typeof a}function B(a){return"undefined"===typeof a}function ba(a){for(var b=Array(a),c=0;c<a;c++)b[c]=D();return b}function D(){return Object.create(null)}function G(a,b){for(var c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function H(a){return new RegExp(a,"g")}
K.prototype.import=function(a,b){if(!b||F(b.serialize)||b.serialize)a=JSON.parse(a);var c={};if(this.a){var e=!b||F(b.doc)||b.doc,d=0;if(!b||F(b.index)||b.index){b=this.a.keys;for(var h=b.length,f=a[0][2];d<f.length;d++)c[f[d]]=1;for(d=0;d<h;d++){f=this.a.index[b[d]];var g=a[d];g&&(f.j=g[0],f.h=g[1],f.g=c)}}e&&(this.m=C(e)?e:a[d])}else{e=a[2];for(d=0;d<e.length;d++)c[e[d]]=1;this.j=a[0];this.h=a[1];this.g=c}};K.prototype.find=function(a,b){return this.where(a,b,1)[0]||null}; function ca(a){for(var b="",c="",e=0,d=a.length,g=void 0;e<d;e++)(g=a[e])!==c&&(b+=c=g);return b}function L(a,b,c,e){if(b&&(c&&b&&(b=G(b,c)),b&&a.u&&(b=G(b,a.u)),a.w&&1<b.length&&(b=G(b,a.w)),b&&(e||""===e)&&(b=b.split(e),a.filter))){a=a.filter;c=b.length;e=[];for(var d=0,g=0;d<c;d++){var f=b[d];f&&!a[f]&&(e[g++]=f)}b=e}return b};M.prototype.export=function(a){var b=!a||B(a.serialize)||a.serialize;if(this.a){var c=!a||B(a.doc)||a.doc,e=!a||B(a.index)||a.index;a=[];var d=0;if(e)for(e=this.a.keys;d<e.length;d++){var g=this.a.index[e[d]];a[d]=[g.l,g.i,Object.keys(g.g)]}c&&(a[d]=this.m)}else a=[this.l,this.i,Object.keys(this.g)];b&&(a=JSON.stringify(a));return a};
K.prototype.where=function(a,b,c,e){var d=this.m,h=[],f=0,g;if(C(a)){c||(c=b);var k=Object.keys(a);var n=k.length;var r=!1;if(1===n&&"id"===k[0])return[d[a.id]];if((g=this.G)&&!e)for(var q=0;q<g.length;q++){var p=g[q],l=a[p];if(!F(l)){var m=this.C[p]["@"+l];if(0===--n)return m;k.splice(k.indexOf(p),1);delete a[p];break}}g=Array(n);for(q=0;q<n;q++)g[q]=k[q].split(":")}else{if(A(a)){b=e||Object.keys(d);c=b.length;for(k=0;k<c;k++)n=d[b[k]],a(n)&&(h[f++]=n);return h}if(F(b))return[d[a]];if("id"===a)return[d[b]]; M.prototype.import=function(a,b){if(!b||B(b.serialize)||b.serialize)a=JSON.parse(a);var c={};if(this.a){var e=!b||B(b.doc)||b.doc,d=0;if(!b||B(b.index)||b.index){b=this.a.keys;for(var g=b.length,f=a[0][2];d<f.length;d++)c[f[d]]=1;for(d=0;d<g;d++){f=this.a.index[b[d]];var h=a[d];h&&(f.l=h[0],f.i=h[1],f.g=c)}}e&&(this.m=z(e)?e:a[d])}else{e=a[2];for(d=0;d<e.length;d++)c[e[d]]=1;this.l=a[0];this.i=a[1];this.g=c}};M.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};
k=[a];n=1;g=[a.split(":")];r=!0}e=m||e||Object.keys(d);q=e.length;for(p=0;p<q;p++){l=m?e[p]:d[e[p]];for(var v=!0,t=0;t<n;t++){r||(b=a[k[t]]);var u=g[t],x=u.length,z=l;if(1<x)for(var B=0;B<x;B++)z=z[u[B]];else z=z[u[0]];if(z!==b){v=!1;break}}if(v&&(h[f++]=l,c&&f===c))break}return h};function L(a){this.clear();this.l=!0!==a&&a}L.prototype.clear=function(){this.cache=G();this.count=G();this.index=G();this.b=[]};L.prototype.set=function(a,b){if(this.l&&F(this.cache[a])){var c=this.b.length;if(c===this.l){c--;var e=this.b[c];delete this.cache[e];delete this.count[e];delete this.index[e]}this.b[c]=a;this.index[a]=c;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b}; M.prototype.where=function(a,b,c,e){var d=this.m,g=[],f=0,h;if(z(a)){c||(c=b);var k=Object.keys(a);var m=k.length;var t=!1;if(1===m&&"id"===k[0])return[d[a.id]];if((h=this.F)&&!e)for(var q=0;q<h.length;q++){var p=h[q],l=a[p];if(!B(l)){var n=this.B[p]["@"+l];if(0===--m)return n;k.splice(k.indexOf(p),1);delete a[p];break}}h=Array(m);for(q=0;q<m;q++)h[q]=k[q].split(":")}else{if(aa(a)){b=e||Object.keys(d);c=b.length;for(k=0;k<c;k++)m=d[b[k]],a(m)&&(g[f++]=m);return g}if(B(b))return[d[a]];if("id"===a)return[d[b]];
L.prototype.get=function(a){var b=this.cache[a];if(this.l&&b){var c=++this.count[a],e=this.index,d=e[a];if(0<d){for(var h=this.b,f=d;this.count[h[--d]]<=c&&-1!==d;);d++;if(d!==f){for(c=f;c>d;c--)f=h[c-1],h[c]=f,e[f]=c;h[d]=a;e[a]=d}}}return b};var Q={},da="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;function ea(a,b,c){var e=fa,d="flexsearch";e=da?URL.createObjectURL(new Blob(["("+e.toString()+")()"],{type:"text/javascript"})):d+".browser.js";d+="-"+a;Q[d]||(Q[d]=[]);Q[d][c]=new Worker(e);Q[d][c].onmessage=b;console.log("Register Worker: "+d+"@"+c);return Q[d][c]} k=[a];m=1;h=[a.split(":")];t=!0}e=n||e||Object.keys(d);q=e.length;for(p=0;p<q;p++){l=n?e[p]:d[e[p]];for(var w=!0,u=0;u<m;u++){t||(b=a[k[u]]);var v=h[u],y=v.length,A=l;if(1<y)for(var C=0;C<y;C++)A=A[v[C]];else A=A[v[0]];if(A!==b){w=!1;break}}if(w&&(g[f++]=l,c&&f===c))break}return g};function O(a){this.clear();this.o=!0!==a&&a}O.prototype.clear=function(){this.cache=D();this.count=D();this.index=D();this.b=[]};O.prototype.set=function(a,b){if(this.o&&B(this.cache[a])){var c=this.b.length;if(c===this.o){c--;var e=this.b[c];delete this.cache[e];delete this.count[e];delete this.index[e]}this.b[c]=a;this.index[a]=c;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b};
function fa(){var a,b;self.onmessage=function(c){if(c=c.data)if(c.search){var e=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold,where:c.where}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:e})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.clear?b.clear():c.info?(c=b.info(),c.worker=a,console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!1,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+ O.prototype.get=function(a){var b=this.cache[a];if(this.o&&b){var c=++this.count[a],e=this.index,d=e[a];if(0<d){for(var g=this.b,f=d;this.count[g[--d]]<=c&&-1!==d;);d++;if(d!==f){for(c=f;c>d;c--)f=g[c-1],g[c]=f,e[f]=c;g[d]=a;e[a]=d}}}return b};var S={},da="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;function fa(a,b,c){var e=ha,d="flexsearch";e=da?URL.createObjectURL(new Blob(["("+e.toString()+")()"],{type:"text/javascript"})):d+".browser.js";d+="-"+a;S[d]||(S[d]=[]);S[d][c]=new Worker(e);S[d][c].onmessage=b;console.log("Register Worker: "+d+"@"+c);return S[d][c]}
1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}}function ha(a,b,c,e){a=ea("id"+a,function(h){(h=h.data)&&h.result&&e(h.id,h.content,h.result,h.limit,h.where,h.cursor,h.suggest)},b);var d=K.toString();c.id=b;a.postMessage({register:d,options:c,id:b});return a}K.prototype.H=function(a,b,c,e){this.v!==this.u&&(this.s=this.s.concat(c),this.v++,e&&this.s.length>=e&&(this.v=this.u),this.v===this.u&&(this.cache&&this.f.set(b,this.s),this.D&&this.D(this.s)));return this};var S={memory:{encode:"extra",i:"strict",threshold:0,c:1},speed:{encode:"icase",i:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",i:"full",threshold:1,c:3},score:{encode:"extra",i:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",i:"strict",threshold:0,c:3,depth:3},fast:{encode:"icase",i:"strict",threshold:8,c:9,depth:1}};var ia={encode:function(a){return a.toLowerCase()},i:"strict",split:/[\W_]+/,cache:!1,async:!1,u:!1,A:!1,a:!1,c:9,threshold:0,depth:0},ja=0,T={};function K(a){if(!(this instanceof K))return new K(a);var b=a&&a.id;this.id=b||0===b?b:ja++;this.init(a);ka(this,"index",function(){return Object.keys(this.g)});ka(this,"length",function(){return this.index.length})}K.registerCharset=function(a,b,c,e){a=T[a]||(T[a]={});a.w=b;a.split=c;a.A=e;return K}; function ha(){var a,b;self.onmessage=function(c){if(c=c.data)if(c.search){var e=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold,where:c.where}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:e})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.clear?b.clear():c.info?(c=b.info(),c.worker=a,console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!1,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+
K.registerLanguage=function(a,b,c,e){a=T[a]||(T[a]={});a.filter=b;a.B=c;a.o=e;return K}; 1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}}function ia(a,b,c,e){a=fa("id"+a,function(g){(g=g.data)&&g.result&&e(g.id,g.content,g.result,g.limit,g.where,g.cursor,g.suggest)},b);var d=M.toString();c.id=b;a.postMessage({register:d,options:c,id:b});return a}M.prototype.G=function(a,b,c,e){this.v!==this.A&&(this.s=this.s.concat(c),this.v++,e&&this.s.length>=e&&(this.v=this.A),this.v===this.A&&(this.cache&&this.f.set(b,this.s),this.C&&this.C(this.s)));return this};var U={memory:{encode:"extra",j:"strict",threshold:0,h:1},speed:{encode:"icase",j:"strict",threshold:1,h:3,depth:2},match:{encode:"extra",j:"full",threshold:1,h:3},score:{encode:"extra",j:"strict",threshold:1,h:9,depth:4},balance:{encode:"balance",j:"strict",threshold:0,h:3,depth:3},fast:{encode:"icase",j:"strict",threshold:8,h:9,depth:1}};var ka={encode:ja,c:!1},la=/[\W_]+/;function ja(a){return L(this,a.toLowerCase(),!1,la)};var ma={encode:ja,tokenize:"strict",cache:!1,async:!1,worker:!1,rtl:!1,doc:!1,resolution:9,threshold:0,depth:0},na=0,oa={},V={};function M(a){if(!(this instanceof M))return new M(a);var b=a&&a.id;this.id=b||0===b?b:na++;this.init(a);pa(this,"index",function(){return Object.keys(this.g)});pa(this,"length",function(){return this.index.length})}M.registerCharset=function(a,b){V[a]=b;return M};M.registerLanguage=function(a,b){V[a]=b;return M};
K.prototype.init=function(a){this.o=[];var b,c;if(w(a))S[a]||console.warn("Preset not found: "+a),a=S[a];else if(b=a.preset)S[b]||console.warn("Preset not found: "+b),a=Object.assign({},S[b],a);this.w||(a?a=Object.assign({},ia,a):a=ia);if(a){if(b=a.worker){if("undefined"===typeof ea)a.worker=!1,this.F=null;else{var e=parseInt(b,10)||4;this.v=0;this.s=[];this.D=null;this.F=Array(e);for(c=0;c<e;c++)this.F[c]=ha(this.id,c,a,this.H)}this.u=b}c=a.charset;e=a.lang;this.b=a.tokenize;this.split=w(b=c||a.split)? M.prototype.init=function(a){var b,c;if(r(a))U[a]||console.warn("Preset not found: "+a),a=U[a];else if(b=a.preset)U[b]||console.warn("Preset not found: "+b),a=Object.assign({},U[b],a);this.encode||(a?a=Object.assign({},ma,a):a=ma);if(a){if(b=a.worker){if("undefined"===typeof fa)a.worker=!1,this.D=null;else{var e=parseInt(b,10)||4;this.v=0;this.s=[];this.C=null;this.D=Array(e);for(c=0;c<e;c++)this.D[c]=ia(this.id,c,a,this.G)}this.A=b}this.async=a.async;c=a.charset;e=a.lang;this.o=(r(c)?V[c].j:c&&c.j)||
T[b]?T[b].split:new RegExp(b,"g"):b;this.A=w(b=c||a.rtl)?T[b].A:b;this.async=a.async;this.threshold=a.threshold;this.c=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.b&&a.depth||0;this.w=w(b=c||a.encode)?T[-1===b.indexOf(":")?b+":default":b].encode:b;if(c=b=e||a.matcher){b=w(b)?T[b].o:b;c=Object.keys(b);for(var d=c.length,h=Array(2*d),f=0,g=0;f<d;f++){var k=c[f];h[g++]=new RegExp(k,"g");h[g++]=b[k]}c=h}this.o=c;if(c=b=e||a.filter)for(b=w(b)?T[b].filter:b,c=G(),d=0;d< a.tokenize;this.c=r(b=a.rtl||c)?V[b].c:c&&c.c||b;this.threshold=a.threshold;this.h=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.o&&a.depth||0;this.encode=r(b=a.encode||c)?V[-1===b.indexOf(":")?b+":default":b].encode:c&&c.encode||b;this.u=(b=a.matcher||e)&&qa(r(b)?oa[b].u:e&&e.u||b,!1);if(c=b=a.filter||e){c=r(b)?oa[b].filter:e&&e.filter||b;for(var d=D(),g=0,f=c.length;g<f;g++)d[c[g]]=1;c=d}this.filter=c;this.w=(b=a.stemmer||e)&&qa(r(b)?oa[b].w:e&&e.w||b,!0);(this.a=
b.length;d++)c[b[d]]=1;this.filter=c;if(e=b=e||a.stemmer){e=w(b)?T[b].B:b;c=Object.keys(e);d=c.length;h=Array(2*d);for(g=f=0;f<d;f++)k=c[f],h[g++]=new RegExp(k+"(?!\\b)"+k+"(\\b)","g"),h[g++]=e[k];e=h}this.B=e;(this.a=c=(b=a.doc)&&la(b))&&(a.doc=null)}this.j=ba(this.c-(this.threshold||0));this.h=G();this.g={};if(c){this.m=G();b=c.index={};e=c.keys=[];d=c.field;h=c.tag;f=c.store;y(c.id)||(c.id=c.id.split(":"));if(f){g=G();if(w(f))g[f]=1;else if(y(f))for(k=0;k<f.length;k++)g[f[k]]=1;else C(f)&&(g=f); c=(b=a.doc)&&ra(b))&&(a.doc=null)}this.l=ba(this.h-(this.threshold||0));this.i=D();this.g={};if(c){this.m=D();b=c.index={};e=c.keys=[];d=c.field;g=c.tag;f=c.store;x(c.id)||(c.id=c.id.split(":"));if(f){var h=D();if(r(f))h[f]=1;else if(x(f))for(var k=0;k<f.length;k++)h[f[k]]=1;else z(f)&&(h=f);c.store=h}if(g){this.B=D();f=D();if(d)if(r(d))f[d]=a;else if(x(d))for(h=0;h<d.length;h++)f[d[h]]=a;else z(d)&&(f=d);x(g)||(c.tag=g=[g]);for(d=0;d<g.length;d++)this.B[g[d]]=D();this.F=g;d=f}if(d){if(!x(d))if(z(d)){var m=
c.store=g}if(h){this.C=G();f=G();if(d)if(w(d))f[d]=a;else if(y(d))for(g=0;g<d.length;g++)f[d[g]]=a;else C(d)&&(f=d);y(h)||(c.tag=h=[h]);for(d=0;d<h.length;d++)this.C[h[d]]=G();this.G=h;d=f}if(d){if(!y(d))if(C(d)){var n=d;c.field=d=Object.keys(d)}else c.field=d=[d];for(c=0;c<d.length;c++)h=d[c],y(h)||(n&&(a=n[h]),e[c]=h,d[c]=h.split(":")),b[h]=new K(a)}}if(b=a.cache)this.l=!0,this.f=new L(b);return this}; d;c.field=d=Object.keys(d)}else c.field=d=[d];for(c=0;c<d.length;c++)g=d[c],x(g)||(m&&(a=m[g]),e[c]=g,d[c]=g.split(":")),b[g]=new M(a)}}if(b=a.cache)this.b=!0,this.f=new O(b);return this};function ra(a){var b=D(),c;for(c in a)if(a.hasOwnProperty(c)){var e=a[c];b[c]=x(e)?e.slice(0):z(e)?ra(e):e}return b}
function la(a){var b=G(),c;for(c in a)if(a.hasOwnProperty(c)){var e=a[c];b[c]=y(e)?e.slice(0):C(e)?la(e):e}return b} M.prototype.add=function(a,b,c,e,d){if(this.a&&z(a))return W(this,"add",a,b);if(b&&r(b)&&(a||0===a)){if(this.g[a]&&!e)return this.update(a,b);if(!d){if(this.async&&"function"!==typeof importScripts){var g=this;d=new Promise(function(C){setTimeout(function(){g.add(a,b,null,e,!0);g=null;C()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,e,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=b;d=D();d._ctx=D();for(var f=c.length,h=this.threshold,k=this.depth,m=this.h,
K.prototype.add=function(a,b,c,e,d){if(this.a&&C(a))return U(this,"add",a,b);if(b&&w(b)&&(a||0===a)){if(this.g[a]&&!e)return this.update(a,b);if(!d){if(this.async&&"function"!==typeof importScripts){var h=this;d=new Promise(function(B){setTimeout(function(){h.add(a,b,null,e,!0);h=null;B()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,e,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.i(b);d=G();d._ctx=G();for(var f=c.length,g=this.threshold,k=this.depth,n= t=this.l,q=this.c,p=0;p<f;p++){var l=c[p];if(l){var n=l.length,w=(q?p+1:f-p)/f,u="";switch(this.o){case "reverse":case "both":for(var v=n;--v;)u=l[v]+u,X(t,d,u,a,q?1:(n-v)/n,w,h,m-1);u="";case "forward":for(v=0;v<n;v++)u+=l[v],X(t,d,u,a,q?(v+1)/n:1,w,h,m-1);break;case "full":for(v=0;v<n;v++)for(var y=(q?v+1:n-v)/n,A=n;A>v;A--)u=l.substring(v,A),X(t,d,u,a,y,w,h,m-1);break;default:if(n=X(t,d,l,a,1,w,h,m-1),k&&1<f&&n>=h)for(n=d._ctx[l]||(d._ctx[l]=D()),l=this.i[l]||(this.i[l]=ba(m-(h||0))),w=p-k,u=p+
this.c,r=this.j,q=this.A,p=0;p<f;p++){var l=c[p];if(l){var m=l.length,v=(q?p+1:f-p)/f,t="";switch(this.b){case "reverse":case "both":for(var u=m;--u;)t=l[u]+t,V(r,d,t,a,q?1:(m-u)/m,v,g,n-1);t="";case "forward":for(u=0;u<m;u++)t+=l[u],V(r,d,t,a,q?(u+1)/m:1,v,g,n-1);break;case "full":for(u=0;u<m;u++)for(var x=(q?u+1:m-u)/m,z=m;z>u;z--)t=l.substring(u,z),V(r,d,t,a,x,v,g,n-1);break;default:if(m=V(r,d,l,a,1,v,g,n-1),k&&1<f&&m>=g)for(m=d._ctx[l]||(d._ctx[l]=G()),l=this.h[l]||(this.h[l]=ba(n-(g||0))),v= k+1,0>w&&(w=0),u>f&&(u=f);w<u;w++)w!==p&&X(l,n,c[w],a,0,m-(w<p?p-w:w-p),h,m-1)}}}this.g[a]=1;this.b=!1}return this};
p-k,t=p+k+1,0>v&&(v=0),t>f&&(t=f);v<t;v++)v!==p&&V(l,m,c[v],a,0,n-(v<p?p-v:v-p),g,n-1)}}}this.g[a]=1;this.l=!1}return this}; function W(a,b,c,e){if(x(c)){var d=c.length;if(d--){for(var g=0;g<d;g++)W(a,b,c[g]);return W(a,b,c[d],e)}}else{var f=a.a.index,h=a.a.keys,k=a.a.tag;g=a.a.store;var m;var t=a.a.id;d=c;for(var q=0;q<t.length;q++)d=d[t[q]];if("remove"===b&&(delete a.m[d],t=h.length,t--)){for(a=0;a<t;a++)f[h[a]].remove(d);return f[h[t]].remove(d,e)}if(k){for(m=0;m<k.length;m++){var p=k[m];var l=c;t=p.split(":");for(q=0;q<t.length;q++)l=l[t[q]];l="@"+l}m=a.B[p];m=m[l]||(m[l]=[])}t=a.a.field;k=0;for(p=t.length;k<p;k++){q=
function U(a,b,c,e){if(y(c)){var d=c.length;if(d--){for(var h=0;h<d;h++)U(a,b,c[h]);return U(a,b,c[d],e)}}else{var f=a.a.index,g=a.a.keys,k=a.a.tag;h=a.a.store;var n;var r=a.a.id;d=c;for(var q=0;q<r.length;q++)d=d[r[q]];if("remove"===b&&(delete a.m[d],r=g.length,r--)){for(a=0;a<r;a++)f[g[a]].remove(d);return f[g[r]].remove(d,e)}if(k){for(n=0;n<k.length;n++){var p=k[n];var l=c;r=p.split(":");for(q=0;q<r.length;q++)l=l[r[q]];l="@"+l}n=a.C[p];n=n[l]||(n[l]=[])}r=a.a.field;k=0;for(p=r.length;k<p;k++){q= t[k];l=c;for(var n=0;n<q.length;n++)l=l[q[n]];q=f[h[k]];"add"===b?q.add(d,l,k===p-1&&e):q.update(d,l,k===p-1&&e)}if(g){e=Object.keys(g);b=D();for(f=0;f<e.length;f++)if(h=e[f],g[h])for(h=h.split(":"),k=t=void 0,p=0;p<h.length;p++)l=h[p],t=(t||c)[l],k=(k||b)[l]=t;c=b}m&&(m[m.length]=c);a.m[d]=c}return a}M.prototype.update=function(a,b,c){if(this.a&&z(a))return W(this,"update",a,b);this.g[a]&&r(b)&&(this.remove(a),this.add(a,b,c,!0));return this};
r[k];l=c;for(var m=0;m<q.length;m++)l=l[q[m]];q=f[g[k]];"add"===b?q.add(d,l,k===p-1&&e):q.update(d,l,k===p-1&&e)}if(h){e=Object.keys(h);b=G();for(f=0;f<e.length;f++)if(g=e[f],h[g])for(g=g.split(":"),k=r=void 0,p=0;p<g.length;p++)l=g[p],r=(r||c)[l],k=(k||b)[l]=r;c=b}n&&(n[n.length]=c);a.m[d]=c}return a}K.prototype.update=function(a,b,c){if(this.a&&C(a))return U(this,"update",a,b);this.g[a]&&w(b)&&(this.remove(a),this.add(a,b,c,!0));return this}; M.prototype.remove=function(a,b,c){if(this.a&&z(a))return W(this,"remove",a,b);if(this.g[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var e=this;c=new Promise(function(d){setTimeout(function(){e.remove(a,null,!0);e=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.h-(this.threshold||0);b++)sa(this.l[b],a);this.depth&&sa(this.i,a);delete this.g[a];this.b=!1}return this};var Y;
K.prototype.remove=function(a,b,c){if(this.a&&C(a))return U(this,"remove",a,b);if(this.g[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var e=this;c=new Promise(function(d){setTimeout(function(){e.remove(a,null,!0);e=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.c-(this.threshold||0);b++)W(this.j[b],a);this.depth&&W(this.h,a);delete this.g[a];this.l=!1}return this};var X; function ta(a,b,c,e,d,g,f,h,k,m,t){e=ua(e,h?0:g,k,f,c,m,t);if(k){k=e.page;var q=e.next;e=e.result}if(h)e=a.where(h,null,g,e);else{c=e;e=a.m;g=c.length;f=Array(g);for(h=0;h<g;h++)f[h]=e[c[h]];e=f}d&&(aa(d)||(Y=d.split(":"),1<Y.length?d=va:(Y=Y[0],d=wa)),e.sort(d));e=Z(k,q,e);a.f&&a.f.set(b,e);return e}
function Y(a,b,c,e,d,h,f,g,k,n,r){e=ma(e,g?0:h,k,f,c,n,r);if(k){k=e.page;var q=e.next;e=e.result}if(g)e=a.where(g,null,h,e);else{c=e;e=a.m;h=c.length;f=Array(h);for(g=0;g<h;g++)f[g]=e[c[g]];e=f}d&&(A(d)||(X=d.split(":"),1<X.length?d=na:(X=X[0],d=oa)),e.sort(d));e=Z(k,q,e);a.f&&a.f.set(b,e);return e} M.prototype.search=function(a,b,c,e){if(z(b)){if(x(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&aa(b)?(c=b,b=1E3):b||0===b||(b=1E3);var g=[],f=a;if(z(a)&&!x(a)){c||(c=a.callback)&&(f.callback=null);var h=a.sort;var k=a.page;b=a.limit;var m=a.threshold;var t=a.suggest;a=a.query}if(this.a){m=this.a.index;var q=f.where,p=f.bool||"or",l=f.field,n=p,w,u;if(l)x(l)||(l=[l]);else if(x(f)){var v=f;l=[];n=[];for(var y=0;y<f.length;y++)e=f[y],d=e.bool||p,l[y]=e.field,n[y]=d,"not"===
K.prototype.search=function(a,b,c,e){if(C(b)){if(y(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&A(b)?(c=b,b=1E3):b||0===b||(b=1E3);var h=[],f=a;if(C(a)&&!y(a)){c||(c=a.callback)&&(f.callback=null);var g=a.sort;var k=a.page;b=a.limit;var n=a.threshold;var r=a.suggest;a=a.query}if(this.a){n=this.a.index;var q=f.where,p=f.bool||"or",l=f.field,m=p,v,t;if(l)y(l)||(l=[l]);else if(y(f)){var u=f;l=[];m=[];for(var x=0;x<f.length;x++)e=f[x],d=e.bool||p,l[x]=e.field,m[x]=d,"not"=== d?w=!0:"and"===d&&(u=!0)}else l=this.a.keys;p=l.length;for(y=0;y<p;y++)v&&(f=v[y]),k&&!r(f)&&(f.page=null,f.limit=0),g[y]=m[l[y]].search(f,0);if(c)return c(ta(this,a,n,g,h,b,t,q,k,u,w));if(this.async){var A=this;return new Promise(function(ea){Promise.all(g).then(function(Aa){ea(ta(A,a,n,Aa,h,b,t,q,k,u,w))})})}return ta(this,a,n,g,h,b,t,q,k,u,w)}m||(m=this.threshold||0);if(!e){if(this.async&&"function"!==typeof importScripts){var C=this;m=new Promise(function(ea){setTimeout(function(){ea(C.search(f,
d?v=!0:"and"===d&&(t=!0)}else l=this.a.keys;p=l.length;for(x=0;x<p;x++)u&&(f=u[x]),k&&!w(f)&&(f.page=null,f.limit=0),h[x]=n[l[x]].search(f,0);if(c)return c(Y(this,a,m,h,g,b,r,q,k,t,v));if(this.async){var z=this;return new Promise(function(aa){Promise.all(h).then(function(pa){aa(Y(z,a,m,pa,g,b,r,q,k,t,v))})})}return Y(this,a,m,h,g,b,r,q,k,t,v)}n||(n=this.threshold||0);if(!e){if(this.async&&"function"!==typeof importScripts){var B=this;n=new Promise(function(aa){setTimeout(function(){aa(B.search(f, b,null,!0));C=null})});if(c)m.then(c);else return m;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!r(a))return g;f=a;if(this.f)if(this.b){if(c=this.f.get(a))return c}else this.f.clear(),this.b=!0;f=this.encode(f);if(!f.length)return g;c=f;v=c.length;e=!0;d=[];var P=D(),Q=0;1<v&&(this.depth?p=!0:c.sort(xa));if(!p||(y=this.i))for(var T=this.h;Q<v;Q++){var E=c[Q];if(E){if(p){if(!l)if(y[E])l=E,P[E]=1;else if(!t)return g;if(t&&Q===v-1&&!d.length)p=!1,E=l||E,P[E]=0;else if(!l)continue}if(!P[E]){var F=
b,null,!0));B=null})});if(c)n.then(c);else return n;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!w(a))return h;f=a;if(this.f)if(this.l){if(c=this.f.get(a))return c}else this.f.clear(),this.l=!0;f=this.encode(f);if(!f.length)return h;c=this.i(f);u=c.length;e=!0;d=[];var N=G(),O=0;1<u&&(this.depth?p=!0:c.sort(qa));if(!p||(x=this.h))for(var R=this.c;O<u;O++){var D=c[O];if(D){if(p){if(!l)if(x[D])l=D,N[D]=1;else if(!r)return h;if(r&&O===u-1&&!d.length)p=!1,D=l||D,N[D]=0;else if(!l)continue}if(!N[D]){var E= [],N=!1,I=0,J=p?y[l]:this.l;if(J)for(var R=void 0,K=0;K<T-m;K++)if(R=J[K]&&J[K][E])F[I++]=R,N=!0;if(N)l=E,d[d.length]=1<I?F.concat.apply([],F):F[0];else if(!t){e=!1;break}P[E]=1}}}else e=!1;e&&(g=ua(d,b,k,t));this.f&&this.f.set(a,g);return g};M.prototype.info=function(){return{id:this.id,items:this.length,matcher:this.u.length,worker:this.A,threshold:this.threshold,depth:this.depth,resolution:this.h,contextual:this.depth&&"strict"===this.o}};M.prototype.clear=function(){return this.destroy().init()};
[],M=!1,H=0,I=p?x[l]:this.j;if(I)for(var P=void 0,J=0;J<R-n;J++)if(P=I[J]&&I[J][D])E[H++]=P,M=!0;if(M)l=D,d[d.length]=1<H?E.concat.apply([],E):E[0];else if(!r){e=!1;break}N[D]=1}}}else e=!1;e&&(h=ma(d,b,k,r));this.f&&this.f.set(a,h);return h};K.prototype.info=function(){return{id:this.id,items:this.length,matcher:this.o.length,worker:this.u,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.b}};K.prototype.clear=function(){return this.destroy().init()}; M.prototype.destroy=function(){this.f&&(this.f.clear(),this.f=null);this.l=this.i=this.g=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.m=null}return this};function pa(a,b,c){Object.defineProperty(a,b,{get:c})}function X(a,b,c,e,d,g,f,h){if(b[c])return b[c];d=d?(h-(f||h/1.5))*g+(f||h/1.5)*d:g;b[c]=d;d>=f&&(a=a[h-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d}
K.prototype.destroy=function(){this.f&&(this.f.clear(),this.f=null);this.j=this.h=this.g=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.m=null}return this};function ka(a,b,c){Object.defineProperty(a,b,{get:c})}function V(a,b,c,e,d,h,f,g){if(b[c])return b[c];d=d?(g-(f||g/1.5))*h+(f||g/1.5)*d:h;b[c]=d;d>=f&&(a=a[g-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d} function sa(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var g=c[e],f=a[g];if(f)for(var h=0,k=f.length;h<k;h++)if(f[h]===b){1===k?delete a[g]:f.splice(h,1);break}else z(f[h])&&sa(f[h],b)}}function qa(a,b){for(var c=Object.keys(a),e=c.length,d=[],g="",f=0,h=0,k;h<e;h++){var m=c[h];(k=a[m])?(d[f++]=H(b?"(?!\\b)"+m+"(\\b)":m),d[f++]=k):g+=(g?"|":"")+m}g&&(d[f++]=H(b?"(?!\\b)("+g+")(\\b)":"("+g+")"),d[f]="");return d}function xa(a,b){return b.length-a.length}
function W(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var h=c[e],f=a[h];if(f)for(var g=0,k=f.length;g<k;g++)if(f[g]===b){1===k?delete a[h]:f.splice(g,1);break}else C(f[g])&&W(f[g],b)}}K.prototype.encode=function(a){a&&this.w&&(a=this.w(a));a&&this.o.length&&(a=ca(a,this.o));a&&this.B&&(a=ca(a,this.B));return a}; function wa(a,b){return a[Y]-b[Y]}function va(a,b){for(var c=Y.length,e=0;e<c;e++)a=a[Y[e]],b=b[Y[e]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}
K.prototype.i=function(a){a=y(a)?a:A(this.b)?this.b(a):a.split(this.split);if(this.filter){for(var b=this.filter,c=a.length,e=A(b),d=[],h=0,f=0;h<c;h++){var g=a[h];g&&(e&&b(g)||!e&&!b[g])&&(d[f++]=g)}a=d}return a};function qa(a,b){return b.length-a.length}function oa(a,b){return a[X]-b[X]}function na(a,b){for(var c=X.length,e=0;e<c;e++)a=a[X[e]],b=b[X[e]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c} function ua(a,b,c,e,d,g,f){var h=[];if(!0===c){c="0";var k=""}else k=c&&c.split(":");var m=a.length;if(1<m){var t=D(),q=[],p,l=0,n,w=!0,u=0,v;if(k)if(2===k.length){var y=k;k=!1}else k=v=parseInt(k[0],10);if(f){for(p=D();l<m;l++)if("not"===d[l]){var A=a[l];var C=A.length;for(n=0;n<C;n++)p["@"+A[n]]=1}else var P=l+1;if(B(P))return Z(c,K,h);l=0}else var Q=r(d)&&d;for(var T;l<m;l++){var E=l===(P||m)-1;if(!Q||!l)if((n=Q||d&&d[l])&&"and"!==n)if("or"===n)T=!1;else continue;else T=g=!0;A=a[l];if(C=A.length){if(w)if(I){var F=
function ma(a,b,c,e,d,h,f){var g=[];if(!0===c){c="0";var k=""}else k=c&&c.split(":");var n=a.length;if(1<n){var r=G(),q=[],p,l=0,m,v=!0,t=0,u;if(k)if(2===k.length){var x=k;k=!1}else k=u=parseInt(k[0],10);if(f){for(p=G();l<n;l++)if("not"===d[l]){var z=a[l];var B=z.length;for(m=0;m<B;m++)p["@"+z[m]]=1}else var N=l+1;if(F(N))return Z(c,J,g);l=0}else var O=w(d)&&d;for(var R;l<n;l++){var D=l===(N||n)-1;if(!O||!l)if((m=O||d&&d[l])&&"and"!==m)if("or"===m)R=!1;else continue;else R=h=!0;z=a[l];if(B=z.length){if(v)if(H){var E= I.length;for(n=0;n<F;n++){w=I[n];var N="@"+w;f&&p[N]||(t[N]=1,g||(h[u++]=w))}var I=null;w=!1}else{I=A;continue}N=!1;for(n=0;n<C;n++){F=A[n];var J="@"+F,R=g?t[J]||0:l;if(!(!R&&!e||f&&p[J]||!g&&t[J]))if(R===l){if(E){if(!v||--v<u)if(h[u++]=F,b&&u===b)return Z(c,u+(k||0),h)}else t[J]=l+1;N=!0}else e&&(J=q[R]||(q[R]=[]),J[J.length]=F)}if(T&&!N&&!e)break}else if(T&&!e)return Z(c,K,A)}if(I)if(l=I.length,f)for(n=k?parseInt(k,10):0;n<l;n++)a=I[n],p["@"+a]||(h[u++]=a);else h=I;if(e)for(u=h.length,y?(l=parseInt(y[0],
H.length;for(m=0;m<E;m++){v=H[m];var M="@"+v;f&&p[M]||(r[M]=1,h||(g[t++]=v))}var H=null;v=!1}else{H=z;continue}M=!1;for(m=0;m<B;m++){E=z[m];var I="@"+E,P=h?r[I]||0:l;if(!(!P&&!e||f&&p[I]||!h&&r[I]))if(P===l){if(D){if(!u||--u<t)if(g[t++]=E,b&&t===b)return Z(c,t+(k||0),g)}else r[I]=l+1;M=!0}else e&&(I=q[P]||(q[P]=[]),I[I.length]=E)}if(R&&!M&&!e)break}else if(R&&!e)return Z(c,J,z)}if(H)if(l=H.length,f)for(m=k?parseInt(k,10):0;m<l;m++)a=H[m],p["@"+a]||(g[t++]=a);else g=H;if(e)for(t=g.length,x?(l=parseInt(x[0], 10)+1,n=parseInt(y[1],10)+1):(l=q.length,n=0);l--;)if(F=q[l]){for(C=F.length;n<C;n++)if(e=F[n],!f||!p["@"+e])if(h[u++]=e,b&&u===b)return Z(c,l+":"+n,h);n=0}}else!m||d&&"not"===d[0]||(h=a[0],k&&(k=parseInt(k[0],10)));if(b){f=h.length;k&&k>f&&(k=0);k=k||0;var K=k+b;K<f?h=h.slice(k,K):(K=0,k&&(h=h.slice(k)))}return Z(c,K,h)};var za={encode:ya,c:!1},Ba=[H("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",H("[\u00e8\u00e9\u00ea\u00eb]"),"e",H("[\u00ec\u00ed\u00ee\u00ef]"),"i",H("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",H("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",H("[\u00fd\u0177\u00ff]"),"y",H("\u00f1"),"n",H("[\u00e7c]"),"k",H("\u00df"),"s",H(" & ")," and ",H("[\\W_]+")," ",H("[^a-z0-9 ]"),""];function ya(a,b){b||(b=this);return L(b,a.toLowerCase(),Ba," ")};var Ca=[H("ae"),"a",H("ai"),"ei",H("ay"),"ei",H("ey"),"ei",H("oe"),"o",H("ue"),"u",H("ie"),"i",H("sz"),"s",H("zs"),"s",H("sh"),"s",H("ck"),"k",H("cc"),"k",H("th"),"t",H("dt"),"t",H("ph"),"f",H("pf"),"f",H("ou"),"o",H("uo"),"u"];function Da(a,b){a&&(a=ya(a,this).join(" "),2<a.length&&(a=G(a,Ca)),b||(1<a.length&&(a=ca(a)),a&&(a=a.split(" "))));return a};var Fa={encode:Ea,c:!1},Ga=[/[\W_]+/g," ",/[^a-z0-9 ]/g,""];function Ea(a){return L(this,a.toLowerCase(),Ga," ")};var Ia={encode:Ha,c:!1},Ja=[H("(?!\\b)p"),"b",H("(?!\\b)z"),"s",H("(?!\\b)[cgq]"),"k",H("(?!\\b)n"),"m",H("(?!\\b)d"),"t",H("(?!\\b)[vw]"),"f",H("(?!\\b)[aeiouy]"),""];function Ha(a){a&&(a=Da(a,!0),1<a.length&&(a=G(a,Ja)),1<a.length&&(a=ca(a)),a&&(a=a.split(" ")));return a};var La={encode:Ka,c:!1,j:"strict"},Ma=[/[\W_]+/g," ",/[^a-z ]/g,""];function Ka(a){a=L(this,a.toLowerCase(),Ma,!1);var b=[];if(a)for(var c=a.split(" "),e=c.length,d=0,g=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){for(var f=a[0],h=Na(f),k=1;k<a.length;k++){var m=Na(a[k]);if(m!==h&&(f+=m,h=m,4===f.length))break}b[g++]=(f+"0000").substring(0,4)}return b}
10)+1,m=parseInt(x[1],10)+1):(l=q.length,m=0);l--;)if(E=q[l]){for(B=E.length;m<B;m++)if(e=E[m],!f||!p["@"+e])if(g[t++]=e,b&&t===b)return Z(c,l+":"+m,g);m=0}}else!n||d&&"not"===d[0]||(g=a[0],k&&(k=parseInt(k[0],10)));if(b){f=g.length;k&&k>f&&(k=0);k=k||0;var J=k+b;J<f?g=g.slice(k,J):(J=0,k&&(g=g.slice(k)))}return Z(c,J,g)};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return K}):"object"===typeof a.exports?a.module.exports=K:a.FlexSearch=K})();}).call(this); function Na(a){switch(a){case "b":case "f":case "p":case "v":return 1;case "c":case "g":case "j":case "k":case "q":case "s":case "x":case "z":return 2;case "d":case "t":return 3;case "l":return 4;case "m":case "n":return 5;case "r":return 6}return""};var Pa={encode:Oa,c:!0},Qa=/[\W_]+/;function Oa(a){return L(this,a,!1,Qa)};var Sa={encode:Ra,c:!1,j:"strict"},Ta=/[\x00-\x7F]/g;function Ra(a){return L(this,a.replace(Ta,""),!1,"")};var Va={encode:Ua,c:!1},Wa=/[\W_]+/;function Ua(a){return L(this,a,!1,Wa)};V["latin:advanced"]={encode:Da,c:!1};V["latin:balance"]=Fa;V["latin:default"]=ka;V["latin:extra"]=Ia;V["latin:simple"]=za;V["latin:soundex"]=La;V["arabic:default"]=Pa;V["cjk:default"]=Sa;V["cyrillic:default"]=Va;(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return M}):"object"===typeof a.exports?a.module.exports=M:a.FlexSearch=M})();}).call(this);

View File

@@ -5,15 +5,15 @@
* Licence: Apache-2.0 * Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function(){'use strict';var u;Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],f=1,d,h,g;f<b;f++){d=a[f];h=Object.keys(d);g=h.length;for(var e=0,n;e<g;e++)n=h[e],c[n]=d[n]}return c});function w(a){return"string"===typeof a}function x(a){return"function"===typeof a}function y(a){for(var b=Array(a),c=0;c<a;c++)b[c]=A();return b}function A(){return Object.create(null)}function C(a,b){for(var c=0,f=b.length;c<f;c+=2)a=a.replace(b[c],b[c+1]);return a};var G={encode:function(a){return a.toLowerCase()},o:"strict",split:/[\W_]+/,cache:!1,async:!1,s:!1,j:!1,m:!1,f:9,threshold:0,depth:0},H=0,I={};function J(a){if(!(this instanceof J))return new J(a);var b=a&&a.id;this.id=b||0===b?b:H++;this.init(a);K(this,"index",function(){return Object.keys(this.a)});K(this,"length",function(){return this.index.length})}J.registerCharset=function(a,b,c,f){a=I[a]||(I[a]={});a.h=b;a.split=c;a.j=f;return J}; (function(){'use strict';var v;Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],e=1,d,h,g;e<b;e++){d=a[e];h=Object.keys(d);g=h.length;for(var f=0,p;f<g;f++)p=h[f],c[p]=d[p]}return c});function w(a){return"string"===typeof a}function y(a){for(var b=Array(a),c=0;c<a;c++)b[c]=z();return b}function z(){return Object.create(null)}function B(a,b){for(var c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a};var C=/[\W_]+/;var G={encode:function(a){if(a=a.toLowerCase())if(a&&this.g&&(a=B(a,this.g)),this.h&&1<a.length&&(a=B(a,this.h)),a&&(C||""===C)&&(a=a.split(C),this.filter)){for(var b=this.filter,c=a.length,e=[],d=0,h=0;d<c;d++){var g=a[d];g&&!b[g]&&(e[h++]=g)}a=e}return a},tokenize:"strict",cache:!1,async:!1,worker:!1,rtl:!1,doc:!1,resolution:9,threshold:0,depth:0},H=0,I={},J={};
J.registerLanguage=function(a,b,c,f){a=I[a]||(I[a]={});a.filter=b;a.l=c;a.c=f;return J};u=J.prototype; function K(a){if(!(this instanceof K))return new K(a);var b=a&&a.id;this.id=b||0===b?b:H++;this.init(a);L(this,"index",function(){return Object.keys(this.a)});L(this,"length",function(){return this.index.length})}K.registerCharset=function(a,b){J[a]=b;return K};K.registerLanguage=function(a,b){J[a]=b;return K};v=K.prototype;
u.init=function(a){this.c=[];var b;this.h||(a?a=Object.assign({},G,a):a=G);if(a){var c=a.charset,f=a.lang;this.i=a.tokenize;this.split=w(b=c||a.split)?I[b]?I[b].split:new RegExp(b,"g"):b;this.j=w(b=c||a.rtl)?I[b].j:b;this.threshold=a.threshold;this.f=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.i&&a.depth||0;this.h=w(b=c||a.encode)?I[-1===b.indexOf(":")?b+":default":b].encode:b;if(c=b=f||a.matcher){b=w(b)?I[b].c:b;c=Object.keys(b);for(var d=c.length,h=Array(2*d), v.init=function(a){var b;this.encode||(a?a=Object.assign({},G,a):a=G);if(a){var c=a.charset,e=a.lang;this.j=(w(c)?J[c].l:c&&c.l)||a.tokenize;this.i=w(b=a.rtl||c)?J[b].i:c&&c.i||b;this.threshold=a.threshold;this.f=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.j&&a.depth||0;this.encode=w(b=a.encode||c)?J[-1===b.indexOf(":")?b+":default":b].encode:c&&c.encode||b;this.g=(b=a.matcher||e)&&M(w(b)?I[b].g:e&&e.g||b,!1);if(c=b=a.filter||e){c=w(b)?I[b].filter:e&&e.filter||b;
g=0,e=0;g<d;g++){var n=c[g];h[e++]=new RegExp(n,"g");h[e++]=b[n]}c=h}this.c=c;if(c=b=f||a.filter)for(b=w(b)?I[b].filter:b,c=A(),d=0;d<b.length;d++)c[b[d]]=1;this.filter=c;if(a=b=f||a.stemmer){a=w(b)?I[b].l:b;f=Object.keys(a);b=f.length;c=Array(2*b);for(h=d=0;d<b;d++)g=f[d],c[h++]=new RegExp(g+"(?!\\b)"+g+"(\\b)","g"),c[h++]=a[g];a=c}this.l=a}this.g=y(this.f-(this.threshold||0));this.b=A();this.a={};return this}; for(var d=z(),h=0,g=c.length;h<g;h++)d[c[h]]=1;c=d}this.filter=c;this.h=(b=a.stemmer||e)&&M(w(b)?I[b].h:e&&e.h||b,!0)}this.c=y(this.f-(this.threshold||0));this.b=z();this.a={};return this};
u.add=function(a,b,c,f,d){if(b&&w(b)&&(a||0===a)){if(this.a[a]&&!f)return this.update(a,b);if(!d&&c)return this.add(a,b,null,f,!0),c(),this;b=this.encode(b);if(!b.length)return this;b=L(this,b);c=A();c._ctx=A();f=b.length;d=this.threshold;for(var h=this.depth,g=this.f,e=this.g,n=this.j,q=0;q<f;q++){var p=b[q];if(p){var l=p.length,m=(n?q+1:f-q)/f,r="";switch(this.i){case "reverse":case "both":for(var k=l;--k;)r=p[k]+r,M(e,c,r,a,n?1:(l-k)/l,m,d,g-1);r="";case "forward":for(k=0;k<l;k++)r+=p[k],M(e,c, v.add=function(a,b,c,e,d){if(b&&w(b)&&(a||0===a)){if(this.a[a]&&!e)return this.update(a,b);if(!d&&c)return this.add(a,b,null,e,!0),c(),this;b=this.encode(b);if(!b.length)return this;c=z();c._ctx=z();e=b.length;d=this.threshold;for(var h=this.depth,g=this.f,f=this.c,p=this.i,l=0;l<e;l++){var q=b[l];if(q){var m=q.length,n=(p?l+1:e-l)/e,r="";switch(this.j){case "reverse":case "both":for(var k=m;--k;)r=q[k]+r,N(f,c,r,a,p?1:(m-k)/m,n,d,g-1);r="";case "forward":for(k=0;k<m;k++)r+=q[k],N(f,c,r,a,p?(k+1)/
r,a,n?(k+1)/l:1,m,d,g-1);break;case "full":for(k=0;k<l;k++)for(var t=(n?k+1:l-k)/l,v=l;v>k;v--)r=p.substring(k,v),M(e,c,r,a,t,m,d,g-1);break;default:if(l=M(e,c,p,a,1,m,d,g-1),h&&1<f&&l>=d)for(l=c._ctx[p]||(c._ctx[p]=A()),p=this.b[p]||(this.b[p]=y(g-(d||0))),m=q-h,r=q+h+1,0>m&&(m=0),r>f&&(r=f);m<r;m++)m!==q&&M(p,l,b[m],a,0,g-(m<q?q-m:m-q),d,g-1)}}}this.a[a]=1}return this};u.update=function(a,b,c){this.a[a]&&w(b)&&(this.remove(a),this.add(a,b,c,!0));return this}; m:1,n,d,g-1);break;case "full":for(k=0;k<m;k++)for(var t=(p?k+1:m-k)/m,u=m;u>k;u--)r=q.substring(k,u),N(f,c,r,a,t,n,d,g-1);break;default:if(m=N(f,c,q,a,1,n,d,g-1),h&&1<e&&m>=d)for(m=c._ctx[q]||(c._ctx[q]=z()),q=this.b[q]||(this.b[q]=y(g-(d||0))),n=l-h,r=l+h+1,0>n&&(n=0),r>e&&(r=e);n<r;n++)n!==l&&N(q,m,b[n],a,0,g-(n<l?l-n:n-l),d,g-1)}}}this.a[a]=1}return this};v.update=function(a,b,c){this.a[a]&&w(b)&&(this.remove(a),this.add(a,b,c,!0));return this};
u.remove=function(a,b,c){if(this.a[a]){if(!c&&b)return this.remove(a,null,!0),b(),this;for(b=0;b<this.f-(this.threshold||0);b++)N(this.g[b],a);this.depth&&N(this.b,a);delete this.a[a]}return this}; v.remove=function(a,b,c){if(this.a[a]){if(!c&&b)return this.remove(a,null,!0),b(),this;for(b=0;b<this.f-(this.threshold||0);b++)O(this.c[b],a);this.depth&&O(this.b,a);delete this.a[a]}return this};
u.search=function(a,b,c,f){b&&x(b)?(c=b,b=1E3):b||0===b||(b=1E3);var d=[],h=a;if("object"===typeof a){var g=!1;b=a.limit;var e=a.threshold;var n=!1;a=a.query}e||(e=this.threshold||0);if(!f&&c)return c(this.search(h,b,null,!0)),this;if(!a||!w(a))return d;h=this.encode(a);if(!h.length)return d;c=L(this,h);f=c.length;h=!0;a=[];var q=A(),p,l=0;1<f&&(this.depth?p=!0:c.sort(Q));var m;if(!p||(m=this.b))for(var r=this.f;l<f;l++){var k=c[l];if(k){if(p){if(!t)if(m[k]){var t=k;q[k]=1}else if(!n)return d;if(n&& v.search=function(a,b,c,e){b&&"function"===typeof b?(c=b,b=1E3):b||0===b||(b=1E3);var d=[],h=a;if("object"===typeof a){var g=!1;b=a.limit;var f=a.threshold;var p=!1;a=a.query}f||(f=this.threshold||0);if(!e&&c)return c(this.search(h,b,null,!0)),this;if(!a||!w(a))return d;h=this.encode(a);if(!h.length)return d;c=h;e=c.length;h=!0;a=[];var l=z(),q,m=0;1<e&&(this.depth?q=!0:c.sort(R));var n;if(!q||(n=this.b))for(var r=this.f;m<e;m++){var k=c[m];if(k){if(q){if(!t)if(n[k]){var t=k;l[k]=1}else if(!p)return d;
l===f-1&&!a.length)p=!1,k=t||k,q[k]=0;else if(!t)continue}if(!q[k]){var v=[],E=!1,O=0;if(t=p?m[t]:this.g)for(var P,F=0;F<r-e;F++)if(P=t[F]&&t[F][k])v[O++]=P,E=!0;if(E)t=k,a[a.length]=1<O?v.concat.apply([],v):v[0];else{h=!1;break}q[k]=1}}}else h=!1;if(h)a:{d=[];!0===g?(g="0",e=""):e=g&&g.split(":");n=a.length;if(1<n){p=A();t=0;r=!0;h=0;var B;for(e&&(2===e.length?e=!1:e=B=parseInt(e[0],10));t<n;t++)if(q=t===n-1,m=a[t],f=m.length){if(r)if(z){l=z.length;for(c=0;c<l;c++)p["@"+z[c]]=1;var z=null;r=!1}else{z= if(p&&m===e-1&&!a.length)q=!1,k=t||k,l[k]=0;else if(!t)continue}if(!l[k]){var u=[],E=!1,P=0;if(t=q?n[t]:this.c)for(var Q,F=0;F<r-f;F++)if(Q=t[F]&&t[F][k])u[P++]=Q,E=!0;if(E)t=k,a[a.length]=1<P?u.concat.apply([],u):u[0];else{h=!1;break}l[k]=1}}}else h=!1;if(h)a:{d=[];!0===g?(g="0",f=""):f=g&&g.split(":");p=a.length;if(1<p){q=z();t=0;r=!0;h=0;var A;for(f&&(2===f.length?f=!1:f=A=parseInt(f[0],10));t<p;t++)if(l=t===p-1,n=a[t],e=n.length){if(r)if(x){m=x.length;for(c=0;c<m;c++)q["@"+x[c]]=1;var x=null;
m;continue}k=!1;for(c=0;c<f;c++)if(l=m[c],v="@"+l,(E=p[v]||0)&&E===t){if(q){if(!B||--B<h)if(d[h++]=l,b&&h===b){d=R(g,h+(e||0),d);break a}}else p[v]=t+1;k=!0}if(!k)break}else{d=R(g,D,m);break a}z&&(d=z)}else n&&(d=a[0],e&&(e=parseInt(e[0],10)));if(b){z=d.length;e&&e>z&&(e=0);B=e||0;var D=B+b;D<z?d=d.slice(B,D):(D=0,B&&(d=d.slice(B)))}d=R(g,D,d)}return d};u.clear=function(){return this.destroy().init()};u.destroy=function(){this.g=this.b=this.a=null;return this}; r=!1}else{x=n;continue}k=!1;for(c=0;c<e;c++)if(m=n[c],u="@"+m,(E=q[u]||0)&&E===t){if(l){if(!A||--A<h)if(d[h++]=m,b&&h===b){d=S(g,h+(f||0),d);break a}}else q[u]=t+1;k=!0}if(!k)break}else{d=S(g,D,n);break a}x&&(d=x)}else p&&(d=a[0],f&&(f=parseInt(f[0],10)));if(b){x=d.length;f&&f>x&&(f=0);A=f||0;var D=A+b;D<x?d=d.slice(A,D):(D=0,A&&(d=d.slice(A)))}d=S(g,D,d)}return d};v.clear=function(){return this.destroy().init()};v.destroy=function(){this.c=this.b=this.a=null;return this};
function K(a,b,c){Object.defineProperty(a,b,{get:c})}function M(a,b,c,f,d,h,g,e){if(b[c])return b[c];d=d?(e-(g||e/1.5))*h+(g||e/1.5)*d:h;b[c]=d;d>=g&&(a=a[e-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=f);return d}function N(a,b){if(a)for(var c=Object.keys(a),f=0,d=c.length;f<d;f++){var h=c[f],g=a[h];if(g)for(var e=0,n=g.length;e<n;e++)if(g[e]===b){1===n?delete a[h]:g.splice(e,1);break}else"object"===typeof g[e]&&N(g[e],b)}} function L(a,b,c){Object.defineProperty(a,b,{get:c})}function N(a,b,c,e,d,h,g,f){if(b[c])return b[c];d=d?(f-(g||f/1.5))*h+(g||f/1.5)*d:h;b[c]=d;d>=g&&(a=a[f-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d}function O(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var h=c[e],g=a[h];if(g)for(var f=0,p=g.length;f<p;f++)if(g[f]===b){1===p?delete a[h]:g.splice(f,1);break}else"object"===typeof g[f]&&O(g[f],b)}}
u.encode=function(a){a&&this.h&&(a=this.h(a));a&&this.c.length&&(a=C(a,this.c));a&&this.l&&(a=C(a,this.l));return a};function L(a,b){b=b.constructor===Array?b:x(a.i)?a.i(b):b.split(a.split);if(a.filter){a=a.filter;for(var c=b.length,f=x(a),d=[],h=0,g=0;h<c;h++){var e=b[h];e&&(f&&a(e)||!f&&!a[e])&&(d[g++]=e)}b=d}return b}function Q(a,b){return b.length-a.length}function R(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return J}):"object"===typeof a.exports?a.module.exports=J:a.FlexSearch=J})();}).call(this); function M(a,b){for(var c=Object.keys(a),e=c.length,d=[],h="",g=0,f=0,p;f<e;f++){var l=c[f];(p=a[l])?(d[g++]=new RegExp(b?"(?!\\b)"+l+"(\\b)":l,"g"),d[g++]=p):h+=(h?"|":"")+l}h&&(d[g++]=new RegExp(b?"(?!\\b)("+h+")(\\b)":"("+h+")","g"),d[g]="");return d}function R(a,b){return b.length-a.length}function S(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return K}):"object"===typeof a.exports?a.module.exports=K:a.FlexSearch=K})();}).call(this);

View File

@@ -5,32 +5,33 @@
* Licence: Apache-2.0 * Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function(){'use strict';Object.assign||(Object.assign=function(){for(var a=arguments,c=a.length,b=a[0],e=1,d,h,f;e<c;e++){d=a[e];h=Object.keys(d);f=h.length;for(var g=0,k;g<f;g++)k=h[g],b[k]=d[k]}return b});window.requestAnimationFrame||(window.requestAnimationFrame=window.setTimeout);window.cancelAnimationFrame||(window.cancelAnimationFrame=window.clearTimeout);window.Promise||(window.Promise=function(){function a(c){this.b=null;var b=this;c(function(e){b.b&&(b.b(e),b.b=null)})}a.prototype.then=function(c){this.b=c};return a}());function w(a){return"string"===typeof a}function y(a){return a.constructor===Array}function A(a){return"function"===typeof a}function C(a){return"object"===typeof a}function F(a){return"undefined"===typeof a}function aa(a){for(var c=Array(a),b=0;b<a;b++)c[b]=G();return c}function G(){return Object.create(null)}function ba(a,c){for(var b=0,e=c.length;b<e;b+=2)a=a.replace(c[b],c[b+1]);return a};K.prototype.export=function(a){var c=!a||F(a.serialize)||a.serialize;if(this.a){var b=!a||F(a.doc)||a.doc,e=!a||F(a.index)||a.index;a=[];var d=0;if(e)for(e=this.a.keys;d<e.length;d++){var h=this.a.index[e[d]];a[d]=[h.j,h.h,Object.keys(h.g)]}b&&(a[d]=this.m)}else a=[this.j,this.h,Object.keys(this.g)];c&&(a=JSON.stringify(a));return a}; (function(){'use strict';Object.assign||(Object.assign=function(){for(var a=arguments,b=a.length,c=a[0],e=1,d,g,f;e<b;e++){d=a[e];g=Object.keys(d);f=g.length;for(var h=0,k;h<f;h++)k=g[h],c[k]=d[k]}return c});window.requestAnimationFrame||(window.requestAnimationFrame=window.setTimeout);window.cancelAnimationFrame||(window.cancelAnimationFrame=window.clearTimeout);window.Promise||(window.Promise=function(){function a(b){this.b=null;var c=this;b(function(e){c.b&&(c.b(e),c.b=null)})}a.prototype.then=function(b){this.b=b};return a}());function r(a){return"string"===typeof a}function x(a){return a.constructor===Array}function z(a){return"function"===typeof a}function B(a){return"object"===typeof a}function D(a){return"undefined"===typeof a}function aa(a){for(var b=Array(a),c=0;c<a;c++)b[c]=G();return b}function G(){return Object.create(null)}function H(a,b){for(var c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function L(a){return new RegExp(a,"g")}
K.prototype.import=function(a,c){if(!c||F(c.serialize)||c.serialize)a=JSON.parse(a);var b={};if(this.a){var e=!c||F(c.doc)||c.doc,d=0;if(!c||F(c.index)||c.index){c=this.a.keys;for(var h=c.length,f=a[0][2];d<f.length;d++)b[f[d]]=1;for(d=0;d<h;d++){f=this.a.index[c[d]];var g=a[d];g&&(f.j=g[0],f.h=g[1],f.g=b)}}e&&(this.m=C(e)?e:a[d])}else{e=a[2];for(d=0;d<e.length;d++)b[e[d]]=1;this.j=a[0];this.h=a[1];this.g=b}};K.prototype.find=function(a,c){return this.where(a,c,1)[0]||null}; function ba(a){for(var b="",c="",e=0,d=a.length,g=void 0;e<d;e++)(g=a[e])!==c&&(b+=c=g);return b}function M(a,b,c,e){if(b&&(c&&b&&(b=H(b,c)),b&&a.u&&(b=H(b,a.u)),a.w&&1<b.length&&(b=H(b,a.w)),b&&(e||""===e)&&(b=b.split(e),a.filter))){a=a.filter;c=b.length;e=[];for(var d=0,g=0;d<c;d++){var f=b[d];f&&!a[f]&&(e[g++]=f)}b=e}return b};O.prototype.export=function(a){var b=!a||D(a.serialize)||a.serialize;if(this.a){var c=!a||D(a.doc)||a.doc,e=!a||D(a.index)||a.index;a=[];var d=0;if(e)for(e=this.a.keys;d<e.length;d++){var g=this.a.index[e[d]];a[d]=[g.l,g.i,Object.keys(g.g)]}c&&(a[d]=this.m)}else a=[this.l,this.i,Object.keys(this.g)];b&&(a=JSON.stringify(a));return a};
K.prototype.where=function(a,c,b,e){var d=this.m,h=[],f=0,g;if(C(a)){b||(b=c);var k=Object.keys(a);var n=k.length;var r=!1;if(1===n&&"id"===k[0])return[d[a.id]];if((g=this.G)&&!e)for(var q=0;q<g.length;q++){var p=g[q],l=a[p];if(!F(l)){var m=this.C[p]["@"+l];if(0===--n)return m;k.splice(k.indexOf(p),1);delete a[p];break}}g=Array(n);for(q=0;q<n;q++)g[q]=k[q].split(":")}else{if(A(a)){c=e||Object.keys(d);b=c.length;for(k=0;k<b;k++)n=d[c[k]],a(n)&&(h[f++]=n);return h}if(F(c))return[d[a]];if("id"===a)return[d[c]]; O.prototype.import=function(a,b){if(!b||D(b.serialize)||b.serialize)a=JSON.parse(a);var c={};if(this.a){var e=!b||D(b.doc)||b.doc,d=0;if(!b||D(b.index)||b.index){b=this.a.keys;for(var g=b.length,f=a[0][2];d<f.length;d++)c[f[d]]=1;for(d=0;d<g;d++){f=this.a.index[b[d]];var h=a[d];h&&(f.l=h[0],f.i=h[1],f.g=c)}}e&&(this.m=B(e)?e:a[d])}else{e=a[2];for(d=0;d<e.length;d++)c[e[d]]=1;this.l=a[0];this.i=a[1];this.g=c}};O.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};
k=[a];n=1;g=[a.split(":")];r=!0}e=m||e||Object.keys(d);q=e.length;for(p=0;p<q;p++){l=m?e[p]:d[e[p]];for(var v=!0,t=0;t<n;t++){r||(c=a[k[t]]);var u=g[t],x=u.length,z=l;if(1<x)for(var B=0;B<x;B++)z=z[u[B]];else z=z[u[0]];if(z!==c){v=!1;break}}if(v&&(h[f++]=l,b&&f===b))break}return h};function L(a){this.clear();this.l=!0!==a&&a}L.prototype.clear=function(){this.cache=G();this.count=G();this.index=G();this.b=[]};L.prototype.set=function(a,c){if(this.l&&F(this.cache[a])){var b=this.b.length;if(b===this.l){b--;var e=this.b[b];delete this.cache[e];delete this.count[e];delete this.index[e]}this.b[b]=a;this.index[a]=b;this.count[a]=-1;this.cache[a]=c;this.get(a)}else this.cache[a]=c}; O.prototype.where=function(a,b,c,e){var d=this.m,g=[],f=0,h;if(B(a)){c||(c=b);var k=Object.keys(a);var m=k.length;var t=!1;if(1===m&&"id"===k[0])return[d[a.id]];if((h=this.F)&&!e)for(var q=0;q<h.length;q++){var p=h[q],l=a[p];if(!D(l)){var n=this.B[p]["@"+l];if(0===--m)return n;k.splice(k.indexOf(p),1);delete a[p];break}}h=Array(m);for(q=0;q<m;q++)h[q]=k[q].split(":")}else{if(z(a)){b=e||Object.keys(d);c=b.length;for(k=0;k<c;k++)m=d[b[k]],a(m)&&(g[f++]=m);return g}if(D(b))return[d[a]];if("id"===a)return[d[b]];
L.prototype.get=function(a){var c=this.cache[a];if(this.l&&c){var b=++this.count[a],e=this.index,d=e[a];if(0<d){for(var h=this.b,f=d;this.count[h[--d]]<=b&&-1!==d;);d++;if(d!==f){for(b=f;b>d;b--)f=h[b-1],h[b]=f,e[f]=b;h[d]=a;e[a]=d}}}return c};var Q={},ca="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;function da(a,c,b){var e=ea,d="flexsearch";e=ca?URL.createObjectURL(new Blob(["("+e.toString()+")()"],{type:"text/javascript"})):d+".browser.js";d+="-"+a;Q[d]||(Q[d]=[]);Q[d][b]=new Worker(e);Q[d][b].onmessage=c;return Q[d][b]} k=[a];m=1;h=[a.split(":")];t=!0}e=n||e||Object.keys(d);q=e.length;for(p=0;p<q;p++){l=n?e[p]:d[e[p]];for(var w=!0,u=0;u<m;u++){t||(b=a[k[u]]);var v=h[u],y=v.length,A=l;if(1<y)for(var C=0;C<y;C++)A=A[v[C]];else A=A[v[0]];if(A!==b){w=!1;break}}if(w&&(g[f++]=l,c&&f===c))break}return g};function S(a){this.clear();this.o=!0!==a&&a}S.prototype.clear=function(){this.cache=G();this.count=G();this.index=G();this.b=[]};S.prototype.set=function(a,b){if(this.o&&D(this.cache[a])){var c=this.b.length;if(c===this.o){c--;var e=this.b[c];delete this.cache[e];delete this.count[e];delete this.index[e]}this.b[c]=a;this.index[a]=c;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b};
function ea(){var a,c;self.onmessage=function(b){if(b=b.data)if(b.search){var e=c.search(b.content,b.threshold?{limit:b.limit,threshold:b.threshold,where:b.where}:b.limit);self.postMessage({id:a,content:b.content,limit:b.limit,result:e})}else b.add?c.add(b.id,b.content):b.update?c.update(b.id,b.content):b.remove?c.remove(b.id):b.clear?c.clear():b.info?(b=c.info(),b.worker=a,console.log(b)):b.register&&(a=b.id,b.options.cache=!1,b.options.async=!1,b.options.worker=!1,c=(new Function(b.register.substring(b.register.indexOf("{")+ S.prototype.get=function(a){var b=this.cache[a];if(this.o&&b){var c=++this.count[a],e=this.index,d=e[a];if(0<d){for(var g=this.b,f=d;this.count[g[--d]]<=c&&-1!==d;);d++;if(d!==f){for(c=f;c>d;c--)f=g[c-1],g[c]=f,e[f]=c;g[d]=a;e[a]=d}}}return b};var U={},ca="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;function ea(a,b,c){var e=fa,d="flexsearch";e=ca?URL.createObjectURL(new Blob(["("+e.toString()+")()"],{type:"text/javascript"})):d+".browser.js";d+="-"+a;U[d]||(U[d]=[]);U[d][c]=new Worker(e);U[d][c].onmessage=b;return U[d][c]}
1,b.register.lastIndexOf("}"))))(),c=new c(b.options))}}function fa(a,c,b,e){a=da("id"+a,function(h){(h=h.data)&&h.result&&e(h.id,h.content,h.result,h.limit,h.where,h.cursor,h.suggest)},c);var d=K.toString();b.id=c;a.postMessage({register:d,options:b,id:c});return a}K.prototype.H=function(a,c,b,e){this.v!==this.u&&(this.s=this.s.concat(b),this.v++,e&&this.s.length>=e&&(this.v=this.u),this.v===this.u&&(this.cache&&this.f.set(c,this.s),this.D&&this.D(this.s)));return this};var ha={memory:{encode:"extra",i:"strict",threshold:0,c:1},speed:{encode:"icase",i:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",i:"full",threshold:1,c:3},score:{encode:"extra",i:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",i:"strict",threshold:0,c:3,depth:3},fast:{encode:"icase",i:"strict",threshold:8,c:9,depth:1}};var ia={encode:function(a){return a.toLowerCase()},i:"strict",split:/[\W_]+/,cache:!1,async:!1,u:!1,A:!1,a:!1,c:9,threshold:0,depth:0},ja=0,S={};function K(a){if(!(this instanceof K))return new K(a);var c=a&&a.id;this.id=c||0===c?c:ja++;this.init(a);ka(this,"index",function(){return Object.keys(this.g)});ka(this,"length",function(){return this.index.length})}K.registerCharset=function(a,c,b,e){a=S[a]||(S[a]={});a.w=c;a.split=b;a.A=e;return K}; function fa(){var a,b;self.onmessage=function(c){if(c=c.data)if(c.search){var e=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold,where:c.where}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:e})}else c.add?b.add(c.id,c.content):c.update?b.update(c.id,c.content):c.remove?b.remove(c.id):c.clear?b.clear():c.info?(c=b.info(),c.worker=a,console.log(c)):c.register&&(a=c.id,c.options.cache=!1,c.options.async=!1,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+
K.registerLanguage=function(a,c,b,e){a=S[a]||(S[a]={});a.filter=c;a.B=b;a.o=e;return K}; 1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}}function ha(a,b,c,e){a=ea("id"+a,function(g){(g=g.data)&&g.result&&e(g.id,g.content,g.result,g.limit,g.where,g.cursor,g.suggest)},b);var d=O.toString();c.id=b;a.postMessage({register:d,options:c,id:b});return a}O.prototype.G=function(a,b,c,e){this.v!==this.A&&(this.s=this.s.concat(c),this.v++,e&&this.s.length>=e&&(this.v=this.A),this.v===this.A&&(this.cache&&this.f.set(b,this.s),this.C&&this.C(this.s)));return this};var ia={memory:{encode:"extra",j:"strict",threshold:0,h:1},speed:{encode:"icase",j:"strict",threshold:1,h:3,depth:2},match:{encode:"extra",j:"full",threshold:1,h:3},score:{encode:"extra",j:"strict",threshold:1,h:9,depth:4},balance:{encode:"balance",j:"strict",threshold:0,h:3,depth:3},fast:{encode:"icase",j:"strict",threshold:8,h:9,depth:1}};var ka={encode:ja,c:!1},la=/[\W_]+/;function ja(a){return M(this,a.toLowerCase(),!1,la)};var ma={encode:ja,tokenize:"strict",cache:!1,async:!1,worker:!1,rtl:!1,doc:!1,resolution:9,threshold:0,depth:0},na=0,oa={},V={};function O(a){if(!(this instanceof O))return new O(a);var b=a&&a.id;this.id=b||0===b?b:na++;this.init(a);pa(this,"index",function(){return Object.keys(this.g)});pa(this,"length",function(){return this.index.length})}O.registerCharset=function(a,b){V[a]=b;return O};O.registerLanguage=function(a,b){V[a]=b;return O};
K.prototype.init=function(a){this.o=[];var c,b;if(w(a))a=ha[a];else if(c=a.preset)a=Object.assign({},ha[c],a);this.w||(a?a=Object.assign({},ia,a):a=ia);if(a){if(c=a.worker){if("undefined"===typeof da)a.worker=!1,this.F=null;else{var e=parseInt(c,10)||4;this.v=0;this.s=[];this.D=null;this.F=Array(e);for(b=0;b<e;b++)this.F[b]=fa(this.id,b,a,this.H)}this.u=c}b=a.charset;e=a.lang;this.b=a.tokenize;this.split=w(c=b||a.split)?S[c]?S[c].split:new RegExp(c,"g"):c;this.A=w(c=b||a.rtl)?S[c].A:c;this.async= O.prototype.init=function(a){var b,c;if(r(a))a=ia[a];else if(b=a.preset)a=Object.assign({},ia[b],a);this.encode||(a?a=Object.assign({},ma,a):a=ma);if(a){if(b=a.worker){if("undefined"===typeof ea)a.worker=!1,this.D=null;else{var e=parseInt(b,10)||4;this.v=0;this.s=[];this.C=null;this.D=Array(e);for(c=0;c<e;c++)this.D[c]=ha(this.id,c,a,this.G)}this.A=b}this.async=a.async;c=a.charset;e=a.lang;this.o=(r(c)?V[c].j:c&&c.j)||a.tokenize;this.c=r(b=a.rtl||c)?V[b].c:c&&c.c||b;this.threshold=a.threshold;this.h=
a.async;this.threshold=a.threshold;this.c=(c=a.resolution)<=this.threshold?this.threshold+1:c;this.depth="strict"===this.b&&a.depth||0;this.w=w(c=b||a.encode)?S[-1===c.indexOf(":")?c+":default":c].encode:c;if(b=c=e||a.matcher){c=w(c)?S[c].o:c;b=Object.keys(c);for(var d=b.length,h=Array(2*d),f=0,g=0;f<d;f++){var k=b[f];h[g++]=new RegExp(k,"g");h[g++]=c[k]}b=h}this.o=b;if(b=c=e||a.filter)for(c=w(c)?S[c].filter:c,b=G(),d=0;d<c.length;d++)b[c[d]]=1;this.filter=b;if(e=c=e||a.stemmer){e=w(c)?S[c].B:c;b= (b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.o&&a.depth||0;this.encode=r(b=a.encode||c)?V[-1===b.indexOf(":")?b+":default":b].encode:c&&c.encode||b;this.u=(b=a.matcher||e)&&qa(r(b)?oa[b].u:e&&e.u||b,!1);if(c=b=a.filter||e){c=r(b)?oa[b].filter:e&&e.filter||b;for(var d=G(),g=0,f=c.length;g<f;g++)d[c[g]]=1;c=d}this.filter=c;this.w=(b=a.stemmer||e)&&qa(r(b)?oa[b].w:e&&e.w||b,!0);(this.a=c=(b=a.doc)&&ra(b))&&(a.doc=null)}this.l=aa(this.h-(this.threshold||0));this.i=G();
Object.keys(e);d=b.length;h=Array(2*d);for(g=f=0;f<d;f++)k=b[f],h[g++]=new RegExp(k+"(?!\\b)"+k+"(\\b)","g"),h[g++]=e[k];e=h}this.B=e;(this.a=b=(c=a.doc)&&la(c))&&(a.doc=null)}this.j=aa(this.c-(this.threshold||0));this.h=G();this.g={};if(b){this.m=G();c=b.index={};e=b.keys=[];d=b.field;h=b.tag;f=b.store;y(b.id)||(b.id=b.id.split(":"));if(f){g=G();if(w(f))g[f]=1;else if(y(f))for(k=0;k<f.length;k++)g[f[k]]=1;else C(f)&&(g=f);b.store=g}if(h){this.C=G();f=G();if(d)if(w(d))f[d]=a;else if(y(d))for(g=0;g< this.g={};if(c){this.m=G();b=c.index={};e=c.keys=[];d=c.field;g=c.tag;f=c.store;x(c.id)||(c.id=c.id.split(":"));if(f){var h=G();if(r(f))h[f]=1;else if(x(f))for(var k=0;k<f.length;k++)h[f[k]]=1;else B(f)&&(h=f);c.store=h}if(g){this.B=G();f=G();if(d)if(r(d))f[d]=a;else if(x(d))for(h=0;h<d.length;h++)f[d[h]]=a;else B(d)&&(f=d);x(g)||(c.tag=g=[g]);for(d=0;d<g.length;d++)this.B[g[d]]=G();this.F=g;d=f}if(d){if(!x(d))if(B(d)){var m=d;c.field=d=Object.keys(d)}else c.field=d=[d];for(c=0;c<d.length;c++)g=d[c],
d.length;g++)f[d[g]]=a;else C(d)&&(f=d);y(h)||(b.tag=h=[h]);for(d=0;d<h.length;d++)this.C[h[d]]=G();this.G=h;d=f}if(d){if(!y(d))if(C(d)){var n=d;b.field=d=Object.keys(d)}else b.field=d=[d];for(b=0;b<d.length;b++)h=d[b],y(h)||(n&&(a=n[h]),e[b]=h,d[b]=h.split(":")),c[h]=new K(a)}}if(c=a.cache)this.l=!0,this.f=new L(c);return this};function la(a){var c=G(),b;for(b in a)if(a.hasOwnProperty(b)){var e=a[b];c[b]=y(e)?e.slice(0):C(e)?la(e):e}return c} x(g)||(m&&(a=m[g]),e[c]=g,d[c]=g.split(":")),b[g]=new O(a)}}if(b=a.cache)this.b=!0,this.f=new S(b);return this};function ra(a){var b=G(),c;for(c in a)if(a.hasOwnProperty(c)){var e=a[c];b[c]=x(e)?e.slice(0):B(e)?ra(e):e}return b}
K.prototype.add=function(a,c,b,e,d){if(this.a&&C(a))return T(this,"add",a,c);if(c&&w(c)&&(a||0===a)){if(this.g[a]&&!e)return this.update(a,c);if(!d){if(this.async&&"function"!==typeof importScripts){var h=this;d=new Promise(function(B){setTimeout(function(){h.add(a,c,null,e,!0);h=null;B()})});if(b)d.then(b);else return d;return this}if(b)return this.add(a,c,null,e,!0),b(),this}c=this.encode(c);if(!c.length)return this;b=this.i(c);d=G();d._ctx=G();for(var f=b.length,g=this.threshold,k=this.depth,n= O.prototype.add=function(a,b,c,e,d){if(this.a&&B(a))return W(this,"add",a,b);if(b&&r(b)&&(a||0===a)){if(this.g[a]&&!e)return this.update(a,b);if(!d){if(this.async&&"function"!==typeof importScripts){var g=this;d=new Promise(function(C){setTimeout(function(){g.add(a,b,null,e,!0);g=null;C()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,e,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=b;d=G();d._ctx=G();for(var f=c.length,h=this.threshold,k=this.depth,m=this.h,
this.c,r=this.j,q=this.A,p=0;p<f;p++){var l=b[p];if(l){var m=l.length,v=(q?p+1:f-p)/f,t="";switch(this.b){case "reverse":case "both":for(var u=m;--u;)t=l[u]+t,U(r,d,t,a,q?1:(m-u)/m,v,g,n-1);t="";case "forward":for(u=0;u<m;u++)t+=l[u],U(r,d,t,a,q?(u+1)/m:1,v,g,n-1);break;case "full":for(u=0;u<m;u++)for(var x=(q?u+1:m-u)/m,z=m;z>u;z--)t=l.substring(u,z),U(r,d,t,a,x,v,g,n-1);break;default:if(m=U(r,d,l,a,1,v,g,n-1),k&&1<f&&m>=g)for(m=d._ctx[l]||(d._ctx[l]=G()),l=this.h[l]||(this.h[l]=aa(n-(g||0))),v= t=this.l,q=this.c,p=0;p<f;p++){var l=c[p];if(l){var n=l.length,w=(q?p+1:f-p)/f,u="";switch(this.o){case "reverse":case "both":for(var v=n;--v;)u=l[v]+u,X(t,d,u,a,q?1:(n-v)/n,w,h,m-1);u="";case "forward":for(v=0;v<n;v++)u+=l[v],X(t,d,u,a,q?(v+1)/n:1,w,h,m-1);break;case "full":for(v=0;v<n;v++)for(var y=(q?v+1:n-v)/n,A=n;A>v;A--)u=l.substring(v,A),X(t,d,u,a,y,w,h,m-1);break;default:if(n=X(t,d,l,a,1,w,h,m-1),k&&1<f&&n>=h)for(n=d._ctx[l]||(d._ctx[l]=G()),l=this.i[l]||(this.i[l]=aa(m-(h||0))),w=p-k,u=p+
p-k,t=p+k+1,0>v&&(v=0),t>f&&(t=f);v<t;v++)v!==p&&U(l,m,b[v],a,0,n-(v<p?p-v:v-p),g,n-1)}}}this.g[a]=1;this.l=!1}return this}; k+1,0>w&&(w=0),u>f&&(u=f);w<u;w++)w!==p&&X(l,n,c[w],a,0,m-(w<p?p-w:w-p),h,m-1)}}}this.g[a]=1;this.b=!1}return this};
function T(a,c,b,e){if(y(b)){var d=b.length;if(d--){for(var h=0;h<d;h++)T(a,c,b[h]);return T(a,c,b[d],e)}}else{var f=a.a.index,g=a.a.keys,k=a.a.tag;h=a.a.store;var n;var r=a.a.id;d=b;for(var q=0;q<r.length;q++)d=d[r[q]];if("remove"===c&&(delete a.m[d],r=g.length,r--)){for(a=0;a<r;a++)f[g[a]].remove(d);return f[g[r]].remove(d,e)}if(k){for(n=0;n<k.length;n++){var p=k[n];var l=b;r=p.split(":");for(q=0;q<r.length;q++)l=l[r[q]];l="@"+l}n=a.C[p];n=n[l]||(n[l]=[])}r=a.a.field;k=0;for(p=r.length;k<p;k++){q= function W(a,b,c,e){if(x(c)){var d=c.length;if(d--){for(var g=0;g<d;g++)W(a,b,c[g]);return W(a,b,c[d],e)}}else{var f=a.a.index,h=a.a.keys,k=a.a.tag;g=a.a.store;var m;var t=a.a.id;d=c;for(var q=0;q<t.length;q++)d=d[t[q]];if("remove"===b&&(delete a.m[d],t=h.length,t--)){for(a=0;a<t;a++)f[h[a]].remove(d);return f[h[t]].remove(d,e)}if(k){for(m=0;m<k.length;m++){var p=k[m];var l=c;t=p.split(":");for(q=0;q<t.length;q++)l=l[t[q]];l="@"+l}m=a.B[p];m=m[l]||(m[l]=[])}t=a.a.field;k=0;for(p=t.length;k<p;k++){q=
r[k];l=b;for(var m=0;m<q.length;m++)l=l[q[m]];q=f[g[k]];"add"===c?q.add(d,l,k===p-1&&e):q.update(d,l,k===p-1&&e)}if(h){e=Object.keys(h);c=G();for(f=0;f<e.length;f++)if(g=e[f],h[g])for(g=g.split(":"),k=r=void 0,p=0;p<g.length;p++)l=g[p],r=(r||b)[l],k=(k||c)[l]=r;b=c}n&&(n[n.length]=b);a.m[d]=b}return a}K.prototype.update=function(a,c,b){if(this.a&&C(a))return T(this,"update",a,c);this.g[a]&&w(c)&&(this.remove(a),this.add(a,c,b,!0));return this}; t[k];l=c;for(var n=0;n<q.length;n++)l=l[q[n]];q=f[h[k]];"add"===b?q.add(d,l,k===p-1&&e):q.update(d,l,k===p-1&&e)}if(g){e=Object.keys(g);b=G();for(f=0;f<e.length;f++)if(h=e[f],g[h])for(h=h.split(":"),k=t=void 0,p=0;p<h.length;p++)l=h[p],t=(t||c)[l],k=(k||b)[l]=t;c=b}m&&(m[m.length]=c);a.m[d]=c}return a}O.prototype.update=function(a,b,c){if(this.a&&B(a))return W(this,"update",a,b);this.g[a]&&r(b)&&(this.remove(a),this.add(a,b,c,!0));return this};
K.prototype.remove=function(a,c,b){if(this.a&&C(a))return T(this,"remove",a,c);if(this.g[a]){if(!b){if(this.async&&"function"!==typeof importScripts){var e=this;b=new Promise(function(d){setTimeout(function(){e.remove(a,null,!0);e=null;d()})});if(c)b.then(c);else return b;return this}if(c)return this.remove(a,null,!0),c(),this}for(c=0;c<this.c-(this.threshold||0);c++)V(this.j[c],a);this.depth&&V(this.h,a);delete this.g[a];this.l=!1}return this};var W; O.prototype.remove=function(a,b,c){if(this.a&&B(a))return W(this,"remove",a,b);if(this.g[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var e=this;c=new Promise(function(d){setTimeout(function(){e.remove(a,null,!0);e=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.h-(this.threshold||0);b++)sa(this.l[b],a);this.depth&&sa(this.i,a);delete this.g[a];this.b=!1}return this};var Y;
function X(a,c,b,e,d,h,f,g,k,n,r){e=ma(e,g?0:h,k,f,b,n,r);if(k){k=e.page;var q=e.next;e=e.result}if(g)e=a.where(g,null,h,e);else{b=e;e=a.m;h=b.length;f=Array(h);for(g=0;g<h;g++)f[g]=e[b[g]];e=f}d&&(A(d)||(W=d.split(":"),1<W.length?d=na:(W=W[0],d=oa)),e.sort(d));e=Y(k,q,e);a.f&&a.f.set(c,e);return e} function ta(a,b,c,e,d,g,f,h,k,m,t){e=ua(e,h?0:g,k,f,c,m,t);if(k){k=e.page;var q=e.next;e=e.result}if(h)e=a.where(h,null,g,e);else{c=e;e=a.m;g=c.length;f=Array(g);for(h=0;h<g;h++)f[h]=e[c[h]];e=f}d&&(z(d)||(Y=d.split(":"),1<Y.length?d=va:(Y=Y[0],d=wa)),e.sort(d));e=Z(k,q,e);a.f&&a.f.set(b,e);return e}
K.prototype.search=function(a,c,b,e){if(C(c)){if(y(c))for(var d=0;d<c.length;d++)c[d].query=a;else c.query=a;a=c;c=1E3}else c&&A(c)?(b=c,c=1E3):c||0===c||(c=1E3);var h=[],f=a;if(C(a)&&!y(a)){b||(b=a.callback)&&(f.callback=null);var g=a.sort;var k=a.page;c=a.limit;var n=a.threshold;var r=a.suggest;a=a.query}if(this.a){n=this.a.index;var q=f.where,p=f.bool||"or",l=f.field,m=p,v,t;if(l)y(l)||(l=[l]);else if(y(f)){var u=f;l=[];m=[];for(var x=0;x<f.length;x++)e=f[x],d=e.bool||p,l[x]=e.field,m[x]=d,"not"=== O.prototype.search=function(a,b,c,e){if(B(b)){if(x(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&z(b)?(c=b,b=1E3):b||0===b||(b=1E3);var g=[],f=a;if(B(a)&&!x(a)){c||(c=a.callback)&&(f.callback=null);var h=a.sort;var k=a.page;b=a.limit;var m=a.threshold;var t=a.suggest;a=a.query}if(this.a){m=this.a.index;var q=f.where,p=f.bool||"or",l=f.field,n=p,w,u;if(l)x(l)||(l=[l]);else if(x(f)){var v=f;l=[];n=[];for(var y=0;y<f.length;y++)e=f[y],d=e.bool||p,l[y]=e.field,n[y]=d,"not"===
d?v=!0:"and"===d&&(t=!0)}else l=this.a.keys;p=l.length;for(x=0;x<p;x++)u&&(f=u[x]),k&&!w(f)&&(f.page=null,f.limit=0),h[x]=n[l[x]].search(f,0);if(b)return b(X(this,a,m,h,g,c,r,q,k,t,v));if(this.async){var z=this;return new Promise(function(Z){Promise.all(h).then(function(pa){Z(X(z,a,m,pa,g,c,r,q,k,t,v))})})}return X(this,a,m,h,g,c,r,q,k,t,v)}n||(n=this.threshold||0);if(!e){if(this.async&&"function"!==typeof importScripts){var B=this;n=new Promise(function(Z){setTimeout(function(){Z(B.search(f,c,null, d?w=!0:"and"===d&&(u=!0)}else l=this.a.keys;p=l.length;for(y=0;y<p;y++)v&&(f=v[y]),k&&!r(f)&&(f.page=null,f.limit=0),g[y]=m[l[y]].search(f,0);if(c)return c(ta(this,a,n,g,h,b,t,q,k,u,w));if(this.async){var A=this;return new Promise(function(da){Promise.all(g).then(function(Aa){da(ta(A,a,n,Aa,h,b,t,q,k,u,w))})})}return ta(this,a,n,g,h,b,t,q,k,u,w)}m||(m=this.threshold||0);if(!e){if(this.async&&"function"!==typeof importScripts){var C=this;m=new Promise(function(da){setTimeout(function(){da(C.search(f,
!0));B=null})});if(b)n.then(b);else return n;return this}if(b)return b(this.search(f,c,null,!0)),this}if(!a||!w(a))return h;f=a;if(this.f)if(this.l){if(b=this.f.get(a))return b}else this.f.clear(),this.l=!0;f=this.encode(f);if(!f.length)return h;b=this.i(f);u=b.length;e=!0;d=[];var N=G(),O=0;1<u&&(this.depth?p=!0:b.sort(qa));if(!p||(x=this.h))for(var R=this.c;O<u;O++){var D=b[O];if(D){if(p){if(!l)if(x[D])l=D,N[D]=1;else if(!r)return h;if(r&&O===u-1&&!d.length)p=!1,D=l||D,N[D]=0;else if(!l)continue}if(!N[D]){var E= b,null,!0));C=null})});if(c)m.then(c);else return m;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!r(a))return g;f=a;if(this.f)if(this.b){if(c=this.f.get(a))return c}else this.f.clear(),this.b=!0;f=this.encode(f);if(!f.length)return g;c=f;v=c.length;e=!0;d=[];var P=G(),Q=0;1<v&&(this.depth?p=!0:c.sort(xa));if(!p||(y=this.i))for(var T=this.h;Q<v;Q++){var E=c[Q];if(E){if(p){if(!l)if(y[E])l=E,P[E]=1;else if(!t)return g;if(t&&Q===v-1&&!d.length)p=!1,E=l||E,P[E]=0;else if(!l)continue}if(!P[E]){var F=
[],M=!1,H=0,I=p?x[l]:this.j;if(I)for(var P=void 0,J=0;J<R-n;J++)if(P=I[J]&&I[J][D])E[H++]=P,M=!0;if(M)l=D,d[d.length]=1<H?E.concat.apply([],E):E[0];else if(!r){e=!1;break}N[D]=1}}}else e=!1;e&&(h=ma(d,c,k,r));this.f&&this.f.set(a,h);return h};K.prototype.info=function(){return{id:this.id,items:this.length,matcher:this.o.length,worker:this.u,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.b}};K.prototype.clear=function(){return this.destroy().init()}; [],N=!1,I=0,J=p?y[l]:this.l;if(J)for(var R=void 0,K=0;K<T-m;K++)if(R=J[K]&&J[K][E])F[I++]=R,N=!0;if(N)l=E,d[d.length]=1<I?F.concat.apply([],F):F[0];else if(!t){e=!1;break}P[E]=1}}}else e=!1;e&&(g=ua(d,b,k,t));this.f&&this.f.set(a,g);return g};O.prototype.info=function(){return{id:this.id,items:this.length,matcher:this.u.length,worker:this.A,threshold:this.threshold,depth:this.depth,resolution:this.h,contextual:this.depth&&"strict"===this.o}};O.prototype.clear=function(){return this.destroy().init()};
K.prototype.destroy=function(){this.f&&(this.f.clear(),this.f=null);this.j=this.h=this.g=null;if(this.a){for(var a=this.a.keys,c=0;c<a.length;c++)this.a.index[a[c]].destroy();this.a=this.m=null}return this};function ka(a,c,b){Object.defineProperty(a,c,{get:b})}function U(a,c,b,e,d,h,f,g){if(c[b])return c[b];d=d?(g-(f||g/1.5))*h+(f||g/1.5)*d:h;c[b]=d;d>=f&&(a=a[g-(d+.5>>0)],a=a[b]||(a[b]=[]),a[a.length]=e);return d} O.prototype.destroy=function(){this.f&&(this.f.clear(),this.f=null);this.l=this.i=this.g=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.m=null}return this};function pa(a,b,c){Object.defineProperty(a,b,{get:c})}function X(a,b,c,e,d,g,f,h){if(b[c])return b[c];d=d?(h-(f||h/1.5))*g+(f||h/1.5)*d:g;b[c]=d;d>=f&&(a=a[h-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d}
function V(a,c){if(a)for(var b=Object.keys(a),e=0,d=b.length;e<d;e++){var h=b[e],f=a[h];if(f)for(var g=0,k=f.length;g<k;g++)if(f[g]===c){1===k?delete a[h]:f.splice(g,1);break}else C(f[g])&&V(f[g],c)}}K.prototype.encode=function(a){a&&this.w&&(a=this.w(a));a&&this.o.length&&(a=ba(a,this.o));a&&this.B&&(a=ba(a,this.B));return a}; function sa(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var g=c[e],f=a[g];if(f)for(var h=0,k=f.length;h<k;h++)if(f[h]===b){1===k?delete a[g]:f.splice(h,1);break}else B(f[h])&&sa(f[h],b)}}function qa(a,b){for(var c=Object.keys(a),e=c.length,d=[],g="",f=0,h=0,k;h<e;h++){var m=c[h];(k=a[m])?(d[f++]=L(b?"(?!\\b)"+m+"(\\b)":m),d[f++]=k):g+=(g?"|":"")+m}g&&(d[f++]=L(b?"(?!\\b)("+g+")(\\b)":"("+g+")"),d[f]="");return d}function xa(a,b){return b.length-a.length}
K.prototype.i=function(a){a=y(a)?a:A(this.b)?this.b(a):a.split(this.split);if(this.filter){for(var c=this.filter,b=a.length,e=A(c),d=[],h=0,f=0;h<b;h++){var g=a[h];g&&(e&&c(g)||!e&&!c[g])&&(d[f++]=g)}a=d}return a};function qa(a,c){return c.length-a.length}function oa(a,c){return a[W]-c[W]}function na(a,c){for(var b=W.length,e=0;e<b;e++)a=a[W[e]],c=c[W[e]];return a-c}function Y(a,c,b){return a?{page:a,next:c?""+c:null,result:b}:b} function wa(a,b){return a[Y]-b[Y]}function va(a,b){for(var c=Y.length,e=0;e<c;e++)a=a[Y[e]],b=b[Y[e]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}
function ma(a,c,b,e,d,h,f){var g=[];if(!0===b){b="0";var k=""}else k=b&&b.split(":");var n=a.length;if(1<n){var r=G(),q=[],p,l=0,m,v=!0,t=0,u;if(k)if(2===k.length){var x=k;k=!1}else k=u=parseInt(k[0],10);if(f){for(p=G();l<n;l++)if("not"===d[l]){var z=a[l];var B=z.length;for(m=0;m<B;m++)p["@"+z[m]]=1}else var N=l+1;if(F(N))return Y(b,J,g);l=0}else var O=w(d)&&d;for(var R;l<n;l++){var D=l===(N||n)-1;if(!O||!l)if((m=O||d&&d[l])&&"and"!==m)if("or"===m)R=!1;else continue;else R=h=!0;z=a[l];if(B=z.length){if(v)if(H){var E= function ua(a,b,c,e,d,g,f){var h=[];if(!0===c){c="0";var k=""}else k=c&&c.split(":");var m=a.length;if(1<m){var t=G(),q=[],p,l=0,n,w=!0,u=0,v;if(k)if(2===k.length){var y=k;k=!1}else k=v=parseInt(k[0],10);if(f){for(p=G();l<m;l++)if("not"===d[l]){var A=a[l];var C=A.length;for(n=0;n<C;n++)p["@"+A[n]]=1}else var P=l+1;if(D(P))return Z(c,K,h);l=0}else var Q=r(d)&&d;for(var T;l<m;l++){var E=l===(P||m)-1;if(!Q||!l)if((n=Q||d&&d[l])&&"and"!==n)if("or"===n)T=!1;else continue;else T=g=!0;A=a[l];if(C=A.length){if(w)if(I){var F=
H.length;for(m=0;m<E;m++){v=H[m];var M="@"+v;f&&p[M]||(r[M]=1,h||(g[t++]=v))}var H=null;v=!1}else{H=z;continue}M=!1;for(m=0;m<B;m++){E=z[m];var I="@"+E,P=h?r[I]||0:l;if(!(!P&&!e||f&&p[I]||!h&&r[I]))if(P===l){if(D){if(!u||--u<t)if(g[t++]=E,c&&t===c)return Y(b,t+(k||0),g)}else r[I]=l+1;M=!0}else e&&(I=q[P]||(q[P]=[]),I[I.length]=E)}if(R&&!M&&!e)break}else if(R&&!e)return Y(b,J,z)}if(H)if(l=H.length,f)for(m=k?parseInt(k,10):0;m<l;m++)a=H[m],p["@"+a]||(g[t++]=a);else g=H;if(e)for(t=g.length,x?(l=parseInt(x[0], I.length;for(n=0;n<F;n++){w=I[n];var N="@"+w;f&&p[N]||(t[N]=1,g||(h[u++]=w))}var I=null;w=!1}else{I=A;continue}N=!1;for(n=0;n<C;n++){F=A[n];var J="@"+F,R=g?t[J]||0:l;if(!(!R&&!e||f&&p[J]||!g&&t[J]))if(R===l){if(E){if(!v||--v<u)if(h[u++]=F,b&&u===b)return Z(c,u+(k||0),h)}else t[J]=l+1;N=!0}else e&&(J=q[R]||(q[R]=[]),J[J.length]=F)}if(T&&!N&&!e)break}else if(T&&!e)return Z(c,K,A)}if(I)if(l=I.length,f)for(n=k?parseInt(k,10):0;n<l;n++)a=I[n],p["@"+a]||(h[u++]=a);else h=I;if(e)for(u=h.length,y?(l=parseInt(y[0],
10)+1,m=parseInt(x[1],10)+1):(l=q.length,m=0);l--;)if(E=q[l]){for(B=E.length;m<B;m++)if(e=E[m],!f||!p["@"+e])if(g[t++]=e,c&&t===c)return Y(b,l+":"+m,g);m=0}}else!n||d&&"not"===d[0]||(g=a[0],k&&(k=parseInt(k[0],10)));if(c){f=g.length;k&&k>f&&(k=0);k=k||0;var J=k+c;J<f?g=g.slice(k,J):(J=0,k&&(g=g.slice(k)))}return Y(b,J,g)};(function(){var a=this||window,c;(c=a.define)&&c.amd?c([],function(){return K}):"object"===typeof a.exports?a.module.exports=K:a.FlexSearch=K})();}).call(this); 10)+1,n=parseInt(y[1],10)+1):(l=q.length,n=0);l--;)if(F=q[l]){for(C=F.length;n<C;n++)if(e=F[n],!f||!p["@"+e])if(h[u++]=e,b&&u===b)return Z(c,l+":"+n,h);n=0}}else!m||d&&"not"===d[0]||(h=a[0],k&&(k=parseInt(k[0],10)));if(b){f=h.length;k&&k>f&&(k=0);k=k||0;var K=k+b;K<f?h=h.slice(k,K):(K=0,k&&(h=h.slice(k)))}return Z(c,K,h)};var za={encode:ya,c:!1},Ba=[L("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",L("[\u00e8\u00e9\u00ea\u00eb]"),"e",L("[\u00ec\u00ed\u00ee\u00ef]"),"i",L("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",L("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",L("[\u00fd\u0177\u00ff]"),"y",L("\u00f1"),"n",L("[\u00e7c]"),"k",L("\u00df"),"s",L(" & ")," and ",L("[\\W_]+")," ",L("[^a-z0-9 ]"),""];function ya(a,b){b||(b=this);return M(b,a.toLowerCase(),Ba," ")};var Ca=[L("ae"),"a",L("ai"),"ei",L("ay"),"ei",L("ey"),"ei",L("oe"),"o",L("ue"),"u",L("ie"),"i",L("sz"),"s",L("zs"),"s",L("sh"),"s",L("ck"),"k",L("cc"),"k",L("th"),"t",L("dt"),"t",L("ph"),"f",L("pf"),"f",L("ou"),"o",L("uo"),"u"];function Da(a,b){a&&(a=ya(a,this).join(" "),2<a.length&&(a=H(a,Ca)),b||(1<a.length&&(a=ba(a)),a&&(a=a.split(" "))));return a};var Fa={encode:Ea,c:!1},Ga=[/[\W_]+/g," ",/[^a-z0-9 ]/g,""];function Ea(a){return M(this,a.toLowerCase(),Ga," ")};var Ia={encode:Ha,c:!1},Ja=[L("(?!\\b)p"),"b",L("(?!\\b)z"),"s",L("(?!\\b)[cgq]"),"k",L("(?!\\b)n"),"m",L("(?!\\b)d"),"t",L("(?!\\b)[vw]"),"f",L("(?!\\b)[aeiouy]"),""];function Ha(a){a&&(a=Da(a,!0),1<a.length&&(a=H(a,Ja)),1<a.length&&(a=ba(a)),a&&(a=a.split(" ")));return a};var La={encode:Ka,c:!1,j:"strict"},Ma=[/[\W_]+/g," ",/[^a-z ]/g,""];function Ka(a){a=M(this,a.toLowerCase(),Ma,!1);var b=[];if(a)for(var c=a.split(" "),e=c.length,d=0,g=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){for(var f=a[0],h=Na(f),k=1;k<a.length;k++){var m=Na(a[k]);if(m!==h&&(f+=m,h=m,4===f.length))break}b[g++]=(f+"0000").substring(0,4)}return b}
function Na(a){switch(a){case "b":case "f":case "p":case "v":return 1;case "c":case "g":case "j":case "k":case "q":case "s":case "x":case "z":return 2;case "d":case "t":return 3;case "l":return 4;case "m":case "n":return 5;case "r":return 6}return""};var Pa={encode:Oa,c:!0},Qa=/[\W_]+/;function Oa(a){return M(this,a,!1,Qa)};var Sa={encode:Ra,c:!1,j:"strict"},Ta=/[\x00-\x7F]/g;function Ra(a){return M(this,a.replace(Ta,""),!1,"")};var Va={encode:Ua,c:!1},Wa=/[\W_]+/;function Ua(a){return M(this,a,!1,Wa)};V["latin:advanced"]={encode:Da,c:!1};V["latin:balance"]=Fa;V["latin:default"]=ka;V["latin:extra"]=Ia;V["latin:simple"]=za;V["latin:soundex"]=La;V["arabic:default"]=Pa;V["cjk:default"]=Sa;V["cyrillic:default"]=Va;(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return O}):"object"===typeof a.exports?a.module.exports=O:a.FlexSearch=O})();}).call(this);

View File

@@ -5,30 +5,31 @@
* Licence: Apache-2.0 * Licence: Apache-2.0
* https://github.com/nextapps-de/flexsearch * https://github.com/nextapps-de/flexsearch
*/ */
(function(){'use strict';function w(a){return"string"===typeof a}function y(a){return a.constructor===Array}function A(a){return"function"===typeof a}function C(a){return"object"===typeof a}function F(a){return"undefined"===typeof a}function G(a){for(var b=Array(a),c=0;c<a;c++)b[c]=K();return b}function K(){return Object.create(null)}function aa(a,b){for(var c=0,e=b.length;c<e;c+=2)a=a.replace(b[c],b[c+1]);return a};L.prototype.export=function(a){var b=!a||F(a.serialize)||a.serialize;if(this.a){var c=!a||F(a.doc)||a.doc,e=!a||F(a.index)||a.index;a=[];var d=0;if(e)for(e=this.a.keys;d<e.length;d++){var h=this.a.index[e[d]];a[d]=[h.j,h.g,Object.keys(h.f)]}c&&(a[d]=this.l)}else a=[this.j,this.g,Object.keys(this.f)];b&&(a=JSON.stringify(a));return a}; (function(){'use strict';function r(a){return"string"===typeof a}function y(a){return a.constructor===Array}function z(a){return"function"===typeof a}function B(a){return"object"===typeof a}function D(a){return"undefined"===typeof a}function aa(a){for(var b=Array(a),c=0;c<a;c++)b[c]=G();return b}function G(){return Object.create(null)}function H(a,b){for(var c=0,e=b.length;c<e&&(a=a.replace(b[c],b[c+1]),a);c+=2);return a}function L(a){return new RegExp(a,"g")}
L.prototype.import=function(a,b){if(!b||F(b.serialize)||b.serialize)a=JSON.parse(a);var c={};if(this.a){var e=!b||F(b.doc)||b.doc,d=0;if(!b||F(b.index)||b.index){b=this.a.keys;for(var h=b.length,f=a[0][2];d<f.length;d++)c[f[d]]=1;for(d=0;d<h;d++){f=this.a.index[b[d]];var g=a[d];g&&(f.j=g[0],f.g=g[1],f.f=c)}}e&&(this.l=C(e)?e:a[d])}else{e=a[2];for(d=0;d<e.length;d++)c[e[d]]=1;this.j=a[0];this.g=a[1];this.f=c}};L.prototype.find=function(a,b){return this.where(a,b,1)[0]||null}; function ba(a){for(var b="",c="",e=0,d=a.length,h=void 0;e<d;e++)(h=a[e])!==c&&(b+=c=h);return b}function M(a,b,c,e){if(b&&(c&&b&&(b=H(b,c)),b&&a.o&&(b=H(b,a.o)),a.s&&1<b.length&&(b=H(b,a.s)),b&&(e||""===e)&&(b=b.split(e),a.filter))){a=a.filter;c=b.length;e=[];for(var d=0,h=0;d<c;d++){var f=b[d];f&&!a[f]&&(e[h++]=f)}b=e}return b};O.prototype.export=function(a){var b=!a||D(a.serialize)||a.serialize;if(this.a){var c=!a||D(a.doc)||a.doc,e=!a||D(a.index)||a.index;a=[];var d=0;if(e)for(e=this.a.keys;d<e.length;d++){var h=this.a.index[e[d]];a[d]=[h.j,h.h,Object.keys(h.f)]}c&&(a[d]=this.m)}else a=[this.j,this.h,Object.keys(this.f)];b&&(a=JSON.stringify(a));return a};
L.prototype.where=function(a,b,c,e){var d=this.l,h=[],f=0,g;if(C(a)){c||(c=b);var k=Object.keys(a);var n=k.length;var r=!1;if(1===n&&"id"===k[0])return[d[a.id]];if((g=this.A)&&!e)for(var q=0;q<g.length;q++){var p=g[q],l=a[p];if(!F(l)){var m=this.w[p]["@"+l];if(0===--n)return m;k.splice(k.indexOf(p),1);delete a[p];break}}g=Array(n);for(q=0;q<n;q++)g[q]=k[q].split(":")}else{if(A(a)){b=e||Object.keys(d);c=b.length;for(k=0;k<c;k++)n=d[b[k]],a(n)&&(h[f++]=n);return h}if(F(b))return[d[a]];if("id"===a)return[d[b]]; O.prototype.import=function(a,b){if(!b||D(b.serialize)||b.serialize)a=JSON.parse(a);var c={};if(this.a){var e=!b||D(b.doc)||b.doc,d=0;if(!b||D(b.index)||b.index){b=this.a.keys;for(var h=b.length,f=a[0][2];d<f.length;d++)c[f[d]]=1;for(d=0;d<h;d++){f=this.a.index[b[d]];var g=a[d];g&&(f.j=g[0],f.h=g[1],f.f=c)}}e&&(this.m=B(e)?e:a[d])}else{e=a[2];for(d=0;d<e.length;d++)c[e[d]]=1;this.j=a[0];this.h=a[1];this.f=c}};O.prototype.find=function(a,b){return this.where(a,b,1)[0]||null};
k=[a];n=1;g=[a.split(":")];r=!0}e=m||e||Object.keys(d);q=e.length;for(p=0;p<q;p++){l=m?e[p]:d[e[p]];for(var v=!0,t=0;t<n;t++){r||(b=a[k[t]]);var u=g[t],x=u.length,z=l;if(1<x)for(var B=0;B<x;B++)z=z[u[B]];else z=z[u[0]];if(z!==b){v=!1;break}}if(v&&(h[f++]=l,c&&f===c))break}return h};function Q(a){this.clear();this.h=!0!==a&&a}Q.prototype.clear=function(){this.cache=K();this.count=K();this.index=K();this.b=[]};Q.prototype.set=function(a,b){if(this.h&&F(this.cache[a])){var c=this.b.length;if(c===this.h){c--;var e=this.b[c];delete this.cache[e];delete this.count[e];delete this.index[e]}this.b[c]=a;this.index[a]=c;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b}; O.prototype.where=function(a,b,c,e){var d=this.m,h=[],f=0,g;if(B(a)){c||(c=b);var k=Object.keys(a);var m=k.length;var t=!1;if(1===m&&"id"===k[0])return[d[a.id]];if((g=this.w)&&!e)for(var q=0;q<g.length;q++){var p=g[q],l=a[p];if(!D(l)){var n=this.u[p]["@"+l];if(0===--m)return n;k.splice(k.indexOf(p),1);delete a[p];break}}g=Array(m);for(q=0;q<m;q++)g[q]=k[q].split(":")}else{if(z(a)){b=e||Object.keys(d);c=b.length;for(k=0;k<c;k++)m=d[b[k]],a(m)&&(h[f++]=m);return h}if(D(b))return[d[a]];if("id"===a)return[d[b]];
Q.prototype.get=function(a){var b=this.cache[a];if(this.h&&b){var c=++this.count[a],e=this.index,d=e[a];if(0<d){for(var h=this.b,f=d;this.count[h[--d]]<=c&&-1!==d;);d++;if(d!==f){for(c=f;c>d;c--)f=h[c-1],h[c]=f,e[f]=c;h[d]=a;e[a]=d}}}return b};var ba={memory:{encode:"extra",i:"strict",threshold:0,c:1},speed:{encode:"icase",i:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",i:"full",threshold:1,c:3},score:{encode:"extra",i:"strict",threshold:1,c:9,depth:4},balance:{encode:"balance",i:"strict",threshold:0,c:3,depth:3},fast:{encode:"icase",i:"strict",threshold:8,c:9,depth:1}};var ca={encode:function(a){return a.toLowerCase()},i:"strict",split:/[\W_]+/,cache:!1,async:!1,B:!1,u:!1,a:!1,c:9,threshold:0,depth:0},da=0,S={};function L(a){if(!(this instanceof L))return new L(a);var b=a&&a.id;this.id=b||0===b?b:da++;this.init(a);ea(this,"index",function(){return Object.keys(this.f)});ea(this,"length",function(){return this.index.length})}L.registerCharset=function(a,b,c,e){a=S[a]||(S[a]={});a.s=b;a.split=c;a.u=e;return L}; k=[a];m=1;g=[a.split(":")];t=!0}e=n||e||Object.keys(d);q=e.length;for(p=0;p<q;p++){l=n?e[p]:d[e[p]];for(var w=!0,u=0;u<m;u++){t||(b=a[k[u]]);var v=g[u],x=v.length,A=l;if(1<x)for(var C=0;C<x;C++)A=A[v[C]];else A=A[v[0]];if(A!==b){w=!1;break}}if(w&&(h[f++]=l,c&&f===c))break}return h};function S(a){this.clear();this.l=!0!==a&&a}S.prototype.clear=function(){this.cache=G();this.count=G();this.index=G();this.b=[]};S.prototype.set=function(a,b){if(this.l&&D(this.cache[a])){var c=this.b.length;if(c===this.l){c--;var e=this.b[c];delete this.cache[e];delete this.count[e];delete this.index[e]}this.b[c]=a;this.index[a]=c;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b};
L.registerLanguage=function(a,b,c,e){a=S[a]||(S[a]={});a.filter=b;a.v=c;a.m=e;return L}; S.prototype.get=function(a){var b=this.cache[a];if(this.l&&b){var c=++this.count[a],e=this.index,d=e[a];if(0<d){for(var h=this.b,f=d;this.count[h[--d]]<=c&&-1!==d;);d++;if(d!==f){for(c=f;c>d;c--)f=h[c-1],h[c]=f,e[f]=c;h[d]=a;e[a]=d}}}return b};var da={memory:{encode:"extra",i:"strict",threshold:0,g:1},speed:{encode:"icase",i:"strict",threshold:1,g:3,depth:2},match:{encode:"extra",i:"full",threshold:1,g:3},score:{encode:"extra",i:"strict",threshold:1,g:9,depth:4},balance:{encode:"balance",i:"strict",threshold:0,g:3,depth:3},fast:{encode:"icase",i:"strict",threshold:8,g:9,depth:1}};var fa={encode:ea,c:!1},ha=/[\W_]+/;function ea(a){return M(this,a.toLowerCase(),!1,ha)};var ia={encode:ea,tokenize:"strict",cache:!1,async:!1,worker:!1,rtl:!1,doc:!1,resolution:9,threshold:0,depth:0},ja=0,U={},V={};function O(a){if(!(this instanceof O))return new O(a);var b=a&&a.id;this.id=b||0===b?b:ja++;this.init(a);ka(this,"index",function(){return Object.keys(this.f)});ka(this,"length",function(){return this.index.length})}O.registerCharset=function(a,b){V[a]=b;return O};O.registerLanguage=function(a,b){V[a]=b;return O};
L.prototype.init=function(a){this.m=[];var b;if(w(a))a=ba[a];else if(b=a.preset)a=Object.assign({},ba[b],a);this.s||(a?a=Object.assign({},ca,a):a=ca);if(a){var c=a.charset;var e=a.lang;this.h=a.tokenize;this.split=w(b=c||a.split)?S[b]?S[b].split:new RegExp(b,"g"):b;this.u=w(b=c||a.rtl)?S[b].u:b;this.async=a.async;this.threshold=a.threshold;this.c=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.h&&a.depth||0;this.s=w(b=c||a.encode)?S[-1===b.indexOf(":")?b+":default": O.prototype.init=function(a){var b;if(r(a))a=da[a];else if(b=a.preset)a=Object.assign({},da[b],a);this.encode||(a?a=Object.assign({},ia,a):a=ia);if(a){this.async=a.async;var c=a.charset;var e=a.lang;this.v=(r(c)?V[c].i:c&&c.i)||a.tokenize;this.c=r(b=a.rtl||c)?V[b].c:c&&c.c||b;this.threshold=a.threshold;this.g=(b=a.resolution)<=this.threshold?this.threshold+1:b;this.depth="strict"===this.v&&a.depth||0;this.encode=r(b=a.encode||c)?V[-1===b.indexOf(":")?b+":default":b].encode:c&&c.encode||b;this.o=(b=
b].encode:b;if(c=b=e||a.matcher){b=w(b)?S[b].m:b;c=Object.keys(b);for(var d=c.length,h=Array(2*d),f=0,g=0;f<d;f++){var k=c[f];h[g++]=new RegExp(k,"g");h[g++]=b[k]}c=h}this.m=c;if(c=b=e||a.filter)for(b=w(b)?S[b].filter:b,c=K(),d=0;d<b.length;d++)c[b[d]]=1;this.filter=c;if(e=b=e||a.stemmer){e=w(b)?S[b].v:b;c=Object.keys(e);d=c.length;h=Array(2*d);for(g=f=0;f<d;f++)k=c[f],h[g++]=new RegExp(k+"(?!\\b)"+k+"(\\b)","g"),h[g++]=e[k];e=h}this.v=e;(this.a=c=(b=a.doc)&&fa(b))&&(a.doc=null)}this.j=G(this.c-(this.threshold|| a.matcher||e)&&la(r(b)?U[b].o:e&&e.o||b,!1);if(c=b=a.filter||e){c=r(b)?U[b].filter:e&&e.filter||b;for(var d=G(),h=0,f=c.length;h<f;h++)d[c[h]]=1;c=d}this.filter=c;this.s=(b=a.stemmer||e)&&la(r(b)?U[b].s:e&&e.s||b,!0);(this.a=c=(b=a.doc)&&ma(b))&&(a.doc=null)}this.j=aa(this.g-(this.threshold||0));this.h=G();this.f={};if(c){this.m=G();b=c.index={};e=c.keys=[];d=c.field;h=c.tag;f=c.store;y(c.id)||(c.id=c.id.split(":"));if(f){var g=G();if(r(f))g[f]=1;else if(y(f))for(var k=0;k<f.length;k++)g[f[k]]=1;
0));this.g=K();this.f={};if(c){this.l=K();e=c.index={};b=c.keys=[];d=c.field;h=c.tag;f=c.store;y(c.id)||(c.id=c.id.split(":"));if(f){g=K();if(w(f))g[f]=1;else if(y(f))for(k=0;k<f.length;k++)g[f[k]]=1;else C(f)&&(g=f);c.store=g}if(h){this.w=K();f=K();if(d)if(w(d))f[d]=a;else if(y(d))for(g=0;g<d.length;g++)f[d[g]]=a;else C(d)&&(f=d);y(h)||(c.tag=h=[h]);for(d=0;d<h.length;d++)this.w[h[d]]=K();this.A=h;d=f}if(d){if(!y(d))if(C(d)){var n=d;c.field=d=Object.keys(d)}else c.field=d=[d];for(c=0;c<d.length;c++)h= else B(f)&&(g=f);c.store=g}if(h){this.u=G();f=G();if(d)if(r(d))f[d]=a;else if(y(d))for(g=0;g<d.length;g++)f[d[g]]=a;else B(d)&&(f=d);y(h)||(c.tag=h=[h]);for(d=0;d<h.length;d++)this.u[h[d]]=G();this.w=h;d=f}if(d){if(!y(d))if(B(d)){var m=d;c.field=d=Object.keys(d)}else c.field=d=[d];for(c=0;c<d.length;c++)h=d[c],y(h)||(m&&(a=m[h]),e[c]=h,d[c]=h.split(":")),b[h]=new O(a)}}if(b=a.cache)this.l=!0,this.b=new S(b);return this};
d[c],y(h)||(n&&(a=n[h]),b[c]=h,d[c]=h.split(":")),e[h]=new L(a)}}if(b=a.cache)this.o=!0,this.b=new Q(b);return this};function fa(a){var b=K(),c;for(c in a)if(a.hasOwnProperty(c)){var e=a[c];b[c]=y(e)?e.slice(0):C(e)?fa(e):e}return b} function ma(a){var b=G(),c;for(c in a)if(a.hasOwnProperty(c)){var e=a[c];b[c]=y(e)?e.slice(0):B(e)?ma(e):e}return b}
L.prototype.add=function(a,b,c,e,d){if(this.a&&C(a))return T(this,"add",a,b);if(b&&w(b)&&(a||0===a)){if(this.f[a]&&!e)return this.update(a,b);if(!d){if(this.async){var h=this;d=new Promise(function(B){setTimeout(function(){h.add(a,b,null,e,!0);h=null;B()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,e,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=this.i(b);d=K();d._ctx=K();for(var f=c.length,g=this.threshold,k=this.depth,n=this.c,r=this.j,q=this.u,p=0;p<f;p++){var l= O.prototype.add=function(a,b,c,e,d){if(this.a&&B(a))return W(this,"add",a,b);if(b&&r(b)&&(a||0===a)){if(this.f[a]&&!e)return this.update(a,b);if(!d){if(this.async){var h=this;d=new Promise(function(C){setTimeout(function(){h.add(a,b,null,e,!0);h=null;C()})});if(c)d.then(c);else return d;return this}if(c)return this.add(a,b,null,e,!0),c(),this}b=this.encode(b);if(!b.length)return this;c=b;d=G();d._ctx=G();for(var f=c.length,g=this.threshold,k=this.depth,m=this.g,t=this.j,q=this.c,p=0;p<f;p++){var l=
c[p];if(l){var m=l.length,v=(q?p+1:f-p)/f,t="";switch(this.h){case "reverse":case "both":for(var u=m;--u;)t=l[u]+t,U(r,d,t,a,q?1:(m-u)/m,v,g,n-1);t="";case "forward":for(u=0;u<m;u++)t+=l[u],U(r,d,t,a,q?(u+1)/m:1,v,g,n-1);break;case "full":for(u=0;u<m;u++)for(var x=(q?u+1:m-u)/m,z=m;z>u;z--)t=l.substring(u,z),U(r,d,t,a,x,v,g,n-1);break;default:if(m=U(r,d,l,a,1,v,g,n-1),k&&1<f&&m>=g)for(m=d._ctx[l]||(d._ctx[l]=K()),l=this.g[l]||(this.g[l]=G(n-(g||0))),v=p-k,t=p+k+1,0>v&&(v=0),t>f&&(t=f);v<t;v++)v!== c[p];if(l){var n=l.length,w=(q?p+1:f-p)/f,u="";switch(this.v){case "reverse":case "both":for(var v=n;--v;)u=l[v]+u,X(t,d,u,a,q?1:(n-v)/n,w,g,m-1);u="";case "forward":for(v=0;v<n;v++)u+=l[v],X(t,d,u,a,q?(v+1)/n:1,w,g,m-1);break;case "full":for(v=0;v<n;v++)for(var x=(q?v+1:n-v)/n,A=n;A>v;A--)u=l.substring(v,A),X(t,d,u,a,x,w,g,m-1);break;default:if(n=X(t,d,l,a,1,w,g,m-1),k&&1<f&&n>=g)for(n=d._ctx[l]||(d._ctx[l]=G()),l=this.h[l]||(this.h[l]=aa(m-(g||0))),w=p-k,u=p+k+1,0>w&&(w=0),u>f&&(u=f);w<u;w++)w!==
p&&U(l,m,c[v],a,0,n-(v<p?p-v:v-p),g,n-1)}}}this.f[a]=1;this.o=!1}return this}; p&&X(l,n,c[w],a,0,m-(w<p?p-w:w-p),g,m-1)}}}this.f[a]=1;this.l=!1}return this};
function T(a,b,c,e){if(y(c)){var d=c.length;if(d--){for(var h=0;h<d;h++)T(a,b,c[h]);return T(a,b,c[d],e)}}else{var f=a.a.index,g=a.a.keys,k=a.a.tag;h=a.a.store;var n;var r=a.a.id;d=c;for(var q=0;q<r.length;q++)d=d[r[q]];if("remove"===b&&(delete a.l[d],r=g.length,r--)){for(a=0;a<r;a++)f[g[a]].remove(d);return f[g[r]].remove(d,e)}if(k){for(n=0;n<k.length;n++){var p=k[n];var l=c;r=p.split(":");for(q=0;q<r.length;q++)l=l[r[q]];l="@"+l}n=a.w[p];n=n[l]||(n[l]=[])}r=a.a.field;k=0;for(p=r.length;k<p;k++){q= function W(a,b,c,e){if(y(c)){var d=c.length;if(d--){for(var h=0;h<d;h++)W(a,b,c[h]);return W(a,b,c[d],e)}}else{var f=a.a.index,g=a.a.keys,k=a.a.tag;h=a.a.store;var m;var t=a.a.id;d=c;for(var q=0;q<t.length;q++)d=d[t[q]];if("remove"===b&&(delete a.m[d],t=g.length,t--)){for(a=0;a<t;a++)f[g[a]].remove(d);return f[g[t]].remove(d,e)}if(k){for(m=0;m<k.length;m++){var p=k[m];var l=c;t=p.split(":");for(q=0;q<t.length;q++)l=l[t[q]];l="@"+l}m=a.u[p];m=m[l]||(m[l]=[])}t=a.a.field;k=0;for(p=t.length;k<p;k++){q=
r[k];l=c;for(var m=0;m<q.length;m++)l=l[q[m]];q=f[g[k]];"add"===b?q.add(d,l,k===p-1&&e):q.update(d,l,k===p-1&&e)}if(h){e=Object.keys(h);b=K();for(f=0;f<e.length;f++)if(g=e[f],h[g])for(g=g.split(":"),k=r=void 0,p=0;p<g.length;p++)l=g[p],r=(r||c)[l],k=(k||b)[l]=r;c=b}n&&(n[n.length]=c);a.l[d]=c}return a}L.prototype.update=function(a,b,c){if(this.a&&C(a))return T(this,"update",a,b);this.f[a]&&w(b)&&(this.remove(a),this.add(a,b,c,!0));return this}; t[k];l=c;for(var n=0;n<q.length;n++)l=l[q[n]];q=f[g[k]];"add"===b?q.add(d,l,k===p-1&&e):q.update(d,l,k===p-1&&e)}if(h){e=Object.keys(h);b=G();for(f=0;f<e.length;f++)if(g=e[f],h[g])for(g=g.split(":"),k=t=void 0,p=0;p<g.length;p++)l=g[p],t=(t||c)[l],k=(k||b)[l]=t;c=b}m&&(m[m.length]=c);a.m[d]=c}return a}O.prototype.update=function(a,b,c){if(this.a&&B(a))return W(this,"update",a,b);this.f[a]&&r(b)&&(this.remove(a),this.add(a,b,c,!0));return this};
L.prototype.remove=function(a,b,c){if(this.a&&C(a))return T(this,"remove",a,b);if(this.f[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var e=this;c=new Promise(function(d){setTimeout(function(){e.remove(a,null,!0);e=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.c-(this.threshold||0);b++)V(this.j[b],a);this.depth&&V(this.g,a);delete this.f[a];this.o=!1}return this};var W; O.prototype.remove=function(a,b,c){if(this.a&&B(a))return W(this,"remove",a,b);if(this.f[a]){if(!c){if(this.async&&"function"!==typeof importScripts){var e=this;c=new Promise(function(d){setTimeout(function(){e.remove(a,null,!0);e=null;d()})});if(b)c.then(b);else return c;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.g-(this.threshold||0);b++)na(this.j[b],a);this.depth&&na(this.h,a);delete this.f[a];this.l=!1}return this};var Y;
function X(a,b,c,e,d,h,f,g,k,n,r){e=ha(e,g?0:h,k,f,c,n,r);if(k){k=e.page;var q=e.next;e=e.result}if(g)e=a.where(g,null,h,e);else{c=e;e=a.l;h=c.length;f=Array(h);for(g=0;g<h;g++)f[g]=e[c[g]];e=f}d&&(A(d)||(W=d.split(":"),1<W.length?d=ia:(W=W[0],d=ja)),e.sort(d));e=Z(k,q,e);a.b&&a.b.set(b,e);return e} function oa(a,b,c,e,d,h,f,g,k,m,t){e=pa(e,g?0:h,k,f,c,m,t);if(k){k=e.page;var q=e.next;e=e.result}if(g)e=a.where(g,null,h,e);else{c=e;e=a.m;h=c.length;f=Array(h);for(g=0;g<h;g++)f[g]=e[c[g]];e=f}d&&(z(d)||(Y=d.split(":"),1<Y.length?d=qa:(Y=Y[0],d=ra)),e.sort(d));e=Z(k,q,e);a.b&&a.b.set(b,e);return e}
L.prototype.search=function(a,b,c,e){if(C(b)){if(y(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&A(b)?(c=b,b=1E3):b||0===b||(b=1E3);var h=[],f=a;if(C(a)&&!y(a)){c||(c=a.callback)&&(f.callback=null);var g=a.sort;var k=a.page;b=a.limit;var n=a.threshold;var r=a.suggest;a=a.query}if(this.a){n=this.a.index;var q=f.where,p=f.bool||"or",l=f.field,m=p,v,t;if(l)y(l)||(l=[l]);else if(y(f)){var u=f;l=[];m=[];for(var x=0;x<f.length;x++)e=f[x],d=e.bool||p,l[x]=e.field,m[x]=d,"not"=== O.prototype.search=function(a,b,c,e){if(B(b)){if(y(b))for(var d=0;d<b.length;d++)b[d].query=a;else b.query=a;a=b;b=1E3}else b&&z(b)?(c=b,b=1E3):b||0===b||(b=1E3);var h=[],f=a;if(B(a)&&!y(a)){c||(c=a.callback)&&(f.callback=null);var g=a.sort;var k=a.page;b=a.limit;var m=a.threshold;var t=a.suggest;a=a.query}if(this.a){m=this.a.index;var q=f.where,p=f.bool||"or",l=f.field,n=p,w,u;if(l)y(l)||(l=[l]);else if(y(f)){var v=f;l=[];n=[];for(var x=0;x<f.length;x++)e=f[x],d=e.bool||p,l[x]=e.field,n[x]=d,"not"===
d?v=!0:"and"===d&&(t=!0)}else l=this.a.keys;p=l.length;for(x=0;x<p;x++)u&&(f=u[x]),k&&!w(f)&&(f.page=null,f.limit=0),h[x]=n[l[x]].search(f,0);if(c)return c(X(this,a,m,h,g,b,r,q,k,t,v));if(this.async){var z=this;return new Promise(function(Y){Promise.all(h).then(function(ka){Y(X(z,a,m,ka,g,b,r,q,k,t,v))})})}return X(this,a,m,h,g,b,r,q,k,t,v)}n||(n=this.threshold||0);if(!e){if(this.async&&"function"!==typeof importScripts){var B=this;n=new Promise(function(Y){setTimeout(function(){Y(B.search(f,b,null, d?w=!0:"and"===d&&(u=!0)}else l=this.a.keys;p=l.length;for(x=0;x<p;x++)v&&(f=v[x]),k&&!r(f)&&(f.page=null,f.limit=0),h[x]=m[l[x]].search(f,0);if(c)return c(oa(this,a,n,h,g,b,t,q,k,u,w));if(this.async){var A=this;return new Promise(function(ca){Promise.all(h).then(function(va){ca(oa(A,a,n,va,g,b,t,q,k,u,w))})})}return oa(this,a,n,h,g,b,t,q,k,u,w)}m||(m=this.threshold||0);if(!e){if(this.async&&"function"!==typeof importScripts){var C=this;m=new Promise(function(ca){setTimeout(function(){ca(C.search(f,
!0));B=null})});if(c)n.then(c);else return n;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!w(a))return h;f=a;if(this.b)if(this.o){if(c=this.b.get(a))return c}else this.b.clear(),this.o=!0;f=this.encode(f);if(!f.length)return h;c=this.i(f);u=c.length;e=!0;d=[];var N=K(),O=0;1<u&&(this.depth?p=!0:c.sort(la));if(!p||(x=this.g))for(var R=this.c;O<u;O++){var D=c[O];if(D){if(p){if(!l)if(x[D])l=D,N[D]=1;else if(!r)return h;if(r&&O===u-1&&!d.length)p=!1,D=l||D,N[D]=0;else if(!l)continue}if(!N[D]){var E= b,null,!0));C=null})});if(c)m.then(c);else return m;return this}if(c)return c(this.search(f,b,null,!0)),this}if(!a||!r(a))return h;f=a;if(this.b)if(this.l){if(c=this.b.get(a))return c}else this.b.clear(),this.l=!0;f=this.encode(f);if(!f.length)return h;c=f;v=c.length;e=!0;d=[];var P=G(),Q=0;1<v&&(this.depth?p=!0:c.sort(sa));if(!p||(x=this.h))for(var T=this.g;Q<v;Q++){var E=c[Q];if(E){if(p){if(!l)if(x[E])l=E,P[E]=1;else if(!t)return h;if(t&&Q===v-1&&!d.length)p=!1,E=l||E,P[E]=0;else if(!l)continue}if(!P[E]){var F=
[],M=!1,H=0,I=p?x[l]:this.j;if(I)for(var P=void 0,J=0;J<R-n;J++)if(P=I[J]&&I[J][D])E[H++]=P,M=!0;if(M)l=D,d[d.length]=1<H?E.concat.apply([],E):E[0];else if(!r){e=!1;break}N[D]=1}}}else e=!1;e&&(h=ha(d,b,k,r));this.b&&this.b.set(a,h);return h};L.prototype.info=function(){return{id:this.id,items:this.length,matcher:this.m.length,worker:this.B,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.h}};L.prototype.clear=function(){return this.destroy().init()}; [],N=!1,I=0,J=p?x[l]:this.j;if(J)for(var R=void 0,K=0;K<T-m;K++)if(R=J[K]&&J[K][E])F[I++]=R,N=!0;if(N)l=E,d[d.length]=1<I?F.concat.apply([],F):F[0];else if(!t){e=!1;break}P[E]=1}}}else e=!1;e&&(h=pa(d,b,k,t));this.b&&this.b.set(a,h);return h};O.prototype.info=function(){return{id:this.id,items:this.length,matcher:this.o.length,worker:this.A,threshold:this.threshold,depth:this.depth,resolution:this.g,contextual:this.depth&&"strict"===this.v}};O.prototype.clear=function(){return this.destroy().init()};
L.prototype.destroy=function(){this.b&&(this.b.clear(),this.b=null);this.j=this.g=this.f=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.l=null}return this};function ea(a,b,c){Object.defineProperty(a,b,{get:c})}function U(a,b,c,e,d,h,f,g){if(b[c])return b[c];d=d?(g-(f||g/1.5))*h+(f||g/1.5)*d:h;b[c]=d;d>=f&&(a=a[g-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d} O.prototype.destroy=function(){this.b&&(this.b.clear(),this.b=null);this.j=this.h=this.f=null;if(this.a){for(var a=this.a.keys,b=0;b<a.length;b++)this.a.index[a[b]].destroy();this.a=this.m=null}return this};function ka(a,b,c){Object.defineProperty(a,b,{get:c})}function X(a,b,c,e,d,h,f,g){if(b[c])return b[c];d=d?(g-(f||g/1.5))*h+(f||g/1.5)*d:h;b[c]=d;d>=f&&(a=a[g-(d+.5>>0)],a=a[c]||(a[c]=[]),a[a.length]=e);return d}
function V(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var h=c[e],f=a[h];if(f)for(var g=0,k=f.length;g<k;g++)if(f[g]===b){1===k?delete a[h]:f.splice(g,1);break}else C(f[g])&&V(f[g],b)}}L.prototype.encode=function(a){a&&this.s&&(a=this.s(a));a&&this.m.length&&(a=aa(a,this.m));a&&this.v&&(a=aa(a,this.v));return a}; function na(a,b){if(a)for(var c=Object.keys(a),e=0,d=c.length;e<d;e++){var h=c[e],f=a[h];if(f)for(var g=0,k=f.length;g<k;g++)if(f[g]===b){1===k?delete a[h]:f.splice(g,1);break}else B(f[g])&&na(f[g],b)}}function la(a,b){for(var c=Object.keys(a),e=c.length,d=[],h="",f=0,g=0,k;g<e;g++){var m=c[g];(k=a[m])?(d[f++]=L(b?"(?!\\b)"+m+"(\\b)":m),d[f++]=k):h+=(h?"|":"")+m}h&&(d[f++]=L(b?"(?!\\b)("+h+")(\\b)":"("+h+")"),d[f]="");return d}function sa(a,b){return b.length-a.length}
L.prototype.i=function(a){a=y(a)?a:A(this.h)?this.h(a):a.split(this.split);if(this.filter){for(var b=this.filter,c=a.length,e=A(b),d=[],h=0,f=0;h<c;h++){var g=a[h];g&&(e&&b(g)||!e&&!b[g])&&(d[f++]=g)}a=d}return a};function la(a,b){return b.length-a.length}function ja(a,b){return a[W]-b[W]}function ia(a,b){for(var c=W.length,e=0;e<c;e++)a=a[W[e]],b=b[W[e]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c} function ra(a,b){return a[Y]-b[Y]}function qa(a,b){for(var c=Y.length,e=0;e<c;e++)a=a[Y[e]],b=b[Y[e]];return a-b}function Z(a,b,c){return a?{page:a,next:b?""+b:null,result:c}:c}
function ha(a,b,c,e,d,h,f){var g=[];if(!0===c){c="0";var k=""}else k=c&&c.split(":");var n=a.length;if(1<n){var r=K(),q=[],p,l=0,m,v=!0,t=0,u;if(k)if(2===k.length){var x=k;k=!1}else k=u=parseInt(k[0],10);if(f){for(p=K();l<n;l++)if("not"===d[l]){var z=a[l];var B=z.length;for(m=0;m<B;m++)p["@"+z[m]]=1}else var N=l+1;if(F(N))return Z(c,J,g);l=0}else var O=w(d)&&d;for(var R;l<n;l++){var D=l===(N||n)-1;if(!O||!l)if((m=O||d&&d[l])&&"and"!==m)if("or"===m)R=!1;else continue;else R=h=!0;z=a[l];if(B=z.length){if(v)if(H){var E= function pa(a,b,c,e,d,h,f){var g=[];if(!0===c){c="0";var k=""}else k=c&&c.split(":");var m=a.length;if(1<m){var t=G(),q=[],p,l=0,n,w=!0,u=0,v;if(k)if(2===k.length){var x=k;k=!1}else k=v=parseInt(k[0],10);if(f){for(p=G();l<m;l++)if("not"===d[l]){var A=a[l];var C=A.length;for(n=0;n<C;n++)p["@"+A[n]]=1}else var P=l+1;if(D(P))return Z(c,K,g);l=0}else var Q=r(d)&&d;for(var T;l<m;l++){var E=l===(P||m)-1;if(!Q||!l)if((n=Q||d&&d[l])&&"and"!==n)if("or"===n)T=!1;else continue;else T=h=!0;A=a[l];if(C=A.length){if(w)if(I){var F=
H.length;for(m=0;m<E;m++){v=H[m];var M="@"+v;f&&p[M]||(r[M]=1,h||(g[t++]=v))}var H=null;v=!1}else{H=z;continue}M=!1;for(m=0;m<B;m++){E=z[m];var I="@"+E,P=h?r[I]||0:l;if(!(!P&&!e||f&&p[I]||!h&&r[I]))if(P===l){if(D){if(!u||--u<t)if(g[t++]=E,b&&t===b)return Z(c,t+(k||0),g)}else r[I]=l+1;M=!0}else e&&(I=q[P]||(q[P]=[]),I[I.length]=E)}if(R&&!M&&!e)break}else if(R&&!e)return Z(c,J,z)}if(H)if(l=H.length,f)for(m=k?parseInt(k,10):0;m<l;m++)a=H[m],p["@"+a]||(g[t++]=a);else g=H;if(e)for(t=g.length,x?(l=parseInt(x[0], I.length;for(n=0;n<F;n++){w=I[n];var N="@"+w;f&&p[N]||(t[N]=1,h||(g[u++]=w))}var I=null;w=!1}else{I=A;continue}N=!1;for(n=0;n<C;n++){F=A[n];var J="@"+F,R=h?t[J]||0:l;if(!(!R&&!e||f&&p[J]||!h&&t[J]))if(R===l){if(E){if(!v||--v<u)if(g[u++]=F,b&&u===b)return Z(c,u+(k||0),g)}else t[J]=l+1;N=!0}else e&&(J=q[R]||(q[R]=[]),J[J.length]=F)}if(T&&!N&&!e)break}else if(T&&!e)return Z(c,K,A)}if(I)if(l=I.length,f)for(n=k?parseInt(k,10):0;n<l;n++)a=I[n],p["@"+a]||(g[u++]=a);else g=I;if(e)for(u=g.length,x?(l=parseInt(x[0],
10)+1,m=parseInt(x[1],10)+1):(l=q.length,m=0);l--;)if(E=q[l]){for(B=E.length;m<B;m++)if(e=E[m],!f||!p["@"+e])if(g[t++]=e,b&&t===b)return Z(c,l+":"+m,g);m=0}}else!n||d&&"not"===d[0]||(g=a[0],k&&(k=parseInt(k[0],10)));if(b){f=g.length;k&&k>f&&(k=0);k=k||0;var J=k+b;J<f?g=g.slice(k,J):(J=0,k&&(g=g.slice(k)))}return Z(c,J,g)};(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return L}):"object"===typeof a.exports?a.module.exports=L:a.FlexSearch=L})();}).call(this); 10)+1,n=parseInt(x[1],10)+1):(l=q.length,n=0);l--;)if(F=q[l]){for(C=F.length;n<C;n++)if(e=F[n],!f||!p["@"+e])if(g[u++]=e,b&&u===b)return Z(c,l+":"+n,g);n=0}}else!m||d&&"not"===d[0]||(g=a[0],k&&(k=parseInt(k[0],10)));if(b){f=g.length;k&&k>f&&(k=0);k=k||0;var K=k+b;K<f?g=g.slice(k,K):(K=0,k&&(g=g.slice(k)))}return Z(c,K,g)};var ua={encode:ta,c:!1},wa=[L("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",L("[\u00e8\u00e9\u00ea\u00eb]"),"e",L("[\u00ec\u00ed\u00ee\u00ef]"),"i",L("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",L("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",L("[\u00fd\u0177\u00ff]"),"y",L("\u00f1"),"n",L("[\u00e7c]"),"k",L("\u00df"),"s",L(" & ")," and ",L("[\\W_]+")," ",L("[^a-z0-9 ]"),""];function ta(a,b){b||(b=this);return M(b,a.toLowerCase(),wa," ")};var xa=[L("ae"),"a",L("ai"),"ei",L("ay"),"ei",L("ey"),"ei",L("oe"),"o",L("ue"),"u",L("ie"),"i",L("sz"),"s",L("zs"),"s",L("sh"),"s",L("ck"),"k",L("cc"),"k",L("th"),"t",L("dt"),"t",L("ph"),"f",L("pf"),"f",L("ou"),"o",L("uo"),"u"];function ya(a,b){a&&(a=ta(a,this).join(" "),2<a.length&&(a=H(a,xa)),b||(1<a.length&&(a=ba(a)),a&&(a=a.split(" "))));return a};var Aa={encode:za,c:!1},Ba=[/[\W_]+/g," ",/[^a-z0-9 ]/g,""];function za(a){return M(this,a.toLowerCase(),Ba," ")};var Da={encode:Ca,c:!1},Ea=[L("(?!\\b)p"),"b",L("(?!\\b)z"),"s",L("(?!\\b)[cgq]"),"k",L("(?!\\b)n"),"m",L("(?!\\b)d"),"t",L("(?!\\b)[vw]"),"f",L("(?!\\b)[aeiouy]"),""];function Ca(a){a&&(a=ya(a,!0),1<a.length&&(a=H(a,Ea)),1<a.length&&(a=ba(a)),a&&(a=a.split(" ")));return a};var Ga={encode:Fa,c:!1,i:"strict"},Ha=[/[\W_]+/g," ",/[^a-z ]/g,""];function Fa(a){a=M(this,a.toLowerCase(),Ha,!1);var b=[];if(a)for(var c=a.split(" "),e=c.length,d=0,h=0;d<e;d++)if((a=c[d])&&(!this.filter||!this.filter[a])){for(var f=a[0],g=Ia(f),k=1;k<a.length;k++){var m=Ia(a[k]);if(m!==g&&(f+=m,g=m,4===f.length))break}b[h++]=(f+"0000").substring(0,4)}return b}
function Ia(a){switch(a){case "b":case "f":case "p":case "v":return 1;case "c":case "g":case "j":case "k":case "q":case "s":case "x":case "z":return 2;case "d":case "t":return 3;case "l":return 4;case "m":case "n":return 5;case "r":return 6}return""};var Ka={encode:Ja,c:!0},La=/[\W_]+/;function Ja(a){return M(this,a,!1,La)};var Na={encode:Ma,c:!1,i:"strict"},Oa=/[\x00-\x7F]/g;function Ma(a){return M(this,a.replace(Oa,""),!1,"")};var Qa={encode:Pa,c:!1},Ra=/[\W_]+/;function Pa(a){return M(this,a,!1,Ra)};V["latin:advanced"]={encode:ya,c:!1};V["latin:balance"]=Aa;V["latin:default"]=fa;V["latin:extra"]=Da;V["latin:simple"]=ua;V["latin:soundex"]=Ga;V["arabic:default"]=Ka;V["cjk:default"]=Na;V["cyrillic:default"]=Qa;(function(){var a=this||window,b;(b=a.define)&&b.amd?b([],function(){return O}):"object"===typeof a.exports?a.module.exports=O:a.FlexSearch=O})();}).call(this);

609
dist/flexsearch.pre.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
(function(){'use strict';window.FlexSearch.registerCharset("arabian:default",function(a){return a.toLowerCase()},"");}).call(this);

1
dist/lang/arabic/default.min.js vendored Normal file
View File

@@ -0,0 +1 @@
(function(){'use strict';var a=/[\W_]+/;window.FlexSearch.registerCharset("arabic:default",{encode:function(b){return this.a(b,!1,a,!1)},b:!0});}).call(this);

4
dist/lang/at.min.js vendored
View File

@@ -1,2 +1,2 @@
(function(){'use strict';window.FlexSearch.registerLanguage("at","aber als am an auch auf aus bei bin bis bist da dadurch daher darum das da\u00df dass dein deine dem den der des dessen deshalb die dies dieser dieses doch dort du durch ein eine einem einen einer eines er es euer eure f\u00fcr hatte hatten hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt kann kannst k\u00f6nnen k\u00f6nnt machen mein meine mit mu\u00df mu\u00dft musst m\u00fcssen m\u00fc\u00dft nach nachdem nein nicht nun oder seid sein seine sich sie sind soll sollen sollst sollt sonst soweit sowie und unser unsere unter vom von vor wann warum was weiter weitere wenn wer werde werden werdet weshalb wie wieder wieso wir wird wirst wo woher wohin zu zum zur \u00fcber".split(" "), (function(){'use strict';window.FlexSearch.registerLanguage("at",{filter:"aber als am an auch auf aus bei bin bis bist da dadurch daher darum das da\u00df dass dein deine dem den der des dessen deshalb die dies dieser dieses doch dort du durch ein eine einem einen einer eines er es euer eure f\u00fcr hatte hatten hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt kann kannst k\u00f6nnen k\u00f6nnt machen mein meine mit mu\u00df mu\u00dft musst m\u00fcssen m\u00fc\u00dft nach nachdem nein nicht nun oder seid sein seine sich sie sind soll sollen sollst sollt sonst soweit sowie und unser unsere unter vom von vor wann warum was weiter weitere wenn wer werde werden werdet weshalb wie wieder wieso wir wird wirst wo woher wohin zu zum zur \u00fcber".split(" "),
{niss:"",isch:"",lich:"",heit:"",keit:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""});}).call(this); b:{niss:"",isch:"",lich:"",heit:"",keit:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""},a:{}});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';window.FlexSearch.registerCharset("cjk:default",function(a){return a.toLowerCase()},"");}).call(this); (function(){'use strict';var a=/[\x00-\x7F]/g;window.FlexSearch.registerCharset("cjk:default",{encode:function(b){return this.a(b.replace(a,""),!1,"",!1)},b:!1,c:"strict"});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';window.FlexSearch.registerCharset("cyrillic:default",function(a){return a.toLowerCase()},"");}).call(this); (function(){'use strict';var a=/[\W_]+/;window.FlexSearch.registerCharset("cyrillic:default",{encode:function(b){return this.a(b,!1,a,!1)},b:!1});}).call(this);

4
dist/lang/de.min.js vendored
View File

@@ -1,2 +1,2 @@
(function(){'use strict';window.FlexSearch.registerLanguage("de","aber als am an auch auf aus bei bin bis bist da dadurch daher darum das da\u00df dass dein deine dem den der des dessen deshalb die dies dieser dieses doch dort du durch ein eine einem einen einer eines er es euer eure f\u00fcr hatte hatten hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt kann kannst k\u00f6nnen k\u00f6nnt machen mein meine mit mu\u00df mu\u00dft musst m\u00fcssen m\u00fc\u00dft nach nachdem nein nicht nun oder seid sein seine sich sie sind soll sollen sollst sollt sonst soweit sowie und unser unsere unter vom von vor wann warum was weiter weitere wenn wer werde werden werdet weshalb wie wieder wieso wir wird wirst wo woher wohin zu zum zur \u00fcber".split(" "), (function(){'use strict';window.FlexSearch.registerLanguage("de",{filter:"aber als am an auch auf aus bei bin bis bist da dadurch daher darum das da\u00df dass dein deine dem den der des dessen deshalb die dies dieser dieses doch dort du durch ein eine einem einen einer eines er es euer eure f\u00fcr hatte hatten hattest hattet hier hinter ich ihr ihre im in ist ja jede jedem jeden jeder jedes jener jenes jetzt kann kannst k\u00f6nnen k\u00f6nnt machen mein meine mit mu\u00df mu\u00dft musst m\u00fcssen m\u00fc\u00dft nach nachdem nein nicht nun oder seid sein seine sich sie sind soll sollen sollst sollt sonst soweit sowie und unser unsere unter vom von vor wann warum was weiter weitere wenn wer werde werden werdet weshalb wie wieder wieso wir wird wirst wo woher wohin zu zum zur \u00fcber".split(" "),
{niss:"",isch:"",lich:"",heit:"",keit:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""});}).call(this); b:{niss:"",isch:"",lich:"",heit:"",keit:"",ell:"",bar:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""},a:{}});}).call(this);

4
dist/lang/en.min.js vendored
View File

@@ -1,2 +1,2 @@
(function(){'use strict';window.FlexSearch.registerLanguage("en","a about above after again against all also am an and any are aren't as at be because been before being below both but by can cannot can't come could couldn't did didn't do does doesn't doing dont down during each even few first for from further get go had hadn't has hasn't have haven't having he hed her here here's hers herself hes him himself his how how's i id if ill im in into is isn't it it's itself i've just know let's like make me more most mustn't my myself new no nor not now of off on once only or other ought our our's ourselves out over own same say see shan't she she'd shell shes should shouldn't so some such than that that's the their theirs them themselves then there there's these they they'd they'll they're they've this those through time to too until up us very want was wasn't way we wed well were weren't we've what what's when when's where where's which while who whom who's why why's will with won't would wouldn't you you'd you'll your you're your's yourself yourselves you've".split(" "), (function(){'use strict';window.FlexSearch.registerLanguage("en",{filter:"a about above after again against all also am an and any are aren't as at be because been before being below both but by can cannot can't come could couldn't did didn't do does doesn't doing dont down during each even few first for from further get go had hadn't has hasn't have haven't having he hed her here here's hers herself hes him himself his how how's i id if ill im in into is isn't it it's itself i've just know let's like make me more most mustn't my myself new no nor not now of off on once only or other ought our our's ourselves out over own same say see shan't she she'd shell shes should shouldn't so some such than that that's the their theirs them themselves then there there's these they they'd they'll they're they've this those through time to too until up us very want was wasn't way we wed well were weren't we've what what's when when's where where's which while who whom who's why why's will with won't would wouldn't you you'd you'll your you're your's yourself yourselves you've".split(" "),
{ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""});}).call(this); b:{ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""},a:{}});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';function a(b,c){for(var d=0,e=c.length;d<e;d+=2)b=b.replace(c[d],c[d+1]);return b}function f(b){return new RegExp(b,"g")};var h=[f("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",f("[\u00e8\u00e9\u00ea\u00eb]"),"e",f("[\u00ec\u00ed\u00ee\u00ef]"),"i",f("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",f("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",f("[\u00fd\u0177\u00ff]"),"y",f("\u00f1"),"n",f("[\u00e7c]"),"k",f("\u00df"),"s",f(" & ")," and ",f("[-/]")," ",f("[^a-z0-9 ]"),"",f("\\s+")," "];var k=[f("ae"),"a",f("ai"),"ei",f("ay"),"ei",f("ey"),"ei",f("oe"),"o",f("ue"),"u",f("ie"),"i",f("sz"),"s",f("zs"),"s",f("sh"),"s",f("ck"),"k",f("cc"),"k",f("th"),"t",f("dt"),"t",f("ph"),"f",f("pf"),"f",f("ou"),"o",f("uo"),"u"];window.FlexSearch.registerCharset("latin:advanced",function(b,c){if(!b)return b;b=b?a(b.toLowerCase(),h):b;2<b.length&&(b=a(b,k));if(!c&&1<b.length){for(var d=c="",e=0,l=b.length,g=void 0;e<l;e++)(g=b[e])!==d&&(c+=d=g);b=c}return b},/[\W_]+/);}).call(this); (function(){'use strict';function a(b){return new RegExp(b,"g")};var f=[a("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",a("[\u00e8\u00e9\u00ea\u00eb]"),"e",a("[\u00ec\u00ed\u00ee\u00ef]"),"i",a("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",a("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",a("[\u00fd\u0177\u00ff]"),"y",a("\u00f1"),"n",a("[\u00e7c]"),"k",a("\u00df"),"s",a(" & ")," and ",a("[\\W_]+")," ",a("[^a-z0-9 ]"),""];function h(b,c){c||(c=this);return c.a(b.toLowerCase(),f," ",!1)};var k=[a("ae"),"a",a("ai"),"ei",a("ay"),"ei",a("ey"),"ei",a("oe"),"o",a("ue"),"u",a("ie"),"i",a("sz"),"s",a("zs"),"s",a("sh"),"s",a("ck"),"k",a("cc"),"k",a("th"),"t",a("dt"),"t",a("ph"),"f",a("pf"),"f",a("ou"),"o",a("uo"),"u"];window.FlexSearch.registerCharset("latin:advanced",{encode:function(b,c){if(b){b=h(b,this).join(" ");if(2<b.length)for(var d=0,e=k.length;d<e&&(b=b.replace(k[d],k[d+1]),b);d+=2);if(!c){if(1<b.length){d=c="";e=0;for(var l=b.length,g=void 0;e<l;e++)(g=b[e])!==d&&(c+=d=g);b=c}b&&(b=b.split(" "))}}return b},b:!1});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';var d=[/[-/]/g," ",/[^a-z0-9 ]/g,"",/\s+/g," "];window.FlexSearch.registerCharset("latin:balance",function(b){b=b.toLowerCase();for(var a=0,c=d.length;a<c;a+=2)b=b.replace(d[a],d[a+1]);c=a="";for(var e=0,g=b.length,f=void 0;e<g;e++)(f=b[e])!==c&&(a+=c=f);return a},/[\W_]+/);}).call(this); (function(){'use strict';var a=[/[\W_]+/g," ",/[^a-z0-9 ]/g,""];window.FlexSearch.registerCharset("latin:balance",{encode:function(b){return this.a(b.toLowerCase(),a," ",!1)},b:!1});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';window.FlexSearch.registerCharset("latin:default",function(a){return a.toLowerCase()},/[\W_]+/);}).call(this); (function(){'use strict';var a=/[\W_]+/;window.FlexSearch.registerCharset("latin:default",{encode:function(b){return this.a(b.toLowerCase(),!1,a,!1)},b:!1});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';function a(b,c){for(var d=0,e=c.length;d<e;d+=2)b=b.replace(c[d],c[d+1]);return b}function f(b){return new RegExp(b,"g")};var h=[f("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",f("[\u00e8\u00e9\u00ea\u00eb]"),"e",f("[\u00ec\u00ed\u00ee\u00ef]"),"i",f("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",f("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",f("[\u00fd\u0177\u00ff]"),"y",f("\u00f1"),"n",f("[\u00e7c]"),"k",f("\u00df"),"s",f(" & ")," and ",f("[-/]")," ",f("[^a-z0-9 ]"),"",f("\\s+")," "];var k=[f("ae"),"a",f("ai"),"ei",f("ay"),"ei",f("ey"),"ei",f("oe"),"o",f("ue"),"u",f("ie"),"i",f("sz"),"s",f("zs"),"s",f("sh"),"s",f("ck"),"k",f("cc"),"k",f("th"),"t",f("dt"),"t",f("ph"),"f",f("pf"),"f",f("ou"),"o",f("uo"),"u"];var l=[f("p"),"b",f("z"),"s",f("[cgq]"),"k",f("n"),"m",f("d"),"t",f("[vw]"),"f",f("[aeiouy]"),""];window.FlexSearch.registerCharset("latin:extra",function(b){if(!b)return b;b&&(b=b?a(b.toLowerCase(),h):b,2<b.length&&(b=a(b,k)));if(1<b.length){b=b.split(" ");for(var c=0;c<b.length;c++){var d=b[c];1<d.length&&(b[c]=d[0]+a(d.substring(1),l))}b=b.join(" ");d=c="";for(var e=0,m=b.length,g=void 0;e<m;e++)(g=b[e])!==d&&(c+=d=g);b=c}return b},/[\W_]+/);}).call(this); (function(){'use strict';function a(b,c){for(var d=0,e=c.length;d<e&&(b=b.replace(c[d],c[d+1]),b);d+=2);return b}function f(b){return new RegExp(b,"g")};var h=[f("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",f("[\u00e8\u00e9\u00ea\u00eb]"),"e",f("[\u00ec\u00ed\u00ee\u00ef]"),"i",f("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",f("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",f("[\u00fd\u0177\u00ff]"),"y",f("\u00f1"),"n",f("[\u00e7c]"),"k",f("\u00df"),"s",f(" & ")," and ",f("[\\W_]+")," ",f("[^a-z0-9 ]"),""];function k(b,c){c||(c=this);return c.a(b.toLowerCase(),h," ",!1)};var l=[f("ae"),"a",f("ai"),"ei",f("ay"),"ei",f("ey"),"ei",f("oe"),"o",f("ue"),"u",f("ie"),"i",f("sz"),"s",f("zs"),"s",f("sh"),"s",f("ck"),"k",f("cc"),"k",f("th"),"t",f("dt"),"t",f("ph"),"f",f("pf"),"f",f("ou"),"o",f("uo"),"u"];function m(b){b&&(b=k(b,this).join(" "),2<b.length&&(b=a(b,l)));return b};var n=[f("(?!\\b)p"),"b",f("(?!\\b)z"),"s",f("(?!\\b)[cgq]"),"k",f("(?!\\b)n"),"m",f("(?!\\b)d"),"t",f("(?!\\b)[vw]"),"f",f("(?!\\b)[aeiouy]"),""];window.FlexSearch.registerCharset("latin:extra",{encode:function(b){if(b){b=m(b);1<b.length&&(b=a(b,n));if(1<b.length){for(var c="",d="",e=0,p=b.length,g=void 0;e<p;e++)(g=b[e])!==d&&(c+=d=g);b=c}b&&(b=b.split(" "))}return b},b:!1});}).call(this);

View File

@@ -1 +1 @@
(function(){'use strict';function a(b){return new RegExp(b,"g")};var d=[a("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",a("[\u00e8\u00e9\u00ea\u00eb]"),"e",a("[\u00ec\u00ed\u00ee\u00ef]"),"i",a("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",a("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",a("[\u00fd\u0177\u00ff]"),"y",a("\u00f1"),"n",a("[\u00e7c]"),"k",a("\u00df"),"s",a(" & ")," and ",a("[-/]")," ",a("[^a-z0-9 ]"),"",a("\\s+")," "];window.FlexSearch.registerCharset("latin:simple",function(b){if(b){b=b.toLowerCase();for(var c=0,e=d.length;c<e;c+=2)b=b.replace(d[c],d[c+1])}return b},/[\W_]+/);}).call(this); (function(){'use strict';function a(b){return new RegExp(b,"g")};var d=[a("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",a("[\u00e8\u00e9\u00ea\u00eb]"),"e",a("[\u00ec\u00ed\u00ee\u00ef]"),"i",a("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",a("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",a("[\u00fd\u0177\u00ff]"),"y",a("\u00f1"),"n",a("[\u00e7c]"),"k",a("\u00df"),"s",a(" & ")," and ",a("[\\W_]+")," ",a("[^a-z0-9 ]"),""];window.FlexSearch.registerCharset("latin:simple",{encode:function(b,c){c||(c=this);return c.a(b.toLowerCase(),d," ",!1)},b:!1});}).call(this);

1
dist/lang/latin/soundex.min.js vendored Normal file
View File

@@ -0,0 +1 @@
(function(){'use strict';var f=[/[\W_]+/g," ",/[^a-z ]/g,""];function l(a){switch(a){case "b":case "f":case "p":case "v":return 1;case "c":case "g":case "j":case "k":case "q":case "s":case "x":case "z":return 2;case "d":case "t":return 3;case "l":return 4;case "m":case "n":return 5;case "r":return 6}return""};window.FlexSearch.registerCharset("latin:soundex",{encode:function(a){a=this.a(a.toLowerCase(),f,!1,!1);var g=[];if(a)for(var h=a.split(" "),m=h.length,c=0,n=0;c<m;c++)if((a=h[c])&&(!this.filter||!this.filter[a])){for(var b=a[0],k=l(b),d=1;d<a.length;d++){var e=l(a[d]);if(e!==k&&(b+=e,k=e,4===b.length))break}g[n++]=(b+"0000").substring(0,4)}return g},b:!1,c:"strict"});}).call(this);

4
dist/lang/us.min.js vendored
View File

@@ -1,2 +1,2 @@
(function(){'use strict';window.FlexSearch.registerLanguage("us","a about above after again against all also am an and any are aren't as at be because been before being below both but by can cannot can't come could couldn't did didn't do does doesn't doing dont down during each even few first for from further get go had hadn't has hasn't have haven't having he hed her here here's hers herself hes him himself his how how's i id if ill im in into is isn't it it's itself i've just know let's like make me more most mustn't my myself new no nor not now of off on once only or other ought our our's ourselves out over own same say see shan't she she'd shell shes should shouldn't so some such than that that's the their theirs them themselves then there there's these they they'd they'll they're they've this those through time to too until up us very want was wasn't way we wed well were weren't we've what what's when when's where where's which while who whom who's why why's will with won't would wouldn't you you'd you'll your you're your's yourself yourselves you've".split(" "), (function(){'use strict';window.FlexSearch.registerLanguage("us",{filter:"a about above after again against all also am an and any are aren't as at be because been before being below both but by can cannot can't come could couldn't did didn't do does doesn't doing dont down during each even few first for from further get go had hadn't has hasn't have haven't having he hed her here here's hers herself hes him himself his how how's i id if ill im in into is isn't it it's itself i've just know let's like make me more most mustn't my myself new no nor not now of off on once only or other ought our our's ourselves out over own same say see shan't she she'd shell shes should shouldn't so some such than that that's the their theirs them themselves then there there's these they they'd they'll they're they've this those through time to too until up us very want was wasn't way we wed well were weren't we've what what's when when's where where's which while who whom who's why why's will with won't would wouldn't you you'd you'll your you're your's yourself yourselves you've".split(" "),
{ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""});}).call(this); b:{ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""},a:{}});}).call(this);

View File

@@ -1 +0,0 @@
import FlexSearch from"./flexsearch.js";import"./export.js";!0,function(){const a=this||window;let b;(b=a.define)&&b.amd?b([],function(){return FlexSearch}):"object"==typeof a.exports?a.module.exports=FlexSearch:a.FlexSearch=FlexSearch}();

View File

@@ -1 +1 @@
export function is_string(a){return"string"==typeof a}export function is_array(a){return a.constructor===Array}export function is_function(a){return"function"==typeof a}export function is_object(a){return"object"==typeof a}export function is_undefined(a){return"undefined"==typeof a}export function get_keys(a){return Object.keys(a)}export function create_object_array(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=create_object();return b}export function create_object(){return Object.create(null)}export function replace(a,b){for(let c=0,d=b.length;c<d;c+=2)a=a.replace(b[c],b[c+1]);return a}export function regex(a){return new RegExp(a,"g")}export function collapse(a){let b="",c="";for(let d,e=0,f=a.length;e<f;e++)(d=a[e])!==c&&(b+=c=d);return b} import FlexSearch from"./flexsearch.js";export function is_string(a){return"string"==typeof a}export function is_array(a){return a.constructor===Array}export function is_function(a){return"function"==typeof a}export function is_object(a){return"object"==typeof a}export function is_undefined(a){return"undefined"==typeof a}export function get_keys(a){return Object.keys(a)}export function create_object_array(a){const b=Array(a);for(let c=0;c<a;c++)b[c]=create_object();return b}export function create_object(){return Object.create(null)}export function replace(a,b){for(let c=0,d=b.length;c<d&&(a=a.replace(b[c],b[c+1]),!!a);c+=2);return a}export function regex(a){return new RegExp(a,"g")}export function collapse(a){let b="",c="";for(let d,e=0,f=a.length;e<f;e++)(d=a[e])!==c&&(b+=c=d);return b}export function filter(a,b){const c=a.length,d=[];for(let e=0,f=0;e<c;e++){const c=a[e];c&&!b[c]&&(d[f++]=c)}return d}FlexSearch.prototype.pipeline=function(a,b,c,d){if(a&&(b&&a&&(a=replace(a,b)),a&&this.matcher&&(a=replace(a,this.matcher)),this.stemmer&&1<a.length&&(a=replace(a,this.stemmer)),d&&1<a.length&&(a=collapse(a)),a&&(c||""===c))){const b=a.split(c);return this.filter?filter(b,this.filter):b}return a};

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
export function encode(a){return a.toLowerCase()}export const split="";

View File

@@ -1 +0,0 @@
export function encode(a){return a.toLowerCase()}export const split="";export const rtl=!0;

1
dist/module/lang/arabic/default.js vendored Normal file
View File

@@ -0,0 +1 @@
import FlexSearch from"../../flexsearch.js";export const rtl=!0;export const tokenize="";export default{encode:encode,rtl:!0};const split=/[\W_]+/;export function encode(a){return this.pipeline(a,!1,split,!1)}

View File

@@ -1 +1 @@
export const filter=["aber","als","am","an","auch","auf","aus","bei","bin","bis","bist","da","dadurch","daher","darum","das","da\xDF","dass","dein","deine","dem","den","der","des","dessen","deshalb","die","dies","dieser","dieses","doch","dort","du","durch","ein","eine","einem","einen","einer","eines","er","es","euer","eure","f\xFCr","hatte","hatten","hattest","hattet","hier","hinter","ich","ihr","ihre","im","in","ist","ja","jede","jedem","jeden","jeder","jedes","jener","jenes","jetzt","kann","kannst","k\xF6nnen","k\xF6nnt","machen","mein","meine","mit","mu\xDF","mu\xDFt","musst","m\xFCssen","m\xFC\xDFt","nach","nachdem","nein","nicht","nun","oder","seid","sein","seine","sich","sie","sind","soll","sollen","sollst","sollt","sonst","soweit","sowie","und","unser","unsere","unter","vom","von","vor","wann","warum","was","weiter","weitere","wenn","wer","werde","werden","werdet","weshalb","wie","wieder","wieso","wir","wird","wirst","wo","woher","wohin","zu","zum","zur","\xFCber"];export const stemmer={niss:"",isch:"",lich:"",heit:"",keit:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""};export const matcher={}; export const filter=["aber","als","am","an","auch","auf","aus","bei","bin","bis","bist","da","dadurch","daher","darum","das","da\xDF","dass","dein","deine","dem","den","der","des","dessen","deshalb","die","dies","dieser","dieses","doch","dort","du","durch","ein","eine","einem","einen","einer","eines","er","es","euer","eure","f\xFCr","hatte","hatten","hattest","hattet","hier","hinter","ich","ihr","ihre","im","in","ist","ja","jede","jedem","jeden","jeder","jedes","jener","jenes","jetzt","kann","kannst","k\xF6nnen","k\xF6nnt","machen","mein","meine","mit","mu\xDF","mu\xDFt","musst","m\xFCssen","m\xFC\xDFt","nach","nachdem","nein","nicht","nun","oder","seid","sein","seine","sich","sie","sind","soll","sollen","sollst","sollt","sonst","soweit","sowie","und","unser","unsere","unter","vom","von","vor","wann","warum","was","weiter","weitere","wenn","wer","werde","werden","werdet","weshalb","wie","wieder","wieso","wir","wird","wirst","wo","woher","wohin","zu","zum","zur","\xFCber"];export const stemmer={niss:"",isch:"",lich:"",heit:"",keit:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher};

View File

@@ -1 +1 @@
export function encode(a){return a.toLowerCase()}export const split=""; import FlexSearch from"../../flexsearch.js";export const rtl=!1;export const tokenize="strict";export default{encode:encode,rtl:!1,tokenize:"strict"};const regex=/[\x00-\x7F]/g;export function encode(a){return this.pipeline(a.replace(regex,""),!1,"",!1)}

View File

@@ -1 +0,0 @@
export function encode(a){return a.toLowerCase()}export const split="";export const rtl=!1;

View File

@@ -1 +1 @@
export function encode(a){return a.toLowerCase()}export const split=""; import FlexSearch from"../../flexsearch.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const split=/[\W_]+/;export function encode(a){return this.pipeline(a,!1,split,!1)}

View File

@@ -1 +0,0 @@
export function encode(a){return a.toLowerCase()}export const split="";export const rtl=!1;

View File

@@ -1 +1 @@
export const filter=["aber","als","am","an","auch","auf","aus","bei","bin","bis","bist","da","dadurch","daher","darum","das","da\xDF","dass","dein","deine","dem","den","der","des","dessen","deshalb","die","dies","dieser","dieses","doch","dort","du","durch","ein","eine","einem","einen","einer","eines","er","es","euer","eure","f\xFCr","hatte","hatten","hattest","hattet","hier","hinter","ich","ihr","ihre","im","in","ist","ja","jede","jedem","jeden","jeder","jedes","jener","jenes","jetzt","kann","kannst","k\xF6nnen","k\xF6nnt","machen","mein","meine","mit","mu\xDF","mu\xDFt","musst","m\xFCssen","m\xFC\xDFt","nach","nachdem","nein","nicht","nun","oder","seid","sein","seine","sich","sie","sind","soll","sollen","sollst","sollt","sonst","soweit","sowie","und","unser","unsere","unter","vom","von","vor","wann","warum","was","weiter","weitere","wenn","wer","werde","werden","werdet","weshalb","wie","wieder","wieso","wir","wird","wirst","wo","woher","wohin","zu","zum","zur","\xFCber"];export const stemmer={niss:"",isch:"",lich:"",heit:"",keit:"",ell:"",bar:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""};export const matcher={}; export const filter=["aber","als","am","an","auch","auf","aus","bei","bin","bis","bist","da","dadurch","daher","darum","das","da\xDF","dass","dein","deine","dem","den","der","des","dessen","deshalb","die","dies","dieser","dieses","doch","dort","du","durch","ein","eine","einem","einen","einer","eines","er","es","euer","eure","f\xFCr","hatte","hatten","hattest","hattet","hier","hinter","ich","ihr","ihre","im","in","ist","ja","jede","jedem","jeden","jeder","jedes","jener","jenes","jetzt","kann","kannst","k\xF6nnen","k\xF6nnt","machen","mein","meine","mit","mu\xDF","mu\xDFt","musst","m\xFCssen","m\xFC\xDFt","nach","nachdem","nein","nicht","nun","oder","seid","sein","seine","sich","sie","sind","soll","sollen","sollst","sollt","sonst","soweit","sowie","und","unser","unsere","unter","vom","von","vor","wann","warum","was","weiter","weitere","wenn","wer","werde","werden","werdet","weshalb","wie","wieder","wieso","wir","wird","wirst","wo","woher","wohin","zu","zum","zur","\xFCber"];export const stemmer={niss:"",isch:"",lich:"",heit:"",keit:"",ell:"",bar:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher};

View File

@@ -1 +1 @@
export const filter=["a","about","above","after","again","against","all","also","am","an","and","any","are","aren't","as","at","be","because","been","before","being","below","both","but","by","can","cannot","can't","come","could","couldn't","did","didn't","do","does","doesn't","doing","dont","down","during","each","even","few","first","for","from","further","get","go","had","hadn't","has","hasn't","have","haven't","having","he","hed","her","here","here's","hers","herself","hes","him","himself","his","how","how's","i","id","if","ill","im","in","into","is","isn't","it","it's","itself","i've","just","know","let's","like","make","me","more","most","mustn't","my","myself","new","no","nor","not","now","of","off","on","once","only","or","other","ought","our","our's","ourselves","out","over","own","same","say","see","shan't","she","she'd","shell","shes","should","shouldn't","so","some","such","than","that","that's","the","their","theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've","this","those","through","time","to","too","until","up","us","very","want","was","wasn't","way","we","wed","well","were","weren't","we've","what","what's","when","when's","where","where's","which","while","who","whom","who's","why","why's","will","with","won't","would","wouldn't","you","you'd","you'll","your","you're","your's","yourself","yourselves","you've"];export const stemmer={ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""};export const matcher={}; export const filter=["a","about","above","after","again","against","all","also","am","an","and","any","are","aren't","as","at","be","because","been","before","being","below","both","but","by","can","cannot","can't","come","could","couldn't","did","didn't","do","does","doesn't","doing","dont","down","during","each","even","few","first","for","from","further","get","go","had","hadn't","has","hasn't","have","haven't","having","he","hed","her","here","here's","hers","herself","hes","him","himself","his","how","how's","i","id","if","ill","im","in","into","is","isn't","it","it's","itself","i've","just","know","let's","like","make","me","more","most","mustn't","my","myself","new","no","nor","not","now","of","off","on","once","only","or","other","ought","our","our's","ourselves","out","over","own","same","say","see","shan't","she","she'd","shell","shes","should","shouldn't","so","some","such","than","that","that's","the","their","theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've","this","those","through","time","to","too","until","up","us","very","want","was","wasn't","way","we","wed","well","were","weren't","we've","what","what's","when","when's","where","where's","which","while","who","whom","who's","why","why's","will","with","won't","would","wouldn't","you","you'd","you'll","your","you're","your's","yourself","yourselves","you've"];export const stemmer={ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher};

View File

@@ -1 +1 @@
import{regex,replace,collapse}from"../../common.js";import encoder_simple from"./simple.js";const regex_ae=regex("ae"),regex_ai=regex("ai"),regex_ay=regex("ay"),regex_ey=regex("ey"),regex_oe=regex("oe"),regex_ue=regex("ue"),regex_ie=regex("ie"),regex_sz=regex("sz"),regex_zs=regex("zs"),regex_ck=regex("ck"),regex_cc=regex("cc"),regex_sh=regex("sh"),regex_th=regex("th"),regex_dt=regex("dt"),regex_ph=regex("ph"),regex_pf=regex("pf"),regex_ou=regex("ou"),regex_uo=regex("uo"),pairs=[regex_ae,"a",regex_ai,"ei",regex_ay,"ei",regex_ey,"ei",regex_oe,"o",regex_ue,"u",regex_ie,"i",regex_sz,"s",regex_zs,"s",regex_sh,"s",regex_ck,"k",regex_cc,"k",regex_th,"t",regex_dt,"t",regex_ph,"f",regex_pf,"f",regex_ou,"o",regex_uo,"u"];export default function(a,b){return a?(a=encoder_simple(a),2<a.length&&(a=replace(a,pairs)),!b&&1<a.length&&(a=collapse(a)),a):a} import FlexSearch from"../../flexsearch.js";import{regex,replace,collapse}from"../../common.js";import{encode as encode_simple}from"./simple.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const regex_ae=regex("ae"),regex_ai=regex("ai"),regex_ay=regex("ay"),regex_ey=regex("ey"),regex_oe=regex("oe"),regex_ue=regex("ue"),regex_ie=regex("ie"),regex_sz=regex("sz"),regex_zs=regex("zs"),regex_ck=regex("ck"),regex_cc=regex("cc"),regex_sh=regex("sh"),regex_th=regex("th"),regex_dt=regex("dt"),regex_ph=regex("ph"),regex_pf=regex("pf"),regex_ou=regex("ou"),regex_uo=regex("uo"),pairs=[regex_ae,"a",regex_ai,"ei",regex_ay,"ei",regex_ey,"ei",regex_oe,"o",regex_ue,"u",regex_ie,"i",regex_sz,"s",regex_zs,"s",regex_sh,"s",regex_ck,"k",regex_cc,"k",regex_th,"t",regex_dt,"t",regex_ph,"f",regex_pf,"f",regex_ou,"o",regex_uo,"u"];export function encode(a,b){return a&&(a=encode_simple(a,this).join(" "),2<a.length&&(a=replace(a,pairs)),!b&&(1<a.length&&(a=collapse(a)),a&&(a=a.split(" ")))),a}

View File

@@ -1 +1 @@
import{regex,replace,collapse}from"../../common.js";const regex_whitespace=regex("[\\W_]+"),regex_strip=regex("[^a-z0-9 ]"),pairs=[regex_whitespace," ",regex_strip,""];export default function(a){return a?collapse(replace(a.toLowerCase(),pairs)):a} import FlexSearch from"../../flexsearch.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const regex_whitespace=/[\W_]+/g,regex_strip=/[^a-z0-9 ]/g,pairs=[regex_whitespace," ",regex_strip,""];export function encode(a){return this.pipeline(a.toLowerCase(),pairs," ",!1)}

1
dist/module/lang/latin/default.js vendored Normal file
View File

@@ -0,0 +1 @@
import FlexSearch from"../../flexsearch.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const split=/[\W_]+/;export function encode(a){return this.pipeline(a.toLowerCase(),!1,split,!1)}

View File

@@ -1 +1 @@
import{regex,replace,collapse}from"../../common.js";import encoder_advanced from"./advanced.js";const soundex_b=regex("p"),soundex_s=regex("z"),soundex_k=regex("[cgq]"),soundex_m=regex("n"),soundex_t=regex("d"),soundex_f=regex("[vw]"),regex_vowel=regex("[aeiouy]"),regex_pairs_extra=[soundex_b,"b",soundex_s,"s",soundex_k,"k",soundex_m,"m",soundex_t,"t",soundex_f,"f",regex_vowel,""];export default function(a){if(!a)return a;if(a=encoder_advanced(a,!0),1<a.length){a=a.split(" ");for(let b=0;b<a.length;b++){const c=a[b];1<c.length&&(a[b]=c[0]+replace(c.substring(1),regex_pairs_extra))}a=a.join(" "),a=collapse(a)}return a} import{regex,replace,collapse}from"../../common.js";import{encode as encode_advanced}from"./advanced.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const prefix="(?!\\b)",soundex_b=regex("(?!\\b)p"),soundex_s=regex("(?!\\b)z"),soundex_k=regex("(?!\\b)[cgq]"),soundex_m=regex("(?!\\b)n"),soundex_t=regex("(?!\\b)d"),soundex_f=regex("(?!\\b)[vw]"),regex_vowel=regex("(?!\\b)[aeiouy]"),pairs=[soundex_b,"b",soundex_s,"s",soundex_k,"k",soundex_m,"m",soundex_t,"t",soundex_f,"f",regex_vowel,""];export function encode(a){return a&&(a=encode_advanced(a,!0),1<a.length&&(a=replace(a,pairs)),1<a.length&&(a=collapse(a)),a&&(a=a.split(" "))),a}

View File

@@ -1 +0,0 @@
export function encode(a){return a.toLowerCase()}export const split=/[\W_]+/;

View File

@@ -1 +0,0 @@
import encoder_advanced from"./advanced.js";import encoder_balance from"./balance.js";import encoder_extra from"./extra.js";import encoder_simple from"./simple.js";export function encode(a){return a.toLowerCase()}export const split=/[\W_]+/;export const rtl=!1;export const advanced=encoder_advanced;export const balance=encoder_balance;export const extra=encoder_extra;export const simple=encoder_simple;

View File

@@ -1 +1 @@
import{regex,replace}from"../../common.js";const regex_whitespace=regex("[\\W_]+"),regex_strip=regex("[^a-z0-9 ]"),regex_a=regex("[\xE0\xE1\xE2\xE3\xE4\xE5]"),regex_e=regex("[\xE8\xE9\xEA\xEB]"),regex_i=regex("[\xEC\xED\xEE\xEF]"),regex_o=regex("[\xF2\xF3\xF4\xF5\xF6\u0151]"),regex_u=regex("[\xF9\xFA\xFB\xFC\u0171]"),regex_y=regex("[\xFD\u0177\xFF]"),regex_n=regex("\xF1"),regex_c=regex("[\xE7c]"),regex_s=regex("\xDF"),regex_and=regex(" & "),regex_pairs_simple=[regex_a,"a",regex_e,"e",regex_i,"i",regex_o,"o",regex_u,"u",regex_y,"y",regex_n,"n",regex_c,"k",regex_s,"s",regex_and," and ",regex_whitespace," ",regex_strip,""];export default function(a){return a?replace(a.toLowerCase(),regex_pairs_simple):a} import FlexSearch from"../../flexsearch.js";import{regex}from"../../common.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const regex_whitespace=regex("[\\W_]+"),regex_strip=regex("[^a-z0-9 ]"),regex_a=regex("[\xE0\xE1\xE2\xE3\xE4\xE5]"),regex_e=regex("[\xE8\xE9\xEA\xEB]"),regex_i=regex("[\xEC\xED\xEE\xEF]"),regex_o=regex("[\xF2\xF3\xF4\xF5\xF6\u0151]"),regex_u=regex("[\xF9\xFA\xFB\xFC\u0171]"),regex_y=regex("[\xFD\u0177\xFF]"),regex_n=regex("\xF1"),regex_c=regex("[\xE7c]"),regex_s=regex("\xDF"),regex_and=regex(" & "),pairs=[regex_a,"a",regex_e,"e",regex_i,"i",regex_o,"o",regex_u,"u",regex_y,"y",regex_n,"n",regex_c,"k",regex_s,"s",regex_and," and ",regex_whitespace," ",regex_strip,""];export function encode(a,b){return b||(b=this),b.pipeline(a.toLowerCase(),pairs," ",!1)}

View File

@@ -1 +1 @@
import{regex,replace}from"../../common.js";const regex_whitespace=regex("[\\W_]+"),regex_strip=regex("[^A-Z0-9 ]"),pairs=[regex_whitespace," ",regex_strip,""];export default function(a){if(!a)return a;if(a=replace(a.toUpperCase(),pairs),!a)return a;const b=a.split(" ");for(let c=0;c<b.length;c++)if(a=b[c]){let d=a[0],e=getCode(d);for(let b=1;b<a.length;b++){const c=getCode(a[b]);if(c!==e&&(d+=c,e=c),5===d.length)break}b[c]=(d+"0000").substring(0,4)}return b}function getCode(a){return"B"===a||"F"===a||"P"===a||"V"===a?1:"C"===a||"G"===a||"J"===a||"K"===a||"Q"===a||"S"===a||"X"===a||"Z"===a?2:"D"===a||"T"===a?3:"L"===a?4:"M"===a||"N"===a?5:"R"===a?6:""} import FlexSearch from"../../flexsearch.js";export const rtl=!1;export const tokenize="strict";export default{encode:encode,rtl:!1,tokenize:"strict"};const regex_whitespace=/[\W_]+/g,regex_strip=/[^a-z ]/g,pairs=[regex_whitespace," ",regex_strip,""];export function encode(a){a=this.pipeline(a.toLowerCase(),pairs,!1,!1);const b=[];if(a){const c=a.split(" "),d=c.length;for(let e=0,f=0;e<d;e++)if((a=c[e])&&(!this.filter||!this.filter[a])){let c=a[0],d=getCode(c);for(let b=1;b<a.length;b++){const e=getCode(a[b]);if(e!==d&&(c+=e,d=e,4===c.length))break}b[f++]=(c+"0000").substring(0,4)}}return b}function getCode(a){return"b"===a||"f"===a||"p"===a||"v"===a?1:"c"===a||"g"===a||"j"===a||"k"===a||"q"===a||"s"===a||"x"===a||"z"===a?2:"d"===a||"t"===a?3:"l"===a?4:"m"===a||"n"===a?5:"r"===a?6:""}

View File

@@ -1 +1 @@
export const filter=["a","about","above","after","again","against","all","also","am","an","and","any","are","aren't","as","at","be","because","been","before","being","below","both","but","by","can","cannot","can't","come","could","couldn't","did","didn't","do","does","doesn't","doing","dont","down","during","each","even","few","first","for","from","further","get","go","had","hadn't","has","hasn't","have","haven't","having","he","hed","her","here","here's","hers","herself","hes","him","himself","his","how","how's","i","id","if","ill","im","in","into","is","isn't","it","it's","itself","i've","just","know","let's","like","make","me","more","most","mustn't","my","myself","new","no","nor","not","now","of","off","on","once","only","or","other","ought","our","our's","ourselves","out","over","own","same","say","see","shan't","she","she'd","shell","shes","should","shouldn't","so","some","such","than","that","that's","the","their","theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've","this","those","through","time","to","too","until","up","us","very","want","was","wasn't","way","we","wed","well","were","weren't","we've","what","what's","when","when's","where","where's","which","while","who","whom","who's","why","why's","will","with","won't","would","wouldn't","you","you'd","you'll","your","you're","your's","yourself","yourselves","you've"];export const stemmer={ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""};export const matcher={}; export const filter=["a","about","above","after","again","against","all","also","am","an","and","any","are","aren't","as","at","be","because","been","before","being","below","both","but","by","can","cannot","can't","come","could","couldn't","did","didn't","do","does","doesn't","doing","dont","down","during","each","even","few","first","for","from","further","get","go","had","hadn't","has","hasn't","have","haven't","having","he","hed","her","here","here's","hers","herself","hes","him","himself","his","how","how's","i","id","if","ill","im","in","into","is","isn't","it","it's","itself","i've","just","know","let's","like","make","me","more","most","mustn't","my","myself","new","no","nor","not","now","of","off","on","once","only","or","other","ought","our","our's","ourselves","out","over","own","same","say","see","shan't","she","she'd","shell","shes","should","shouldn't","so","some","such","than","that","that's","the","their","theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've","this","those","through","time","to","too","until","up","us","very","want","was","wasn't","way","we","wed","well","were","weren't","we've","what","what's","when","when's","where","where's","which","while","who","whom","who's","why","why's","will","with","won't","would","wouldn't","you","you'd","you'll","your","you're","your's","yourself","yourselves","you've"];export const stemmer={ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher};

View File

@@ -1 +1 @@
const profiles=[];let profile;export function profile_start(a){(profile[a]||(profile[a]={time:0,count:0,ops:0,nano:0})).ops=("undefined"==typeof performance?Date:performance).now()}export function profile_end(a){const b=profile[a];b.time+=("undefined"==typeof performance?Date:performance).now()-b.ops,b.count++,b.ops=1000/b.time*b.count,b.micro=1000*(b.time/b.count)}"undefined"!=typeof window&&(window.stats=profiles); const profiles=[];let profile;export function profile_start(a){(profile[a]||(profile[a]={time:0,count:0,ops:0,nano:0})).ops=("undefined"==typeof performance?Date:performance).now()}export function profile_end(a){const b=profile[a];b.time+=("undefined"==typeof performance?Date:performance).now()-b.ops,b.count++,b.ops=1000/b.time*b.count,b.micro=1000*(b.time/b.count)}

View File

@@ -1 +1 @@
import FlexSearch from"./flexsearch.js";const worker_stack={},inline_supported="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL;export default function init(a,b,c,d,e){let f=a;const g=inline_supported?URL.createObjectURL(new Blob([(RELEASE?"":"var RELEASE = '"+RELEASE+"';var DEBUG = false;var PROFILER = true;var SUPPORT_PRESET = true;var SUPPORT_SUGGESTION = true;var SUPPORT_ENCODER = true;var SUPPORT_CACHE = true;var SUPPORT_ASYNC = true;var SUPPORT_SERIALIZE = true;var SUPPORT_INFO = true;var SUPPORT_DOCUMENT = true;var SUPPORT_WHERE = true;var SUPPORT_PAGINATION = true;var SUPPORT_OPERATOR = true;var SUPPORT_CALLBACK = true;var SUPPORT_WORKER = true;")+"("+c.toString()+")()"],{type:"text/javascript"})):f+(RELEASE?"."+RELEASE:"")+".js";return f+="-"+b,worker_stack[f]||(worker_stack[f]=[]),worker_stack[f][e]=new Worker(g),worker_stack[f][e].onmessage=d,!1,worker_stack[f][e]}function worker_module(){let a,b;self.onmessage=function(c){const d=c.data;if(d)if(d.search){const c=b.search(d.content,d.threshold?{limit:d.limit,threshold:d.threshold,where:d.where}:d.limit);self.postMessage({id:a,content:d.content,limit:d.limit,result:c})}else if(d.add)b.add(d.id,d.content);else if(d.update)b.update(d.id,d.content);else if(d.remove)b.remove(d.id);else if(d.clear)b.clear();else if(d.info){const c=b.info();c.worker=a,console.log(c)}else d.register&&(a=d.id,d.options.cache=!1,d.options.async=!1,d.options.worker=!1,b=new Function(d.register.substring(d.register.indexOf("{")+1,d.register.lastIndexOf("}")))(),b=new b(d.options))}}export function addWorker(a,b,c,d){const e=init("flexsearch","id"+a,worker_module,function(a){const b=a.data;b&&b.result&&d(b.id,b.content,b.result,b.limit,b.where,b.cursor,b.suggest)},b),f=FlexSearch.toString();return c.id=b,e.postMessage({register:f,options:c,id:b}),e}FlexSearch.prototype.worker_handler=function(a,b,c,d){return this._task_completed!==this.worker&&(this._task_result=this._task_result.concat(c),this._task_completed++,d&&this._task_result.length>=d&&(this._task_completed=this.worker),this._task_completed===this.worker&&(this.cache&&this._cache.set(b,this._task_result),this._current_callback&&this._current_callback(this._task_result))),this}; import FlexSearch from"./flexsearch.js";const worker_stack={},inline_supported="undefined"!=typeof Blob&&"undefined"!=typeof URL&&URL.createObjectURL;export default function init(a,b,c,d,e){let f=a;const g=inline_supported?URL.createObjectURL(new Blob([(RELEASE?"":"var RELEASE = '"+RELEASE+"';var DEBUG = false;var PROFILER = false;var SUPPORT_PRESET = true;var SUPPORT_SUGGESTION = true;var SUPPORT_ENCODER = true;var SUPPORT_CACHE = true;var SUPPORT_ASYNC = true;var SUPPORT_SERIALIZE = true;var SUPPORT_INFO = true;var SUPPORT_DOCUMENT = true;var SUPPORT_WHERE = true;var SUPPORT_PAGINATION = true;var SUPPORT_OPERATOR = true;var SUPPORT_CALLBACK = true;var SUPPORT_WORKER = true;")+"("+c.toString()+")()"],{type:"text/javascript"})):f+(RELEASE?"."+RELEASE:"")+".js";return f+="-"+b,worker_stack[f]||(worker_stack[f]=[]),worker_stack[f][e]=new Worker(g),worker_stack[f][e].onmessage=d,!1,worker_stack[f][e]}function worker_module(){let a,b;self.onmessage=function(c){const d=c.data;if(d)if(d.search){const c=b.search(d.content,d.threshold?{limit:d.limit,threshold:d.threshold,where:d.where}:d.limit);self.postMessage({id:a,content:d.content,limit:d.limit,result:c})}else if(d.add)b.add(d.id,d.content);else if(d.update)b.update(d.id,d.content);else if(d.remove)b.remove(d.id);else if(d.clear)b.clear();else if(d.info){const c=b.info();c.worker=a,console.log(c)}else d.register&&(a=d.id,d.options.cache=!1,d.options.async=!1,d.options.worker=!1,b=new Function(d.register.substring(d.register.indexOf("{")+1,d.register.lastIndexOf("}")))(),b=new b(d.options))}}export function addWorker(a,b,c,d){const e=init("flexsearch","id"+a,worker_module,function(a){const b=a.data;b&&b.result&&d(b.id,b.content,b.result,b.limit,b.where,b.cursor,b.suggest)},b),f=FlexSearch.toString();return c.id=b,e.postMessage({register:f,options:c,id:b}),e}FlexSearch.prototype.worker_handler=function(a,b,c,d){return this._task_completed!==this.worker&&(this._task_result=this._task_result.concat(c),this._task_completed++,d&&this._task_result.length>=d&&(this._task_completed=this.worker),this._task_completed===this.worker&&(this.cache&&this._cache.set(b,this._task_result),this._current_callback&&this._current_callback(this._task_result))),this};

View File

@@ -1,34 +1,34 @@
## Documentation 0.7.0 ## Documentation 0.7.0-rev2
### Language Handler ### Language Handler
Handling languages was completely replaced by a more generic approach. All language-specific definitions has excluded and was optimized for maximum dead-code elimination when using compiler/bundler. Each language exists of 6 definitions, which are divided into two groups: Handling languages was completely replaced by a more generic approach. All language-specific definitions has excluded and was optimized for maximum dead-code elimination when using compiler/bundler. Each language exists of 5 definitions, which are divided into two groups:
1. Charset (mandatory) 1. Charset
1. `encode` 1. ___encode___, type: `function(string):string[]`
2. `split` 2. ___rtl___, type: `boolean`
3. `rtl` 2. Language
2. Language (optional) 1. ___matcher___, type: `{string: string}`
1. `stemmer` 2. ___stemmer___, type: `{string: string}`
2. `filter` 3. ___filter___, type: `string[]`
3. `matcher`
Therefore to __fully__ describe a custom language on the fly you need to pass: The charset contains the encoding logic, the language contains stemmer, stopword filter and matchers. Multiple language definitions can use the same charset encoder. Also this separation let you manage different language definitions for special use cases (e.g. names, cities, dialects/slang, etc.).
To fully describe a custom language __on the fly__ you need to pass:
```js ```js
const index = FlexSearch({ const index = FlexSearch({
// mandatory: // mandatory:
encode: (str) => str, encode: (str) => [str],
split: /\W+/,
rtl: false,
// optionally: // optionally:
filter: [], rtl: false,
stemmer: {}, stemmer: {},
matcher: {} matcher: {},
filter: []
}); });
``` ```
When passing no parameter it uses the default `latin` schema. <!-- The field `matcher` includes just application-custom matchers which is not a part of the language pack. --> When passing no parameter it uses the `latin:default` schema by default.
<table> <table>
<tr></tr> <tr></tr>
@@ -40,13 +40,7 @@ When passing no parameter it uses the default `latin` schema. <!-- The field `ma
<tr> <tr>
<td><b>encode</b></td> <td><b>encode</b></td>
<td>charset</td> <td>charset</td>
<td>The encoder function.</td> <td>The encoder function. Has to return an array of separated words (or an empty string).</td>
</tr>
<tr></tr>
<tr>
<td><b>split</b></td>
<td>charset</td>
<td>The expression which splits words.</td>
</tr> </tr>
<tr></tr> <tr></tr>
<tr> <tr>
@@ -74,75 +68,87 @@ When passing no parameter it uses the default `latin` schema. <!-- The field `ma
</tr> </tr>
</table> </table>
#### About Tokenizer
In FlexSearch you can't provide your own tokenizer, because it is a direct dependency to the core unit. What in FlexSearch is called "split" is often named the "tokenizer" on other libraries. Of course splitting sentences into words is also a kind of tokenize, but the tokenizer of FlexSearch splits the word itself into chunks (strict, forward, reverse/both, full, ngram).
### 1. Language Packs: ES6 Modules ### 1. Language Packs: ES6 Modules
The goal is to collect language definitions and providing them as built-ins for simple reusing. The folder `/lang/` includes all definitions, also divided by charset and language. Let's take an example on how to make a full qualified initialization of a built-in language: The most simple way to assign charset/language specific encoding via modules is:
```js ```js
import { encode, split, rtl } from "./dist/module/lang/latin/index.js"; import charset from "./dist/module/lang/latin/soundex.js";
import lang from "./dist/module/lang/en.js";
const index = FlexSearch({
charset: charset,
lang: lang
});
```
Just import the __default export__ by each module and assign them accordingly.
The full qualified example from above is:
```js
import { encode, rtl, tokenize } from "./dist/module/lang/latin/soundex.js";
import { stemmer, filter, matcher } from "./dist/module/lang/en.js"; import { stemmer, filter, matcher } from "./dist/module/lang/en.js";
const index = FlexSearch({ const index = FlexSearch({
// charset:
encode: encode, encode: encode,
split: split, // assign forced tokenizer first:
tokenize: tokenize || "forward",
rtl: rtl, rtl: rtl,
// language:
filter: filter,
stemmer: stemmer, stemmer: stemmer,
matcher: matcher matcher: matcher,
filter: filter
}); });
``` ```
The example above is the standard interface which is at least exported from each charset/language. The example above is the standard interface which is at least exported from each charset/language.
When passing nothing to the initializer: __Note:__ Some of the encoder variants limit the use of built-in tokenizer (e.g. soundex). To be save prioritize the forced tokenizer and fall back to your choice, e.g. `tokenize || "forward"`.
```js
const index = FlexSearch();
```
it uses the default `latin` schema by default, pretty much the same like:
```js
import { encode, split } from "./dist/module/lang/latin/index.js";
const index = FlexSearch({
encode: encode,
split: split
});
```
#### Encoder Variants #### Encoder Variants
You remember the old encoding variants like `simple`, `advanced`, `extra`, or `balanced`? These are also supported and provides you several variants of encoding (which has different performance and results). You remember the encoding variants like `simple`, `advanced`, `extra`, or `balanced`? These are also supported and provides you several variants of encoding (which differs in performance and degree of normalization).
It is pretty straight forward when using a encoder variant: It is pretty straight forward when using a encoder variant:
```js ```js
import { advanced, extra, split } from "./dist/module/lang/latin/index.js"; import advanced from "./dist/module/lang/latin/advanced.js";
import { encode } from "./dist/module/lang/latin/extra.js";
const index_advanced = FlexSearch({ const index_advanced = FlexSearch({
encode: advanced, // inherit all definitions:
split: split charset: advanced
}); });
const index_extra = FlexSearch({ const index_extra = FlexSearch({
encode: extra, // just inherit the encoder:
split: split encode: encode
}); });
``` ```
#### Available Latin Encoders
1. default
2. simple
3. advanced
4. extra
5. balance
6. soundex
You can assign a charset by passing the charset during initialization, e.g. `charset: "latin"` for the default charset encoder or `charset: "latin:soundex"` for a encoder variant.
#### Dialect / Slang #### Dialect / Slang
Language definitions (especially matchers) also could be used to normalize dialect and slang of a specific language. Language definitions (especially matchers) also could be used to normalize dialect and slang of a specific language.
### 2. Language Packs: ES5 Modules ### 2. Language Packs: ES5 Modules
You need to make the charset and/or language definitions available:
1. All charset definitions are included in the `flexsearch.min.js` build by default, but no language-specific definitions are included
2. You can load packages located in `/dist/lang/` (files refers to languages, folders are charsets)
3. You can make a custom build
When loading language packs, make sure that the library was loaded before: When loading language packs, make sure that the library was loaded before:
```html ```html
@@ -151,30 +157,42 @@ When loading language packs, make sure that the library was loaded before:
<script src="dist/lang/en.min.js"></script> <script src="dist/lang/en.min.js"></script>
``` ```
Because you loading packs as external packages (non-ES6-modules) you have to initialize them this way: Because you loading packs as external packages (non-ES6-modules) you have to initialize them by shortcuts:
```js ```js
var index = FlexSearch({ const index = FlexSearch({
// charset: charset: "latin:soundex",
encode: "latin",
split: "latin",
rtl: "latin",
// language:
filter: "en",
stemmer: "en",
matcher: "en"
});
```
Or a shortcut for all charset and language specific settings, e.g. same from above as:
```js
var index = FlexSearch({
charset: "latin",
lang: "en" lang: "en"
}); });
``` ```
> Use the `charset:variant` notation to assign charset and its variants. When just passing the charset without a variant will automatically resolve as `charset:default`.
The example above is a shortcut for:
```js
const index = FlexSearch({
encode: "latin:soundex",
tokenize: "latin:soundex",
rtl: "latin:soundex",
stemmer: "en",
matcher: "en",
filter: "en"
});
```
You can also override existing definitions, e.g.:
```js
const index = FlexSearch({
charset: "latin",
lang: "en",
matcher: {}
});
```
Passed definitions will __not__ extend default definitions, they will replace them. When you like to extend a definition just create a new language file and put in all the content.
#### Encoder Variants #### Encoder Variants
It is pretty straight forward when using an encoder variant: It is pretty straight forward when using an encoder variant:
@@ -188,27 +206,53 @@ It is pretty straight forward when using an encoder variant:
```js ```js
const index_advanced = FlexSearch({ const index_advanced = FlexSearch({
encode: "latin:advanced", encode: "latin:advanced"
split: "latin"
}); });
const index_extra = FlexSearch({ const index_extra = FlexSearch({
encode: "latin:extra", encode: "latin:extra"
split: "latin"
}); });
``` ```
But here we use the `charset:variant` notation to define charset and its variants. Just using "latin" as the encoder implicitly will resolved as `latin:default` under the hood. Again use the `charset:variant` notation to define charset and its variants.
### Partial Tokenizer
In FlexSearch you can't provide your own partial tokenizer, because it is a direct dependency to the core unit. The built-in tokenizer of FlexSearch splits each word into chunks by different patterns:
1. strict (supports contextual index)
2. forward
3. reverse / both
4. full
5. ngram (supports contextual index, coming soon)
### Language Processing Pipeline ### Language Processing Pipeline
This is the default pipeline provided by FlexSearch: This is the default pipeline provided by FlexSearch:
<p> <p>
<img src="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.7.0/doc/pipeline.svg"> <img src="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@45d02844dd65a43b0c46633c509762ae0446bb97/doc/pipeline.svg?2">
</p> </p>
You can specify your own pipeline or extend it in the upcoming release. #### Custom Pipeline
At first take a look into the default pipeline in `src/common.js`. It is very simple and straight forward. The pipeline will process as some sort of inversion of control, the final encoder implementation has to handle charset and also language specific transformations. This workaround has left over from many tests.
Inject the default pipeline by e.g.:
```js
this.pipeline(
/* string: */ str.toLowerCase(),
/* normalize: */ false,
/* split: */ split,
/* collapse: */ false
);
```
Use the pipeline schema from above to understand the iteration and the difference of pre-encoding and post-encoding. Stemmer and matchers needs to be applied after charset normalization but before language transformations, filters also.
Here is a good example of extending pipelines: `src/lang/latin/extra.js``src/lang/latin/advanced.js``src/lang/latin/simple.js`.
### How to contribute? ### How to contribute?
@@ -216,14 +260,12 @@ Search for your language in `src/lang/`, if it exists you can extend or provide
A new charset should provide at least: A new charset should provide at least:
1. `encode` A function which normalize the charset (remove special chars, etc.) 1. `encode` A function which normalize the charset of a passed text content (remove special chars, lingual transformations, etc.) and __returns an array of separated words__. Also stemmer, matcher or stopword filter needs to be applied here. When the language has no words make sure to provide something similar, e.g. each chinese sign could also be a "word". Don't return the whole text content without split.
2. `split` A regular expression or a function which splits a sentence into words (or similar when language has no word breaks)
3. `rtl` A boolean flag which indicates right-to-left encoding 3. `rtl` A boolean flag which indicates right-to-left encoding
Basically the charset file looks something like: Basically the charset needs just to provide an encoder function along with an indicator for right-to-left encoding:
```js ```js
export function encode(str){ return str } export function encode(str){ return [str] }
export const split = /[\W_]+/;
export const rtl = false; export const rtl = false;
``` ```

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -27,17 +27,17 @@
"url": "https://github.com/nextapps-de/flexsearch.git" "url": "https://github.com/nextapps-de/flexsearch.git"
}, },
"scripts": { "scripts": {
"build": "node task/build RELEASE=min DEBUG=false PROFILER=false USE_POLYFILL=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true", "build": "node task/build RELEASE=min DEBUG=false PROFILER=false POLYFILL=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_LANG=false SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true",
"build:debug": "node task/build RELEASE=debug DEBUG=true PROFILER=false USE_POLYFILL=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true", "build:debug": "node task/build RELEASE=debug DEBUG=true PROFILER=false POLYFILL=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_LANG=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true",
"build:compact": "node task/build RELEASE=compact DEBUG=false PROFILER=false USE_POLYFILL=true SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=false SUPPORT_PAGINATION=false", "build:compact": "node task/build RELEASE=compact DEBUG=false PROFILER=false POLYFILL=true SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_LANG=false SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=false SUPPORT_PAGINATION=false",
"build:light": "node task/build RELEASE=light DEBUG=false PROFILER=false USE_POLYFILL=true SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_PRESET=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_DOCUMENT=false SUPPORT_OPERATOR=false SUPPORT_WHERE=false SUPPORT_PAGINATION=false", "build:light": "node task/build RELEASE=light DEBUG=false PROFILER=false POLYFILL=true SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_LANG=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_PRESET=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_DOCUMENT=false SUPPORT_OPERATOR=false SUPPORT_WHERE=false SUPPORT_PAGINATION=false",
"build:custom": "node task/build RELEASE=custom DEBUG=false PROFILER=false USE_POLYFILL=false SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_PRESET=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_DOCUMENT=false SUPPORT_OPERATOR=false SUPPORT_WHERE=false SUPPORT_PAGINATION=false", "build:custom": "node task/build RELEASE=custom DEBUG=false PROFILER=false POLYFILL=false SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_LANG=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_PRESET=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_INFO=false SUPPORT_DOCUMENT=false SUPPORT_OPERATOR=false SUPPORT_WHERE=false SUPPORT_PAGINATION=false",
"build:es5": "node task/build RELEASE=es5 DEBUG=true PROFILER=false USE_POLYFILL=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true LANGUAGE_OUT=ECMASCRIPT5_STRICT", "build:es5": "node task/build RELEASE=es5 DEBUG=true PROFILER=false POLYFILL=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_LANG=false SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true LANGUAGE_OUT=ECMASCRIPT5_STRICT",
"build:node": "node task/build RELEASE=node DEBUG=false PROFILER=false USE_POLYFILL=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true", "build:node": "node task/build RELEASE=node DEBUG=false PROFILER=false POLYFILL=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_LANG=false SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true",
"build:pre": "node task/build RELEASE=pre DEBUG=false PROFILER=false USE_POLYFILL=true SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true FORMATTING=PRETTY_PRINT", "build:pre": "node task/build RELEASE=pre DEBUG=false PROFILER=false POLYFILL=true SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_LANG=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_PRESET=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_INFO=true SUPPORT_DOCUMENT=true SUPPORT_OPERATOR=true SUPPORT_WHERE=true SUPPORT_PAGINATION=true FORMATTING=PRETTY_PRINT",
"build:lang": "node task/build RELEASE=lang USE_POLYFILL=false", "build:lang": "node task/build RELEASE=lang POLYFILL=false",
"build:module": "babel src -d dist/module && exit 0", "build:module": "babel src -d dist/module && exit 0",
"build:all": "npm run build && npm run build:light && npm run build:compact && npm run build:es5 && npm run build:node && npm run build:pre && npm run build:debug && npm run build:module", "build:all": "npm run build && npm run build:light && npm run build:compact && npm run build:es5 && npm run build:node && npm run build:pre && npm run build:debug && npm run build:lang && npm run build:module",
"test": "npm run build:pre && cd test && npm install && npm run test", "test": "npm run build:pre && cd test && npm install && npm run test",
"update": "npm install google-closure-compiler@nightly" "update": "npm install google-closure-compiler@nightly"
}, },

View File

@@ -1,10 +1,71 @@
import FlexSearch from "./flexsearch.js"; import { default as FlexSearch, global_charset, global_lang } from "./flexsearch.js";
import charset_latin_advanced from "./lang/latin/advanced.js";
import charset_latin_balance from "./lang/latin/balance.js";
import charset_latin_default from "./lang/latin/default.js";
import charset_latin_extra from "./lang/latin/extra.js";
import charset_latin_simple from "./lang/latin/simple.js";
import charset_latin_soundex from "./lang/latin/soundex.js";
import charset_arabic_default from "./lang/arabic/default.js";
import charset_cjk_default from "./lang/cjk/default.js";
import charset_cyrillic_default from "./lang/cyrillic/default.js";
import lang_de from "./lang/de.js";
import lang_en from "./lang/en.js";
import lang_at from "./lang/at.js";
import lang_us from "./lang/us.js";
import "./export.js"; import "./export.js";
//import { encode as icase } from "./lang/latin/icase.js";
if(SUPPORT_ENCODER){ if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "latin") || (SUPPORT_ENCODER.indexOf("latin:advanced") !== -1)))){
//FlexSearch.Encoder["icase"] = icase; global_charset["latin:advanced"] = charset_latin_advanced;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "latin") || (SUPPORT_ENCODER.indexOf("latin:balance") !== -1)))){
global_charset["latin:balance"] = charset_latin_balance;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "latin") || (SUPPORT_ENCODER.indexOf("latin:default") !== -1)))){
global_charset["latin:default"] = charset_latin_default;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "latin") || (SUPPORT_ENCODER.indexOf("latin:extra") !== -1)))){
global_charset["latin:extra"] = charset_latin_extra;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "latin") || (SUPPORT_ENCODER.indexOf("latin:simple") !== -1)))){
global_charset["latin:simple"] = charset_latin_simple;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "latin") || (SUPPORT_ENCODER.indexOf("latin:soundex") !== -1)))){
global_charset["latin:soundex"] = charset_latin_soundex;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "arabic") || (SUPPORT_ENCODER.indexOf("arabic:default") !== -1)))){
global_charset["arabic:default"] = charset_arabic_default;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "cjk") || (SUPPORT_ENCODER.indexOf("cjk:default") !== -1)))){
global_charset["cjk:default"] = charset_cjk_default;
}
if(SUPPORT_ENCODER === true || (SUPPORT_ENCODER && ((SUPPORT_ENCODER === "cyrillic") || (SUPPORT_ENCODER.indexOf("cyrillic:default") !== -1)))){
global_charset["cyrillic:default"] = charset_cyrillic_default;
}
if(SUPPORT_LANG === true || (SUPPORT_LANG && SUPPORT_LANG.indexOf("de") !== -1)){
global_lang["de"] = lang_de;
}
if(SUPPORT_LANG === true || (SUPPORT_LANG && SUPPORT_LANG.indexOf("en") !== -1)){
global_lang["en"] = lang_en;
}
if(SUPPORT_LANG === true || (SUPPORT_LANG && SUPPORT_LANG.indexOf("at") !== -1)){
global_lang["at"] = lang_at;
}
if(SUPPORT_LANG === true || (SUPPORT_LANG && SUPPORT_LANG.indexOf("us") !== -1)){
global_lang["us"] = lang_us;
} }
(function(){ (function(){

View File

@@ -1,3 +1,5 @@
import FlexSearch from "./flexsearch.js";
/** /**
* @param {*} val * @param {*} val
* @returns {boolean} * @returns {boolean}
@@ -60,7 +62,7 @@ export function get_keys(obj){
/** /**
* https://jsperf.com/comparison-object-index-type * https://jsperf.com/comparison-object-index-type
* @param {number} count * @param {!number} count
* @returns {Object|Array<Object>} * @returns {Object|Array<Object>}
*/ */
@@ -83,25 +85,23 @@ export function create_object(){
/** /**
* @param {!string} str * @param {!string} str
* @param {RegExp|Array} regexp * @param {Array} regexp
* @returns {string} * @returns {string}
*/ */
export function replace(str, regexp/*, replacement*/){ export function replace(str, regexp){
//if(is_undefined(replacement)){ for(let i = 0, len = regexp.length; i < len; i += 2){
for(let i = 0, len = /** @type {Array} */ (regexp).length; i < len; i += 2){
str = str.replace(regexp[i], regexp[i + 1]); str = str.replace(regexp[i], regexp[i + 1]);
if(!str){
break;
}
} }
return str; return str;
// }
// else{
//
// return str.replace(/** @type {!RegExp} */ (regex), replacement || "");
// }
} }
/** /**
@@ -135,6 +135,112 @@ export function collapse(string){
return final; return final;
} }
// TODO using fast-swap
export function filter(words, map){
const length = words.length;
const filtered = [];
for(let i = 0, count = 0; i < length; i++){
const word = words[i];
if(word && !map[word]){
filtered[count++] = word;
}
}
return filtered;
}
/**
* @param {!string} str
* @param {boolean|Array<string|RegExp>=} normalize
* @param {boolean|string|RegExp=} split
* @param {boolean=} _collapse
* @returns {string|Array<string>}
*/
FlexSearch.prototype.pipeline = function(str, normalize, split, _collapse){
if(str){
if(normalize && str){
str = replace(str, /** @type {Array<string|RegExp>} */ (normalize));
}
if(str && this.matcher){
str = replace(str, this.matcher);
}
if(this.stemmer && str.length > 1){
str = replace(str, this.stemmer);
}
if(_collapse && str.length > 1){
str = collapse(str);
}
if(str){
if(split || (split === "")){
const words = str.split(/** @type {string|RegExp} */ (split));
return this.filter ? filter(words, this.filter) : words;
}
}
}
return str;
};
// export function pipeline(str, normalize, matcher, stemmer, split, _filter, _collapse){
//
// if(str){
//
// if(normalize && str){
//
// str = replace(str, normalize);
// }
//
// if(matcher && str){
//
// str = replace(str, matcher);
// }
//
// if(stemmer && str.length > 1){
//
// str = replace(str, stemmer);
// }
//
// if(_collapse && str.length > 1){
//
// str = collapse(str);
// }
//
// if(str){
//
// if(split !== false){
//
// str = str.split(split);
//
// if(_filter){
//
// str = filter(str, _filter);
// }
// }
// }
// }
//
// return str;
// }
// const chars = {a:1, e:1, i:1, o:1, u:1, y:1}; // const chars = {a:1, e:1, i:1, o:1, u:1, y:1};
// //
// function collapse_repeating_chars(string){ // function collapse_repeating_chars(string){

View File

@@ -8,11 +8,17 @@ const DEBUG = true;
const PROFILER = false; const PROFILER = false;
/** @define {boolean} */ /** @define {boolean} */
const SUPPORT_WORKER = true; const POLYFILL = true;
/** @define {boolean} */ /** @define {boolean} */
const SUPPORT_WORKER = true;
/** @define {boolean|string} */
const SUPPORT_ENCODER = true; const SUPPORT_ENCODER = true;
/** @define {boolean|string} */
const SUPPORT_LANG = true;
/** @define {boolean} */ /** @define {boolean} */
const SUPPORT_CACHE = true; const SUPPORT_CACHE = true;
@@ -45,11 +51,3 @@ const SUPPORT_OPERATOR = true;
/** @define {boolean} */ /** @define {boolean} */
const SUPPORT_CALLBACK = true; const SUPPORT_CALLBACK = true;
/** @define {boolean} */
const USE_POLYFILL = true;
// /** @define {boolean} */
// const SUPPORT_LANG_DE = true;
// /** @define {boolean} */
// const SUPPORT_LANG_EN = true;

View File

@@ -25,9 +25,9 @@ FlexSearch.prototype.export;
/** @export */ /** @export */
FlexSearch.prototype.import; FlexSearch.prototype.import;
/** @export */ /** @export */
FlexSearch.prototype.encode; //FlexSearch.prototype.encode;
/** @export */ /** @export */
FlexSearch.prototype.addMatcher; //FlexSearch.prototype.addMatcher;
/** @export */ /** @export */
Promise.prototype.then; Promise.prototype.then;

View File

@@ -14,7 +14,7 @@ import Cache from "./cache.js";
import Worker from "./worker.js"; import Worker from "./worker.js";
import presets from "./presets.js"; import presets from "./presets.js";
//import { profile_start, profile_end } from "./profiler.js"; //import { profile_start, profile_end } from "./profiler.js";
import { encode as default_encoder, split as default_split } from "./lang/latin/index.js"; import { encode as default_encoder } from "./lang/latin/default.js"; // , split as default_split
import { addWorker } from "./worker.js"; import { addWorker } from "./worker.js";
import { import {
is_undefined, is_undefined,
@@ -25,7 +25,7 @@ import {
get_keys, get_keys,
create_object, create_object,
create_object_array, create_object_array,
replace, //replace,
regex regex
} from "./common.js"; } from "./common.js";
@@ -37,35 +37,31 @@ import {
const defaults = { const defaults = {
encode: default_encoder, "encode": default_encoder,
tokenize: "strict", "tokenize": "strict",
split: default_split, // split: default_split,
// enrich: true, // enrich: true,
// clone: false, // clone: false,
// suggest: false, // suggest: false,
cache: false, "cache": false,
async: false, "async": false,
worker: false, "worker": false,
rtl: false, "rtl": false,
doc: false, "doc": false,
// maximum scoring // maximum scoring
resolution: 9, "resolution": 9,
// minimum scoring // minimum scoring
threshold: 0, "threshold": 0,
// contextual depth // contextual depth
depth: 0 "depth": 0
}; };
let id_counter = 0; let id_counter = 0;
const global_lang = {}; export const global_lang = {};
// const global_rtl = {}; export const global_charset = {};
// const global_filter = {};
// const global_stemmer = {};
// const global_encoder = {};
// const global_split = {};
/** /**
* NOTE: Actually not really required when using bare objects via: Object.create(null) * NOTE: Actually not really required when using bare objects via: Object.create(null)
@@ -141,34 +137,24 @@ export default function FlexSearch(options){
/** /**
* @param {!string} name * @param {!string} name
* @param {function(string):string} encoder * @param {Object} charset
* @param {string|RegExp} split
* @param {boolean} rtl
*/ */
FlexSearch["registerCharset"] = function(name, encoder, split, rtl){ FlexSearch["registerCharset"] = function(name, charset){
const lang = global_lang[name] || (global_lang[name] = {}); global_charset[name] = charset;
lang.encoder = encoder;
lang.split = split;
lang.rtl = rtl;
return FlexSearch; return FlexSearch;
}; };
/** /**
* @param {!string} name * @param {!string} name
* @param {Array<string>} filter * @param {Object} lang
* @param {Object<string, string>} stemmer
* @param {Object<string, Array<string>|string>} matcher
*/ */
FlexSearch["registerLanguage"] = function(name, filter, stemmer, matcher){ FlexSearch["registerLanguage"] = function(name, lang){
const lang = global_lang[name] || (global_lang[name] = {}); global_charset[name] = lang;
lang.filter = filter;
lang.stemmer = stemmer;
lang.matcher = matcher;
return FlexSearch; return FlexSearch;
}; };
@@ -205,7 +191,6 @@ FlexSearch.prototype.init = function(options){
* @private * @private
*/ */
this.matcher = [];
let custom; let custom;
let doc; let doc;
@@ -234,7 +219,7 @@ FlexSearch.prototype.init = function(options){
} }
} }
if(!this.encoder){ if(!this.encode){
if(options){ if(options){
@@ -287,48 +272,44 @@ FlexSearch.prototype.init = function(options){
this.worker = custom; this.worker = custom;
} }
const charset = options["charset"];
const lang = options["lang"];
/** @private */
this.tokenizer = options["tokenize"];
/** @private */
this.split = is_string(custom = charset || options["split"]) ? (global_lang[custom] ? global_lang[custom].split : regex(custom)) : custom;
/** @private */
this.rtl = is_string(custom = charset || options["rtl"]) ? global_lang[custom].rtl : custom;
if(SUPPORT_ASYNC){ if(SUPPORT_ASYNC){
/** @private */ /** @private */
this.async = options["async"]; this.async = options["async"];
/** @private */ /** @private */
this._timer = 0; this.timer = 0;
} }
const charset = options["charset"];
const lang = options["lang"];
/** @private */
this.tokenizer = (is_string(charset) ? global_charset[charset].tokenize : charset && charset.tokenize) || options["tokenize"];
/** @private */
//this.split = is_string(custom = options["split"] || charset) ? (global_charset[custom] ? global_charset[custom].split : regex(custom)) : global_charset.split || custom;
/** @private */
this.rtl = is_string(custom = options["rtl"] || charset) ? global_charset[custom].rtl : charset && charset.rtl || custom;
/** @private */ /** @private */
this.threshold = options["threshold"]; this.threshold = options["threshold"];
/** @private */ /** @private */
this.resolution = ((custom = options["resolution"]) <= this.threshold ? this.threshold + 1 : custom); this.resolution = ((custom = options["resolution"]) <= this.threshold ? this.threshold + 1 : custom);
/** @private */ /** @private */
this.depth = ((this.tokenizer === "strict") && options["depth"]) || 0; this.depth = ((this.tokenizer === "strict") && options["depth"]) || 0;
/** @private */ /** @export */
this.encoder = is_string(custom = charset || options["encode"]) ? global_lang[custom.indexOf(":") === -1 ? custom + ":default" : custom].encode : custom; //is_function(custom = options["encode"]) ? custom : (FlexSearch.Encoder[custom] /*&& global_encoder[custom].bind(global_encoder)*/); this.encode = is_string(custom = options["encode"] || charset) ? global_charset[custom.indexOf(":") === -1 ? custom + ":default" : custom].encode : charset && charset.encode || custom; //is_function(custom = options["encode"]) ? custom : (FlexSearch.Encoder[custom] /*&& global_encoder[custom].bind(global_encoder)*/);
this.matcher = (custom = lang || options["matcher"]) && init_matcher( this.matcher = (custom = options["matcher"] || lang) && init_stemmer_or_matcher(
is_string(custom) ? global_lang[custom].matcher : custom is_string(custom) ? global_lang[custom].matcher : lang && lang.matcher || custom, false
//this.encoder
); );
/** @private */ this.filter = (custom = options["filter"] || lang) && init_filter(
this.filter = (custom = lang || options["filter"]) && init_filter(
is_string(custom) ? global_lang[custom].filter : custom is_string(custom) ? global_lang[custom].filter : lang && lang.filter || custom
//this.encoder
); );
/** @private */ this.stemmer = (custom = options["stemmer"] || lang) && init_stemmer_or_matcher(
this.stemmer = (custom = lang || options["stemmer"]) && init_stemmer(
is_string(custom) ? global_lang[custom].stemmer : custom is_string(custom) ? global_lang[custom].stemmer : lang && lang.stemmer || custom, true
//this.encoder
); );
// TODO: provide boost // TODO: provide boost
@@ -525,27 +506,6 @@ function clone_object(obj){
return clone; return clone;
} }
/**
* @param {!Object<string, string>} custom
*/
function init_matcher(custom){
const keys = get_keys(custom);
const length = keys.length;
const matcher = new Array(length * 2);
for(let i = 0, count = 0; i < length; i++){
const key = keys[i];
matcher[count++] = regex(key);
matcher[count++] = custom[key];
}
return matcher;
}
/** /**
* @param {number|string} id * @param {number|string} id
* @param {string|Function} content * @param {string|Function} content
@@ -649,7 +609,7 @@ FlexSearch.prototype.add = function(id, content, callback, _skip_update, _recall
return this; return this;
} }
const words = this.tokenize(content); const words = content; //this.tokenize(content);
const dupes = create_object(); const dupes = create_object();
dupes["_ctx"] = create_object(); dupes["_ctx"] = create_object();
@@ -1498,7 +1458,7 @@ FlexSearch.prototype.search = function(query, limit, callback, _recall){
return result; return result;
} }
const words = this.tokenize(_query); const words = _query; //this.tokenize(_query);
const length = words.length; const length = words.length;
let found = true; let found = true;
const check = []; const check = [];
@@ -1885,138 +1845,142 @@ function remove_index(map, id){
} }
} }
/** // FlexSearch.prototype.encode = function(value){
* @param {string} value
* @returns {string}
*/
FlexSearch.prototype.encode = function(value){
// if(PROFILER){
// //
// profile_start("encode"); // // if(PROFILER){
// } // //
// // profile_start("encode");
if(value && this.encoder){ // // }
value = this.encoder(value);
}
if(value && this.matcher.length){
value = replace(value, this.matcher);
}
if(value && this.stemmer){
value = replace(value, this.stemmer);
}
// if(PROFILER){
// //
// profile_end("encode"); // // if(value && this.normalize){
// //
// // value = this.normalize(value);
// // }
// //
// // if(value && this.matcher){
// //
// // value = replace(value, this.matcher);
// // }
// //
// // if(value && this.stemmer){
// //
// // value = replace(value, this.stemmer);
// // }
//
// if(value && this.encoder){
//
// value = this.encoder(value);
// } // }
//
// // if(value && this.split){
// //
// // value = value.split(this.split);
// // }
// //
// // if(this.filter){
// //
// // value = filter_words(value, this.filter);
// // }
//
// // if(PROFILER){
// //
// // profile_end("encode");
// // }
//
// return value;
// };
return value; // FlexSearch.prototype.tokenize = function(content){
}; //
// let words = (
/** //
* @param {string} content // this.split ?
* @returns {Array<string>} //
*/ // content.split(this.split)
FlexSearch.prototype.tokenize = function(content){
let words = (
is_array(content) ?
content
:(
is_function(this.tokenizer) ?
this.tokenizer(content)
:(
//SUPPORT_ENCODER && (tokenizer === "ngram") ?
/** @type {!Array<string>} */
//(ngram(/** @type {!string} */(content)))
// : // :
/** @type {!string} */ // content
(content).split(this.split) // );
) //
) // if(this.filter){
); //
// words = filter_words(words, this.filter);
if(this.filter){ // }
//
words = filter_words(words, this.filter); // return words;
} // };
return words;
};
// TODO using fast-swap // TODO using fast-swap
function filter_words(words, fn_or_map){ // function filter_words(words, fn_or_map){
//
const length = words.length; // const length = words.length;
const has_function = is_function(fn_or_map); // const filtered = [];
const filtered = []; //
// for(let i = 0, count = 0; i < length; i++){
for(let i = 0, count = 0; i < length; i++){ //
// const word = words[i];
const word = words[i]; //
// if(word){
if(word){ //
// if(!fn_or_map[word]){
if((has_function && fn_or_map(word)) || //
(!has_function && !fn_or_map[word])){ // filtered[count++] = word;
// }
filtered[count++] = word; // }
} // }
} //
} // return filtered;
// }
return filtered;
}
/** /**
* @param {Array<string>} words * @param {Array<string>} words
* @returns {Object<string, string>} * @returns {Object<string, string>}
*/ */
function init_filter(words){ // , encoder function init_filter(words){
const final = create_object(); const final = create_object();
for(let i = 0; i < words.length; i++){ for(let i = 0, length = words.length; i < length; i++){
const word = /*encoder ? encoder(words[i]) :*/ words[i]; final[words[i]] = 1;
final[word] = 1; // String.fromCharCode((65000 - words.length) + i); // mask filtered words?
} }
return final; return final;
} }
/** /**
* @param {!Object<string, string>} stem * @param {!Object<string, string>} obj
* @param {boolean} is_stemmer
* @returns {Array} * @returns {Array}
*/ */
function init_stemmer(stem){ // , encoder function init_stemmer_or_matcher(obj, is_stemmer){
const keys = Object.keys(stem); const keys = get_keys(obj);
const length = keys.length; const length = keys.length;
const final = new Array(length * 2); const final = [];
for(let i = 0, count = 0; i < length; i++){ let removal = "", count = 0;
for(let i = 0, tmp; i < length; i++){
const key = keys[i]; const key = keys[i];
//const tmp = encoder ? encoder(key) : key;
final[count++] = regex(key + "(?!\\b)" + key + "(\\b)"); //regex(key + "($|\\W)"); //regex("(?=.{" + tmp.length + ",})" + tmp + "$"), if((tmp = obj[key])){
final[count++] = stem[key]; // encoder(stem[key])
final[count++] = regex(is_stemmer ? "(?!\\b)" + key + "(\\b)" : key);
final[count++] = tmp;
}
else{
removal += (removal ? "|" : "") + key;
}
}
if(removal){
final[count++] = regex(is_stemmer ? "(?!\\b)(" + removal + ")(\\b)" : "(" + removal + ")");
final[count] = "";
} }
return final; return final;

View File

@@ -1,7 +0,0 @@
export function encode(str){
return str.toLowerCase();
}
export const split = "";
export const rtl = true;

View File

@@ -0,0 +1,25 @@
import FlexSearch from "../../flexsearch.js";
export const rtl = true;
export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
const split = /[\W_]+/;
/**
* @this FlexSearch
*/
export function encode(str){
return this.pipeline(
/* string: */ str,
/* normalize: */ false,
/* split: */ split,
/* collapse: */ false
);
}

View File

@@ -163,3 +163,10 @@ export const stemmer = {
}; };
export const matcher = {}; export const matcher = {};
export default {
filter: filter,
stemmer: stemmer,
matcher: matcher
}

26
src/lang/cjk/default.js Normal file
View File

@@ -0,0 +1,26 @@
import FlexSearch from "../../flexsearch.js";
export const rtl = false;
export const tokenize = "strict";
export default {
encode: encode,
rtl: rtl,
tokenize: tokenize
}
const regex = /[\x00-\x7F]/g;
/**
* @this FlexSearch
*/
export function encode(str){
return this.pipeline(
/* string: */ str.replace(regex, ""),
/* normalize: */ false,
/* split: */ "",
/* collapse: */ false
);
}

View File

@@ -1,7 +0,0 @@
export function encode(str){
return str.toLowerCase();
}
export const split = "";
export const rtl = false;

View File

@@ -0,0 +1,25 @@
import FlexSearch from "../../flexsearch.js";
export const rtl = false;
export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
const split = /[\W_]+/;
/**
* @this FlexSearch
*/
export function encode(str){
return this.pipeline(
/* string: */ str,
/* normalize: */ false,
/* split: */ split,
/* collapse: */ false
);
}

View File

@@ -1,7 +0,0 @@
export function encode(str){
return str.toLowerCase();
}
export const split = "";
export const rtl = false;

View File

@@ -176,3 +176,10 @@ export const stemmer = {
*/ */
export const matcher = {}; export const matcher = {};
export default {
filter: filter,
stemmer: stemmer,
matcher: matcher
}

View File

@@ -267,3 +267,10 @@ export const stemmer = {
}; };
export const matcher = {}; export const matcher = {};
export default {
filter: filter,
stemmer: stemmer,
matcher: matcher
}

View File

@@ -1,5 +1,13 @@
import FlexSearch from "../../flexsearch.js";
import { regex, replace, collapse } from "../../common.js"; import { regex, replace, collapse } from "../../common.js";
import encoder_simple from "./simple.js"; import { encode as encode_simple } from "./simple.js";
export const rtl = false;
export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
// Phonetic Normalization // Phonetic Normalization
@@ -43,30 +51,30 @@ const pairs = [
regex_uo, "u" regex_uo, "u"
]; ];
export default function(string, _skip_post_processing){ export function encode(str, _skip_postprocessing){
if(!string){ if(str){
return string; str = encode_simple(str, /** @type {FlexSearch} */ (this)).join(" ");
if(str.length > 2){
str = replace(str, pairs);
} }
// perform simple encoding if(!_skip_postprocessing){
string = encoder_simple(string);
// normalize special pairs if(str.length > 1){
if(string.length > 2){
string = replace(string, pairs); str = collapse(str);
} }
if(!_skip_post_processing){ if(str){
// delete all repeating chars str = str.split(" ");
if(string.length > 1){ }
string = collapse(string);
} }
} }
return string; return str;
} }

View File

@@ -1,19 +1,31 @@
import { regex, replace, collapse } from "../../common.js"; import FlexSearch from "../../flexsearch.js";
const regex_whitespace = regex("[\\W_]+"), export const rtl = false;
regex_strip = regex("[^a-z0-9 ]"); export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
const regex_whitespace = /[\W_]+/g;
const regex_strip = /[^a-z0-9 ]/g;
const pairs = [ const pairs = [
regex_whitespace, " ", regex_whitespace, " ",
regex_strip, "" regex_strip, ""
]; ];
export default function(str){ /**
* @this FlexSearch
*/
if(!str){ export function encode(str){
return str; return this.pipeline(
}
/* string: */ str.toLowerCase(),
return collapse(replace(str.toLowerCase(), pairs)); /* normalize: */ pairs,
/* split: */ " ",
/* collapse: */ false
);
} }

25
src/lang/latin/default.js Normal file
View File

@@ -0,0 +1,25 @@
import FlexSearch from "../../flexsearch.js";
export const rtl = false;
export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
const split = /[\W_]+/;
/**
* @this FlexSearch
*/
export function encode(str){
return this.pipeline(
/* string: */ str.toLowerCase(),
/* normalize: */ false,
/* split: */ split,
/* collapse: */ false
);
}

View File

@@ -1,17 +1,25 @@
import { regex, replace, collapse } from "../../common.js"; import { regex, replace, collapse } from "../../common.js";
import encoder_advanced from "./advanced.js"; import { encode as encode_advanced } from "./advanced.js";
export const rtl = false;
export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
// Soundex Normalization // Soundex Normalization
const soundex_b = regex("p"), const prefix = "(?!\\b)";
soundex_s = regex("z"), const soundex_b = regex(prefix + "p"),
soundex_k = regex("[cgq]"), soundex_s = regex(prefix + "z"),
soundex_m = regex("n"), soundex_k = regex(prefix + "[cgq]"),
soundex_t = regex("d"), soundex_m = regex(prefix + "n"),
soundex_f = regex("[vw]"), soundex_t = regex(prefix + "d"),
regex_vowel = regex("[aeiouy]"); soundex_f = regex(prefix + "[vw]"),
regex_vowel = regex(prefix + "[aeiouy]");
const regex_pairs_extra = [ const pairs = [
soundex_b, "b", soundex_b, "b",
soundex_s, "s", soundex_s, "s",
@@ -22,33 +30,27 @@ const regex_pairs_extra = [
regex_vowel, "" regex_vowel, ""
]; ];
export default function(str){ export function encode(str){
if(!str){ if(str){
return str; str = encode_advanced(str, /* skip post-processing: */ true);
}
str = encoder_advanced(str, /* skip post processing? */ true);
if(str.length > 1){ if(str.length > 1){
str = str.split(" "); str = replace(str, pairs);
for(let i = 0; i < str.length; i++){
const current = str[i];
if(current.length > 1){
// keep first char
str[i] = current[0] + replace(current.substring(1), regex_pairs_extra);
}
} }
str = str.join(" "); if(str.length > 1){
str = collapse(str); str = collapse(str);
} }
if(str){
str = str.split(" ");
}
}
return str; return str;
} }

View File

@@ -1,17 +0,0 @@
import encoder_advanced from "./advanced.js";
import encoder_balance from "./balance.js";
import encoder_extra from "./extra.js";
import encoder_simple from "./simple.js";
export function encode(str){
return str.toLowerCase();
}
export const split = /[\W_]+/;
export const rtl = false;
export const advanced = encoder_advanced;
export const balance = encoder_balance;
export const extra = encoder_extra;
export const simple = encoder_simple;

View File

@@ -1,4 +1,12 @@
import { regex, replace } from "../../common.js"; import FlexSearch from "../../flexsearch.js";
import { regex } from "../../common.js";
export const rtl = false;
export const tokenize = "";
export default {
encode: encode,
rtl: rtl
}
// Charset Normalization // Charset Normalization
@@ -15,7 +23,7 @@ const regex_whitespace = regex("[\\W_]+"),
regex_s = regex("ß"), regex_s = regex("ß"),
regex_and = regex(" & "); regex_and = regex(" & ");
const regex_pairs_simple = [ const pairs = [
regex_a, "a", regex_a, "a",
regex_e, "e", regex_e, "e",
@@ -31,12 +39,20 @@ const regex_pairs_simple = [
regex_strip, "" regex_strip, ""
]; ];
export default function(str){ /**
* @param {string} str
* @param {FlexSearch} self
*/
if(!str){ export function encode(str, self){
return str; self || (self = this);
}
return self.pipeline(
return replace(str.toLowerCase(), regex_pairs_simple);
/* string: */ str.toLowerCase(),
/* normalize: */ pairs,
/* split: */ " ",
/* collapse: */ false
);
} }

View File

@@ -1,34 +1,45 @@
// https://www.rosettacode.org/wiki/Soundex import FlexSearch from "../../flexsearch.js";
import { regex, replace } from "../../common.js"; export const rtl = false;
export const tokenize = "strict";
export default {
encode: encode,
rtl: rtl,
tokenize: tokenize
}
const regex_whitespace = regex("[\\W_]+"), const regex_whitespace = /[\W_]+/g;
regex_strip = regex("[^A-Z0-9 ]"); const regex_strip = /[^a-z ]/g;
const pairs = [ const pairs = [
regex_whitespace, " ", regex_whitespace, " ",
regex_strip, "" regex_strip, ""
]; ];
export default function(str){ /**
* @this FlexSearch
*/
if(!str){ export function encode(str){
return str; str = this.pipeline(
}
str = replace(str.toUpperCase(), pairs); /* string: */ str.toLowerCase(),
/* normalize: */ pairs,
/* split: */ false,
/* collapse: */ false
);
if(!str){ const result = [];
return str; if(str){
}
const words = str.split(" "); const words = str.split(" ");
const length = words.length;
for(let x = 0; x < words.length; x++){ for(let x = 0, count = 0; x < length; x++){
if((str = words[x])){ if((str = words[x]) && (!this.filter || !this.filter[str])){
let code = str[0]; let code = str[0];
let previous = getCode(code); let previous = getCode(code);
@@ -49,40 +60,43 @@ export default function(str){
} }
} }
words[x] = (code + "0000").substring(0, 4); result[count++] = (code + "0000").substring(0, 4);
}
} }
} }
return words; return result;
} }
// https://www.rosettacode.org/wiki/Soundex
function getCode(char){ function getCode(char){
switch(char){ switch(char){
case 'B': case 'b':
case 'F': case 'f':
case 'P': case 'p':
case 'V': case 'v':
return 1; return 1;
case 'C': case 'c':
case 'G': case 'g':
case 'J': case 'j':
case 'K': case 'k':
case 'Q': case 'q':
case 'S': case 's':
case 'X': case 'x':
case 'Z': case 'z':
return 2; return 2;
case 'D': case 'd':
case 'T': case 't':
return 3; return 3;
case 'L': case 'l':
return 4; return 4;
case 'M': case 'm':
case 'N': case 'n':
return 5; return 5;
case 'R': case 'r':
return 6; return 6;
} }

View File

@@ -267,3 +267,10 @@ export const stemmer = {
}; };
export const matcher = {}; export const matcher = {};
export default {
filter: filter,
stemmer: stemmer,
matcher: matcher
}

View File

@@ -1,4 +1,4 @@
if(USE_POLYFILL){ if(POLYFILL){
Object.assign || (Object.assign = function(){ Object.assign || (Object.assign = function(){

View File

@@ -18,10 +18,10 @@ var supported_lang = [
var supported_charset = { var supported_charset = {
'latin': ["encode", "advanced", "balance", "extra", "simple", "soundex"], 'latin': ["default", "advanced", "balance", "extra", "simple", "soundex"],
'cjk': ["encode"], 'cjk': ["default"],
'cyrillic': ["encode"], 'cyrillic': ["default"],
'arabian': ["encode"], 'arabic': ["default"],
}; };
let flag_str = ""; let flag_str = "";
@@ -55,12 +55,6 @@ var options = (function(argv){
compilation_level = val; compilation_level = val;
} }
/*
else if(index === "USE_POLYFILL"){
use_polyfill = val;
}
*/
else{ else{
if(index !== "RELEASE"){ if(index !== "RELEASE"){
@@ -176,8 +170,8 @@ if(release === "lang"){
(function(lang){ (function(lang){
fs.writeFileSync("tmp/" + lang + ".js", ` fs.writeFileSync("tmp/" + lang + ".js", `
import { filter, stemmer, matcher } from "../src/lang/${lang}.js"; import lang from "../src/lang/${lang}.js";
window["FlexSearch"]["registerLanguage"]("${lang}", filter, stemmer, matcher); window["FlexSearch"]["registerLanguage"]("${lang}", lang);
`); `);
exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + lang + ".js' --js='tmp/" + lang + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + lang + ".min.js' && exit 0", function(){ exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + lang + ".js' --js='tmp/" + lang + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + lang + ".min.js' && exit 0", function(){
@@ -198,13 +192,13 @@ if(release === "lang"){
(function(charset, variant){ (function(charset, variant){
fs.writeFileSync("tmp/" + charset + "_" + variant + ".js", ` fs.writeFileSync("tmp/" + charset + "_" + variant + ".js", `
import { split, ${variant} } from "../src/lang/${charset}/index.js"; import charset from "../src/lang/${charset}/${variant}.js";
window["FlexSearch"]["registerCharset"]("${charset}:${(variant === "encode" ? "default" : variant)}", ${variant}, split); window["FlexSearch"]["registerCharset"]("${charset}:${variant}", charset);
`); `);
exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + charset + "_" + variant + ".js' --js='tmp/" + charset + "_" + variant + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + charset + "/" + (variant === "encode" ? "default" : variant) + ".min.js' && exit 0", function(){ exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + charset + "_" + variant + ".js' --js='tmp/" + charset + "_" + variant + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + charset + "/" + variant + ".min.js' && exit 0", function(){
console.log("Build Complete: " + charset + "/" + (variant === "encode" ? "default" : variant) + ".min.js"); console.log("Build Complete: " + charset + "/" + variant + ".min.js");
next(x, y, ++z); next(x, y, ++z);
}); });