Closed loris closed 8 years ago
Will take a look at this later today :) Thanks for your work on this!
One thing I would say this needs is an addition to the README for its usage details. Could you add that into this PR?
I gave it a try at detailing the method usage, feel free to improve it :)
LGTM. I'll do a couple more tests today, and if all looks well, I'll get another release out today.
Please do, especially regarding the following lines:
.replace(/\-/g, ' ')
.replace(/(\.|\b(the|and|of|de|des|du|di|del|y|da|und|die) \b)/g, '')
We might need to add some more small words or characters to improve the matching.
ooo, yeah, we'll need at least la
and el
, los
, and las
for spanish... (this could get suuuper long...)
Hi @therebelrobot, have you had the chance to check this out?
I remember taking a look at it back when you submitted it, but haven't had a chance to take a deep dive because of the holiday. I'll have some time today to play catch up, set up new releases, etc. Defs by PT EOD for sure.
kk. lgtm. setting up a release.
v1.5.0
published.
Hi again, This is a fix I do need for my own use cases. So feel free to reject it if you think it might bloat the library. But I think it could be quite useful to others. It makes the matching insensitive to the case, diacritics, the presence of small words (of, the, end, ...) or some characters like "-" and ".". It does not have any performance impact since I do build an index at start (It might even be a bit faster). Have a look at the new test case to see some examples of matching that was not possible before.
(Sorry for the multiple commits, at first I was using an external fuzzy matching library but results were too inaccurate)