ModErn Text Analysis
META Enumerates Textual Applications
|
Filter that stems words according to the porter2 stemmer algorithm. More...
#include <porter2_stemmer.h>
Public Member Functions | |
porter2_stemmer (std::unique_ptr< token_stream > source) | |
Constructs a new porter2 stemmer filter, reading tokens from the given source. More... | |
porter2_stemmer (const porter2_stemmer &other) | |
Copy constructor. More... | |
void | set_content (const std::string &content) override |
Sets the content for the beginning of the filter chain. More... | |
std::string | next () override |
Obtains the next token in the sequence. | |
operator bool () const override | |
Determines if there are more tokens available in the stream. | |
Public Member Functions inherited from meta::util::multilevel_clonable< Root, Base, Derived > | |
virtual std::unique_ptr< Root > | clone () const |
Clones the given object. More... | |
Static Public Attributes | |
static const std::string | id = "porter2-stemmer" |
Identifier for this filter. | |
Private Member Functions | |
void | next_token () |
Finds the next valid token for this filter. | |
Private Attributes | |
std::unique_ptr< token_stream > | source_ |
The stream to read tokens from. | |
util::optional< std::string > | token_ |
The buffered next token. | |
Filter that stems words according to the porter2 stemmer algorithm.
Requires that the porter2 stemmer project submodule be downloaded.
meta::analyzers::filters::porter2_stemmer::porter2_stemmer | ( | std::unique_ptr< token_stream > | source | ) |
Constructs a new porter2 stemmer filter, reading tokens from the given source.
source | The source to construct the filter from |
meta::analyzers::filters::porter2_stemmer::porter2_stemmer | ( | const porter2_stemmer & | other | ) |
Copy constructor.
other | The porter2_stemmer to copy into this one |
|
override |
Sets the content for the beginning of the filter chain.
content | The string content to set |