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 46 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
48 void MatchByBuilder(
const char* doc, MatchCallback callback,
void* user_obj)
NLIB_NOEXCEPT;
49 void MatchByBuilder(
const char* doc, MatchCallback callback) NLIB_NOEXCEPT {
50 MatchByBuilder(doc, callback, NULL);
63 struct BuildFailureArcTh;
64 struct BuildReportTreeHolderTh;
65 struct BuildFailureTreeHolderTh;
66 struct BuildGotoArcHolderTh;
67 struct BuildLenHolderTh;
71 struct AhoCorasickBuilderPrivate;
72 AhoCorasickBuilderPrivate* prv_;
78 NLIB_DEFINE_STD_SWAP(::nlib_ns::succinct::AhoCorasickBuilder)
79 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 80 #undef NLIB_VIS_PUBLIC 81 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 84 #endif // INCLUDE_NN_NLIB_SUCCINCT_AHOCORASICKBUILDER_H_ #define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
Uses the Aho-Corasick algorithm to detect language and patterns.
AhoCorasickBuilder() noexcept
Instantiates the object with default parameters (default constructor).
Defines the class for searching text strings using the Aho-Corasick string-matching algorithm...
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
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.