node-bitap
node-bitap copied to clipboard
Issues with Deletions
Hi, great little JS program you have here. One question I have, however, is whether your algorithm is really handling deletions correctly - that is, like in the source paper.
Check those examples:
> bitap('testing', 'testx', 1)
[]
> bitap('testing', 'xtest', 1)
[]
> bitap('testing', 'texst', 1)
[]
In all the three above, only one deletion would be needed to make the pattern be found in the text, at position 0 (or, in your program, position 3, since for some reason you decide to return the position of the end of the matched substrings).