nlib
nn::nlib::succinct::WordFilterBuilder Class Referencefinal

Class to create a WordFilter object that corresponds to a term and excluded terms. More...

#include "nn/nlib/succinct/WordFilter.h"

Public Member Functions

WordFilterBuild () noexcept
 Creates a WordFilter object. More...
 
std::unique_ptr< WordFilterBuild2 () noexcept
 Creates a WordFilter object. More...
 
bool AddWord (const char *str) noexcept
 Adds term to match to the filter. More...
 
bool AddWords (const char *str, size_t len) noexcept
 Adds a string from an array containing a set of target strings. The strings must be delimited by newlines (CRLF or LF). More...
 
bool AddWords (const char *str) noexcept
 Adds a string from an array containing a set of target strings. The strings must be delimited by newlines (CRLF or LF). More...
 
bool AddExcludeWord (const char *str) noexcept
 Adds an excluded term. More...
 
bool AddExcludeWords (const char *str, size_t len) noexcept
 Adds a string from an array containing a set of excluded terms. The strings must be delimited by newlines (CRLF or LF). More...
 
bool AddExcludeWords (const char *str) noexcept
 Adds a string from an array containing a set of excluded terms. The strings must be delimited by newlines (CRLF or LF). More...
 
Constructor, Destructor, and Initialization
constexpr WordFilterBuilder () noexcept
 Instantiates the object with default parameters (default constructor). Requires initialization with Init() after execution.
 
 ~WordFilterBuilder () noexcept
 Destructor.
 
 WordFilterBuilder (WordFilterBuilder &&rhs)
 Instantiates the object (move constructor).
 
WordFilterBuilderoperator= (WordFilterBuilder &&rhs)
 Move assignment operator.
 
void Reset () noexcept
 Resets this object to the state immediately after the default constructor was executed.
 
bool Init () noexcept
 Initializes an object. Returns true if successful.
 

Detailed Description

Class to create a WordFilter object that corresponds to a term and excluded terms.

Definition at line 59 of file WordFilter.h.

Member Function Documentation

◆ AddExcludeWord()

nn::nlib::succinct::WordFilterBuilder::AddExcludeWord ( const char *  str)
noexcept

Adds an excluded term.

Parameters
[in]strExcluded term.
Returns
Returns true when successful.

◆ AddExcludeWords() [1/2]

nn::nlib::succinct::WordFilterBuilder::AddExcludeWords ( const char *  str,
size_t  len 
)
noexcept

Adds a string from an array containing a set of excluded terms. The strings must be delimited by newlines (CRLF or LF).

Parameters
[in]strPointer to the string.
[in]lenThe string length (the value of strlen).
Returns
Returns true when successful.

◆ AddExcludeWords() [2/2]

nn::nlib::succinct::WordFilterBuilder::AddExcludeWords ( const char *  str)
inlinenoexcept

Adds a string from an array containing a set of excluded terms. The strings must be delimited by newlines (CRLF or LF).

Parameters
[in]strPointer to the string.
Returns
Returns true when successful.

Definition at line 75 of file WordFilter.h.

◆ AddWord()

nn::nlib::succinct::WordFilterBuilder::AddWord ( const char *  str)
noexcept

Adds term to match to the filter.

Parameters
[in]strTerm to match.
Returns
Returns true when successful.

◆ AddWords() [1/2]

nn::nlib::succinct::WordFilterBuilder::AddWords ( const char *  str,
size_t  len 
)
noexcept

Adds a string from an array containing a set of target strings. The strings must be delimited by newlines (CRLF or LF).

Parameters
[in]strPointer to the string.
[in]lenThe string length (the value of strlen).
Returns
Returns true when successful.

◆ AddWords() [2/2]

nn::nlib::succinct::WordFilterBuilder::AddWords ( const char *  str)
inlinenoexcept

Adds a string from an array containing a set of target strings. The strings must be delimited by newlines (CRLF or LF).

Parameters
[in]strPointer to the string.
Returns
Returns true when successful.

Definition at line 72 of file WordFilter.h.

◆ Build()

nn::nlib::succinct::WordFilterBuilder::Build ( )
noexcept

Creates a WordFilter object.

Returns
Pointer to the WordFilter object.
Description
Call after setting target terms for the filter using functions such as AddWord and AddExcludeWord.

◆ Build2()

nn::nlib::succinct::WordFilterBuilder::Build2 ( )
inlinenoexcept

Creates a WordFilter object.

Returns
unique_ptr to the WordFilter object.
Description
Call after setting target terms for the filter using functions such as AddWord and AddExcludeWord.

Definition at line 68 of file WordFilter.h.


The documentation for this class was generated from the following files: