presage  0.9.2~beta
Public Member Functions | Protected Member Functions | List of all members
Combiner Class Referenceabstract

#include <combiner.h>

Inheritance diagram for Combiner:
Inheritance graph
Collaboration diagram for Combiner:
Collaboration graph

Public Member Functions

 Combiner ()
 
virtual ~Combiner ()
 
virtual Prediction combine (const std::vector< Prediction > &)=0
 

Protected Member Functions

virtual Prediction filter (const Prediction &prediction) const
 

Detailed Description

Combiner interface

A combiner takes one or more predictions and combines them into a single prediction.

Definition at line 40 of file combiner.h.

Constructor & Destructor Documentation

◆ Combiner()

Combiner::Combiner ( )

Definition at line 30 of file combiner.cpp.

◆ ~Combiner()

Combiner::~Combiner ( )
virtual

Definition at line 35 of file combiner.cpp.

Member Function Documentation

◆ combine()

virtual Prediction Combiner::combine ( const std::vector< Prediction > &  )
pure virtual

Implemented in MeritocracyCombiner.

Referenced by PredictorActivator::predict().

Here is the caller graph for this function:

◆ filter()

Prediction Combiner::filter ( const Prediction prediction) const
protectedvirtual

Uniquify duplicate tokens and accumulate their probability

input prediction -> output combined prediction

  • - foo, 0.2 foo, MAX_PREDICTION bar, 0.1 bar, 0.3 foobar, 0.1 foobar, 0.1 foo, 0.8 foz, 0.1 bar, 0.2 foo, 0.3 foz, 0.1

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

Here is the call graph for this function:
Here is the caller graph for this function:

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