Got rid of some obsolete stuff from the glade files
[dasher.git] / Src / DasherCore / CannaConversionHelper.h
blobe0e87f09ea14b658d9f4b04a17cff6d791bfaf5b
1 #ifndef __CANNA_CONVERSION_HELPER_H__
2 #define __CANNA_CONVERSION_HELPER_H__
4 #include "ConversionHelper.h"
5 /// \ingroup Model
6 /// @{
7 class CCannaConversionHelper : public CConversionHelper {
8 public:
9 CCannaConversionHelper();
10 ~CCannaConversionHelper();
12 virtual bool Convert(const std::string &strSource, SCENode ** pRoot, int * childCount, int CMid);
15 virtual void AssignSizes(SCENode * pStart, Dasher::CLanguageModel::Context context, long normalization, int uniform, int iNChildren);
18 virtual Dasher::CLanguageModel * GetLanguageModel() { return NULL; };
22 /* virtual bool GetPhraseList(int HZIndex, SCENode ** psOutput, int CMid) { */
23 /* return false; */
24 /* }; */
26 /* virtual void BuildDataBase() { */
27 /* }; */
29 virtual void ClearData(int CMid) {
30 };
32 /* virtual std::vector<std::vector<std::vector<std::vector<std::vector<int> > > > > * GetDP(int CMid) { */
33 /* return NULL; */
34 /* };//get data pointer */
36 private:
37 void ProcessCandidate(std::string strCandidate, SCENode *pRoot, SCENode *pTail);
39 unsigned int iUTF8Decode(const std::string &strChar) {
40 int iLength = strChar.size();
42 unsigned int iCode = 0;
44 switch(iLength) {
45 case 0:
46 // Invalid - return 0;
47 iCode = 0;
48 break;
49 case 1:
50 iCode = static_cast<int>(strChar[0]) & 127;
51 break;
52 case 2:
53 iCode = static_cast<int>(strChar[1]) & 63 + ((static_cast<int>(strChar[0]) & 31) << 6);
54 break;
55 case 3:
56 iCode = static_cast<int>(strChar[2]) & 63 + ((static_cast<int>(strChar[1]) & 63) << 6) +
57 ((static_cast<int>(strChar[0]) & 15) << 12);
58 break;
59 case 4:
60 // Invalid (as far as we're concerned) - return 0;
61 iCode = 0;
62 break;
65 return iCode;
68 int context_id;
69 bool IsInit;
71 /// @}
72 #endif