Turboshtein
nry.me·164w
Preview
Report Post

TL;DR - Possibly the fastest way of computing the Levenshtein distance between two fairly short ASCII strings in Python...


Background

I didn’t study computer science so the usefulness of bit shifts and other bitwise operations outside of low-level programming have always been a bit of a gray area for me. I finally gave in and decided to spend some time reading up on the subject and ended up implementing the Myers bit-vector algorithm1 for computing Levenshtein edit distance. I was fairly happy with the results so I wrapped the original C code in Python and uploaded it to PyPI. Coincidentally, it’s also pretty fast.…

Similar Posts

Loading similar posts...