Diffstat (limited to 'inputmethods/dasher/PPMLanguageModel.h') (more/less context) (show 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 @@ -1,68 +1,69 @@ // PPMLanguageModel.h // ///////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2002 David Ward // ///////////////////////////////////////////////////////////////////////////// #ifndef __PPMLanguageModel_h__ #define __PPMLanguageModel_h__ #include "NoClones.h" #include "MSVC_Unannoy.h" #include <vector> #include <stdio.h> #include "LanguageModel.h" -static char dumpTrieStr[40000]; +// static char dumpTrieStr[40000]; const int MAX_ORDER = 5; const int maxcont =200; namespace Dasher {class CPPMLanguageModel;} class Dasher::CPPMLanguageModel : public Dasher::CLanguageModel, private NoClones { public: CPPMLanguageModel(CAlphabet *_alphabet, int _normalization); - ~CPPMLanguageModel(); + virtual ~CPPMLanguageModel(); class CPPMnode { public: CPPMnode* find_symbol(int sym); CPPMnode* add_symbol_to_node(int sym,int *update); CPPMnode* child; CPPMnode* next; CPPMnode* vine; short int count; const short int symbol; CPPMnode(int sym); }; class CPPMContext : public CContext { public: - CPPMContext(CPPMContext const &input) {head = input.head; order= input.order;} + CPPMContext(CPPMContext const &input) : CContext(input) + { head = input.head;order= input.order;} CPPMContext(CPPMnode* _head=0, int _order=0) : head(_head),order(_order) {}; ~CPPMContext() {}; void dump(); CPPMnode* head; int order; }; void ReleaseContext(CContext*); CContext* GetRootContext(); inline CContext* CloneContext(CContext*); void EnterSymbol(CContext* context, modelchar Symbol); //inline bool GetProbs(CContext*,std::vector<symbol> &newchars,std::vector<unsigned int> &groups,std::vector<unsigned int> &probs,double addprob); bool GetProbs(CContext*, std::vector<unsigned int> &Probs, double AddProb); void LearnSymbol(CContext* Context, modelchar Symbol); void dump(); private: CPPMContext *m_rootcontext; CPPMnode *root; void AddSymbol(CPPMContext& context,int symbol); void dumpSymbol(int symbol); void dumpString( char *str, int pos, int len ); void dumpTrie( CPPMnode *t, int d ); |