presage
0.9.2~beta
|
#include <combiner.h>
Public Member Functions | |
Combiner () | |
virtual | ~Combiner () |
virtual Prediction | combine (const std::vector< Prediction > &)=0 |
Protected Member Functions | |
virtual Prediction | filter (const Prediction &prediction) const |
Combiner interface
A combiner takes one or more predictions and combines them into a single prediction.
Definition at line 40 of file combiner.h.
Combiner::Combiner | ( | ) |
Definition at line 30 of file combiner.cpp.
|
virtual |
Definition at line 35 of file combiner.cpp.
|
pure virtual |
Implemented in MeritocracyCombiner.
Referenced by PredictorActivator::predict().
|
protectedvirtual |
Uniquify duplicate tokens and accumulate their probability
input prediction -> output combined prediction
FIXME : current implementation is O(n^2) ... it doesn't have to be.
Definition at line 55 of file combiner.cpp.
References Prediction::addSuggestion(), Suggestion::getProbability(), Prediction::getSuggestion(), Suggestion::getWord(), Suggestion::MAX_PROBABILITY, Suggestion::setProbability(), and Prediction::size().
Referenced by MeritocracyCombiner::combine().