presage  0.9.2~beta
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ContextChangeDetector Class Reference

#include <contextChangeDetector.h>

Collaboration diagram for ContextChangeDetector:
Collaboration graph

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
 

Detailed Description

Definition at line 36 of file contextChangeDetector.h.

Constructor & Destructor Documentation

◆ ContextChangeDetector()

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::~ContextChangeDetector ( )

Definition at line 49 of file contextChangeDetector.cpp.

Member Function Documentation

◆ change()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ context_change()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ context_change_helper()

bool ContextChangeDetector::context_change_helper ( const std::string &  str1,
const std::string &  str2 
) const
private

Definition at line 99 of file contextChangeDetector.cpp.

References wordChars.

Referenced by context_change().

Here is the caller graph for this function:

◆ get_sliding_window()

std::string ContextChangeDetector::get_sliding_window ( ) const

Definition at line 265 of file contextChangeDetector.cpp.

References sliding_window.

Referenced by change().

Here is the caller graph for this function:

◆ set_sliding_window_size()

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().

Here is the caller graph for this function:

◆ update_sliding_window()

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().

Here is the caller graph for this function:

Member Data Documentation

◆ blankspaceChars

const std::string ContextChangeDetector::blankspaceChars
private

Definition at line 62 of file contextChangeDetector.h.

Referenced by change().

◆ controlChars

const std::string ContextChangeDetector::controlChars
private

Definition at line 63 of file contextChangeDetector.h.

◆ DEFAULT_SLIDING_WINDOW_SIZE

const std::string::size_type ContextChangeDetector::DEFAULT_SLIDING_WINDOW_SIZE = 80
staticprivate

Definition at line 56 of file contextChangeDetector.h.

Referenced by set_sliding_window_size().

◆ lowercase_mode

bool ContextChangeDetector::lowercase_mode
private

Definition at line 64 of file contextChangeDetector.h.

Referenced by change().

◆ separatorChars

const std::string ContextChangeDetector::separatorChars
private

Definition at line 61 of file contextChangeDetector.h.

Referenced by change().

◆ sliding_window

std::string ContextChangeDetector::sliding_window
private

◆ SLIDING_WINDOW_SIZE

std::string::size_type ContextChangeDetector::SLIDING_WINDOW_SIZE
private

Definition at line 57 of file contextChangeDetector.h.

Referenced by set_sliding_window_size(), and update_sliding_window().

◆ wordChars

const std::string ContextChangeDetector::wordChars
private

Definition at line 60 of file contextChangeDetector.h.

Referenced by context_change_helper().


The documentation for this class was generated from the following files: