News for hackers. Stuff that matters.
Re:Show HN: RapidFuzz – A fast string matching library for P... by germanjoey on Monday March 30, 2020 @05:02AM (#22726314)
Looks awesome. I've used FuzzyWuzzy to some success in the past but its performance was abysmal, so I'm interested in giving this a try.

Any chance you could also implement a weighted-levenshtein version? (or allow passing in a weight-table for various characters combinations as like a kwarg or something?)

edit: Something like this, but with the speed of C++ would be amazing. https://pypi.org/project/weighted-levenshtein/

Re:Show HN: RapidFuzz – A fast string matching library for P... by maxbachmann on Monday March 30, 2020 @05:10AM (#22726341)
In the last release I added a module `rapidfuzz.levenshtein` which allows calculating a normal levenshtein distance and a weighted version where substitutions have a weight of 2 (this one is actually used by FuzzyWuzzy for ratio calculations). But when there is interest in other weighting options I can add a version that allows to pass in custom costs for insertions, deletions, and substitutions
Re:Show HN: RapidFuzz – A fast string matching library for P... by germanjoey on Monday March 30, 2020 @07:19AM (#22727019)
I am very interested in a version that allow you to pass in a custom substitution cost! It has a great use for OCR applications!
Re:Show HN: RapidFuzz – A fast string matching library for P... by maxbachmann on Monday March 30, 2020 @10:51AM (#22728455)
Well then I will add it :)
Re:Show HN: RapidFuzz – A fast string matching library for P... by maxbachmann on Tuesday March 31, 2020 @06:00AM (#22736207)
`rapidfuzz.levenshtein.weighted_distance` does now support the three parameters `insert_cost`, `delete_cost` and `replace_cost`.
Re:Show HN: RapidFuzz – A fast string matching library for P... by edraferi on Monday March 30, 2020 @08:02AM (#22727295)
Yeah that would be pretty cool. I’d be interested to use that to implement phonetic distance scoring.