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

#include <abbreviationExpansionPredictor.h>

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

List of all members.

Public Member Functions

 AbbreviationExpansionPredictor (Configuration *, ContextTracker *)
 ~AbbreviationExpansionPredictor ()
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)

Private Member Functions

void set_abbreviations (const std::string &filename)
void cacheAbbreviationsExpansions ()

Private Attributes

std::string abbreviations
std::map< std::string,
std::string > 
cache
Dispatcher
< AbbreviationExpansionPredictor
dispatcher

Static Private Attributes

static const char * LOGGER = "Presage.Predictors.AbbreviationExpansionPredictor.LOGGER"
static const char * ABBREVIATIONS = "Presage.Predictors.AbbreviationExpansionPredictor.ABBREVIATIONS"

Detailed Description

Abbreviation expansion predictor.

This predictor maps abbreviations to the corresponding fully expanded token (i.e. word or phrase).

The mapping between abbreviations and expansions is stored in the file specified by the predictor configuration section.

The format for the abbreviation-expansion database is a simple tab separated text file format, with each abbreviation-expansion pair per line.

Definition at line 45 of file abbreviationExpansionPredictor.h.


Constructor & Destructor Documentation

Definition at line 47 of file abbreviationExpansionPredictor.cpp.


Member Function Documentation

Definition at line 91 of file abbreviationExpansionPredictor.cpp.

References abbreviations, buffer, cache, endl(), and Predictor::logger.

Referenced by set_abbreviations().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements Predictor.

Definition at line 88 of file abbreviationExpansionPredictor.cpp.

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

Generate prediction.

Parameters:
sizedesired prediction size
filterfilter

Implements Predictor.

Definition at line 62 of file abbreviationExpansionPredictor.cpp.

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

Here is the call graph for this function:

void AbbreviationExpansionPredictor::set_abbreviations ( const std::string &  filename) [private]

Definition at line 53 of file abbreviationExpansionPredictor.cpp.

References abbreviations, cacheAbbreviationsExpansions(), endl(), and Predictor::logger.

Referenced by AbbreviationExpansionPredictor().

Here is the call graph for this function:

Here is the caller graph for this function:

void AbbreviationExpansionPredictor::update ( const Observable variable) [virtual]

Implements Observer.

Definition at line 125 of file abbreviationExpansionPredictor.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 * AbbreviationExpansionPredictor::ABBREVIATIONS = "Presage.Predictors.AbbreviationExpansionPredictor.ABBREVIATIONS" [static, private]

Definition at line 58 of file abbreviationExpansionPredictor.h.

Referenced by AbbreviationExpansionPredictor().

std::map< std::string, std::string> AbbreviationExpansionPredictor::cache [private]

Definition at line 64 of file abbreviationExpansionPredictor.h.

Referenced by cacheAbbreviationsExpansions(), and predict().

Definition at line 66 of file abbreviationExpansionPredictor.h.

Referenced by AbbreviationExpansionPredictor(), and update().

const char * AbbreviationExpansionPredictor::LOGGER = "Presage.Predictors.AbbreviationExpansionPredictor.LOGGER" [static, private]

Definition at line 57 of file abbreviationExpansionPredictor.h.

Referenced by AbbreviationExpansionPredictor().


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