Ejemplo n.º 1
0
        private void SetLanguage(int language)
        {
            Hwr.ClearLanguage(settingObj);

            if (language == Hwr.DLANG_MATH_MIDDLE_EXPANSION)
            {
                Hwr.AddLanguage(settingObj, Hwr.DLANG_MATH_MIDDLE_EXPANSION, Hwr.DTYPE_MATH_EX);
            }
            else if (language == Hwr.DLANG_MATH_CHEMICAL)
            {
                Hwr.AddLanguage(settingObj, Hwr.DLANG_MATH_CHEMICAL, Hwr.DTYPE_MATH_CF);
            }

            Hwr.SetAttribute(settingObj);
        }
        private void SetLanguage(int language)
        {
            Hwr.ClearLanguage(settingObj);

            if (language == Hwr.DLANG_KOREAN)
            {
                Hwr.AddLanguage(settingObj, Hwr.DLANG_KOREAN, Hwr.DTYPE_KOREAN | Hwr.DTYPE_UPPERCASE | Hwr.DTYPE_LOWERCASE);
            }
            else if (language == Hwr.DLANG_ENGLISH)
            {
                Hwr.AddLanguage(settingObj, Hwr.DLANG_ENGLISH, Hwr.DTYPE_UPPERCASE | Hwr.DTYPE_LOWERCASE);
            }
            else if (language == Hwr.DLANG_CHINA)
            {
                Hwr.AddLanguage(settingObj, Hwr.DLANG_CHINA, Hwr.DTYPE_SIMP);
            }
            else if (language == Hwr.DLANG_JAPANESE)
            {
                Hwr.AddLanguage(settingObj, Hwr.DLANG_JAPANESE, Hwr.DTYPE_HIRAGANA);
            }

            Hwr.SetAttribute(settingObj);
        }
Ejemplo n.º 3
0
        private int InitializeEngine()
        {
            int status = Hwr.Create("./license_key/license.key");

            if (inkObj == IntPtr.Zero)
            {
                inkObj = Hwr.CreateInkObject();
            }
            if (settingObj == IntPtr.Zero)
            {
                settingObj = Hwr.CreateSettingObject();
            }
            if (resultObj == IntPtr.Zero)
            {
                resultObj = Hwr.CreateResultObject();
            }
            Hwr.SetExternalResourcePath("./hdb");
            Hwr.SetRecognitionMode(settingObj, Hwr.MULTICHAR);
            Hwr.SetCandidateSize(settingObj, MAX_CANDIDATES);
            SetLanguage(Hwr.DLANG_MATH_MIDDLE_EXPANSION);
            Hwr.SetAttribute(settingObj);

            return(status);
        }