3 #ifndef INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ 4 #define INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_ 8 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 10 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 18 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
28 #ifdef NLIB_CXX11_RVALUE_REFERENCES 33 WordFilterPrivate* tmp = rhs.prv_;
38 void Match(
const char* doc, MatchCallback callback,
void* user_obj) NLIB_NOEXCEPT {
39 this->Match(doc,
nlib_strlen(doc), callback, user_obj);
41 void Match(
const char* doc, MatchCallback callback) NLIB_NOEXCEPT {
42 this->Match(doc, callback, NULL);
44 void Match(
const char* data,
size_t n, MatchCallback callback,
void* user_obj)
NLIB_NOEXCEPT;
45 void Match(
const char* data,
size_t n, MatchCallback callback) NLIB_NOEXCEPT {
46 this->Match(data, n, callback, NULL);
53 class WordFilterPrivate;
54 WordFilterPrivate* prv_;
71 bool AddExcludeWords(
const char* str,
size_t len)
NLIB_NOEXCEPT;
77 struct WordFilterBuilderPrivate;
78 WordFilterBuilderPrivate* prv_;
85 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS) 86 #undef NLIB_VIS_PUBLIC 87 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 90 #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.