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 51 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
53 void MatchByBuilder(
const char* doc, MatchCallback callback,
void* user_obj)
NLIB_NOEXCEPT;
54 void MatchByBuilder(
const char* doc, MatchCallback callback) NLIB_NOEXCEPT {
55 MatchByBuilder(doc, callback,
nullptr);
64 struct BuildFailureArcTh;
65 struct BuildReportTreeHolderTh;
66 struct BuildFailureTreeHolderTh;
67 struct BuildGotoArcHolderTh;
68 struct BuildLenHolderTh;
72 struct AhoCorasickBuilderPrivate;
73 AhoCorasickBuilderPrivate* prv_;
79 NLIB_DEFINE_STD_SWAP(::nlib_ns::succinct::AhoCorasickBuilder)
80 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 81 #undef NLIB_VIS_PUBLIC 82 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 85 #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...
~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...
#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.