Reputation: 67223
I'd like to try using the std::boyer_moore_searcher class. But I've run into two questions:
boyer_moore_searcher
class deals with this?Upvotes: 1
Views: 1277
Reputation: 7374
This is the answer to the first question:
Where is it? I'm using Visual Studio 2019 but it reports "namespace std has no member boyer_moore_searcher".
boyer_moore_searcher
is introduced in c++17 so to compile you need to enable c++17 option:
MSVC Compile option /std:c++17
or:
propertie->C/C++->All Options->C++ Language Standard
.
Upvotes: 1
Reputation: 16660
One of the issues with the Boyer Moore algorithm is that the jump table must be very large for Unicode characters
This is not really an answer, but too long for a comment.
The "skip table" for Boyer-Moore needs to have an entry for every "character" in the pattern that you're searching for.
For char
, the simplest (and fastest) way to do that is to have a 256-element array (and that's how the B-M algorithm was described in the original papers). But that's not a requirement; just an implementation detail.
Upvotes: 2