presage
0.9.2~beta
|
#include <contextChangeDetector.h>
Public Member Functions | |
ContextChangeDetector (const std::string, const std::string, const std::string, const std::string, bool) | |
~ContextChangeDetector () | |
bool | context_change (const std::string &past_stream) const |
std::string | change (const std::string &past_stream) const |
std::string | get_sliding_window () const |
void | set_sliding_window_size (const std::string &str) |
void | update_sliding_window (const std::string &str) |
Private Member Functions | |
bool | context_change_helper (const std::string &str1, const std::string &str2) const |
Private Attributes | |
std::string::size_type | SLIDING_WINDOW_SIZE |
std::string | sliding_window |
const std::string | wordChars |
const std::string | separatorChars |
const std::string | blankspaceChars |
const std::string | controlChars |
bool | lowercase_mode |
Static Private Attributes | |
static const std::string::size_type | DEFAULT_SLIDING_WINDOW_SIZE = 80 |
Definition at line 36 of file contextChangeDetector.h.
ContextChangeDetector::ContextChangeDetector | ( | const std::string | wChars, |
const std::string | tChars, | ||
const std::string | bChars, | ||
const std::string | cChars, | ||
bool | lowercase | ||
) |
Definition at line 35 of file contextChangeDetector.cpp.
ContextChangeDetector::~ContextChangeDetector | ( | ) |
Definition at line 49 of file contextChangeDetector.cpp.
std::string ContextChangeDetector::change | ( | const std::string & | past_stream | ) | const |
Definition at line 203 of file contextChangeDetector.cpp.
References blankspaceChars, context_change(), get_sliding_window(), lowercase_mode, Tokenizer::lowercaseMode(), ReverseTokenizer::nextToken(), separatorChars, and sliding_window.
Referenced by ContextTracker::update().
bool ContextChangeDetector::context_change | ( | const std::string & | past_stream | ) | const |
Definition at line 75 of file contextChangeDetector.cpp.
References context_change_helper(), and sliding_window.
Referenced by change(), and ContextTracker::contextChange().
|
private |
Definition at line 99 of file contextChangeDetector.cpp.
References wordChars.
Referenced by context_change().
std::string ContextChangeDetector::get_sliding_window | ( | ) | const |
Definition at line 265 of file contextChangeDetector.cpp.
References sliding_window.
Referenced by change().
void ContextChangeDetector::set_sliding_window_size | ( | const std::string & | str | ) |
Definition at line 54 of file contextChangeDetector.cpp.
References DEFAULT_SLIDING_WINDOW_SIZE, and SLIDING_WINDOW_SIZE.
Referenced by ContextTracker::set_sliding_window_size().
void ContextChangeDetector::update_sliding_window | ( | const std::string & | str | ) |
Definition at line 63 of file contextChangeDetector.cpp.
References sliding_window, and SLIDING_WINDOW_SIZE.
Referenced by ContextTracker::update().
|
private |
Definition at line 62 of file contextChangeDetector.h.
Referenced by change().
|
private |
Definition at line 63 of file contextChangeDetector.h.
|
staticprivate |
Definition at line 56 of file contextChangeDetector.h.
Referenced by set_sliding_window_size().
|
private |
Definition at line 64 of file contextChangeDetector.h.
Referenced by change().
|
private |
Definition at line 61 of file contextChangeDetector.h.
Referenced by change().
|
private |
Definition at line 58 of file contextChangeDetector.h.
Referenced by change(), context_change(), get_sliding_window(), and update_sliding_window().
|
private |
Definition at line 57 of file contextChangeDetector.h.
Referenced by set_sliding_window_size(), and update_sliding_window().
|
private |
Definition at line 60 of file contextChangeDetector.h.
Referenced by context_change_helper().