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`.
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/