diff --git a/dist/thinker.cjs b/dist/thinker.cjs index 825849e..fd69f72 100644 --- a/dist/thinker.cjs +++ b/dist/thinker.cjs @@ -923,14 +923,14 @@ let diff; if (!times[id]) { - times[id] = process.hrtime(); + times[id] = performance.now(); return; } - diff = process.hrtime(times[id]); + diff = performance.now() - times[id]; times[id] = undefined; - return (diff[0] * 1e9 + diff[1]) / 1E6; + return diff; }; }()); diff --git a/dist/thinker.min.js b/dist/thinker.min.js index 9961317..f4e209e 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 c907b5d..a32cc80 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","id","diff","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","performance","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,E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AU1N,UAAU9D,GAG1C,GAAI8V,kBAAoBlC,gBAAgBM,UAAYN,gBAAgBM,SAAS4B,kBAAmB,CAC/FlW,IAAImW,gBAAkBnC,gBAAgBM,SAAS4B,kBAG/C,GAAI1Q,MAAM4Q,QAAQD,iBAAkB,CACnC,IAAInW,IAAIgB,EAAI,EAAGA,EAAImV,gBAAgBtW,OAAQmB,IAAK,CAC/ChB,IAAIqW,MAAQzE,UAAUkE,YAAYC,QAAQG,kBAAkBnT,IAAIoT,gBAAgBnV,KAAO,EACvF4Q,UAAUkE,YAAYC,QAAQG,kBAAkB7Q,IAAI8Q,gBAAgBnV,KAAMqV,YAErE,CACNrW,IAAIqW,MAAQzE,UAAUkE,YAAYC,QAAQG,kBAAkBnT,IAAIoT,kBAAoB,EACpFvE,UAAUkE,YAAYC,QAAQG,kBAAkB7Q,IAAI8Q,kBAAmBE,WAS5E/F,KAAK,YAGLsB,UAAU1N,UAAY0N,UAAU1N,UAAUqS,KAAK,SAAS7W,EAAGC,GAC1D,OAAOoV,OAAOE,UAAatV,EAAE0R,OAAS3R,EAAE2R,OAAW3R,EAAE2R,OAAS1R,EAAE0R,SAIjEO,UAAU0D,YAAYiB,KAAOjG,KAAK,YAGlC,GAAIyE,OAAOM,OAASzD,UAAU1N,UAAUrE,OAASkV,OAAOM,MAAO,CAC9DzD,UAAU1N,UAAY0N,UAAU1N,UAAUyH,MAAM,EAAGoJ,OAAOM,OAG3DzD,UAAU4E,aAAe5E,UAAU1N,UAAUrE,OAE7C+R,UAAU0D,YAAYlI,OAASkD,KAAK,cAEpCsB,UAAU0D,YAAYmB,MAAQnG,KAAK,iBAEnC,OAAOsB,WAIRxS,QAAQ+Q,WAAaA,WACrB/Q,QAAQyT,QAAUA,QAElB,OAAOzT"} \ 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","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","id","diff","performance","now","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,G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AAS2B,kBAAmB,CAC/FjW,IAAIkW,gBAAkBlC,gBAAgBM,SAAS2B,kBAG/C,GAAIzQ,MAAM2Q,QAAQD,iBAAkB,CACnC,IAAIlW,IAAIgB,EAAI,EAAGA,EAAIkV,gBAAgBrW,OAAQmB,IAAK,CAC/ChB,IAAIoW,MAAQxE,UAAUiE,YAAYC,QAAQG,kBAAkBlT,IAAImT,gBAAgBlV,KAAO,EACvF4Q,UAAUiE,YAAYC,QAAQG,kBAAkB5Q,IAAI6Q,gBAAgBlV,KAAMoV,YAErE,CACNpW,IAAIoW,MAAQxE,UAAUiE,YAAYC,QAAQG,kBAAkBlT,IAAImT,kBAAoB,EACpFtE,UAAUiE,YAAYC,QAAQG,kBAAkB5Q,IAAI6Q,kBAAmBE,WAS5E9F,KAAK,YAGLsB,UAAU1N,UAAY0N,UAAU1N,UAAUoS,KAAK,SAAS5W,EAAGC,GAC1D,OAAOoV,OAAOE,UAAatV,EAAE0R,OAAS3R,EAAE2R,OAAW3R,EAAE2R,OAAS1R,EAAE0R,SAIjEO,UAAUlB,YAAY4F,KAAOhG,KAAK,YAGlC,GAAIyE,OAAOM,OAASzD,UAAU1N,UAAUrE,OAASkV,OAAOM,MAAO,CAC9DzD,UAAU1N,UAAY0N,UAAU1N,UAAUyH,MAAM,EAAGoJ,OAAOM,OAG3DzD,UAAU2E,aAAe3E,UAAU1N,UAAUrE,OAE7C+R,UAAUlB,YAAYtD,OAASkD,KAAK,cAEpCsB,UAAUlB,YAAY8F,MAAQlG,KAAK,iBAEnC,OAAOsB,WAIRxS,QAAQ+Q,WAAaA,WACrB/Q,QAAQyT,QAAUA,QAElB,OAAOzT"} \ No newline at end of file diff --git a/dist/thinker.min.mjs b/dist/thinker.min.mjs index 9a04f4f..bedb9a8 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 3ca7018..8bd6b5c 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","id","diff","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","performance","queryResult","suggestion","trim","interpretation","exactMode","rank","totalHits","collections","reduced","c","filtered","collectedMetaKey","currentMetadata","isArray","count","tmpRes","sort","returnedHits","total"],"mappings":"AA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N,UAAU1N,UAAUyH,MAAM,EAAGsJ,OAAOM,OAG3D3D,UAAU8E,aAAe9E,UAAU1N,UAAUvE,OAE7CiS,UAAU4D,YAAYpI,OAASkD,KAAK,cAEpCsB,UAAU4D,YAAYmB,MAAQrG,KAAK,iBAEnC,OAAOsB,WAIRyB,QAAQlD,WAAaA,WACrBkD,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","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","id","diff","performance","now","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,QAAS,IAE9B,MAAMC,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,EAC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--git a/dist/thinker.mjs b/dist/thinker.mjs index b075996..5b5f14c 100644 --- a/dist/thinker.mjs +++ b/dist/thinker.mjs @@ -917,14 +917,14 @@ let time = (function () { let diff; if (!times[id]) { - times[id] = process.hrtime(); + times[id] = performance.now(); return; } - diff = process.hrtime(times[id]); + diff = performance.now() - times[id]; times[id] = undefined; - return (diff[0] * 1e9 + diff[1]) / 1E6; + return diff; }; }()); diff --git a/package.json b/package.json index b2e2f0d..32ef391 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "thinker-fts", - "version": "2.0.0", + "version": "2.0.1", "description": "Pure Javascript/Node.js in-memory full text search engine.", "author": "Hexagon ", "contributors": [ diff --git a/src/utils.js b/src/utils.js index 808523b..c6908ff 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,3 @@ -"use strict"; - // Helper function for measuring execution time let time = (function () { let times = {}; @@ -8,14 +6,14 @@ let time = (function () { let diff; if (!times[id]) { - times[id] = process.hrtime(); + times[id] = performance.now(); return; } - diff = process.hrtime(times[id]); + diff = performance.now() - times[id]; times[id] = undefined; - return (diff[0] * 1e9 + diff[1]) / 1E6; + return diff; }; }());