16 #ifndef INCLUDE_NN_NLIB_SUCCINCT_AHOCORASICKBUILDER_H_ 17 #define INCLUDE_NN_NLIB_SUCCINCT_AHOCORASICKBUILDER_H_ 22 #include "nn/nlib/Swap.h" 25 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 26 #undef NLIB_VIS_PUBLIC 27 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 45 #ifdef __cpp_rvalue_references 48 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
50 void MatchByBuilder(
const char* doc, MatchCallback callback,
void* user_obj)
NLIB_NOEXCEPT;
52 MatchByBuilder(doc, callback,
nullptr);
61 struct BuildFailureArcTh;
62 struct BuildReportTreeHolderTh;
63 struct BuildFailureTreeHolderTh;
64 struct BuildGotoArcHolderTh;
65 struct BuildLenHolderTh;
69 struct AhoCorasickBuilderPrivate;
70 AhoCorasickBuilderPrivate* prv_;
77 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 78 #undef NLIB_VIS_PUBLIC 79 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 82 #endif // INCLUDE_NN_NLIB_SUCCINCT_AHOCORASICKBUILDER_H_ std::unique_ptr< AhoCorasick > Build2() noexcept
Creates the AhoCorasick object and return it with unique_ptr. Constructs an Aho-Corasick algorithm au...
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
~AhoCorasickBuilder() noexcept
Destructor.
Uses the Aho-Corasick algorithm to detect language and patterns.
constexpr AhoCorasickBuilder() noexcept
Instantiates the object with default parameters (default constructor).
Defines the class for searching text strings using the Aho-Corasick string-matching algorithm...
Implements stream-related classes usually commonly used, various containers, and other gadget classes...
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
bool AddWords(const char *str) noexcept
Adds a string from an array containing a set of target strings. The strings must be delimited by newl...
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Creates the index (automaton) used in the Aho-Corasick algorithm.
void MatchByBuilder(const char *doc, MatchCallback callback) noexcept
A parameter omitted version of the above function.