2 lines
1,002 B
JavaScript
2 lines
1,002 B
JavaScript
(function(self){'use strict';const b=/[\u0300-\u036f]/g;function l(a){return new RegExp(a,"g")};const n=/[\W_]+/,p=[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 "];const q=/[^a-z0-9]+/,r={b:"p",v:"f",w:"f",z:"s",x:"s","\u00df":"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};self.FlexSearch.registerCharset("latin:balance",{encode:function(a){var e=this.h,c=a;c.normalize&&(c=c.normalize("NFD").replace(b,""));a=e.call(this,c.toLowerCase(),!a.normalize&&p,n,!1).join(" ");e=[];if(a){c=a.split(q);const t=c.length;for(let g=0,d,u=0;g<t;g++)if((a=c[g])&&(!this.filter||!this.filter[a])){d=a[0];let h=r[d]||d,m=h;for(let k=1;k<a.length;k++){d=a[k];const f=r[d]||d;f&&f!==m&&(h+=f,m=f)}e[u++]=h}}return e},l:!1,m:"strict"});}(this));
|