You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be helpful if the README included an example on how best to use this to match. My thought would be something like:
constword1='Smith';constword2='Schmidt';// These should match on one keyconstkeys1=doubleMetaphone(word1);// Output: [ 'SM0', 'XMT' ]constkeys2=doubleMetaphone(word2);// Output: [ 'XMT', 'SMT' ]constisMatch=keys.some(k=>keys2.includes(k));
Is that the best way?
One thought for an improvement would be the output of doubleMetaphone is a Set, in which case you could do this:
constisMatch=keys1.intersection(keys2).size>0;
But it would be useful to create a benchmark to see if there is actually much of a performance improvement.
The text was updated successfully, but these errors were encountered:
I kinda get it. But, there are other things that people want too, such as combining with stemmer as shown in the readme. And we can’t get examples for all cases. And at some point, perhaps it’s more about generic JavaScript knowledge and not about this package.
The problem with “Is that the best way?” is that there are different trade offs that apply to different people. To name some, compatibility with older JS vs performance vs bundle size.
It would be helpful if the README included an example on how best to use this to match. My thought would be something like:
Is that the best way?
One thought for an improvement would be the output of
doubleMetaphone
is aSet
, in which case you could do this:But it would be useful to create a benchmark to see if there is actually much of a performance improvement.
The text was updated successfully, but these errors were encountered: