Example #1
0
        public void MarkStress(ref string sWordForm, CWordFormManaged wf)
        {
            int           iPos    = -1;
            EM_StressType eType   = EM_StressType.STRESS_TYPE_UNDEFINED;
            char          chrMark = ' ';

            EM_ReturnCode eRet = wf.eGetFirstStressPos(ref iPos, ref eType);

            do
            {
                if (eRet != EM_ReturnCode.H_NO_ERROR && eRet != EM_ReturnCode.H_FALSE)
                {
                    continue;
                }

                if (EM_StressType.STRESS_PRIMARY == eType)
                {
                    if (sWordForm[iPos] != 'ё')
                    {
                        chrMark   = '\x301';
                        sWordForm = sWordForm.Insert(iPos + 1, chrMark.ToString());
                    }
                }
                else if (EM_StressType.STRESS_SECONDARY == eType)
                {
                    chrMark = '\x300';
                }

                eRet = wf.eGetNextStressPos(ref iPos, ref eType);
            }   while (EM_ReturnCode.H_NO_ERROR == eRet);
        }
Example #2
0
        public void MarkStress(ref string sWordForm, CWordFormManaged wf)
        {
            int iPos = -1;
            EM_StressType eType = EM_StressType.STRESS_TYPE_UNDEFINED;
            char chrMark = ' ';

            EM_ReturnCode eRet = wf.eGetFirstStressPos(ref iPos, ref eType);
            do
            {
                if (eRet != EM_ReturnCode.H_NO_ERROR && eRet != EM_ReturnCode.H_FALSE)
                {
                    continue;
                }

                if (EM_StressType.STRESS_PRIMARY == eType)
                {
                    if (sWordForm[iPos] != 'ё')
                    {
                        chrMark = '\x301';
                        sWordForm = sWordForm.Insert(iPos+1, chrMark.ToString());
                    }
                }
                else if (EM_StressType.STRESS_SECONDARY == eType)
                {
                    chrMark = '\x300';
                }

                eRet = wf.eGetNextStressPos(ref iPos, ref eType);

            }   while (EM_ReturnCode.H_NO_ERROR == eRet);
        }