presage  0.9.2~beta
dictionaryPredictor.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_DICTIONARYPREDICTOR
26 #define PRESAGE_DICTIONARYPREDICTOR
27 
28 #include "predictor.h"
29 #include "../core/dispatcher.h"
30 
31 #include <fstream>
32 
33 
40 class DictionaryPredictor : public Predictor, public Observer {
41 public:
44 
45  virtual Prediction predict (const size_t size, const char** filter) const;
46 
47  virtual void learn (const std::vector<std::string>& change);
48 
49  virtual void update (const Observable* variable);
50 
51  void set_dictionary (const std::string& value);
52  void set_probability (const std::string& value);
53 
54 private:
55  std::string LOGGER;
56  std::string DICTIONARY;
57  std::string PROBABILITY;
58 
59  std::string dictionary_path;
60  double probability;
61 
63 };
64 
65 #endif // PRESAGE_DICTIONARYPREDICTOR
DictionaryPredictor(Configuration *, ContextTracker *, const char *)
virtual void learn(const std::vector< std::string > &change)
virtual Prediction predict(const size_t size, const char **filter) const
Generate prediction.
void set_dictionary(const std::string &value)
virtual void update(const Observable *variable)
void set_probability(const std::string &value)
Tracks user interaction and context.
Dispatcher< DictionaryPredictor > dispatcher