ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
analyzers
filters
empty_sentence_filter.h
Go to the documentation of this file.
1
9
#ifndef META_EMPTY_SENTENCE_FILTER_H_
10
#define META_EMPTY_SENTENCE_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
{
27
class
empty_sentence_filter
28
:
public
util::clonable
<token_stream, empty_sentence_filter>
29
{
30
public
:
36
empty_sentence_filter
(std::unique_ptr<token_stream> source);
37
42
empty_sentence_filter
(
const
empty_sentence_filter
& 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>
first_
;
74
76
util::optional<std::string>
second_
;
77
};
78
}
79
}
80
}
81
#endif
meta::util::optional< std::string >
optional.h
meta::analyzers::filters::empty_sentence_filter::id
static const std::string id
Identifier for this filter.
Definition:
empty_sentence_filter.h:61
meta::analyzers::filters::empty_sentence_filter::first_
util::optional< std::string > first_
Keeps track of the left hand side of a potentially empty sentence.
Definition:
empty_sentence_filter.h:73
meta::analyzers::filters::empty_sentence_filter::empty_sentence_filter
empty_sentence_filter(std::unique_ptr< token_stream > source)
Constructs an empty_sentence_filter which reads tokens from the given source.
Definition:
empty_sentence_filter.cpp:17
meta::util::multilevel_clonable
Template class to facilitate polymorphic cloning.
Definition:
clonable.h:28
clonable.h
meta::analyzers::filters::empty_sentence_filter::next
std::string next() override
Obtains the next token in the sequence.
Definition:
empty_sentence_filter.cpp:60
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::empty_sentence_filter
Filter that removes any empty sentences from the token stream.
Definition:
empty_sentence_filter.h:27
meta::analyzers::filters::empty_sentence_filter::second_
util::optional< std::string > second_
Keeps track of the right hand side of a potentially empty sentence.
Definition:
empty_sentence_filter.h:76
meta::analyzers::filters::empty_sentence_filter::set_content
void set_content(const std::string &content) override
Sets the content for the beginning of the filter chain.
Definition:
empty_sentence_filter.cpp:32
meta::analyzers::filters::empty_sentence_filter::source_
std::unique_ptr< token_stream > source_
The source to read tokens from.
Definition:
empty_sentence_filter.h:70
token_stream.h
meta::analyzers::filters::empty_sentence_filter::next_token
void next_token()
Finds the next valid token for this filter.
Definition:
empty_sentence_filter.cpp:39
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1