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_SIMULATOR 00026 #define PRESAGE_SIMULATOR 00027 00028 #include "presage.h" 00029 00030 #include <sstream> 00031 00052 class Simulator { 00053 public: 00054 Simulator(PresageCallback* callback, 00055 std::stringstream& sstream, 00056 const std::string = ""); 00057 ~Simulator(); 00058 00059 void simulate(std::string); 00060 // void reset(); 00061 void results() const; 00062 int getKi() const; 00063 int getKs() const; 00064 int getKn() const; 00065 double getKSR() const; 00066 00067 bool getAutoSpace() const; 00068 void setAutoSpace( bool ); 00069 00070 void setKs(int); 00071 00072 void silentMode(bool); 00073 00074 private: 00075 Presage* presagePtr; 00076 00077 bool find( const std::vector<std::string>&, const std::string& ) const; 00078 00079 bool autoSpace; // determines whether predictive system is able to insert a space at the end of the word 00080 00081 int ki; 00082 int ks; 00083 int kn; 00084 00085 bool silent_mode; 00086 00087 std::stringstream& m_sstream; 00088 }; 00089 00090 00091 #endif // PRESAGE_SIMULATOR