16 #ifndef INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ 17 #define INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ 19 #include "nn/nlib/Swap.h" 22 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 23 #undef NLIB_VIS_PUBLIC 24 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 32 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
42 void Match(
const char* doc, MatchCallback callback,
void* user_obj) NLIB_NOEXCEPT {
43 this->Match(doc,
nlib_strlen(doc), callback, user_obj);
45 void Match(
const char* doc, MatchCallback callback) NLIB_NOEXCEPT {
46 this->Match(doc, callback, NULL);
48 void Match(
const char* data,
size_t n, MatchCallback callback,
void* user_obj)
NLIB_NOEXCEPT;
49 void Match(
const char* data,
size_t n, MatchCallback callback) NLIB_NOEXCEPT {
50 this->Match(data, n, callback, NULL);
57 class WordFilterPrivate;
58 WordFilterPrivate* prv_;
76 bool AddExcludeWords(
const char* str,
size_t len)
NLIB_NOEXCEPT;
86 struct WordFilterBuilderPrivate;
87 WordFilterBuilderPrivate* prv_;
93 NLIB_DEFINE_STD_SWAP(::nlib_ns::succinct::WordFilter)
94 NLIB_DEFINE_STD_SWAP(::nlib_ns::succinct::WordFilterBuilder)
95 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 96 #undef NLIB_VIS_PUBLIC 97 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 100 #endif // INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ #define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
void swap(WordFilter &rhs) noexcept
Swaps the contents of an object.
void Match(const char *doc, MatchCallback callback, void *user_obj) noexcept
Inspects the string to detect the registered string.
Class that checks whether text contains the predefined set of words.
Defines the class for searching text strings using the Aho-Corasick string-matching algorithm...
WordFilter() noexcept
Instantiates the object.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
bool AddExcludeWords(const char *str) noexcept
Adds a string from an array containing a set of excluded terms. The strings must be delimited by newl...
Class to create a WordFilter object that corresponds to a term and excluded terms.
The class for writing binary to streams (to OutputStream).
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.
The class for reading binary from streams (from InputStream).
WordFilterBuilder() noexcept
Instantiates the object.