3 #ifndef INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_
4 #define INCLUDE_NN_NLIB_SUCCINCT_WORDFILTER_H_
12 #if defined(_MSC_VER) && defined(nx_succinct_EXPORTS)
13 #undef NLIB_VIS_PUBLIC
14 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
23 typedef bool (*MatchCallback)(
const char* first,
const char* last, uint32_t nodeid,
33 #ifdef NLIB_CXX11_RVALUE_REFERENCES
39 void Match(const
char* doc, MatchCallback callback,
void* user_obj = NULL) NLIB_NOEXCEPT {
40 this->Match(doc,
nlib_strlen(doc), callback, user_obj);
42 NLIB_VIS_PUBLIC void Match(
const char* data,
size_t n, MatchCallback callback,
43 void* user_obj = NULL) NLIB_NOEXCEPT;
61 NLIB_VIS_PUBLIC bool AddWords(const
char* str,
size_t len) NLIB_NOEXCEPT;
62 bool AddWords(const
char* str) NLIB_NOEXCEPT {
63 return AddWords(str, strlen(str));
68 return AddExcludeWords(str, strlen(str));
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_WORDFILTER_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Implements Trie using LOUDS.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#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.
The class for realloc-based implementations of C string vectors.
UniquePtr owns the pointer, and when it goes out of scope, the pointer is released by the destructor ...
Defines that class that is corresponding to std::unique_ptr.
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...
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).
The class for reading binary from streams (from InputStream).
WordFilterBuilder() noexcept
Instantiates the object.
~WordFilterBuilder() noexcept
Destructor.