Diffstat (limited to 'inputmethods/dasher/PPMLanguageModel.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/PPMLanguageModel.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/inputmethods/dasher/PPMLanguageModel.h b/inputmethods/dasher/PPMLanguageModel.h index bd860b8..7025a0a 100644 --- a/inputmethods/dasher/PPMLanguageModel.h +++ b/inputmethods/dasher/PPMLanguageModel.h | |||
@@ -7,50 +7,51 @@ | |||
7 | ///////////////////////////////////////////////////////////////////////////// | 7 | ///////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | #ifndef __PPMLanguageModel_h__ | 9 | #ifndef __PPMLanguageModel_h__ |
10 | #define __PPMLanguageModel_h__ | 10 | #define __PPMLanguageModel_h__ |
11 | 11 | ||
12 | #include "NoClones.h" | 12 | #include "NoClones.h" |
13 | #include "MSVC_Unannoy.h" | 13 | #include "MSVC_Unannoy.h" |
14 | #include <vector> | 14 | #include <vector> |
15 | #include <stdio.h> | 15 | #include <stdio.h> |
16 | 16 | ||
17 | #include "LanguageModel.h" | 17 | #include "LanguageModel.h" |
18 | 18 | ||
19 | static char dumpTrieStr[40000]; | 19 | // static char dumpTrieStr[40000]; |
20 | const int MAX_ORDER = 5; | 20 | const int MAX_ORDER = 5; |
21 | const int maxcont =200; | 21 | const int maxcont =200; |
22 | 22 | ||
23 | namespace Dasher {class CPPMLanguageModel;} | 23 | namespace Dasher {class CPPMLanguageModel;} |
24 | class Dasher::CPPMLanguageModel : public Dasher::CLanguageModel, private NoClones | 24 | class Dasher::CPPMLanguageModel : public Dasher::CLanguageModel, private NoClones |
25 | { | 25 | { |
26 | public: | 26 | public: |
27 | CPPMLanguageModel(CAlphabet *_alphabet, int _normalization); | 27 | CPPMLanguageModel(CAlphabet *_alphabet, int _normalization); |
28 | ~CPPMLanguageModel(); | 28 | virtual ~CPPMLanguageModel(); |
29 | 29 | ||
30 | class CPPMnode { | 30 | class CPPMnode { |
31 | public: | 31 | public: |
32 | CPPMnode* find_symbol(int sym); | 32 | CPPMnode* find_symbol(int sym); |
33 | CPPMnode* add_symbol_to_node(int sym,int *update); | 33 | CPPMnode* add_symbol_to_node(int sym,int *update); |
34 | CPPMnode* child; | 34 | CPPMnode* child; |
35 | CPPMnode* next; | 35 | CPPMnode* next; |
36 | CPPMnode* vine; | 36 | CPPMnode* vine; |
37 | short int count; | 37 | short int count; |
38 | const short int symbol; | 38 | const short int symbol; |
39 | CPPMnode(int sym); | 39 | CPPMnode(int sym); |
40 | }; | 40 | }; |
41 | 41 | ||
42 | class CPPMContext : public CContext { | 42 | class CPPMContext : public CContext { |
43 | public: | 43 | public: |
44 | CPPMContext(CPPMContext const &input) {head = input.head;order= input.order;} | 44 | CPPMContext(CPPMContext const &input) : CContext(input) |
45 | { head = input.head;order= input.order;} | ||
45 | CPPMContext(CPPMnode* _head=0, int _order=0) : head(_head),order(_order) {}; | 46 | CPPMContext(CPPMnode* _head=0, int _order=0) : head(_head),order(_order) {}; |
46 | ~CPPMContext() {}; | 47 | ~CPPMContext() {}; |
47 | void dump(); | 48 | void dump(); |
48 | CPPMnode* head; | 49 | CPPMnode* head; |
49 | int order; | 50 | int order; |
50 | }; | 51 | }; |
51 | 52 | ||
52 | void ReleaseContext(CContext*); | 53 | void ReleaseContext(CContext*); |
53 | CContext* GetRootContext(); | 54 | CContext* GetRootContext(); |
54 | inline CContext* CloneContext(CContext*); | 55 | inline CContext* CloneContext(CContext*); |
55 | void EnterSymbol(CContext* context, modelchar Symbol); | 56 | void EnterSymbol(CContext* context, modelchar Symbol); |
56 | //inline bool GetProbs(CContext*,std::vector<symbol> &newchars,std::vector<unsigned int> &groups,std::vector<unsigned int> &probs,double addprob); | 57 | //inline bool GetProbs(CContext*,std::vector<symbol> &newchars,std::vector<unsigned int> &groups,std::vector<unsigned int> &probs,double addprob); |