presage  0.8.7
Public Member Functions | Private Attributes | Friends
Prediction Class Reference

#include <prediction.h>

List of all members.

Public Member Functions

 Prediction ()
 ~Prediction ()
const Predictionoperator= (const Prediction &)
bool operator== (const Prediction &) const
size_t size () const
Suggestion getSuggestion (int=0) const
Suggestion getSuggestion (std::string token) const
void addSuggestion (Suggestion)
std::string toString () const

Private Attributes

std::vector< Suggestionsuggestions

Friends

std::ostream & operator<< (std::ostream &, const Prediction &)

Detailed Description

Prediction

A prediction contains a set of Suggestion objects. More precisely, a Prediction is a list of Suggestion object, ordered by decreasing probability.

A Prediction object is returned by the predictors and by a combiner object.

Definition at line 47 of file prediction.h.


Constructor & Destructor Documentation

Definition at line 28 of file prediction.cpp.

Definition at line 31 of file prediction.cpp.


Member Function Documentation

Inserts a new suggestion, preserves the ordering.

The suggestion object to be inserted is compared against the suggestions already contained in the prediction and inserted in an ordered fashion.

Comparison between suggestion objects uses the overloaded operator<

Definition at line 90 of file prediction.cpp.

References suggestions.

Referenced by MeritocracyCombiner::combine(), Combiner::filter(), PredictorActivator::parse_internal_commands(), DummyPredictor::predict(), DictionaryPredictor::predict(), DejavuPredictor::predict(), AbbreviationExpansionPredictor::predict(), SmoothedNgramPredictor::predict(), RecencyPredictor::predict(), and ARPAPredictor::predict().

Here is the caller graph for this function:

Suggestion Prediction::getSuggestion ( int  i = 0) const

Returns nth most probable suggestion.

Definition at line 73 of file prediction.cpp.

References suggestions.

Referenced by Combiner::filter(), operator==(), Presage::predict(), and Selector::select().

Here is the caller graph for this function:

Suggestion Prediction::getSuggestion ( std::string  token) const

Returns suggestion with given token.

Definition at line 80 of file prediction.cpp.

References suggestions.

const Prediction & Prediction::operator= ( const Prediction right)

Definition at line 34 of file prediction.cpp.

References suggestions.

bool Prediction::operator== ( const Prediction right) const

Predictions are equal iff suggestions are equal and in same order.

Definition at line 45 of file prediction.cpp.

References getSuggestion(), and size().

Here is the call graph for this function:

size_t Prediction::size ( ) const

Returns number of suggestions in prediction.

Definition at line 68 of file prediction.cpp.

References suggestions.

Referenced by Combiner::filter(), operator==(), RecencyPredictor::predict(), Presage::predict(), and Selector::select().

Here is the caller graph for this function:

std::string Prediction::toString ( ) const

Returns a string representation of the prediction.

Definition at line 106 of file prediction.cpp.

References suggestions.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const Prediction p 
) [friend]

Definition at line 116 of file prediction.cpp.


Member Data Documentation

std::vector<Suggestion> Prediction::suggestions [private]

Definition at line 87 of file prediction.h.

Referenced by addSuggestion(), getSuggestion(), operator<<(), operator=(), size(), and toString().


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