presage 0.9.1
simulator.h
Go to the documentation of this file.
1
2/******************************************************
3 * Presage, an extensible predictive text entry system
4 * ---------------------------------------------------
5 *
6 * Copyright (C) 2008 Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 **********(*)*/
23
24
25#ifndef PRESAGE_SIMULATOR
26#define PRESAGE_SIMULATOR
27
28#include "presage.h"
29
30#include <sstream>
31
52class Simulator {
53public:
54 Simulator(PresageCallback* callback,
55 std::stringstream& sstream,
56 const std::string = "");
57 ~Simulator();
58
59 void simulate(std::string);
60// void reset();
61 void results() const;
62 int getKi() const;
63 int getKs() const;
64 int getKn() const;
65 double getKSR() const;
66
67 bool getAutoSpace() const;
68 void setAutoSpace( bool );
69
70 void setKs(int);
71
72 void silentMode(bool);
73
74private:
76
77 bool find( const std::vector<std::string>&, const std::string& ) const;
78
79 bool autoSpace; // determines whether predictive system is able to insert a space at the end of the word
80
81 int ki;
82 int ks;
83 int kn;
84
86
87 std::stringstream& m_sstream;
88};
89
90
91#endif // PRESAGE_SIMULATOR
Presage, the intelligent predictive text entry platform.
Definition: presage.h:113
std::stringstream & m_sstream
Definition: simulator.h:87
double getKSR() const
Definition: simulator.cpp:203
void silentMode(bool)
Definition: simulator.cpp:246
void setAutoSpace(bool)
Definition: simulator.cpp:241
void simulate(std::string)
Definition: simulator.cpp:52
bool silent_mode
Definition: simulator.h:85
void results() const
Definition: simulator.cpp:164
int ki
Definition: simulator.h:81
int getKs() const
Definition: simulator.cpp:191
bool getAutoSpace() const
Definition: simulator.cpp:236
int kn
Definition: simulator.h:83
bool find(const std::vector< std::string > &, const std::string &) const
Definition: simulator.cpp:216
void setKs(int)
Definition: simulator.cpp:209
int getKn() const
Definition: simulator.cpp:197
bool autoSpace
Definition: simulator.h:79
Presage * presagePtr
Definition: simulator.h:75
int ks
Definition: simulator.h:82
int getKi() const
Definition: simulator.cpp:185