presage
0.8.7
|
#include <dictionaryPredictor.h>
Public Member Functions | |
DictionaryPredictor (Configuration *, ContextTracker *) | |
~DictionaryPredictor () | |
virtual Prediction | predict (const size_t size, const char **filter) const |
Generate prediction. | |
virtual void | learn (const std::vector< std::string > &change) |
virtual void | update (const Observable *variable) |
void | set_dictionary (const std::string &value) |
void | set_probability (const std::string &value) |
Private Attributes | |
std::string | dictionary_path |
double | probability |
Dispatcher< DictionaryPredictor > | dispatcher |
Static Private Attributes | |
static const char * | LOGGER = "Presage.Predictors.DictionaryPredictor.LOGGER" |
static const char * | DICTIONARY = "Presage.Predictors.DictionaryPredictor.DICTIONARY" |
static const char * | PROBABILITY = "Presage.Predictors.DictionaryPredictor.PROBABILITY" |
Dictionary predictive predictor.
Generates a prediction by extracting tokens that start with the current prefix from a given dictionary.
Definition at line 40 of file dictionaryPredictor.h.
DictionaryPredictor::DictionaryPredictor | ( | Configuration * | config, |
ContextTracker * | ht | ||
) |
Definition at line 33 of file dictionaryPredictor.cpp.
References DICTIONARY, dispatcher, Configuration::find(), LOGGER, Dispatcher< class_t >::map(), PROBABILITY, set_dictionary(), Predictor::set_logger(), and set_probability().
Definition at line 48 of file dictionaryPredictor.cpp.
void DictionaryPredictor::learn | ( | const std::vector< std::string > & | change | ) | [virtual] |
Implements Predictor.
Definition at line 96 of file dictionaryPredictor.cpp.
References endl().
Prediction DictionaryPredictor::predict | ( | const size_t | size, |
const char ** | filter | ||
) | const [virtual] |
Generate prediction.
size | desired prediction size |
filter | filter |
Implements Predictor.
Definition at line 66 of file dictionaryPredictor.cpp.
References Prediction::addSuggestion(), Predictor::contextTracker, dictionary_path, endl(), ContextTracker::getPrefix(), Predictor::logger, and probability.
void DictionaryPredictor::set_dictionary | ( | const std::string & | value | ) |
Definition at line 53 of file dictionaryPredictor.cpp.
References dictionary_path, endl(), and Predictor::logger.
Referenced by DictionaryPredictor().
void DictionaryPredictor::set_probability | ( | const std::string & | value | ) |
Definition at line 60 of file dictionaryPredictor.cpp.
References endl(), Predictor::logger, probability, and Utility::toDouble().
Referenced by DictionaryPredictor().
void DictionaryPredictor::update | ( | const Observable * | variable | ) | [virtual] |
Implements Observer.
Definition at line 102 of file dictionaryPredictor.cpp.
References Dispatcher< class_t >::dispatch(), dispatcher, endl(), Observable::get_name(), Observable::get_value(), and Predictor::logger.
const char * DictionaryPredictor::DICTIONARY = "Presage.Predictors.DictionaryPredictor.DICTIONARY" [static, private] |
Definition at line 56 of file dictionaryPredictor.h.
Referenced by DictionaryPredictor().
std::string DictionaryPredictor::dictionary_path [private] |
Definition at line 59 of file dictionaryPredictor.h.
Referenced by predict(), and set_dictionary().
Definition at line 62 of file dictionaryPredictor.h.
Referenced by DictionaryPredictor(), and update().
const char * DictionaryPredictor::LOGGER = "Presage.Predictors.DictionaryPredictor.LOGGER" [static, private] |
Definition at line 55 of file dictionaryPredictor.h.
Referenced by DictionaryPredictor().
const char * DictionaryPredictor::PROBABILITY = "Presage.Predictors.DictionaryPredictor.PROBABILITY" [static, private] |
Definition at line 57 of file dictionaryPredictor.h.
Referenced by DictionaryPredictor().
double DictionaryPredictor::probability [private] |
Definition at line 60 of file dictionaryPredictor.h.
Referenced by predict(), and set_probability().