mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-09-02 02:12:46 +02:00
v0.3.21 FIX whitespace regex split
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
FlexSearch v0.3.2
|
||||
FlexSearch v0.3.21
|
||||
Copyright 2019 Nextapps GmbH
|
||||
Author: Thomas Wilkerling
|
||||
Released under the Apache 2.0 Licence
|
||||
@@ -11,7 +11,7 @@ a[l];"a"===n||"e"===n||"i"===n||"o"===n||"u"===n||"y"===n?d++:f++;" "!==n&&(c+=n
|
||||
function O(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function P(a,b){a=a.length-b.length;return 0>a?-1:a?1:0}function Q(a,b,d){let c=[],e=[];const l=a.length;if(1<l){a.sort(P);const f={};let n=a[0],g=n.length,h=0;for(;h<g;)f[n[h++]]=1;let p,q=0,m=0;for(;++m<l;){let F=!1;const R=m===l-1;e=[];n=a[m];g=n.length;for(h=0;h<g;)if(p=n[h++],f[p]){var k=f[p];if(k===m){if(R){if(c[q++]=p,b&&q===b)return c}else f[p]=m+1;F=!0}else d&&(k=e[k]||(e[k]=[]),k[k.length]=p)}if(!F&&!d)break}if(d&&(q=c.length,(m=e.length)&&
|
||||
(!b||q<b)))for(;m--;)if(p=e[m])for(let a=0,d=p.length;a<d;a++)if(c[q++]=p[a],b&&q===b)return c}else l&&(c=a[0],b&&c.length>b&&(c=c.slice(0,b)));return c}function w(a){return"string"===typeof a}function x(a){return"function"===typeof a}function y(a){return"undefined"===typeof a}function C(a){a.l||(a.l=H(function(){a.l=0;{const b=a.async;let d;b&&(a.async=!1);if(a.c.length){const b=Date.now();let c;for(;(c=a.c.shift())||0===c;){d=a.f[c];switch(d[0]){case z.add:a.add(d[1],d[2]);break;case z.remove:a.remove(d[1])}delete a.f[c];
|
||||
if(100<Date.now()-b)break}a.c.length&&C(a)}b&&(a.async=b)}},1,"search-async-"+a.id))}function I(a){const b=Array(a);for(let d=0;d<a;d++)b[d]={};return b}const t={encode:"icase",a:"forward",m:!1,cache:!1,async:!1,o:!1,threshold:0,depth:0},E={memory:{encode:"extra",a:"strict",threshold:7},speed:{encode:"icase",a:"strict",threshold:7,depth:2},match:{encode:"extra",a:"full"},score:{encode:"extra",a:"strict",threshold:5,depth:4},balance:{encode:"balance",a:"strict",threshold:6,depth:3},fastest:{encode:"icase",
|
||||
a:"strict",threshold:9,depth:1}},D=[];let N=0;const z={add:0,update:1,remove:2},J=c("[ -/]"),K={},L={},M=function(){const a=Object.getOwnPropertyNames({}.__proto__),b={};for(let d=0;d<a.length;d++)b[a[d]]=1;return b}();g.create=function(a){return new g(a)};g.registerMatcher=function(a){for(let b in a)a.hasOwnProperty(b)&&D.push(c(b),a[b]);return this};g.registerEncoder=function(a,b){u[a]=b.bind(u);return this};g.registerLanguage=function(a,b){K[a]=b.filter;L[a]=b.stemmer;return this};g.encode=function(a,
|
||||
a:"strict",threshold:9,depth:1}},D=[];let N=0;const z={add:0,update:1,remove:2},J=c("[\\s/-]"),K={},L={},M=function(){const a=Object.getOwnPropertyNames({}.__proto__),b={};for(let d=0;d<a.length;d++)b[a[d]]=1;return b}();g.create=function(a){return new g(a)};g.registerMatcher=function(a){for(let b in a)a.hasOwnProperty(b)&&D.push(c(b),a[b]);return this};g.registerEncoder=function(a,b){u[a]=b.bind(u);return this};g.registerLanguage=function(a,b){K[a]=b.filter;L[a]=b.stemmer;return this};g.encode=function(a,
|
||||
b){return M[a]?b:u[a](b)};g.prototype.init=function(a){this.j=[];a||(a=t);var b=a.profile,d=b?E[b]:{};this.a=a.tokenize||d.a||this.a||t.a;this.async=y(b=a.async)?this.async||t.async:b;this.threshold=y(b=a.threshold)?d.threshold||this.threshold||t.threshold:b;this.depth=y(b=a.depth)?d.depth||this.depth||t.depth:b;this.h=(b=y(b=a.encode)?d.encode:b)&&u[b]&&u[b].bind(u)||(x(b)?b:this.h||!1);(b=a.matcher)&&this.addMatcher(b);if(b=a.filter){b=K[b]||b;d=this.h;var f={};if(b)for(let a=0;a<b.length;a++){const c=
|
||||
d?d(b[a]):b[a];f[c]=String.fromCharCode(65E3-b.length+a)}this.filter=b=f}if(b=a.stemmer){var e;a=L[b]||b;b=this.h;d=[];if(a)for(e in a)a.hasOwnProperty(e)&&(f=b?b(e):e,d.push(c("(?=.{"+(f.length+3)+",})"+f+"$"),b?b(a[e]):a[e]));this.stemmer=e=d}this.i=I(10);this.g={};this.b={};this.f={};this.c=[];this.l=0;return this};g.prototype.encode=function(a){a&&D.length&&(a=h(a,D));a&&this.j.length&&(a=h(a,this.j));a&&this.h&&(a=this.h(a));a&&this.stemmer&&(a=h(a,this.stemmer));return a};g.prototype.addMatcher=
|
||||
function(a){const b=this.j;for(const d in a)a.hasOwnProperty(d)&&b.push(c(d),a[d]);return this};g.prototype.add=function(a,b,d){if(b&&w(b)&&(a&&!M[a]||0===a))if(this.b[a]&&!d)this.update(a,b);else{if(this.async)return this.f[a]||(this.c[this.c.length]=a),this.f[a]=[z.add,a,b],C(this),this;b=this.encode(b);if(!b.length)return this;d=this.a;b=x(d)?d(b):"ngram"===d?G(b):b.split(J);const f={_ctx:{}},h=this.threshold,r=this.depth,p=this.i,q=b.length;for(let m=0;m<q;m++){var c=b[m];if(c){var e=c.length,
|
||||
@@ -19,6 +19,6 @@ l=(q-m)/q,k="";switch(d){case "reverse":case "both":for(var g=e-1;1<=g;g--)k=c[g
|
||||
function(a,b){this.b[a]&&w(b)&&(this.remove(a),this.add(a,b,!0));return this};g.prototype.remove=function(a){if(this.b[a]){if(this.async)return this.f[a]||(this.c[this.c.length]=a),this.f[a]=[z.remove,a],C(this),this;for(let b=0;10>b;b++)A(this.i[b],a);this.depth&&A(this.g,a);delete this.b[a]}return this};g.prototype.search=function(a,b,c,f){let d=a,g,k=[];"object"===typeof a&&((c=a.callback||b)&&(d.callback=null),b=a.limit,g=a.threshold,a=a.query);g||(g=this.threshold||0);x(b)?(c=b,b=1E3):b||0===
|
||||
b||(b=1E3);if(c){{let a=this;H(function(){c(a.search(d,b,null,!0));a=null},1,"search-"+this.id)}}else{if(!f&&this.async&&"function"!==typeof importScripts){let a=this;return new Promise(function(c){c(a.search(d,b,null,!0));a=null})}if(!a||!w(a))return k;d=a;d=this.encode(d);if(!d.length)return k;a=this.a;a=x(a)?a(d):"ngram"===a?G(d):d.split(J);f=a.length;var h=!0,n=[],r={};if(1<f)if(this.depth){var t=!0;var p=a[0];r[p]=1}else a.sort(O);var q;if(!t||(q=this.g)[p])for(let b=t?1:0;b<f;b++){const c=a[b];
|
||||
if(c&&!r[c]){let a=!1;const b=[];let d=0;for(let e=9;e>=g;e--){var m=(t?q[p]:this.i)[e];if(m=m[c])b[d++]=m,a=!0}if(a)n[n.length]=1<d?n.concat.apply([],b):b[0];else{h=!1;break}r[c]=1}p=c}else h=!1;h&&(k=Q(n,b,!1));return k}};g.prototype.clear=function(){this.destroy();return this.init()};g.prototype.destroy=function(){this.filter=this.stemmer=this.i=this.g=this.b=this.f=this.c=null;return this};const u={icase:function(a){return a.toLowerCase()},simple:function(){const a=[c("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),
|
||||
"a",c("[\u00e8\u00e9\u00ea\u00eb]"),"e",c("[\u00ec\u00ed\u00ee\u00ef]"),"i",c("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",c("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",c("[\u00fd\u0177\u00ff]"),"y",c("\u00f1"),"n",c("\u00e7"),"c",c("\u00df"),"s",c(" & ")," and ",c("[-/]")," ",c("[^a-z0-9 ]"),"",c("\\s\\s+")," "];return function(b){b=h(b.toLowerCase(),a);return" "!==b?b:""}}(),advanced:function(){const a=[c("ae"),"a",c("ai"),"ei",c("ay"),"ei",c("ey"),"ei",c("oe"),"o",c("ue"),"u",c("ie"),"i",c("sz"),
|
||||
"s",c("zs"),"s",c("sh"),"s",c("ck"),"k",c("cc"),"k",c("dt"),"t",c("ph"),"f",c("pf"),"f",c("ou"),"o",c("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=h(b,a));c||1<b.length&&(b=B(b));return b}}(),extra:function(){const a=[c("p"),"b",c("z"),"s",c("[cgq]"),"k",c("n"),"m",c("d"),"t",c("[vw]"),"f",c("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+h(d.substring(1),
|
||||
a))}b=b.join(" ");b=B(b)}return b}}(),balance:function(){const a=[c("[-/]")," ",c("[^a-z0-9 ]"),"",c("\\s\\s+")," "];return function(b){return B(h(b.toLowerCase(),a))}}()},H=function(){const a={};return function(b,c,f){const d=a[f];d&&clearTimeout(d);return a[f]=setTimeout(b,c)}}();return g}(!1),this);
|
||||
"a",c("[\u00e8\u00e9\u00ea\u00eb]"),"e",c("[\u00ec\u00ed\u00ee\u00ef]"),"i",c("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",c("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",c("[\u00fd\u0177\u00ff]"),"y",c("\u00f1"),"n",c("\u00e7"),"c",c("\u00df"),"s",c(" & ")," and ",c("[-/]")," ",c("[^a-z0-9 ]"),"",c("\\s+")," "];return function(b){b=h(b.toLowerCase(),a);return" "!==b?b:""}}(),advanced:function(){const a=[c("ae"),"a",c("ai"),"ei",c("ay"),"ei",c("ey"),"ei",c("oe"),"o",c("ue"),"u",c("ie"),"i",c("sz"),"s",
|
||||
c("zs"),"s",c("sh"),"s",c("ck"),"k",c("cc"),"k",c("dt"),"t",c("ph"),"f",c("pf"),"f",c("ou"),"o",c("uo"),"u"];return function(b,c){if(!b)return b;b=this.simple(b);2<b.length&&(b=h(b,a));c||1<b.length&&(b=B(b));return b}}(),extra:function(){const a=[c("p"),"b",c("z"),"s",c("[cgq]"),"k",c("n"),"m",c("d"),"t",c("[vw]"),"f",c("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let c=0;c<b.length;c++){const d=b[c];1<d.length&&(b[c]=d[0]+h(d.substring(1),
|
||||
a))}b=b.join(" ");b=B(b)}return b}}(),balance:function(){const a=[c("[-/]")," ",c("[^a-z0-9 ]"),"",c("\\s+")," "];return function(b){return B(h(b.toLowerCase(),a))}}()},H=function(){const a={};return function(b,c,f){const d=a[f];d&&clearTimeout(d);return a[f]=setTimeout(b,c)}}();return g}(!1),this);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
;/**!
|
||||
* @preserve FlexSearch v0.3.2
|
||||
* @preserve FlexSearch v0.3.21
|
||||
* Copyright 2019 Nextapps GmbH
|
||||
* Author: Thomas Wilkerling
|
||||
* Released under the Apache 2.0 Licence
|
||||
@@ -121,11 +121,12 @@
|
||||
* @const {RegExp}
|
||||
*/
|
||||
|
||||
const regex_split = regex("[ -\/]");
|
||||
const regex_split = regex("[\\s/-]");
|
||||
const filter = {};
|
||||
const stemmer = {};
|
||||
|
||||
/**
|
||||
*
|
||||
* @const {Object<string|number, number>}
|
||||
*/
|
||||
|
||||
@@ -1359,9 +1360,9 @@
|
||||
|
||||
const global_encoder_balance = (function(){
|
||||
|
||||
const regex_whitespace = regex("\\s\\s+"),
|
||||
const regex_whitespace = regex("\\s+"),
|
||||
regex_strip = regex("[^a-z0-9 ]"),
|
||||
regex_space = regex("[-\/]"),
|
||||
regex_space = regex("[-/]"),
|
||||
regex_vowel = regex("[aeiouy]");
|
||||
|
||||
/** @const {Array} */
|
||||
@@ -1406,9 +1407,9 @@
|
||||
|
||||
"simple": (function(){
|
||||
|
||||
const regex_whitespace = regex("\\s\\s+"),
|
||||
const regex_whitespace = regex("\\s+"),
|
||||
regex_strip = regex("[^a-z0-9 ]"),
|
||||
regex_space = regex("[-\/]"),
|
||||
regex_space = regex("[-/]"),
|
||||
regex_a = regex("[àáâãäå]"),
|
||||
regex_e = regex("[èéêë]"),
|
||||
regex_i = regex("[ìíîï]"),
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
FlexSearch v0.3.2
|
||||
FlexSearch v0.3.21
|
||||
Copyright 2019 Nextapps GmbH
|
||||
Author: Thomas Wilkerling
|
||||
Released under the Apache 2.0 Licence
|
||||
@@ -7,11 +7,11 @@
|
||||
*/
|
||||
'use strict';(function(f,t,u){let k;(k=u.define)&&k.amd?k([],function(){return t}):(k=u.modules)?k[f.toLowerCase()]=t:"object"===typeof exports?module.exports=t:u[f]=t})("FlexSearch",function(){function f(a){a||(a=w);this.id=a.id||G++;this.init(a);t(this,"index",function(){return this.a});t(this,"length",function(){return Object.keys(this.a).length})}function t(a,b,c){Object.defineProperty(a,b,{get:c})}function u(a,b){for(let c=0;c<b.length;c+=2)a=a.replace(b[c],b[c+1]);return a}function k(a,b,c,
|
||||
e,d,h,g){if(b[c])return b[c];d=d?(9-(g||6))*h+(g||6)*d:h;b[c]=d;d>=g&&(a=a[d+.5>>0],a=a[c]||(a[c]=[]),a[a.length]=e);return d}function y(a,b){if(a){const c=Object.keys(a);for(let e=0,d=c.length;e<d;e++){const d=c[e],g=a[d];if(g)for(let c=0,e=g.length;c<e;c++)if(g[c]===b){1===e?delete a[d]:g.splice(c,1);break}else"object"===typeof g[c]&&y(g[c],b)}}}function H(a,b){a=a.length-b.length;return 0>a?1:a?-1:0}function I(a,b){a=a.length-b.length;return 0>a?-1:a?1:0}function x(a){return"function"===typeof a}
|
||||
function z(a){return"undefined"===typeof a}function B(a){const b=Array(a);for(let c=0;c<a;c++)b[c]={};return b}const w={encode:"icase",b:"forward",i:!1,cache:!1,async:!1,j:!1,threshold:0,depth:0},A=[];let G=0;const C=/[ -/]/g,D={},E={},F=function(){const a=Object.getOwnPropertyNames({}.__proto__),b={};for(let c=0;c<a.length;c++)b[a[c]]=1;return b}();f.create=function(a){return new f(a)};f.registerMatcher=function(a){for(let b in a)a.hasOwnProperty(b)&&A.push(new RegExp(b,"g"),a[b]);return this};f.registerEncoder=
|
||||
function(a,b){v[a]=b.bind(v);return this};f.registerLanguage=function(a,b){D[a]=b.filter;E[a]=b.stemmer;return this};f.encode=function(a,b){return F[a]?b:v[a](b)};f.prototype.init=function(a){this.h=[];a||(a=w);var b=a.profile,c={};this.b=a.tokenize||c.b||this.b||w.b;this.threshold=z(b=a.threshold)?c.threshold||this.threshold||w.threshold:b;this.depth=z(b=a.depth)?c.depth||this.depth||w.depth:b;this.f=(b=z(b=a.encode)?c.encode:b)&&v[b]&&v[b].bind(v)||(x(b)?b:this.f||!1);(b=a.matcher)&&this.addMatcher(b);
|
||||
if(b=a.filter){b=D[b]||b;c=this.f;var e={};if(b)for(let a=0;a<b.length;a++){const d=c?c(b[a]):b[a];e[d]=String.fromCharCode(65E3-b.length+a)}this.filter=b=e}if(b=a.stemmer){var d;a=E[b]||b;b=this.f;c=[];if(a)for(d in a)a.hasOwnProperty(d)&&(e=b?b(d):d,c.push(new RegExp("(?=.{"+(e.length+3)+",})"+e+"$","g"),b?b(a[d]):a[d]));this.stemmer=d=c}this.g=B(10);this.c={};this.a={};return this};f.prototype.encode=function(a){a&&A.length&&(a=u(a,A));a&&this.h.length&&(a=u(a,this.h));a&&this.f&&(a=this.f(a));
|
||||
a&&this.stemmer&&(a=u(a,this.stemmer));return a};f.prototype.addMatcher=function(a){const b=this.h;for(const c in a)a.hasOwnProperty(c)&&b.push(new RegExp(c,"g"),a[c]);return this};f.prototype.add=function(a,b,c){if(b&&"string"===typeof b&&(a&&!F[a]||0===a))if(this.a[a]&&!c)this.update(a,b);else{b=this.encode(b);if(!b.length)return this;c=this.b;b=x(c)?c(b):b.split(C);const f={_ctx:{}},l=this.threshold,r=this.depth,q=this.g,n=b.length;for(let p=0;p<n;p++){var e=b[p];if(e){var d=e.length,h=(n-p)/n,
|
||||
g="";switch(c){case "reverse":case "both":for(var m=d-1;1<=m;m--)g=e[m]+g,k(q,f,g,a,(d-m)/d,h,l);g="";case "forward":for(m=0;m<d;m++)g+=e[m],k(q,f,g,a,1,h,l);break;case "full":for(m=0;m<d;m++){const b=(d-m)/d;for(let c=d;c>m;c--)g=e.substring(m,c),k(q,f,g,a,b,h,l)}break;default:if(d=k(q,f,e,a,1,h,l),r&&1<n&&d>=l)for(d=f._ctx[e]||(f._ctx[e]={}),e=this.c[e]||(this.c[e]=B(10)),h=p-r,g=p+r+1,0>h&&(h=0),g>n&&(g=n);h<g;h++)h!==p&&k(e,d,b[h],a,0,10-(h<p?p-h:h-p),l)}}}this.a[a]=1}return this};f.prototype.update=
|
||||
function z(a){return"undefined"===typeof a}function B(a){const b=Array(a);for(let c=0;c<a;c++)b[c]={};return b}const w={encode:"icase",b:"forward",i:!1,cache:!1,async:!1,j:!1,threshold:0,depth:0},A=[];let G=0;const C=/[\s/-]/g,D={},E={},F=function(){const a=Object.getOwnPropertyNames({}.__proto__),b={};for(let c=0;c<a.length;c++)b[a[c]]=1;return b}();f.create=function(a){return new f(a)};f.registerMatcher=function(a){for(let b in a)a.hasOwnProperty(b)&&A.push(new RegExp(b,"g"),a[b]);return this};
|
||||
f.registerEncoder=function(a,b){v[a]=b.bind(v);return this};f.registerLanguage=function(a,b){D[a]=b.filter;E[a]=b.stemmer;return this};f.encode=function(a,b){return F[a]?b:v[a](b)};f.prototype.init=function(a){this.h=[];a||(a=w);var b=a.profile,c={};this.b=a.tokenize||c.b||this.b||w.b;this.threshold=z(b=a.threshold)?c.threshold||this.threshold||w.threshold:b;this.depth=z(b=a.depth)?c.depth||this.depth||w.depth:b;this.f=(b=z(b=a.encode)?c.encode:b)&&v[b]&&v[b].bind(v)||(x(b)?b:this.f||!1);(b=a.matcher)&&
|
||||
this.addMatcher(b);if(b=a.filter){b=D[b]||b;c=this.f;var e={};if(b)for(let a=0;a<b.length;a++){const d=c?c(b[a]):b[a];e[d]=String.fromCharCode(65E3-b.length+a)}this.filter=b=e}if(b=a.stemmer){var d;a=E[b]||b;b=this.f;c=[];if(a)for(d in a)a.hasOwnProperty(d)&&(e=b?b(d):d,c.push(new RegExp("(?=.{"+(e.length+3)+",})"+e+"$","g"),b?b(a[d]):a[d]));this.stemmer=d=c}this.g=B(10);this.c={};this.a={};return this};f.prototype.encode=function(a){a&&A.length&&(a=u(a,A));a&&this.h.length&&(a=u(a,this.h));a&&this.f&&
|
||||
(a=this.f(a));a&&this.stemmer&&(a=u(a,this.stemmer));return a};f.prototype.addMatcher=function(a){const b=this.h;for(const c in a)a.hasOwnProperty(c)&&b.push(new RegExp(c,"g"),a[c]);return this};f.prototype.add=function(a,b,c){if(b&&"string"===typeof b&&(a&&!F[a]||0===a))if(this.a[a]&&!c)this.update(a,b);else{b=this.encode(b);if(!b.length)return this;c=this.b;b=x(c)?c(b):b.split(C);const f={_ctx:{}},l=this.threshold,r=this.depth,q=this.g,n=b.length;for(let p=0;p<n;p++){var e=b[p];if(e){var d=e.length,
|
||||
h=(n-p)/n,g="";switch(c){case "reverse":case "both":for(var m=d-1;1<=m;m--)g=e[m]+g,k(q,f,g,a,(d-m)/d,h,l);g="";case "forward":for(m=0;m<d;m++)g+=e[m],k(q,f,g,a,1,h,l);break;case "full":for(m=0;m<d;m++){const b=(d-m)/d;for(let c=d;c>m;c--)g=e.substring(m,c),k(q,f,g,a,b,h,l)}break;default:if(d=k(q,f,e,a,1,h,l),r&&1<n&&d>=l)for(d=f._ctx[e]||(f._ctx[e]={}),e=this.c[e]||(this.c[e]=B(10)),h=p-r,g=p+r+1,0>h&&(h=0),g>n&&(g=n);h<g;h++)h!==p&&k(e,d,b[h],a,0,10-(h<p?p-h:h-p),l)}}}this.a[a]=1}return this};f.prototype.update=
|
||||
function(a,b){this.a[a]&&"string"===typeof b&&(this.remove(a),this.add(a,b,!0));return this};f.prototype.remove=function(a){if(this.a[a]){for(let b=0;10>b;b++)y(this.g[b],a);this.depth&&y(this.c,a);delete this.a[a]}return this};f.prototype.search=function(a,b,c){var e=a,d=[];if("object"===typeof a){b=a.limit;var h=a.threshold;a=a.query}h||(h=this.threshold||0);x(b)?(c=b,b=1E3):b||0===b||(b=1E3);if(c)c(this.search(e,b,null,!0));else{if(!a||"string"!==typeof a)return d;e=this.encode(a);if(!e.length)return d;
|
||||
a=this.b;a=x(a)?a(e):e.split(C);c=a.length;var g=!0;e=[];var f={};if(1<c)if(this.depth){var k=!0;var l=a[0];f[l]=1}else a.sort(H);var r;if(!k||(r=this.c)[l])for(var q=k?1:0;q<c;q++){var n=a[q];if(n&&!f[n]){let a=!1;const b=[];let c=0;for(let d=9;d>=h;d--){var p=(k?r[l]:this.g)[d];if(p=p[n])b[c++]=p,a=!0}if(a)e[e.length]=1<c?e.concat.apply([],b):b[0];else{g=!1;break}f[n]=1}l=n}else g=!1;if(g)a:{h=[];d=e.length;if(1<d){e.sort(I);l={};k=e[0];r=k.length;for(a=0;a<r;)l[k[a++]]=1;for(f=g=0;++f<d;){q=!1;
|
||||
n=f===d-1;k=e[f];r=k.length;for(a=0;a<r;)if(c=k[a++],l[c]&&l[c]===f){if(n){if(h[g++]=c,b&&g===b){d=h;break a}}else l[c]=f+1;q=!0}if(!q)break}}else d&&(h=e[0],b&&h.length>b&&(h=h.slice(0,b)));d=h}return d}};f.prototype.clear=function(){this.destroy();return this.init()};f.prototype.destroy=function(){this.filter=this.stemmer=this.g=this.c=this.a=null;return this};const v={icase:function(a){return a.toLowerCase()}};return f}(!1),this);
|
||||
|
8
flexsearch.min.js
vendored
8
flexsearch.min.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
FlexSearch v0.3.2
|
||||
FlexSearch v0.3.21
|
||||
Copyright 2019 Nextapps GmbH
|
||||
Author: Thomas Wilkerling
|
||||
Released under the Apache 2.0 Licence
|
||||
@@ -13,7 +13,7 @@ u=0;for(;u<h;)l[e[u++]]=1;let n,p=0,m=0;for(;++m<k;){let I=!1;const X=m===k-1;f=
|
||||
typeof a}function y(a){return"undefined"===typeof a}function F(a){a.D||(a.D=K(function(){a.D=0;{const b=a.async;let d;b&&(a.async=!1);if(a.f.length){const b=Date.now();let f;for(;(f=a.f.shift())||0===f;){d=a.g[f];switch(d[0]){case D.add:a.add(d[1],d[2]);break;case D.remove:a.remove(d[1])}delete a.g[f];if(100<Date.now()-b)break}a.f.length&&F(a)}b&&(a.async=b)}},1,"search-async-"+a.id))}function L(a){const b=Array(a);for(let d=0;d<a;d++)b[d]={};return b}function Y(a,b,d,c){a=q("flexsearch","id"+a,function(){let a,
|
||||
b;self.onmessage=function(c){if(c=c.data)if(c.search){const d=b.search(c.content,c.threshold?{limit:c.limit,threshold:c.threshold}:c.limit);self.postMessage({id:a,content:c.content,limit:c.limit,result:d})}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.register&&(a=c.id,c.options.cache=!1,c.options.async=!0,c.options.worker=!1,b=(new Function(c.register.substring(c.register.indexOf("{")+1,c.register.lastIndexOf("}"))))(),b=new b(c.options))}},
|
||||
function(a){(a=a.data)&&a.result&&c(a.id,a.content,a.result,a.limit)},b);const f=Q.toString();d.id=b;a.postMessage(b,{register:f,options:d,id:b});return a}const v={encode:"icase",b:"forward",u:!1,cache:!1,async:!1,c:!1,threshold:0,depth:0},H={memory:{encode:"extra",b:"strict",threshold:7},speed:{encode:"icase",b:"strict",threshold:7,depth:2},match:{encode:"extra",b:"full"},score:{encode:"extra",b:"strict",threshold:5,depth:4},balance:{encode:"balance",b:"strict",threshold:6,depth:3},fastest:{encode:"icase",
|
||||
b:"strict",threshold:9,depth:1}},G=[];let R=0;const D={add:0,update:1,remove:2},M=e("[ -/]"),N={},O={},P=function(){const a=Object.getOwnPropertyNames({}.__proto__),b={};for(let d=0;d<a.length;d++)b[a[d]]=1;return b}();h.create=function(a){return new h(a)};h.registerMatcher=function(a){for(let b in a)a.hasOwnProperty(b)&&G.push(e(b),a[b]);return this};h.registerEncoder=function(a,b){A[a]=b.bind(A);return this};h.registerLanguage=function(a,b){N[a]=b.filter;O[a]=b.stemmer;return this};h.encode=function(a,
|
||||
b:"strict",threshold:9,depth:1}},G=[];let R=0;const D={add:0,update:1,remove:2},M=e("[\\s/-]"),N={},O={},P=function(){const a=Object.getOwnPropertyNames({}.__proto__),b={};for(let d=0;d<a.length;d++)b[a[d]]=1;return b}();h.create=function(a){return new h(a)};h.registerMatcher=function(a){for(let b in a)a.hasOwnProperty(b)&&G.push(e(b),a[b]);return this};h.registerEncoder=function(a,b){A[a]=b.bind(A);return this};h.registerLanguage=function(a,b){N[a]=b.filter;O[a]=b.stemmer;return this};h.encode=function(a,
|
||||
b){return P[a]?b:A[a](b)};h.prototype.init=function(a){this.C=[];a||(a=v);let b=a.profile;const d=b?H[b]:{};if(b=a.worker)if(Worker){const c=this,d=parseInt(b,10)||4;c.m=-1;c.o=0;c.h=[];c.B=null;c.j=Array(d);for(let b=0;b<d;b++)c.j[b]=Y(c.id,b,a,function(a,b,d,f){if(c.o!==c.c)return c.h=c.h.concat(d),c.o++,f&&c.h.length>=f&&(c.o=c.c),c.B&&c.o===c.c&&(c.cache&&c.i.set(b,c.h),c.B(c.h),c.h=[]),c})}else a.worker=!1,this.j=null;this.b=a.tokenize||d.b||this.b||v.b;this.async=y(b=a.async)?this.async||v.async:
|
||||
b;this.c=y(b=a.worker)?this.c||v.c:b;this.threshold=y(b=a.threshold)?d.threshold||this.threshold||v.threshold:b;this.depth=y(b=a.depth)?d.depth||this.depth||v.depth:b;this.u=y(b=a.suggest)?this.u||v.u:b;this.s=(b=y(b=a.encode)?d.encode:b)&&A[b]&&A[b].bind(A)||(C(b)?b:this.s||!1);(b=a.matcher)&&this.addMatcher(b);if(b=a.filter)this.filter=S(N[b]||b,this.s);if(b=a.stemmer)this.stemmer=T(O[b]||b,this.s);this.w=L(10);this.l={};this.a={};this.g={};this.f=[];this.D=0;this.v=!0;this.i=(this.cache=b=y(b=
|
||||
a.cache)?this.cache||v.cache:b)?new Z(b):!1;return this};h.prototype.encode=function(a){a&&G.length&&(a=w(a,G));a&&this.C.length&&(a=w(a,this.C));a&&this.s&&(a=this.s(a));a&&this.stemmer&&(a=w(a,this.stemmer));return a};h.prototype.addMatcher=function(a){const b=this.C;for(const d in a)a.hasOwnProperty(d)&&b.push(e(d),a[d]);return this};h.prototype.add=function(a,b,d){if(b&&B(b)&&(a&&!P[a]||0===a))if(this.a[a]&&!d)this.update(a,b);else{if(this.c)return++this.m>=this.j.length&&(this.m=0),this.j[this.m].postMessage(this.m,
|
||||
@@ -23,8 +23,8 @@ this.a[a];this.j[b].postMessage(b,{remove:!0,id:a});delete this.a[a];return this
|
||||
d,this.o=0,this.h=[],g=0;g<this.c;g++)this.j[g].postMessage(g,{search:!0,limit:b,threshold:e,content:a});else if(d){{let a=this;K(function(){d(a.search(f,b,null,!0));a=null},1,"search-"+this.id)}}else{if(!c&&this.async&&"function"!==typeof importScripts){let a=this;return new Promise(function(c){c(a.search(f,b,null,!0));a=null})}if(!a||!B(a))return g;f=a;if(this.cache)if(this.v){if(c=this.i.get(a))return c}else this.i.clear(),this.v=!0;f=this.encode(f);if(!f.length)return g;c=this.b;c=C(c)?c(f):"ngram"===
|
||||
c?J(f):f.split(M);var h=c.length,r=!0,q=[],u={};if(1<h)if(this.depth){var n=!0;var p=c[0];u[p]=1}else c.sort(U);var m;if(!n||(m=this.l)[p])for(let a=n?1:0;a<h;a++){const b=c[a];if(b&&!u[b]){let a=!1;const c=[];let d=0;for(let f=9;f>=e;f--){var t=(n?m[p]:this.w)[f];if(t=t[b])c[d++]=t,a=!0}if(a)q[q.length]=1<d?q.concat.apply([],c):c[0];else if(!this.u){r=!1;break}u[b]=1}p=b}else r=!1;r&&(g=W(q,b,this.u));this.cache&&this.i.set(a,g);return g}};h.prototype.clear=function(){this.destroy();return this.init()};
|
||||
h.prototype.destroy=function(){this.cache&&(this.i.clear(),this.i=null);this.filter=this.stemmer=this.w=this.l=this.a=this.g=this.f=null;return this};const A={icase:function(a){return a.toLowerCase()},simple:function(){const a=[e("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),"a",e("[\u00e8\u00e9\u00ea\u00eb]"),"e",e("[\u00ec\u00ed\u00ee\u00ef]"),"i",e("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),"o",e("[\u00f9\u00fa\u00fb\u00fc\u0171]"),"u",e("[\u00fd\u0177\u00ff]"),"y",e("\u00f1"),"n",e("\u00e7"),"c",e("\u00df"),
|
||||
"s",e(" & ")," and ",e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s\\s+")," "];return function(b){b=w(b.toLowerCase(),a);return" "!==b?b:""}}(),advanced:function(){const a=[e("ae"),"a",e("ai"),"ei",e("ay"),"ei",e("ey"),"ei",e("oe"),"o",e("ue"),"u",e("ie"),"i",e("sz"),"s",e("zs"),"s",e("sh"),"s",e("ck"),"k",e("cc"),"k",e("dt"),"t",e("ph"),"f",e("pf"),"f",e("ou"),"o",e("uo"),"u"];return function(b,d){if(!b)return b;b=this.simple(b);2<b.length&&(b=w(b,a));d||1<b.length&&(b=E(b));return b}}(),extra:function(){const a=
|
||||
[e("p"),"b",e("z"),"s",e("[cgq]"),"k",e("n"),"m",e("d"),"t",e("[vw]"),"f",e("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let d=0;d<b.length;d++){const c=b[d];1<c.length&&(b[d]=c[0]+w(c.substring(1),a))}b=b.join(" ");b=E(b)}return b}}(),balance:function(){const a=[e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s\\s+")," "];return function(b){return E(w(b.toLowerCase(),a))}}()},K=function(){const a={};return function(b,d,c){const f=a[c];f&&clearTimeout(f);
|
||||
"s",e(" & ")," and ",e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){b=w(b.toLowerCase(),a);return" "!==b?b:""}}(),advanced:function(){const a=[e("ae"),"a",e("ai"),"ei",e("ay"),"ei",e("ey"),"ei",e("oe"),"o",e("ue"),"u",e("ie"),"i",e("sz"),"s",e("zs"),"s",e("sh"),"s",e("ck"),"k",e("cc"),"k",e("dt"),"t",e("ph"),"f",e("pf"),"f",e("ou"),"o",e("uo"),"u"];return function(b,d){if(!b)return b;b=this.simple(b);2<b.length&&(b=w(b,a));d||1<b.length&&(b=E(b));return b}}(),extra:function(){const a=
|
||||
[e("p"),"b",e("z"),"s",e("[cgq]"),"k",e("n"),"m",e("d"),"t",e("[vw]"),"f",e("[aeiouy]"),""];return function(b){if(!b)return b;b=this.advanced(b,!0);if(1<b.length){b=b.split(" ");for(let d=0;d<b.length;d++){const c=b[d];1<c.length&&(b[d]=c[0]+w(c.substring(1),a))}b=b.join(" ");b=E(b)}return b}}(),balance:function(){const a=[e("[-/]")," ",e("[^a-z0-9 ]"),"",e("\\s+")," "];return function(b){return E(w(b.toLowerCase(),a))}}()},K=function(){const a={};return function(b,d,c){const f=a[c];f&&clearTimeout(f);
|
||||
return a[c]=setTimeout(b,d)}}(),Z=function(){function a(a){this.clear();this.A=!0!==a&&a}a.prototype.clear=function(){this.cache={};this.count={};this.index={};this.a=[]};a.prototype.set=function(a,d){if(this.A&&y(this.cache[a])){let b=this.a.length;if(b===this.A){b--;const a=this.a[b];delete this.cache[a];delete this.count[a];delete this.index[a]}this.index[a]=b;this.a[b]=a;this.count[a]=-1;this.cache[a]=d;this.get(a)}else this.cache[a]=d};a.prototype.get=function(a){const b=this.cache[a];if(this.A&&
|
||||
b){var c=++this.count[a];const b=this.index;let d=b[a];if(0<d){const f=this.a;for(var e=d;this.count[f[--d]]<=c&&-1!==d;);d++;if(d!==e){for(c=e;c>d;c--)e=f[c-1],f[c]=e,b[e]=c;f[d]=a;b[a]=d}}}return b};return a}();return h}(function(){const q=Object.create(null),z="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(h,t,e,w,x){let r=h;h=z?URL.createObjectURL(new Blob(["("+e.toString()+")()"],{type:"text/javascript"})):r+".min.js";r+="-"+t;q[r]||(q[r]=[]);q[r][x]=
|
||||
new Worker(h);q[r][x].onmessage=w;return{postMessage:function(e,h){q[r][e].postMessage(h)}}}}()),this);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "flexsearch",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.21",
|
||||
"description": "Next-Generation full text search library with zero dependencies.",
|
||||
"homepage": "https://github.com/nextapps-de/flexsearch/",
|
||||
"author": "Thomas Wilkerling",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
FlexSearch v0.3.2
|
||||
FlexSearch v0.3.21
|
||||
Copyright 2019 Nextapps GmbH
|
||||
Author: Thomas Wilkerling
|
||||
Released under the Apache 2.0 Licence
|
||||
@@ -20,7 +20,7 @@ r.length;for(k=0;k<t;)if(n=r[k++],g[n]){var l=g[n];if(l===q){if(m){if(f[p++]=n,c
|
||||
M(function(){b.F=0;var c=b.async;c&&(b.async=!1);if(b.b.length){for(var a=Date.now(),f;(f=b.b.shift())||0===f;){var d=b.c[f];switch(d[0]){case C.add:b.add(d[1],d[2]);break;case C.remove:b.remove(d[1])}delete b.c[f];if(100<Date.now()-a)break}b.b.length&&B(b)}c&&(b.async=c)},1,"search-async-"+b.id))}function N(b){for(var c=Array(b),a=0;a<b;a++)c[a]={};return c}function ca(b,c,a,f){b=g("flexsearch","id"+b,function(){var b,c;self.onmessage=function(a){if(a=a.data)if(a.search){var f=c.search(a.content,
|
||||
a.threshold?{limit:a.limit,threshold:a.threshold}:a.limit);self.postMessage({id:b,content:a.content,limit:a.limit,result:f})}else a.add?c.add(a.id,a.content):a.update?c.update(a.id,a.content):a.remove?c.remove(a.id):a.clear?c.clear():a.register&&(b=a.id,a.options.cache=!1,a.options.async=!0,a.options.worker=!1,c=(new Function(a.register.substring(a.register.indexOf("{")+1,a.register.lastIndexOf("}"))))(),c=new c(a.options))}},function(b){(b=b.data)&&b.result&&f(b.id,b.content,b.result,b.limit)},c);
|
||||
var d=aa.toString();a.id=c;b.postMessage(c,{register:d,options:a,id:c});return b}var w={encode:"icase",h:"forward",w:!1,cache:!1,async:!1,i:!1,threshold:0,depth:0},L={memory:{encode:"extra",h:"strict",threshold:7},speed:{encode:"icase",h:"strict",threshold:7,depth:2},match:{encode:"extra",h:"full"},score:{encode:"extra",h:"strict",threshold:5,depth:4},balance:{encode:"balance",h:"strict",threshold:6,depth:3},fastest:{encode:"icase",h:"strict",threshold:9,depth:1}},F=[],ba=0,C={add:0,update:1,remove:2},
|
||||
O=a("[ -/]"),P={},Q={},R=function(){for(var b=Object.getOwnPropertyNames({}.__proto__),c={},a=0;a<b.length;a++)c[b[a]]=1;return c}();e.create=function(b){return new e(b)};e.registerMatcher=function(b){for(var c in b)b.hasOwnProperty(c)&&F.push(a(c),b[c]);return this};e.registerEncoder=function(b,c){y[b]=c.bind(y);return this};e.registerLanguage=function(b,c){P[b]=c.filter;Q[b]=c.stemmer;return this};e.encode=function(b,c){return R[b]?c:y[b](c)};e.prototype.init=function(b){this.D=[];b||(b=w);var c=
|
||||
O=a("[\\s/-]"),P={},Q={},R=function(){for(var b=Object.getOwnPropertyNames({}.__proto__),c={},a=0;a<b.length;a++)c[b[a]]=1;return c}();e.create=function(b){return new e(b)};e.registerMatcher=function(b){for(var c in b)b.hasOwnProperty(c)&&F.push(a(c),b[c]);return this};e.registerEncoder=function(b,c){y[b]=c.bind(y);return this};e.registerLanguage=function(b,c){P[b]=c.filter;Q[b]=c.stemmer;return this};e.encode=function(b,c){return R[b]?c:y[b](c)};e.prototype.init=function(b){this.D=[];b||(b=w);var c=
|
||||
b.profile,a=c?L[c]:{};if(c=b.worker)if(Worker){var f=this,d=parseInt(c,10)||4;f.m=-1;f.o=0;f.f=[];f.C=null;f.j=Array(d);for(var e=0;e<d;e++)f.j[e]=ca(f.id,e,b,function(b,c,a,d){if(f.o!==f.i)return f.f=f.f.concat(a),f.o++,d&&f.f.length>=d&&(f.o=f.i),f.C&&f.o===f.i&&(f.cache&&f.g.set(c,f.f),f.C(f.f),f.f=[]),f})}else b.worker=!1,this.j=null;this.h=b.tokenize||a.h||this.h||w.h;this.async=x(c=b.async)?this.async||w.async:c;this.i=x(c=b.worker)?this.i||w.i:c;this.threshold=x(c=b.threshold)?a.threshold||
|
||||
this.threshold||w.threshold:c;this.depth=x(c=b.depth)?a.depth||this.depth||w.depth:c;this.w=x(c=b.suggest)?this.w||w.w:c;this.s=(c=x(c=b.encode)?a.encode:c)&&y[c]&&y[c].bind(y)||(H(c)?c:this.s||!1);(c=b.matcher)&&this.addMatcher(c);if(c=b.filter)this.filter=V(P[c]||c,this.s);if(c=b.stemmer)this.stemmer=Z(Q[c]||c,this.s);this.v=N(10);this.l={};this.a={};this.c={};this.b=[];this.F=0;this.u=!0;this.g=(this.cache=c=x(c=b.cache)?this.cache||w.cache:c)?new da(c):!1;return this};e.prototype.encode=function(b){b&&
|
||||
F.length&&(b=l(b,F));b&&this.D.length&&(b=l(b,this.D));b&&this.s&&(b=this.s(b));b&&this.stemmer&&(b=l(b,this.stemmer));return b};e.prototype.addMatcher=function(b){var c=this.D,d;for(d in b)b.hasOwnProperty(d)&&c.push(a(d),b[d]);return this};e.prototype.add=function(b,c,a){if(c&&E(c)&&(b&&!R[b]||0===b))if(this.a[b]&&!a)this.update(b,c);else{if(this.i)return++this.m>=this.j.length&&(this.m=0),this.j[this.m].postMessage(this.m,{add:!0,id:b,content:c}),this.a[b]=""+this.m,this;if(this.async)return this.c[b]||
|
||||
@@ -29,8 +29,8 @@ l.substring(u,v),d(k,f,q,b,m,p,e);break;default:if(n=d(k,f,l,b,1,p,e),g&&1<r&&n>
|
||||
(this.b[this.b.length]=b),this.c[b]=[C.remove,b],B(this),this;for(c=0;10>c;c++)m(this.v[c],b);this.depth&&m(this.l,b);delete this.a[b];this.u=!1}return this};e.prototype.search=function(b,c,a,f){var d=b,e=[];if("object"===typeof b){(a=b.callback||c)&&(d.callback=null);c=b.limit;var g=b.threshold;b=b.query}g||(g=this.threshold||0);H(c)?(a=c,c=1E3):c||0===c||(c=1E3);if(this.i)for(this.C=a,this.o=0,this.f=[],e=0;e<this.i;e++)this.j[e].postMessage(e,{search:!0,limit:c,threshold:g,content:b});else if(a){var k=
|
||||
this;M(function(){a(k.search(d,c,null,!0));k=null},1,"search-"+this.id)}else{if(!f&&this.async&&"function"!==typeof importScripts){var l=this;return new Promise(function(b){b(l.search(d,c,null,!0));l=null})}if(!b||!E(b))return e;d=b;if(this.cache)if(this.u){if(f=this.g.get(b))return f}else this.g.clear(),this.u=!0;d=this.encode(d);if(!d.length)return e;f=this.h;f=H(f)?f(d):"ngram"===f?D(d):d.split(O);var t=f.length,n=!0,p=[],q={};if(1<t)if(this.depth){var m=!0;var v=f[0];q[v]=1}else f.sort(W);var w;
|
||||
if(!m||(w=this.l)[v])for(var x=m?1:0;x<t;x++){var y=f[x];if(y&&!q[y]){var G=void 0;G=void 0;for(var C=!1,B=[],F=0,I=9;I>=g;I--)if(G=(m?w[v]:this.v)[I],G=G[y])B[F++]=G,C=!0;if(C)p[p.length]=1<F?p.concat.apply([],B):B[0];else if(!this.w){n=!1;break}q[y]=1}v=y}else n=!1;n&&(e=Y(p,c,this.w));this.cache&&this.g.set(b,e);return e}};e.prototype.clear=function(){this.destroy();return this.init()};e.prototype.destroy=function(){this.cache&&(this.g.clear(),this.g=null);this.filter=this.stemmer=this.v=this.l=
|
||||
this.a=this.c=this.b=null;return this};var y={icase:function(b){return b.toLowerCase()},simple:function(){var b=[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("\u00e7"),"c",a("\u00df"),"s",a(" & ")," and ",a("[-/]")," ",a("[^a-z0-9 ]"),"",a("\\s\\s+")," "];return function(c){c=l(c.toLowerCase(),
|
||||
this.a=this.c=this.b=null;return this};var y={icase:function(b){return b.toLowerCase()},simple:function(){var b=[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("\u00e7"),"c",a("\u00df"),"s",a(" & ")," and ",a("[-/]")," ",a("[^a-z0-9 ]"),"",a("\\s+")," "];return function(c){c=l(c.toLowerCase(),
|
||||
b);return" "!==c?c:""}}(),advanced:function(){var b=[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("dt"),"t",a("ph"),"f",a("pf"),"f",a("ou"),"o",a("uo"),"u"];return function(c,a){if(!c)return c;c=this.simple(c);2<c.length&&(c=l(c,b));a||1<c.length&&(c=v(c));return c}}(),extra:function(){var b=[a("p"),"b",a("z"),"s",a("[cgq]"),"k",a("n"),"m",a("d"),"t",a("[vw]"),"f",a("[aeiouy]"),""];return function(a){if(!a)return a;
|
||||
a=this.advanced(a,!0);if(1<a.length){a=a.split(" ");for(var c=0;c<a.length;c++){var d=a[c];1<d.length&&(a[c]=d[0]+l(d.substring(1),b))}a=a.join(" ");a=v(a)}return a}}(),balance:function(){var b=[a("[-/]")," ",a("[^a-z0-9 ]"),"",a("\\s\\s+")," "];return function(a){return v(l(a.toLowerCase(),b))}}()},M=function(){var b={};return function(a,d,f){var c=b[f];c&&clearTimeout(c);return b[f]=setTimeout(a,d)}}(),da=function(){function a(a){this.clear();this.B=!0!==a&&a}a.prototype.clear=function(){this.cache=
|
||||
a=this.advanced(a,!0);if(1<a.length){a=a.split(" ");for(var c=0;c<a.length;c++){var d=a[c];1<d.length&&(a[c]=d[0]+l(d.substring(1),b))}a=a.join(" ");a=v(a)}return a}}(),balance:function(){var b=[a("[-/]")," ",a("[^a-z0-9 ]"),"",a("\\s+")," "];return function(a){return v(l(a.toLowerCase(),b))}}()},M=function(){var b={};return function(a,d,f){var c=b[f];c&&clearTimeout(c);return b[f]=setTimeout(a,d)}}(),da=function(){function a(a){this.clear();this.B=!0!==a&&a}a.prototype.clear=function(){this.cache=
|
||||
{};this.count={};this.index={};this.a=[]};a.prototype.set=function(a,b){if(this.B&&x(this.cache[a])){var c=this.a.length;if(c===this.B){c--;var d=this.a[c];delete this.cache[d];delete this.count[d];delete this.index[d]}this.index[a]=c;this.a[c]=a;this.count[a]=-1;this.cache[a]=b;this.get(a)}else this.cache[a]=b};a.prototype.get=function(a){var b=this.cache[a];if(this.B&&b){var c=++this.count[a],d=this.index,e=d[a];if(0<e){for(var g=this.a,k=e;this.count[g[--e]]<=c&&-1!==e;);e++;if(e!==k){for(c=k;c>
|
||||
e;c--)k=g[c-1],g[c]=k,d[k]=c;g[e]=a;d[a]=e}}}return b};return a}();return e}(function(){var g=Object.create(null),h="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(e,k,a,l,d){var m=e;e=h?URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"})):m+".es5.js";m+="-"+k;g[m]||(g[m]=[]);g[m][d]=new Worker(e);g[m][d].onmessage=l;return{postMessage:function(a,d){g[m][a].postMessage(d)}}}}()),this);
|
||||
|
Reference in New Issue
Block a user