joshaven / string_score

JavaScript string ranking 0 for no match upto 1 for perfect... "String".score("str"); //=> 0.825
MIT License
840 stars 62 forks source link

Support diacritics #34

Open bambeusz opened 4 years ago

bambeusz commented 4 years ago

So I stumbled on matching city names in Germany and particularly I have this:

'Gross-Gerau' .score('Groß-Gerau') => 0

I wonder if there's any chance that you can support mapping it first without diacritics as an option in the config? would be much easier this would be usage (as I see it):

'Gross-Gerau' .score('Groß-Gerau', { diacriticsMap: true }) => 1

or similar

joshaven commented 4 years ago

If you add the fuzzy match it should work.

Sent from my iPhone

On Jan 7, 2020, at 9:39 PM, Daniel Chmielowiec notifications@github.com wrote:

 So I stumbled on matching city names in Germany and particularly I have this: 'Gross-Gerau' .score('Groß-Gerau') which gives me 0, so I wonder if there's any chance that you can support mapping it first without diacritics as an option in the config? would be much easier

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.