Host FlexSearch

This commit is contained in:
Will Faught
2025-03-02 00:23:46 -08:00
parent 2e77b35940
commit 078157e62c
164 changed files with 23495 additions and 1 deletions

View File

@@ -0,0 +1 @@
import{IndexInterface}from"../../type.js";import{regex,replace,collapse}from"../../lang.js";import{encode as encode_balance}from"./balance.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};const regex_ae=regex("ae"),regex_oe=regex("oe"),regex_sh=regex("sh"),regex_th=regex("th"),regex_ph=regex("ph"),regex_pf=regex("pf"),pairs=[regex_ae,"a",regex_oe,"o",regex_sh,"s",regex_th,"t",regex_ph,"f",regex_pf,"f",regex("(?![aeo])h(?![aeo])"),"",regex("(?!^[aeo])h(?!^[aeo])"),""];export function encode(a,b){return a&&(a=encode_balance.call(this,a).join(" "),2<a.length&&(a=replace(a,pairs)),!b&&(1<a.length&&(a=collapse(a)),a&&(a=a.split(" ")))),a||[]}

View File

@@ -0,0 +1 @@
import{IndexInterface}from"../../type.js";import{encode as encode_simple}from"./simple.js";export const rtl=!1;export const tokenize="strict";export default{encode:encode,rtl:!1,tokenize:"strict"};const regex_strip=/[^a-z0-9]+/,soundex={b:"p",v:"f",w:"f",z:"s",x:"s",ß:"s",d:"t",n:"m",c:"k",g:"k",j:"k",q:"k",i:"e",y:"e",u:"o"};export function encode(a){a=encode_simple.call(this,a).join(" ");const b=[];if(a){const c=a.split(regex_strip),d=c.length;for(let e,f=0,g=0;f<d;f++)if((a=c[f])&&(!this.filter||!this.filter[a])){e=a[0];let c=soundex[e]||e,d=c;for(let b=1;b<a.length;b++){e=a[b];const f=soundex[e]||e;f&&f!==d&&(c+=f,d=f)}b[g++]=c}}return b}

View File

@@ -0,0 +1 @@
import{IndexInterface}from"../../type.js";import{pipeline,normalize,regex_whitespace}from"../../lang.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};export function encode(a){return pipeline.call(this,(""+a).toLowerCase(),!1,regex_whitespace,!1)}

View File

@@ -0,0 +1 @@
import{IndexInterface}from"../../type.js";import{regex,replace,collapse}from"../../lang.js";import{encode as encode_advanced}from"./advanced.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};const prefix="(?!\\b)",regex_vowel=regex("(?!\\b)[aeo]"),pairs=[regex_vowel,""];export function encode(a){return a&&(a=encode_advanced.call(this,a,!0),1<a.length&&(a=a.replace(regex_vowel,"")),1<a.length&&(a=collapse(a)),a&&(a=a.split(" "))),a||[]}

View File

@@ -0,0 +1 @@
import{IndexInterface}from"../../type.js";import{pipeline,normalize,regex_whitespace,regex}from"../../lang.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};const 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 "];export function encode(a){return a=""+a,pipeline.call(this,normalize(a).toLowerCase(),!a.normalize&&pairs,regex_whitespace,!1)}