16 #ifndef INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ 17 #define INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ 21 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 22 #undef NLIB_VIS_PUBLIC 23 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 31 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
41 #ifdef NLIB_CXX11_RVALUE_REFERENCES 46 WordFilterPrivate* tmp = rhs.prv_;
51 void Match(
const char* doc, MatchCallback callback,
void* user_obj) NLIB_NOEXCEPT {
52 this->Match(doc,
nlib_strlen(doc), callback, user_obj);
54 void Match(
const char* doc, MatchCallback callback) NLIB_NOEXCEPT {
55 this->Match(doc, callback, NULL);
57 void Match(
const char* data,
size_t n, MatchCallback callback,
void* user_obj)
NLIB_NOEXCEPT;
58 void Match(
const char* data,
size_t n, MatchCallback callback) NLIB_NOEXCEPT {
59 this->Match(data, n, callback, NULL);
66 class WordFilterPrivate;
67 WordFilterPrivate* prv_;
84 bool AddExcludeWords(
const char* str,
size_t len)
NLIB_NOEXCEPT;
90 struct WordFilterBuilderPrivate;
91 WordFilterBuilderPrivate* prv_;
98 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 99 #undef NLIB_VIS_PUBLIC 100 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 103 #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.
An empty structure indicating that an argument to a function needs to be moved.
Defines the class for searching text strings using the Aho-Corasick string-matching algorithm...
WordFilter() noexcept
Instantiates the object.
WordFilter & assign(WordFilter &rhs, move_tag) noexcept
Assigns the object by using swap for a move.
#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.