R1j1t / contextualSpellCheck

✔️Contextual word checker for better suggestions
MIT License
405 stars 56 forks source link

replace editdistance with rapidfuzz #60

Closed maxbachmann closed 3 years ago

maxbachmann commented 3 years ago

This PR replaces editdistance with RapidFuzz (disclaimer: I am the author). RapidFuzz has a faster Levenshtein implementation and in addition provides a function process.extractOne, which searches for the choice with the highest similarity/smallest edit distance in a list of choices. This is allows the use of a couple of optimizations and saves a lot of function call overhead from Python making it a lot faster.

R1j1t commented 3 years ago

@maxbachmann Thanks for the pull request. Currently the bottleneck in performance is not in the edit distance code. So I will not merge this PR. Once the current slow part of the code is optimized, I will merge it then. So I will close it for now.