in reply to Why Boyer-Moore, Horspool, alpha-skip et.al don't work for bit strings. (And is there an alternative that does?)

I guess I would just use a trie with short circuit and step through bit by bit (ony actually searching i+n bits on the needle if the previous bits match and jumping forward 1 bit on a fail) or modified aho-corasick that is constructed with offset needles where you bit compare and shift in larger blocks but with more compares per block -- backtracking if the constructed needle offsets match. This second option may have much better performance as you are able to use the alignment of the bit stream in memory and the cpu's register to your advantage. Its a lot of compares but in a way that is completely optimized by the system.
  • Comment on Re: Why Boyer-Moore, Horspool, alpha-skip et.al don't work for bit strings. (And is there an alternative that does?)