presage  0.8.7
Public Member Functions | Private Attributes | Static Private Attributes
DictionaryPredictor Class Reference

#include <dictionaryPredictor.h>

Inheritance diagram for DictionaryPredictor:
Inheritance graph
[legend]
Collaboration diagram for DictionaryPredictor:
Collaboration graph
[legend]

List of all members.

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< DictionaryPredictordispatcher

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"

Detailed Description

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.


Constructor & Destructor Documentation

Definition at line 48 of file dictionaryPredictor.cpp.


Member Function Documentation

void DictionaryPredictor::learn ( const std::vector< std::string > &  change) [virtual]

Implements Predictor.

Definition at line 96 of file dictionaryPredictor.cpp.

References endl().

Here is the call graph for this function:

Prediction DictionaryPredictor::predict ( const size_t  size,
const char **  filter 
) const [virtual]

Generate prediction.

Parameters:
sizedesired prediction size
filterfilter

Implements Predictor.

Definition at line 66 of file dictionaryPredictor.cpp.

References Prediction::addSuggestion(), Predictor::contextTracker, dictionary_path, endl(), ContextTracker::getPrefix(), Predictor::logger, and probability.

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 60 of file dictionaryPredictor.h.

Referenced by predict(), and set_probability().


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