1 #ifndef __CANNA_CONVERSION_HELPER_H__
2 #define __CANNA_CONVERSION_HELPER_H__
4 #include "ConversionHelper.h"
7 class CCannaConversionHelper
: public CConversionHelper
{
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) { */
26 /* virtual void BuildDataBase() { */
29 virtual void ClearData(int CMid
) {
32 /* virtual std::vector<std::vector<std::vector<std::vector<std::vector<int> > > > > * GetDP(int CMid) { */
34 /* };//get data pointer */
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;
46 // Invalid - return 0;
50 iCode
= static_cast<int>(strChar
[0]) & 127;
53 iCode
= static_cast<int>(strChar
[1]) & 63 + ((static_cast<int>(strChar
[0]) & 31) << 6);
56 iCode
= static_cast<int>(strChar
[2]) & 63 + ((static_cast<int>(strChar
[1]) & 63) << 6) +
57 ((static_cast<int>(strChar
[0]) & 15) << 12);
60 // Invalid (as far as we're concerned) - return 0;