ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
analyzers
filters
porter2_stemmer.h
Go to the documentation of this file.
1
9
#ifndef META_FILTER_PORTER2_STEMMER_H_
10
#define META_FILTER_PORTER2_STEMMER_H_
11
12
#include <memory>
13
#include "
analyzers/token_stream.h
"
14
#include "
util/clonable.h
"
15
#include "
util/optional.h
"
16
17
namespace
meta
18
{
19
namespace
analyzers
20
{
21
namespace
filters
22
{
23
28
class
porter2_stemmer
:
public
util::clonable
<token_stream, porter2_stemmer>
29
{
30
public
:
36
porter2_stemmer
(std::unique_ptr<token_stream> source);
37
42
porter2_stemmer
(
const
porter2_stemmer
& other);
43
48
void
set_content
(
const
std::string& content)
override
;
49
53
std::string
next
()
override
;
54
58
operator
bool()
const override
;
59
61
const
static
std::string
id
;
62
63
private
:
67
void
next_token
();
68
70
std::unique_ptr<token_stream>
source_
;
71
73
util::optional<std::string>
token_
;
74
};
75
}
76
}
77
}
78
#endif
meta::util::optional< std::string >
meta::analyzers::filters::porter2_stemmer::source_
std::unique_ptr< token_stream > source_
The stream to read tokens from.
Definition:
porter2_stemmer.h:70
optional.h
meta::analyzers::filters::porter2_stemmer::next_token
void next_token()
Finds the next valid token for this filter.
Definition:
porter2_stemmer.cpp:43
meta::analyzers::filters::porter2_stemmer
Filter that stems words according to the porter2 stemmer algorithm.
Definition:
porter2_stemmer.h:28
meta::analyzers::filters::porter2_stemmer::token_
util::optional< std::string > token_
The buffered next token.
Definition:
porter2_stemmer.h:73
meta::util::multilevel_clonable
Template class to facilitate polymorphic cloning.
Definition:
clonable.h:28
meta::analyzers::filters::porter2_stemmer::porter2_stemmer
porter2_stemmer(std::unique_ptr< token_stream > source)
Constructs a new porter2 stemmer filter, reading tokens from the given source.
Definition:
porter2_stemmer.cpp:18
clonable.h
meta
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition:
analyzer.h:24
meta::analyzers::filters::porter2_stemmer::id
static const std::string id
Identifier for this filter.
Definition:
porter2_stemmer.h:61
meta::analyzers::filters::porter2_stemmer::next
std::string next() override
Obtains the next token in the sequence.
Definition:
porter2_stemmer.cpp:36
meta::analyzers::filters::porter2_stemmer::set_content
void set_content(const std::string &content) override
Sets the content for the beginning of the filter chain.
Definition:
porter2_stemmer.cpp:30
token_stream.h
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1