Bitap algorithm
Appearance
The bitap algorithm computes the levenshtein distance between two strings assuming it is smaller than a small integer n. It does this by precomputing a bit mask indicating which letter is allowed in which place. Then it is able to do most of the work bitwise operations which are extremely fast.
External References
- A simple implementation of the bitap algorithm that can handle most regular expressions.