presage
0.8.7
|
00001 00002 /****************************************************** 00003 * Presage, an extensible predictive text entry system 00004 * --------------------------------------------------- 00005 * 00006 * Copyright (C) 2008 Matteo Vescovi <matteo.vescovi@yahoo.co.uk> 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License along 00019 with this program; if not, write to the Free Software Foundation, Inc., 00020 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00021 * 00022 **********(*)*/ 00023 00024 00025 #ifndef PRESAGE_PREDICTION 00026 #define PRESAGE_PREDICTION 00027 00028 #ifdef HAVE_CONFIG_H 00029 #include "config.h" 00030 #endif 00031 00032 #include <vector> 00033 00034 #include "suggestion.h" 00035 00036 00047 class Prediction { 00048 friend std::ostream &operator<<( std::ostream &, const Prediction & ); 00049 00050 public: 00051 Prediction(); 00052 ~Prediction(); 00053 00054 const Prediction &operator=( const Prediction & ); 00055 00058 bool operator== (const Prediction&) const; 00059 00062 size_t size() const; 00063 00066 Suggestion getSuggestion(int=0) const; 00067 00070 Suggestion getSuggestion(std::string token) const; 00071 00081 void addSuggestion( Suggestion ); 00082 00085 std::string toString() const; 00086 private: 00087 std::vector<Suggestion> suggestions; 00088 00089 }; 00090 00091 00092 #endif // PRESAGE_PREDICTION