ModErn Text Analysis
META Enumerates Textual Applications
lowercase_filter.h
Go to the documentation of this file.
1 
9 #ifndef META_LOWERCASE_FILTER_H_
10 #define META_LOWERCASE_FILTER_H_
11 
12 #include <memory>
13 #include "analyzers/token_stream.h"
14 #include "util/clonable.h"
15 
16 namespace meta
17 {
18 namespace analyzers
19 {
20 namespace filters
21 {
22 
26 class lowercase_filter : public util::clonable<token_stream, lowercase_filter>
27 {
28  public:
34  lowercase_filter(std::unique_ptr<token_stream> source);
35 
40  lowercase_filter(const lowercase_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:
63  std::unique_ptr<token_stream> source_;
64 };
65 }
66 }
67 }
68 #endif
std::string next() override
Obtains the next token in the sequence.
Definition: lowercase_filter.cpp:37
static const std::string id
Identifier for this filter.
Definition: lowercase_filter.h:59
void set_content(const std::string &content) override
Sets the content for the beginning of the filter chain.
Definition: lowercase_filter.cpp:32
Template class to facilitate polymorphic cloning.
Definition: clonable.h:28
std::unique_ptr< token_stream > source_
The stream to read tokens from.
Definition: lowercase_filter.h:63
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
Filter that converts all tokens to lowercase.
Definition: lowercase_filter.h:26
lowercase_filter(std::unique_ptr< token_stream > source)
Constructs a new lowercase_filter, reading tokens from the given source.
Definition: lowercase_filter.cpp:20