ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
analyzers
filters
alpha_filter.h
Go to the documentation of this file.
1
9
#ifndef META_ALPHA_FILTER_H_
10
#define META_ALPHA_FILTER_H_
11
12
#include "
analyzers/token_stream.h
"
13
#include "
util/clonable.h
"
14
#include "
util/optional.h
"
15
16
namespace
meta
17
{
18
namespace
analyzers
19
{
20
namespace
filters
21
{
22
27
class
alpha_filter
:
public
util::clonable
<token_stream, alpha_filter>
28
{
29
public
:
34
alpha_filter
(std::unique_ptr<token_stream> source);
35
40
alpha_filter
(
const
alpha_filter
& other);
41
46
void
set_content
(
const
std::string& content)
override
;
47
51
std::string
next
()
override
;
52
56
operator
bool()
const override
;
57
59
const
static
std::string
id
;
60
61
private
:
65
void
next_token
();
66
68
std::unique_ptr<token_stream>
source_
;
69
71
util::optional<std::string>
token_
;
72
};
73
}
74
}
75
}
76
#endif
meta::util::optional< std::string >
optional.h
meta::analyzers::filters::alpha_filter
Filter that removes "non-letter" characters from tokens.
Definition:
alpha_filter.h:27
meta::analyzers::filters::alpha_filter::alpha_filter
alpha_filter(std::unique_ptr< token_stream > source)
Constructs an alpha filter reading tokens from the given source.
Definition:
alpha_filter.cpp:19
meta::analyzers::filters::alpha_filter::id
static const std::string id
Identifier for this filter.
Definition:
alpha_filter.h:59
meta::analyzers::filters::alpha_filter::token_
util::optional< std::string > token_
The buffered token.
Definition:
alpha_filter.h:71
meta::analyzers::filters::alpha_filter::set_content
void set_content(const std::string &content) override
Sets the content for the beginning of the filter chain.
Definition:
alpha_filter.cpp:31
meta::util::multilevel_clonable
Template class to facilitate polymorphic cloning.
Definition:
clonable.h:28
clonable.h
meta::analyzers::filters::alpha_filter::source_
std::unique_ptr< token_stream > source_
The source to read tokens from.
Definition:
alpha_filter.h:68
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::alpha_filter::next
std::string next() override
Obtains the next token in the sequence.
Definition:
alpha_filter.cpp:37
token_stream.h
meta::analyzers::filters::alpha_filter::next_token
void next_token()
Finds the next valid token for this filter.
Definition:
alpha_filter.cpp:44
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1