prediction.h
Go to the documentation of this file.
/******************************************************
* Presage, an extensible predictive text entry system
* ---------------------------------------------------
*
* Copyright (C) 2008 Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
**********(*)*/
#ifndef PRESAGE_PREDICTION
#define PRESAGE_PREDICTION
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <vector>
#include "suggestion.h"
class Prediction {
friend std::ostream &operator<<( std::ostream &, const Prediction & );
public:
Prediction();
~Prediction();
const Prediction &operator=( 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:
std::vector<Suggestion> suggestions;
};
#endif // PRESAGE_PREDICTION
Prediction
Definition: prediction.h:47
suggestion.h
Prediction::~Prediction
~Prediction()
Definition: prediction.cpp:31
Prediction::toString
std::string toString() const
Definition: prediction.cpp:106
Prediction::operator==
bool operator==(const Prediction &) const
Definition: prediction.cpp:45
Prediction::Prediction
Prediction()
Definition: prediction.cpp:28
Prediction::suggestions
std::vector< Suggestion > suggestions
Definition: prediction.h:87
Prediction::getSuggestion
Suggestion getSuggestion(int=0) const
Definition: prediction.cpp:73
Prediction::operator<<
friend std::ostream & operator<<(std::ostream &, const Prediction &)
Definition: prediction.cpp:116
Prediction::size
size_t size() const
Definition: prediction.cpp:68
Prediction::operator=
const Prediction & operator=(const Prediction &)
Definition: prediction.cpp:34
Prediction::addSuggestion
void addSuggestion(Suggestion)
Definition: prediction.cpp:90
Suggestion
Definition: suggestion.h:50