ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
meta::analyzers::filters::porter2_stemmer Class Reference

Filter that stems words according to the porter2 stemmer algorithm. More...

#include <porter2_stemmer.h>

Inheritance diagram for meta::analyzers::filters::porter2_stemmer:
meta::util::multilevel_clonable< Root, Base, Derived >

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_streamsource_
 The stream to read tokens from.
 
util::optional< std::string > token_
 The buffered next token.
 

Detailed Description

Filter that stems words according to the porter2 stemmer algorithm.

Requires that the porter2 stemmer project submodule be downloaded.

Constructor & Destructor Documentation

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.

Parameters
sourceThe source to construct the filter from
meta::analyzers::filters::porter2_stemmer::porter2_stemmer ( const porter2_stemmer other)

Copy constructor.

Parameters
otherThe porter2_stemmer to copy into this one

Member Function Documentation

void meta::analyzers::filters::porter2_stemmer::set_content ( const std::string &  content)
override

Sets the content for the beginning of the filter chain.

Parameters
contentThe string content to set

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