diff --git a/dist/thinker.cjs b/dist/thinker.cjs index a1606a8..66daa0e 100644 --- a/dist/thinker.cjs +++ b/dist/thinker.cjs @@ -517,8 +517,6 @@ return exported; } - var stemmer_1 = stemmer; - // Standard suffix manipulations. var step2list = { ational: 'ate', @@ -583,10 +581,16 @@ var step3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; var step4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - // Stem `value`. - // eslint-disable-next-line complexity + /** + * Stem `value`. + * + * @param {string} value + * @returns {string} + */ function stemmer(value) { + /** @type {boolean} */ var firstCharacterWasLowerCaseY; + /** @type {RegExpMatchArray} */ var match; value = String(value).toLowerCase(); @@ -607,17 +611,17 @@ // Step 1a. if (sfxSsesOrIes.test(value)) { // Remove last two characters. - value = value.slice(0, value.length - 2); + value = value.slice(0, -2); } else if (sfxS.test(value)) { // Remove last character. - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } // Step 1b. if ((match = sfxEED.exec(value))) { if (gt0.test(match[1])) { // Remove last character. - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } } else if ((match = sfxEdOrIng.exec(value)) && vowelInStem.test(match[1])) { value = match[1]; @@ -627,7 +631,7 @@ value += 'e'; } else if (sfxMultiConsonantLike.test(value)) { // Remove last character. - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } else if (consonantLike.test(value)) { // Append `e`. value += 'e'; @@ -669,7 +673,7 @@ } if (sfxLl.test(value) && gt1.test(value)) { - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } // Turn initial `Y` back to `y`. @@ -889,7 +893,7 @@ return function ( w ) { // Dont process stopwords if ( stopwords[w] === true ) return w; - return stemmer_1( w ); + return stemmer( w ); }; } diff --git a/dist/thinker.min.js b/dist/thinker.min.js index 4f989b6..79c5438 100644 --- a/dist/thinker.min.js +++ b/dist/thinker.min.js @@ -1 +1 @@ -(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.Thinker=factory())})(this,function(){"use strict";var levenshtein$1={exports:{}};const peq=new Uint32Array(65536);const myers_32=(a,b)=>{const n=a.length;const m=b.length;const lst=1<{const n=a.length;const m=b.length;const mhc=[];const phc=[];const hsize=Math.ceil(n/32);const vsize=Math.ceil(m/32);let score=m;for(let i=0;i>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;score+=ph>>>m-1&1;score-=mh>>>m-1&1;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<{if(a.length>b.length){const tmp=b;b=a;a=tmp}if(a.length===0){return b.length}if(a.length<=32){return myers_32(a,b)}return myers_x(a,b)};const closest=(str,arr)=>{let min_distance=Infinity;let min_index=0;for(let i=0;itmp){nextCol=tmp}tmp=prevRow[j+1]+1;if(nextCol>tmp){nextCol=tmp}prevRow[j]=curCol}prevRow[j]=nextCol}return nextCol}return levenshtein.distance(str1,str2)}};if(module!==null&&"object"!=="undefined"&&module.exports===exports){module.exports=Levenshtein}else if(typeof self!=="undefined"&&typeof self.postMessage==="function"&&typeof self.importScripts==="function"){self.Levenshtein=Levenshtein}else if(typeof window!=="undefined"&&window!==null){window.Levenshtein=Levenshtein}})()})(levenshtein$1,levenshtein$1.exports);var levenshtein=levenshtein$1.exports;function Index(options){let words=[],documents=[],lookupPreProcessed=new Map(null),lookupPartial=new Map(null),lookupProcessed=new Map(null),lookupSuggestion=new Map(null),query=function(location,lookupMap,filterFunc){let matches=lookupMap.get(location),arr1=[],arr2,i,newIdx,idx,idxKey,iEntry,subroutine=function(word,arr1){arr2=words[word];idx=new Map;for(let j=0;j3?max:3:3;return split[0]+(build.join("")+new Array(max+1).join("0")).slice(0,max)})})(function(fn){module.exports=fn})})(soundex$1);var Soundex=soundex$1.exports;function stopwords(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w}}function wordforms(wordform){wordform=wordform||{};return function(w){return wordform[w]||w}}function multiples(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([a-zåäö])\1+/gi,"$1")}}function dashes(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([^\s]){1}-/,"$1")}}function stripHtml(){let replaceMap={nbsp:" ",gt:">",lt:"<",aring:"å",Aring:"Å",ouml:"ö",Ouml:"Ö",auml:"ä",Auml:"Ä",Oslash:"Ø",oslash:"ø",uuml:"ü",Uuml:"Ü",quot:'"'},result,num;return function(field){field=field.replace(/(.*?)<\/a>/gi," $2 $1 ");field=field.replace(//gi," $1 ");field=field.replace(/.*?<\/script>/gi,"");field=field.replace(/.*?<\/style>/gi,"");field=field.replace(/<(?:.|\s)*?>/g," ");field=field.replace(/&#([0-9]{1,3});/gi,function(match,numStr){num=parseInt(numStr,10);return String.fromCharCode(num)});field=field.replace(/&([a-z]{2,5});/gi,function(match,entity){if((result=replaceMap[entity])!==undefined){return result}else{return" "}});return field}}function swedishStemmer(stopwords){let i,suffix=["dd","gd","nn","dt","gt","mm","tt"],endings=["igheter","igheten","ingarna","iteten","ingen","anden","andet","orna","aste","aren","arna","ande","erna","arne","itet","ndet","orn","het","ast","and","ade","ern","ing","are","en","ad","an","ar","ig","er","et","or","at","e","a"];stopwords=stopwords||{};return function(w){let word=w.substring(0,2),r1=w.substring(2,w.length);if(stopwords[w]===true)return w;if(w.length<=2)return w;if(r1[r1.length-1]==="s")r1=r1.substring(0,r1.length-1);if(r1.length===0)return word;for(i=0;i-1){r1=r1.substring(0,r1.lastIndexOf(endings[i]))}}if(r1.length===0)return word;w=word+r1;if(stopwords[w]===true)return w;for(i=0;i0){toss=true}else if(resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}function property(){return function(options){options=defaults({resultSet:null,index:null,sortBy:null},options);let documentResultsFinal=[],documentResultsLookup={},i,j,documentId,doc,weight,matches,word,match;j=0;while(word=options.resultSet.expressions[j++]){matches=[{flag:1,rows:word.hits.partial,weight:options.partialHit,length:word.hits.partial.length},{flag:2,rows:word.hits.processed,weight:options.processedHit,length:word.hits.processed.length},{flag:3,rows:word.hits.exact,weight:options.exactHit,length:word.hits.exact.length}];while(match=matches.pop()){for(i=0;i0){toss=true}else if(options.resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}var rankers=Object.freeze({__proto__:null,standard:standard,property:property});function processWord(word,opts){let result,i;if(!word||word.lengthopts.maxWordLen){word=word.substring(0,opts.maxWordLen)}if(!opts.caseSensitive){word=word.toLowerCase()}result={original:word,preprocessed:undefined,processed:undefined};for(i=0;i1&¤tField[k]!==""){wordHistory.push(currentField[k]);if(wordHistory.length>1){for(let l=0;l=opts.concatenateWords){wordHistory.shift()}}}}}}}if(done)self.index.compress()};Thinker.prototype.addFieldProcessor=function(fn){return this.options.fieldProcessors.push(fn),this};Thinker.prototype.addWordPreProcessor=function(fn){return this.options.wordPreProcessors.push(fn),this};Thinker.prototype.addWordProcessor=function(fn){return this.options.wordProcessors.push(fn),this};Thinker.prototype.find=function(params){time("totalFindTime");time("findTime");if(typeof params==="string"){params={expression:params}}params=defaults({expression:null,direction:true,filter:null,reduce:null,collectAll:null,collect:null,sortBy:"weight",limit:null},params);if(!params.expression)params.expression="";let self=this,words,word,resultSet={expressions:[],performance:{}},queryResult,suggestion,i,expression;expression=params.expression.replace(/-\s+/g," ");expression=expression.replace(/([^\s]){1}-/,"$1");expression=expression.replace(/\s+/g," ");expression=expression.trim(" ");words=expression.split(" ");for(i=0;i=0;i--){if(params.reduce(resultSet.documents[i].metadata)){tmpRes.push(resultSet.documents[i])}}resultSet.documents=tmpRes}if(params.collect){for(let c=0;cparams.limit){resultSet.documents=resultSet.documents.slice(0,params.limit)}resultSet.returnedHits=resultSet.documents.length;resultSet.performance.filter=time("filterTime");resultSet.performance.total=time("totalFindTime");return resultSet};Thinker.processors=processors;Thinker.rankers=rankers;return Thinker}); \ No newline at end of file +(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.Thinker=factory())})(this,function(){"use strict";var levenshtein$1={exports:{}};const peq=new Uint32Array(65536);const myers_32=(a,b)=>{const n=a.length;const m=b.length;const lst=1<{const n=a.length;const m=b.length;const mhc=[];const phc=[];const hsize=Math.ceil(n/32);const vsize=Math.ceil(m/32);let score=m;for(let i=0;i>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;score+=ph>>>m-1&1;score-=mh>>>m-1&1;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<{if(a.length>b.length){const tmp=b;b=a;a=tmp}if(a.length===0){return b.length}if(a.length<=32){return myers_32(a,b)}return myers_x(a,b)};const closest=(str,arr)=>{let min_distance=Infinity;let min_index=0;for(let i=0;itmp){nextCol=tmp}tmp=prevRow[j+1]+1;if(nextCol>tmp){nextCol=tmp}prevRow[j]=curCol}prevRow[j]=nextCol}return nextCol}return levenshtein.distance(str1,str2)}};if(module!==null&&"object"!=="undefined"&&module.exports===exports){module.exports=Levenshtein}else if(typeof self!=="undefined"&&typeof self.postMessage==="function"&&typeof self.importScripts==="function"){self.Levenshtein=Levenshtein}else if(typeof window!=="undefined"&&window!==null){window.Levenshtein=Levenshtein}})()})(levenshtein$1,levenshtein$1.exports);var levenshtein=levenshtein$1.exports;function Index(options){let words=[],documents=[],lookupPreProcessed=new Map(null),lookupPartial=new Map(null),lookupProcessed=new Map(null),lookupSuggestion=new Map(null),query=function(location,lookupMap,filterFunc){let matches=lookupMap.get(location),arr1=[],arr2,i,newIdx,idx,idxKey,iEntry,subroutine=function(word,arr1){arr2=words[word];idx=new Map;for(let j=0;j3?max:3:3;return split[0]+(build.join("")+new Array(max+1).join("0")).slice(0,max)})})(function(fn){module.exports=fn})})(soundex$1);var Soundex=soundex$1.exports;function stopwords(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w}}function wordforms(wordform){wordform=wordform||{};return function(w){return wordform[w]||w}}function multiples(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([a-zåäö])\1+/gi,"$1")}}function dashes(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([^\s]){1}-/,"$1")}}function stripHtml(){let replaceMap={nbsp:" ",gt:">",lt:"<",aring:"å",Aring:"Å",ouml:"ö",Ouml:"Ö",auml:"ä",Auml:"Ä",Oslash:"Ø",oslash:"ø",uuml:"ü",Uuml:"Ü",quot:'"'},result,num;return function(field){field=field.replace(/(.*?)<\/a>/gi," $2 $1 ");field=field.replace(//gi," $1 ");field=field.replace(/.*?<\/script>/gi,"");field=field.replace(/.*?<\/style>/gi,"");field=field.replace(/<(?:.|\s)*?>/g," ");field=field.replace(/&#([0-9]{1,3});/gi,function(match,numStr){num=parseInt(numStr,10);return String.fromCharCode(num)});field=field.replace(/&([a-z]{2,5});/gi,function(match,entity){if((result=replaceMap[entity])!==undefined){return result}else{return" "}});return field}}function swedishStemmer(stopwords){let i,suffix=["dd","gd","nn","dt","gt","mm","tt"],endings=["igheter","igheten","ingarna","iteten","ingen","anden","andet","orna","aste","aren","arna","ande","erna","arne","itet","ndet","orn","het","ast","and","ade","ern","ing","are","en","ad","an","ar","ig","er","et","or","at","e","a"];stopwords=stopwords||{};return function(w){let word=w.substring(0,2),r1=w.substring(2,w.length);if(stopwords[w]===true)return w;if(w.length<=2)return w;if(r1[r1.length-1]==="s")r1=r1.substring(0,r1.length-1);if(r1.length===0)return word;for(i=0;i-1){r1=r1.substring(0,r1.lastIndexOf(endings[i]))}}if(r1.length===0)return word;w=word+r1;if(stopwords[w]===true)return w;for(i=0;i0){toss=true}else if(resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}function property(){return function(options){options=defaults({resultSet:null,index:null,sortBy:null},options);let documentResultsFinal=[],documentResultsLookup={},i,j,documentId,doc,weight,matches,word,match;j=0;while(word=options.resultSet.expressions[j++]){matches=[{flag:1,rows:word.hits.partial,weight:options.partialHit,length:word.hits.partial.length},{flag:2,rows:word.hits.processed,weight:options.processedHit,length:word.hits.processed.length},{flag:3,rows:word.hits.exact,weight:options.exactHit,length:word.hits.exact.length}];while(match=matches.pop()){for(i=0;i0){toss=true}else if(options.resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}var rankers=Object.freeze({__proto__:null,standard:standard,property:property});function processWord(word,opts){let result,i;if(!word||word.lengthopts.maxWordLen){word=word.substring(0,opts.maxWordLen)}if(!opts.caseSensitive){word=word.toLowerCase()}result={original:word,preprocessed:undefined,processed:undefined};for(i=0;i1&¤tField[k]!==""){wordHistory.push(currentField[k]);if(wordHistory.length>1){for(let l=0;l=opts.concatenateWords){wordHistory.shift()}}}}}}}if(done)self.index.compress()};Thinker.prototype.addFieldProcessor=function(fn){return this.options.fieldProcessors.push(fn),this};Thinker.prototype.addWordPreProcessor=function(fn){return this.options.wordPreProcessors.push(fn),this};Thinker.prototype.addWordProcessor=function(fn){return this.options.wordProcessors.push(fn),this};Thinker.prototype.find=function(params){time("totalFindTime");time("findTime");if(typeof params==="string"){params={expression:params}}params=defaults({expression:null,direction:true,filter:null,reduce:null,collectAll:null,collect:null,sortBy:"weight",limit:null},params);if(!params.expression)params.expression="";let self=this,words,word,resultSet={expressions:[],performance:{}},queryResult,suggestion,i,expression;expression=params.expression.replace(/-\s+/g," ");expression=expression.replace(/([^\s]){1}-/,"$1");expression=expression.replace(/\s+/g," ");expression=expression.trim(" ");words=expression.split(" ");for(i=0;i=0;i--){if(params.reduce(resultSet.documents[i].metadata)){tmpRes.push(resultSet.documents[i])}}resultSet.documents=tmpRes}if(params.collect){for(let c=0;cparams.limit){resultSet.documents=resultSet.documents.slice(0,params.limit)}resultSet.returnedHits=resultSet.documents.length;resultSet.performance.filter=time("filterTime");resultSet.performance.total=time("totalFindTime");return resultSet};Thinker.processors=processors;Thinker.rankers=rankers;return Thinker}); \ No newline at end of file diff --git a/dist/thinker.min.js.map b/dist/thinker.min.js.map index 3a32d38..7d6cbf2 100644 --- a/dist/thinker.min.js.map +++ b/dist/thinker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["dist/thinker.cjs"],"names":["global","factory","exports","module","define","amd","globalThis","self","Thinker","this","levenshtein$1","peq","Uint32Array","myers_32","a","b","n","length","m","lst","let","pv","mv","sc","i","charCodeAt","eq","xv","myers_x","mhc","phc","hsize","Math","ceil","vsize","score","j","start","end","min","k","pb","mb","xh","ph","mh","distance","tmp","closest","str","arr","min_distance","Infinity","min_index","dist","fastestLevenshtein","collator","Intl","Collator","sensitivity","err","console","log","levenshtein","prevRow","str2Char","Levenshtein","get","str1","str2","options","useCollator","str1Len","str2Len","curCol","nextCol","strCmp","compare","charAt","String","fromCharCode","postMessage","importScripts","window","Index","words","documents","lookupPreProcessed","Map","lookupPartial","lookupProcessed","lookupSuggestion","query","location","lookupMap","filterFunc","matches","arr1","arr2","newIdx","idx","idxKey","iEntry","subroutine","word","set","undefined","constructor","Array","populate","wordIdx","lookup","dest","indexOf","exported","populatePartial","populateProcessed","populateDocuments","docid","meta","push","getMetadata","docidx","docIndexToId","populatePreProcessed","docIdx","fieldIdx","suggest","indexOriginal","suggestionCounter","match","found","preprocessed","original","getDocuments","exact","hits","processed","partial","findClosestWord","w","closestValue","closestIndex","forEach","value","key","compress","enableSuggestions","suggestionMinWordCount","delete","stemmer_1","stemmer","step2list","ational","tional","enci","anci","izer","bli","alli","entli","eli","ousli","ization","ation","ator","alism","iveness","fulness","ousness","aliti","iviti","biliti","logi","step3list","icate","ative","alize","iciti","ical","ful","ness","consonant","vowel","consonants","vowels","gt0","RegExp","eq1","gt1","vowelInStem","consonantLike","sfxLl","sfxE","sfxY","sfxIon","sfxEdOrIng","sfxAtOrBlOrIz","sfxEED","sfxS","sfxSsesOrIes","sfxMultiConsonantLike","step2","step3","step4","firstCharacterWasLowerCaseY","toLowerCase","slice","test","exec","soundex$1","Setup","scale","mysql","split","toUpperCase","replace","map","BFPV","CGJKQSXZ","DT","L","MN","R","keys","Object","reverse","build","letter","index","array","num","filter","first","splice","len","max","join","fn","Soundex","stopwords","stopword","wordforms","wordform","multiples","dashes","stripHtml","replaceMap","nbsp","gt","lt","aring","Aring","ouml","Ouml","auml","Auml","Oslash","oslash","uuml","Uuml","quot","result","field","numStr","parseInt","entity","swedishStemmer","suffix","endings","substring","r1","lastIndexOf","substr","englishStemmer","soundex","stemmers","swedish","english","processors","freeze","__proto__","time","times","performance","id","diff","now","process","hrtime","defaults","source","obj","prototype","hasOwnProperty","call","Error","standard","defaultFieldOptions","weight","boostPercentage","exactHit","processedHit","partialHit","fields","minimumWeight","resultSet","documentResultsFinal","documentResultsLookup","documentId","fieldIndex","matchCount","doc","fieldOptions","expressions","flag","rows","pop","temp","toss","modifier","property","sortBy","rankers","processWord","opts","minWordLen","maxWordLen","caseSensitive","wordPreProcessors","wordProcessors","ranker","propertyRanker","characters","minWildcardWordLen","maxWildcardWordLen","fieldProcessors","optionalPlusFromExpressions","concatenateWords","feed","texts","done","currentDocument","currentField","currentWord","addWord","augmented","wIndex","metadata","wordHistory","l","augmentedWord","shift","addFieldProcessor","addWordPreProcessor","addWordProcessor","find","params","expression","direction","reduce","collectAll","collect","limit","queryResult","suggestion","trim","interpretation","exactMode","rank","totalHits","collections","reduced","c","filtered","collectedMetaKey","currentMetadata","isArray","count","tmpRes","sort","returnedHits","total"],"mappings":"CAAA,SAAWA,OAAQC,gBACVC,UAAY,iBAAmBC,SAAW,YAAcA,OAAOD,QAAUD,iBACzEG,SAAW,YAAcA,OAAOC,IAAMD,OAAOH,UACnDD,cAAgBM,aAAe,YAAcA,WAAaN,QAAUO,KAAMP,OAAOQ,QAAUP,YAH9F,CAIGQ,KAAM,wBAEP,IAAIC,cAAgB,CAACR,QAAS,IAE9B,MAAMS,IAAM,IAAIC,YAAY,OAC5B,MAAMC,SAAW,CAACC,EAAGC,KACnB,MAAMC,EAAIF,EAAEG,OACZ,MAAMC,EAAIH,EAAEE,OACZ,MAAME,IAAM,GAAMH,EAAI,EACtBI,IAAIC,IAAM,EACVD,IAAIE,GAAK,EACTF,IAAIG,GAAKP,EACTI,IAAII,EAAIR,EACR,MAAOQ,IAAK,CACVb,IAAIG,EAAEW,WAAWD,KAAO,GAAKA,EAE/B,IAAKA,EAAI,EAAGA,EAAIN,EAAGM,IAAK,CACtBJ,IAAIM,GAAKf,IAAII,EAAEU,WAAWD,IAC1B,MAAMG,GAAKD,GAAKJ,GAChBI,KAAQA,GAAKL,IAAMA,GAAMA,GACzBC,MAAQI,GAAKL,IACbA,IAAMK,GACN,GAAIJ,GAAKH,IAAK,CACZI,KAEF,GAAIF,GAAKF,IAAK,CACZI,KAEFD,GAAMA,IAAM,EAAK,EACjBD,GAAMA,IAAM,IAAOM,GAAKL,IACxBA,IAAMK,GAERH,EAAIR,EACJ,MAAOQ,IAAK,CACVb,IAAIG,EAAEW,WAAWD,IA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QAAQD,iBAAkB,CACnC,IAAIpW,IAAIgB,EAAI,EAAGA,EAAIoV,gBAAgBvW,OAAQmB,IAAK,CAC/ChB,IAAIsW,MAAQxE,UAAUiE,YAAYC,QAAQG,kBAAkBpT,IAAIqT,gBAAgBpV,KAAO,EACvF8Q,UAAUiE,YAAYC,QAAQG,kBAAkB9Q,IAAI+Q,gBAAgBpV,KAAMsV,YAErE,CACNtW,IAAIsW,MAAQxE,UAAUiE,YAAYC,QAAQG,kBAAkBpT,IAAIqT,kBAAoB,EACpFtE,UAAUiE,YAAYC,QAAQG,kBAAkB9Q,IAAI+Q,kBAAmBE,WAS5EhG,KAAK,YAGLwB,UAAU5N,UAAY4N,UAAU5N,UAAUsS,KAAK,SAAS9W,EAAGC,GAC1D,OAAOsV,OAAOE,UAAaxV,EAAE4R,OAAS7R,EAAE6R,OAAW7R,EAAE6R,OAAS5R,EAAE4R,SAIjEO,UAAUtB,YAAYgG,KAAOlG,KAAK,YAGlC,GAAI2E,OAAOM,OAASzD,UAAU5N,UAAUrE,OAASoV,OAAOM,MAAO,CAC9DzD,UAAU5N,UAAY4N,UAAU5N,UAAUyH,MAAM,EAAGsJ,OAAOM,OAG3DzD,UAAU2E,aAAe3E,UAAU5N,UAAUrE,OAE7CiS,UAAUtB,YAAYpD,OAASkD,KAAK,cAEpCwB,UAAUtB,YAAYkG,MAAQpG,KAAK,iBAEnC,OAAOwB,WAIR1S,QAAQ+Q,WAAaA,WACrB/Q,QAAQ2T,QAAUA,QAElB,OAAO3T"} \ No newline at end of file +{"version":3,"sources":["dist/thinker.cjs"],"names":["global","factory","exports","module","define","amd","globalThis","self","Thinker","this","levenshtein$1","peq","Uint32Array","myers_32","a","b","n","length","m","lst","let","pv","mv","sc","i","charCodeAt","eq","xv","myers_x","mhc","phc","hsize","Math","ceil","vsize","score","j","start","end","min","k","pb","mb","xh","ph","mh","distance","tmp","closest","str","arr","min_distance","Infinity","min_index","dist","fastestLevenshtein","collator","Intl","Collator","sensitivity","err","console","log","levenshtein","prevRow","str2Char","Levenshtein","get","str1","str2","options","useCollator","str1Len","str2Len","curCol","nextCol","strCmp","compare","charAt","String","fromCharCode","postMessage","importScripts","window","Index","words","documents","lookupPreProcessed","Map","lookupPartial","lookupProcessed","lookupSuggestion","query","location","lookupMap","filterFunc","matches","arr1","arr2","newIdx","idx","idxKey","iEntry","subroutine","word","set","undefined","constructor","Array","populate","wordIdx","lookup","dest","indexOf","exported","populatePartial","populateProcessed","populateDocuments","docid","meta","push","getMetadata","docidx","docIndexToId","populatePreProcessed","docIdx","fieldIdx","suggest","indexOriginal","suggestionCounter","match","found","preprocessed","original","getDocuments","exact","hits","processed","partial","findClosestWord","w","closestValue","closestIndex","forEach","value","key","compress","enableSuggestions","suggestionMinWordCount","delete","step2list","ational","tional","enci","anci","izer","bli","alli","entli","eli","ousli","ization","ation","ator","alism","iveness","fulness","ousness","aliti","iviti","biliti","logi","step3list","icate","ative","alize","iciti","ical","ful","ness","consonant","vowel","consonants","vowels","gt0","RegExp","eq1","gt1","vowelInStem","consonantLike","sfxLl","sfxE","sfxY","sfxIon","sfxEdOrIng","sfxAtOrBlOrIz","sfxEED","sfxS","sfxSsesOrIes","sfxMultiConsonantLike","step2","step3","step4","stemmer","firstCharacterWasLowerCaseY","toLowerCase","slice","test","exec","soundex$1","Setup","scale","mysql","split","toUpperCase","replace","map","BFPV","CGJKQSXZ","DT","L","MN","R","keys","Object","reverse","build","letter","index","array","num","filter","first","splice","len","max","join","fn","Soundex","stopwords","stopword","wordforms","wordform","multiples","dashes","stripHtml","replaceMap","nbsp","gt","lt","aring","Aring","ouml","Ouml","auml","Auml","Oslash","oslash","uuml","Uuml","quot","result","field","numStr","parseInt","entity","swedishStemmer","suffix","endings","substring","r1","lastIndexOf","substr","englishStemmer","soundex","stemmers","swedish","english","processors","freeze","__proto__","time","times","performance","id","diff","now","process","hrtime","defaults","source","obj","prototype","hasOwnProperty","call","Error","standard","defaultFieldOptions","weight","boostPercentage","exactHit","processedHit","partialHit","fields","minimumWeight","resultSet","documentResultsFinal","documentResultsLookup","documentId","fieldIndex","matchCount","doc","fieldOptions","expressions","flag","rows","pop","temp","toss","modifier","property","sortBy","rankers","processWord","opts","minWordLen","maxWordLen","caseSensitive","wordPreProcessors","wordProcessors","ranker","propertyRanker","characters","minWildcardWordLen","maxWildcardWordLen","fieldProcessors","optionalPlusFromExpressions","concatenateWords","feed","texts","done","currentDocument","currentField","currentWord","addWord","augmented","wIndex","metadata","wordHistory","l","augmentedWord","shift","addFieldProcessor","addWordPreProcessor","addWordProcessor","find","params","expression","direction","reduce","collectAll","collect","limit","queryResult","suggestion","trim","interpretation","exactMode","rank","totalHits","collections","reduced","c","filtered","collectedMetaKey","currentMetadata","isArray","count","tmpRes","sort","returnedHits","total"],"mappings":"CAAA,SAAWA,OAAQC,gBACVC,UAAY,iBAAmBC,SAAW,YAAcA,OAAOD,QAAUD,iBACzEG,SAAW,YAAcA,OAAOC,IAAMD,OAAOH,UACnDD,cAAgBM,aAAe,YAAcA,WAAaN,QAAUO,KAAMP,OAAOQ,QAAUP,YAH9F,CAIGQ,KAAM,wBAEP,IAAIC,cAAgB,CAACR,QAAS,IAE9B,MAAMS,IAAM,IAAIC,YAAY,OAC5B,MAAMC,SAAW,CAACC,EAAGC,KACnB,MAAMC,EAAIF,EAAEG,OACZ,MAAMC,EAAIH,EAAEE,OACZ,MAAME,IAAM,GAAMH,EAAI,EACtBI,IAAIC,IAAM,EACVD,IAAIE,GAAK,EACTF,IAAIG,GAAKP,EACTI,IAAII,EAAIR,EACR,MAAOQ,IAAK,CACVb,IAAIG,EAAEW,WAAWD,KAAO,GAAKA,EAE/B,IAAKA,EAAI,EAAGA,EAAIN,EAAGM,IAAK,CACtBJ,IAAIM,GAAKf,IAAII,EAAEU,WAAWD,IAC1B,MAAMG,GAAKD,GAAKJ,GAChBI,KAAQA,GAAKL,IAAMA,GAAMA,GACzBC,MAAQI,GAAKL,IACbA,IAAMK,GACN,GAAIJ,GAAKH,IAAK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AAS2B,kBAAmB,CAC/FlW,IAAImW,gBAAkBlC,gBAAgBM,SAAS2B,kBAG/C,GAAI1Q,MAAM4Q,QAAQD,iBAAkB,CACnC,IAAInW,IAAIgB,EAAI,EAAGA,EAAImV,gBAAgBtW,OAAQmB,IAAK,CAC/ChB,IAAIqW,MAAQxE,UAAUiE,YAAYC,QAAQG,kBAAkBnT,IAAIoT,gBAAgBnV,KAAO,EACvF6Q,UAAUiE,YAAYC,QAAQG,kBAAkB7Q,IAAI8Q,gBAAgBnV,KAAMqV,YAErE,CACNrW,IAAIqW,MAAQxE,UAAUiE,YAAYC,QAAQG,kBAAkBnT,IAAIoT,kBAAoB,EACpFtE,UAAUiE,YAAYC,QAAQG,kBAAkB7Q,IAAI8Q,kBAAmBE,WAS5EhG,KAAK,YAGLwB,UAAU3N,UAAY2N,UAAU3N,UAAUqS,KAAK,SAAS7W,EAAGC,GAC1D,OAAOqV,OAAOE,UAAavV,EAAE2R,OAAS5R,EAAE4R,OAAW5R,EAAE4R,OAAS3R,EAAE2R,SAIjEO,UAAUtB,YAAYgG,KAAOlG,KAAK,YAGlC,GAAI2E,OAAOM,OAASzD,UAAU3N,UAAUrE,OAASmV,OAAOM,MAAO,CAC9DzD,UAAU3N,UAAY2N,UAAU3N,UAAUwH,MAAM,EAAGsJ,OAAOM,OAG3DzD,UAAU2E,aAAe3E,UAAU3N,UAAUrE,OAE7CgS,UAAUtB,YAAYpD,OAASkD,KAAK,cAEpCwB,UAAUtB,YAAYkG,MAAQpG,KAAK,iBAEnC,OAAOwB,WAIRzS,QAAQ8Q,WAAaA,WACrB9Q,QAAQ0T,QAAUA,QAElB,OAAO1T"} \ No newline at end of file diff --git a/dist/thinker.min.mjs b/dist/thinker.min.mjs index 8ca133c..9e26769 100644 --- a/dist/thinker.min.mjs +++ b/dist/thinker.min.mjs @@ -1 +1 @@ -var levenshtein$1={exports:{}};const peq=new Uint32Array(65536);const myers_32=(a,b)=>{const n=a.length;const m=b.length;const lst=1<{const n=a.length;const m=b.length;const mhc=[];const phc=[];const hsize=Math.ceil(n/32);const vsize=Math.ceil(m/32);let score=m;for(let i=0;i>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;score+=ph>>>m-1&1;score-=mh>>>m-1&1;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<{if(a.length>b.length){const tmp=b;b=a;a=tmp}if(a.length===0){return b.length}if(a.length<=32){return myers_32(a,b)}return myers_x(a,b)};const closest=(str,arr)=>{let min_distance=Infinity;let min_index=0;for(let i=0;itmp){nextCol=tmp}tmp=prevRow[j+1]+1;if(nextCol>tmp){nextCol=tmp}prevRow[j]=curCol}prevRow[j]=nextCol}return nextCol}return levenshtein.distance(str1,str2)}};if(module!==null&&"object"!=="undefined"&&module.exports===exports){module.exports=Levenshtein}else if(typeof self!=="undefined"&&typeof self.postMessage==="function"&&typeof self.importScripts==="function"){self.Levenshtein=Levenshtein}else if(typeof window!=="undefined"&&window!==null){window.Levenshtein=Levenshtein}})()})(levenshtein$1,levenshtein$1.exports);var levenshtein=levenshtein$1.exports;function Index(options){let words=[],documents=[],lookupPreProcessed=new Map(null),lookupPartial=new Map(null),lookupProcessed=new Map(null),lookupSuggestion=new Map(null),query=function(location,lookupMap,filterFunc){let matches=lookupMap.get(location),arr1=[],arr2,i,newIdx,idx,idxKey,iEntry,subroutine=function(word,arr1){arr2=words[word];idx=new Map;for(let j=0;j3?max:3:3;return split[0]+(build.join("")+new Array(max+1).join("0")).slice(0,max)})})(function(fn){module.exports=fn})})(soundex$1);var Soundex=soundex$1.exports;function stopwords(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w}}function wordforms(wordform){wordform=wordform||{};return function(w){return wordform[w]||w}}function multiples(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([a-zåäö])\1+/gi,"$1")}}function dashes(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([^\s]){1}-/,"$1")}}function stripHtml(){let replaceMap={nbsp:" ",gt:">",lt:"<",aring:"å",Aring:"Å",ouml:"ö",Ouml:"Ö",auml:"ä",Auml:"Ä",Oslash:"Ø",oslash:"ø",uuml:"ü",Uuml:"Ü",quot:'"'},result,num;return function(field){field=field.replace(/(.*?)<\/a>/gi," $2 $1 ");field=field.replace(//gi," $1 ");field=field.replace(/.*?<\/script>/gi,"");field=field.replace(/.*?<\/style>/gi,"");field=field.replace(/<(?:.|\s)*?>/g," ");field=field.replace(/&#([0-9]{1,3});/gi,function(match,numStr){num=parseInt(numStr,10);return String.fromCharCode(num)});field=field.replace(/&([a-z]{2,5});/gi,function(match,entity){if((result=replaceMap[entity])!==undefined){return result}else{return" "}});return field}}function swedishStemmer(stopwords){let i,suffix=["dd","gd","nn","dt","gt","mm","tt"],endings=["igheter","igheten","ingarna","iteten","ingen","anden","andet","orna","aste","aren","arna","ande","erna","arne","itet","ndet","orn","het","ast","and","ade","ern","ing","are","en","ad","an","ar","ig","er","et","or","at","e","a"];stopwords=stopwords||{};return function(w){let word=w.substring(0,2),r1=w.substring(2,w.length);if(stopwords[w]===true)return w;if(w.length<=2)return w;if(r1[r1.length-1]==="s")r1=r1.substring(0,r1.length-1);if(r1.length===0)return word;for(i=0;i-1){r1=r1.substring(0,r1.lastIndexOf(endings[i]))}}if(r1.length===0)return word;w=word+r1;if(stopwords[w]===true)return w;for(i=0;i0){toss=true}else if(resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}function property(){return function(options){options=defaults({resultSet:null,index:null,sortBy:null},options);let documentResultsFinal=[],documentResultsLookup={},i,j,documentId,doc,weight,matches,word,match;j=0;while(word=options.resultSet.expressions[j++]){matches=[{flag:1,rows:word.hits.partial,weight:options.partialHit,length:word.hits.partial.length},{flag:2,rows:word.hits.processed,weight:options.processedHit,length:word.hits.processed.length},{flag:3,rows:word.hits.exact,weight:options.exactHit,length:word.hits.exact.length}];while(match=matches.pop()){for(i=0;i0){toss=true}else if(options.resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}var rankers=Object.freeze({__proto__:null,standard:standard,property:property});function processWord(word,opts){let result,i;if(!word||word.lengthopts.maxWordLen){word=word.substring(0,opts.maxWordLen)}if(!opts.caseSensitive){word=word.toLowerCase()}result={original:word,preprocessed:undefined,processed:undefined};for(i=0;i1&¤tField[k]!==""){wordHistory.push(currentField[k]);if(wordHistory.length>1){for(let l=0;l=opts.concatenateWords){wordHistory.shift()}}}}}}}if(done)self.index.compress()};Thinker.prototype.addFieldProcessor=function(fn){return this.options.fieldProcessors.push(fn),this};Thinker.prototype.addWordPreProcessor=function(fn){return this.options.wordPreProcessors.push(fn),this};Thinker.prototype.addWordProcessor=function(fn){return this.options.wordProcessors.push(fn),this};Thinker.prototype.find=function(params){time("totalFindTime");time("findTime");if(typeof params==="string"){params={expression:params}}params=defaults({expression:null,direction:true,filter:null,reduce:null,collectAll:null,collect:null,sortBy:"weight",limit:null},params);if(!params.expression)params.expression="";let self=this,words,word,resultSet={expressions:[],performance:{}},queryResult,suggestion,i,expression;expression=params.expression.replace(/-\s+/g," ");expression=expression.replace(/([^\s]){1}-/,"$1");expression=expression.replace(/\s+/g," ");expression=expression.trim(" ");words=expression.split(" ");for(i=0;i=0;i--){if(params.reduce(resultSet.documents[i].metadata)){tmpRes.push(resultSet.documents[i])}}resultSet.documents=tmpRes}if(params.collect){for(let c=0;cparams.limit){resultSet.documents=resultSet.documents.slice(0,params.limit)}resultSet.returnedHits=resultSet.documents.length;resultSet.performance.filter=time("filterTime");resultSet.performance.total=time("totalFindTime");return resultSet};Thinker.processors=processors;Thinker.rankers=rankers;export{Thinker,Thinker as default}; \ No newline at end of file +var levenshtein$1={exports:{}};const peq=new Uint32Array(65536);const myers_32=(a,b)=>{const n=a.length;const m=b.length;const lst=1<{const n=a.length;const m=b.length;const mhc=[];const phc=[];const hsize=Math.ceil(n/32);const vsize=Math.ceil(m/32);let score=m;for(let i=0;i>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<>>i&1;const mb=mhc[i/32|0]>>>i&1;const xv=eq|mv;const xh=((eq|mb)&pv)+pv^pv|eq|mb;let ph=mv|~(xh|pv);let mh=pv&xh;score+=ph>>>m-1&1;score-=mh>>>m-1&1;if(ph>>>31^pb){phc[i/32|0]^=1<>>31^mb){mhc[i/32|0]^=1<{if(a.length>b.length){const tmp=b;b=a;a=tmp}if(a.length===0){return b.length}if(a.length<=32){return myers_32(a,b)}return myers_x(a,b)};const closest=(str,arr)=>{let min_distance=Infinity;let min_index=0;for(let i=0;itmp){nextCol=tmp}tmp=prevRow[j+1]+1;if(nextCol>tmp){nextCol=tmp}prevRow[j]=curCol}prevRow[j]=nextCol}return nextCol}return levenshtein.distance(str1,str2)}};if(module!==null&&"object"!=="undefined"&&module.exports===exports){module.exports=Levenshtein}else if(typeof self!=="undefined"&&typeof self.postMessage==="function"&&typeof self.importScripts==="function"){self.Levenshtein=Levenshtein}else if(typeof window!=="undefined"&&window!==null){window.Levenshtein=Levenshtein}})()})(levenshtein$1,levenshtein$1.exports);var levenshtein=levenshtein$1.exports;function Index(options){let words=[],documents=[],lookupPreProcessed=new Map(null),lookupPartial=new Map(null),lookupProcessed=new Map(null),lookupSuggestion=new Map(null),query=function(location,lookupMap,filterFunc){let matches=lookupMap.get(location),arr1=[],arr2,i,newIdx,idx,idxKey,iEntry,subroutine=function(word,arr1){arr2=words[word];idx=new Map;for(let j=0;j3?max:3:3;return split[0]+(build.join("")+new Array(max+1).join("0")).slice(0,max)})})(function(fn){module.exports=fn})})(soundex$1);var Soundex=soundex$1.exports;function stopwords(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w}}function wordforms(wordform){wordform=wordform||{};return function(w){return wordform[w]||w}}function multiples(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([a-zåäö])\1+/gi,"$1")}}function dashes(stopword){stopword=stopword||{};return function(w){if(stopword[w]===true)return;return w.replace(/([^\s]){1}-/,"$1")}}function stripHtml(){let replaceMap={nbsp:" ",gt:">",lt:"<",aring:"å",Aring:"Å",ouml:"ö",Ouml:"Ö",auml:"ä",Auml:"Ä",Oslash:"Ø",oslash:"ø",uuml:"ü",Uuml:"Ü",quot:'"'},result,num;return function(field){field=field.replace(/(.*?)<\/a>/gi," $2 $1 ");field=field.replace(//gi," $1 ");field=field.replace(/.*?<\/script>/gi,"");field=field.replace(/.*?<\/style>/gi,"");field=field.replace(/<(?:.|\s)*?>/g," ");field=field.replace(/&#([0-9]{1,3});/gi,function(match,numStr){num=parseInt(numStr,10);return String.fromCharCode(num)});field=field.replace(/&([a-z]{2,5});/gi,function(match,entity){if((result=replaceMap[entity])!==undefined){return result}else{return" "}});return field}}function swedishStemmer(stopwords){let i,suffix=["dd","gd","nn","dt","gt","mm","tt"],endings=["igheter","igheten","ingarna","iteten","ingen","anden","andet","orna","aste","aren","arna","ande","erna","arne","itet","ndet","orn","het","ast","and","ade","ern","ing","are","en","ad","an","ar","ig","er","et","or","at","e","a"];stopwords=stopwords||{};return function(w){let word=w.substring(0,2),r1=w.substring(2,w.length);if(stopwords[w]===true)return w;if(w.length<=2)return w;if(r1[r1.length-1]==="s")r1=r1.substring(0,r1.length-1);if(r1.length===0)return word;for(i=0;i-1){r1=r1.substring(0,r1.lastIndexOf(endings[i]))}}if(r1.length===0)return word;w=word+r1;if(stopwords[w]===true)return w;for(i=0;i0){toss=true}else if(resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}function property(){return function(options){options=defaults({resultSet:null,index:null,sortBy:null},options);let documentResultsFinal=[],documentResultsLookup={},i,j,documentId,doc,weight,matches,word,match;j=0;while(word=options.resultSet.expressions[j++]){matches=[{flag:1,rows:word.hits.partial,weight:options.partialHit,length:word.hits.partial.length},{flag:2,rows:word.hits.processed,weight:options.processedHit,length:word.hits.processed.length},{flag:3,rows:word.hits.exact,weight:options.exactHit,length:word.hits.exact.length}];while(match=matches.pop()){for(i=0;i0){toss=true}else if(options.resultSet.expressions[j].modifier==="+"&&documentResultsFinal[i].expressions[j]===0){toss=true}}}if(!toss){temp[temp.length]=documentResultsFinal[i]}}return temp}}var rankers=Object.freeze({__proto__:null,standard:standard,property:property});function processWord(word,opts){let result,i;if(!word||word.lengthopts.maxWordLen){word=word.substring(0,opts.maxWordLen)}if(!opts.caseSensitive){word=word.toLowerCase()}result={original:word,preprocessed:undefined,processed:undefined};for(i=0;i1&¤tField[k]!==""){wordHistory.push(currentField[k]);if(wordHistory.length>1){for(let l=0;l=opts.concatenateWords){wordHistory.shift()}}}}}}}if(done)self.index.compress()};Thinker.prototype.addFieldProcessor=function(fn){return this.options.fieldProcessors.push(fn),this};Thinker.prototype.addWordPreProcessor=function(fn){return this.options.wordPreProcessors.push(fn),this};Thinker.prototype.addWordProcessor=function(fn){return this.options.wordProcessors.push(fn),this};Thinker.prototype.find=function(params){time("totalFindTime");time("findTime");if(typeof params==="string"){params={expression:params}}params=defaults({expression:null,direction:true,filter:null,reduce:null,collectAll:null,collect:null,sortBy:"weight",limit:null},params);if(!params.expression)params.expression="";let self=this,words,word,resultSet={expressions:[],performance:{}},queryResult,suggestion,i,expression;expression=params.expression.replace(/-\s+/g," ");expression=expression.replace(/([^\s]){1}-/,"$1");expression=expression.replace(/\s+/g," ");expression=expression.trim(" ");words=expression.split(" ");for(i=0;i=0;i--){if(params.reduce(resultSet.documents[i].metadata)){tmpRes.push(resultSet.documents[i])}}resultSet.documents=tmpRes}if(params.collect){for(let c=0;cparams.limit){resultSet.documents=resultSet.documents.slice(0,params.limit)}resultSet.returnedHits=resultSet.documents.length;resultSet.performance.filter=time("filterTime");resultSet.performance.total=time("totalFindTime");return resultSet};Thinker.processors=processors;Thinker.rankers=rankers;export{Thinker,Thinker as default}; \ No newline at end of file diff --git a/dist/thinker.min.mjs.map b/dist/thinker.min.mjs.map index 03b5e39..f3e2018 100644 --- a/dist/thinker.min.mjs.map +++ b/dist/thinker.min.mjs.map @@ -1 +1 @@ -{"version":3,"sources":["dist/thinker.mjs"],"names":["levenshtein$1","exports","peq","Uint32Array","myers_32","a","b","n","length","m","lst","let","pv","mv","sc","i","charCodeAt","eq","xv","myers_x","mhc","phc","hsize","Math","ceil","vsize","score","j","start","end","min","k","pb","mb","xh","ph","mh","distance","tmp","closest","str","arr","min_distance","Infinity","min_index","dist","fastestLevenshtein","module","collator","Intl","Collator","sensitivity","err","console","log","levenshtein","prevRow","str2Char","Levenshtein","get","str1","str2","options","useCollator","str1Len","str2Len","curCol","nextCol","strCmp","compare","charAt","String","fromCharCode","self","postMessage","importScripts","window","Index","words","documents","lookupPreProcessed","Map","lookupPartial","lookupProcessed","lookupSuggestion","query","location","lookupMap","filterFunc","matches","arr1","arr2","newIdx","idx","idxKey","iEntry","subroutine","word","set","undefined","constructor","Array","populate","wordIdx","lookup","dest","indexOf","exported","populatePartial","populateProcessed","populateDocuments","docid","meta","push","getMetadata","docidx","docIndexToId","populatePreProcessed","docIdx","fieldIdx","suggest","indexOriginal","suggestionCounter","match","found","preprocessed","original","getDocuments","exact","hits","processed","partial","findClosestWord","w","closestValue","closestIndex","forEach","value","key","compress","enableSuggestions","suggestionMinWordCount","delete","stemmer_1","stemmer","step2list","ational","tional","enci","anci","izer","bli","alli","entli","eli","ousli","ization","ation","ator","alism","iveness","fulness","ousness","aliti","iviti","biliti","logi","step3list","icate","ative","alize","iciti","ical","ful","ness","consonant","vowel","consonants","vowels","gt0","RegExp","eq1","gt1","vowelInStem","consonantLike","sfxLl","sfxE","sfxY","sfxIon","sfxEdOrIng","sfxAtOrBlOrIz","sfxEED","sfxS","sfxSsesOrIes","sfxMultiConsonantLike","step2","step3","step4","firstCharacterWasLowerCaseY","toLowerCase","slice","test","exec","soundex$1","Setup","scale","mysql","split","toUpperCase","replace","map","BFPV","CGJKQSXZ","DT","L","MN","R","keys","Object","reverse","build","letter","index","array","num","filter","first","splice","len","max","join","fn","Soundex","stopwords","stopword","wordforms","wordform","multiples","dashes","stripHtml","replaceMap","nbsp","gt","lt","aring","Aring","ouml","Ouml","auml","Auml","Oslash","oslash","uuml","Uuml","quot","result","field","numStr","parseInt","entity","swedishStemmer","suffix","endings","substring","r1","lastIndexOf","substr","englishStemmer","soundex","stemmers","swedish","english","processors","freeze","__proto__","time","times","performance","id","diff","now","process","hrtime","defaults","source","obj","prototype","hasOwnProperty","call","Error","standard","defaultFieldOptions","weight","boostPercentage","exactHit","processedHit","partialHit","fields","minimumWeight","resultSet","documentResultsFinal","documentResultsLookup","documentId","fieldIndex","matchCount","doc","fieldOptions","expressions","flag","rows","pop","temp","toss","modifier","property","sortBy","rankers","processWord","opts","minWordLen","maxWordLen","caseSensitive","wordPreProcessors","wordProcessors","Thinker","this","ranker","propertyRanker","characters","minWildcardWordLen","maxWildcardWordLen","fieldProcessors","optionalPlusFromExpressions","concatenateWords","feed","texts","done","currentDocument","currentField","currentWord","addWord","augmented","wIndex","metadata","wordHistory","l","augmentedWord","shift","addFieldProcessor","addWordPreProcessor","addWordProcessor","find","params","expression","direction","reduce","collectAll","collect","limit","queryResult","suggestion","trim","interpretation","exactMode","rank","totalHits","collections","reduced","c","filtered","collectedMetaKey","currentMetadata","isArray","count","tmpRes","sort","returnedHits","total"],"mappings":"AAAA,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OE,UAAa5V,EAAE8R,OAAS/R,EAAE+R,OAAW/R,EAAE+R,OAAS9R,EAAE8R,SAIjEO,UAAUtB,YAAYkG,KAAOpG,KAAK,YAGlC,GAAI6E,OAAOM,OAAS3D,UAAU5N,UAAUvE,OAASwV,OAAOM,MAAO,CAC9D3D,UAAU5N,UAAY4N,UAAU5N,UAAUyH,MAAM,EAAGwJ,OAAOM,OAG3D3D,UAAU6E,aAAe7E,UAAU5N,UAAUvE,OAE7CmS,UAAUtB,YAAYpD,OAASkD,KAAK,cAEpCwB,UAAUtB,YAAYoG,MAAQtG,KAAK,iBAEnC,OAAOwB,WAIRyB,QAAQpD,WAAaA,WACrBoD,QAAQR,QAAUA,eAETQ,QAASA"} \ No newline at end of file +{"version":3,"sources":["dist/thinker.mjs"],"names":["levenshtein$1","exports","peq","Uint32Array","myers_32","a","b","n","length","m","lst","let","pv","mv","sc","i","charCodeAt","eq","xv","myers_x","mhc","phc","hsize","Math","ceil","vsize","score","j","start","end","min","k","pb","mb","xh","ph","mh","distance","tmp","closest","str","arr","min_distance","Infinity","min_index","dist","fastestLevenshtein","module","collator","Intl","Collator","sensitivity","err","console","log","levenshtein","prevRow","str2Char","Levenshtein","get","str1","str2","options","useCollator","str1Len","str2Len","curCol","nextCol","strCmp","compare","charAt","String","fromCharCode","self","postMessage","importScripts","window","Index","words","documents","lookupPreProcessed","Map","lookupPartial","lookupProcessed","lookupSuggestion","query","location","lookupMap","filterFunc","matches","arr1","arr2","newIdx","idx","idxKey","iEntry","subroutine","word","set","undefined","constructor","Array","populate","wordIdx","lookup","dest","indexOf","exported","populatePartial","populateProcessed","populateDocuments","docid","meta","push","getMetadata","docidx","docIndexToId","populatePreProcessed","docIdx","fieldIdx","suggest","indexOriginal","suggestionCounter","match","found","preprocessed","original","getDocuments","exact","hits","processed","partial","findClosestWord","w","closestValue","closestIndex","forEach","value","key","compress","enableSuggestions","suggestionMinWordCount","delete","step2list","ational","tional","enci","anci","izer","bli","alli","entli","eli","ousli","ization","ation","ator","alism","iveness","fulness","ousness","aliti","iviti","biliti","logi","step3list","icate","ative","alize","iciti","ical","ful","ness","consonant","vowel","consonants","vowels","gt0","RegExp","eq1","gt1","vowelInStem","consonantLike","sfxLl","sfxE","sfxY","sfxIon","sfxEdOrIng","sfxAtOrBlOrIz","sfxEED","sfxS","sfxSsesOrIes","sfxMultiConsonantLike","step2","step3","step4","stemmer","firstCharacterWasLowerCaseY","toLowerCase","slice","test","exec","soundex$1","Setup","scale","mysql","split","toUpperCase","replace","map","BFPV","CGJKQSXZ","DT","L","MN","R","keys","Object","reverse","build","letter","index","array","num","filter","first","splice","len","max","join","fn","Soundex","stopwords","stopword","wordforms","wordform","multiples","dashes","stripHtml","replaceMap","nbsp","gt","lt","aring","Aring","ouml","Ouml","auml","Auml","Oslash","oslash","uuml","Uuml","quot","result","field","numStr","parseInt","entity","swedishStemmer","suffix","endings","substring","r1","lastIndexOf","substr","englishStemmer","soundex","stemmers","swedish","english","processors","freeze","__proto__","time","times","performance","id","diff","now","process","hrtime","defaults","source","obj","prototype","hasOwnProperty","call","Error","standard","defaultFieldOptions","weight","boostPercentage","exactHit","processedHit","partialHit","fields","minimumWeight","resultSet","documentResultsFinal","documentResultsLookup","documentId","fieldIndex","matchCount","doc","fieldOptions","expressions","flag","rows","pop","temp","toss","modifier","property","sortBy","rankers","processWord","opts","minWordLen","maxWordLen","caseSensitive","wordPreProcessors","wordProcessors","Thinker","this","ranker","propertyRanker","characters","minWildcardWordLen","maxWildcardWordLen","fieldProcessors","optionalPlusFromExpressions","concatenateWords","feed","texts","done","currentDocument","currentField","currentWord","addWord","augmented","wIndex","metadata","wordHistory","l","augmentedWord","shift","addFieldProcessor","addWordPreProcessor","addWordProcessor","find","params","expression","direction","reduce","collectAll","collect","limit","queryResult","suggestion","trim","interpretation","exactMode","rank","totalHits","collections","reduced","c","filtered","collectedMetaKey","currentMetadata","isArray","count","tmpRes","sort","returnedHits","total"],"mappings":"AAAA,IAAIA,cAAgB,CAACC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K,YAGlC,GAAI6E,OAAOM,OAAS3D,UAAU3N,UAAUvE,OAASuV,OAAOM,MAAO,CAC9D3D,UAAU3N,UAAY2N,UAAU3N,UAAUwH,MAAM,EAAGwJ,OAAOM,OAG3D3D,UAAU6E,aAAe7E,UAAU3N,UAAUvE,OAE7CkS,UAAUtB,YAAYpD,OAASkD,KAAK,cAEpCwB,UAAUtB,YAAYoG,MAAQtG,KAAK,iBAEnC,OAAOwB,WAIRyB,QAAQpD,WAAaA,WACrBoD,QAAQR,QAAUA,eAETQ,QAASA"} \ No newline at end of file diff --git a/dist/thinker.mjs b/dist/thinker.mjs index 204da14..b159a54 100644 --- a/dist/thinker.mjs +++ b/dist/thinker.mjs @@ -511,8 +511,6 @@ function Index(options) { return exported; } -var stemmer_1 = stemmer; - // Standard suffix manipulations. var step2list = { ational: 'ate', @@ -577,10 +575,16 @@ var step2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|izati var step3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; var step4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; -// Stem `value`. -// eslint-disable-next-line complexity +/** + * Stem `value`. + * + * @param {string} value + * @returns {string} + */ function stemmer(value) { + /** @type {boolean} */ var firstCharacterWasLowerCaseY; + /** @type {RegExpMatchArray} */ var match; value = String(value).toLowerCase(); @@ -601,17 +605,17 @@ function stemmer(value) { // Step 1a. if (sfxSsesOrIes.test(value)) { // Remove last two characters. - value = value.slice(0, value.length - 2); + value = value.slice(0, -2); } else if (sfxS.test(value)) { // Remove last character. - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } // Step 1b. if ((match = sfxEED.exec(value))) { if (gt0.test(match[1])) { // Remove last character. - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } } else if ((match = sfxEdOrIng.exec(value)) && vowelInStem.test(match[1])) { value = match[1]; @@ -621,7 +625,7 @@ function stemmer(value) { value += 'e'; } else if (sfxMultiConsonantLike.test(value)) { // Remove last character. - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } else if (consonantLike.test(value)) { // Append `e`. value += 'e'; @@ -663,7 +667,7 @@ function stemmer(value) { } if (sfxLl.test(value) && gt1.test(value)) { - value = value.slice(0, value.length - 1); + value = value.slice(0, -1); } // Turn initial `Y` back to `y`. @@ -883,7 +887,7 @@ function englishStemmer ( stopwords ) { return function ( w ) { // Dont process stopwords if ( stopwords[w] === true ) return w; - return stemmer_1( w ); + return stemmer( w ); }; } diff --git a/package-lock.json b/package-lock.json index a90bfb0..251bfbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "thinker-fts", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "thinker-fts", - "version": "2.0.4", + "version": "2.0.5", "license": "MIT", "devDependencies": { "@rollup/plugin-commonjs": "^21.0.2", diff --git a/package.json b/package.json index f804bed..2f36f84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "thinker-fts", - "version": "2.0.4", + "version": "2.0.5", "description": "Pure Javascript/Node.js in-memory full text search engine.", "author": "Hexagon ", "contributors": [