4 ms·
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 a
by germanjoey 7y ago
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/ https://pypi.org/project/weighted-levenshtein/
- maxbachmann 7y agoIn 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
- germanjoey 7y agoI am very interested in a version that allow you to pass in a custom substitution cost! It has a great use for OCR applications!
- edraferi 7y agoYeah that would be pretty cool. I’d be interested to use that to implement phonetic distance scoring.
- maxbachmann 7y agoWell then I will add it :)
- maxbachmann 7y ago`rapidfuzz.levenshtein.weighted_distance` does now support the three parameters `insert_cost`, `delete_cost` and `replace_cost`.