node-bitap
node-bitap copied to clipboard
Mishandling first character of text
Another issue I found is that there is something wrong in how your program handles the very beginning of he text where search should happen. For example:
bitap('test related to text beginning', 'te', 0)
[ 10, 17 ]
That misses the match at the very beginning. Compare to:
bitap(' test related to text beginning', 'te', 0)
[ 2, 11, 18 ]