Exemple #1
0
        }   //  ShowLongParticipialForms (...)

/*
 *      protected void Preprocess (string sSearchString)
 *      {
 *          int i_Stress = Convert.ToInt32(true); // It should've been bool
 *          if (Regex.IsMatch (sSearchString, (string)">"))
 *          {
 *              i_Stress = Convert.ToInt32(true);
 *          }
 *          else
 *          {
 *              i_Stress = Convert.ToInt32(true); // Test
 *          }
 *          sSearchString = sSearchString.Replace(">", "");
 *          if (Regex.IsMatch (sSearchString, (string)"\\-"))
 *          {
 *              string[] arr_Range = Regex.Split (sSearchString, (string)"([0-9]*)\\-([0-9]*)");
 *              long l_start_id = long.Parse(arr_Range[1]);
 *              long l_end_id = long.Parse(arr_Range[2]);
 *              m_LexPreprocessor.PrepareLexemes (l_start_id, l_end_id, i_Stress);
 *          }
 *          else
 *          {
 *              long l_lexeme_id = long.Parse (sSearchString);
 *              m_LexPreprocessor.PrepareLexeme(l_lexeme_id, i_Stress);
 *          }
 *
 *      }   //  Preprocess (...)
 */
        protected void ShowParseOutput()
        {
            int iWordform = 0, iPreviousID = -1;

            tabControl.TabPages.Clear();

            if (null == m_Parser)
            {
                MessageBox.Show("Internal error: Parser object is null.", "Zal error", MessageBoxButtons.OK);
                return;
            }

            int iWordForm             = 0;
            CWordFormManaged wordform = null;
            EM_ReturnCode    eRet     = (EM_ReturnCode)m_Parser.eGetFirstWordForm(ref wordform);

            if (CErrorCode.bError(eRet))
            {
                MessageBox.Show("Error");
                return;
            }
            if (EM_ReturnCode.H_NO_ERROR != eRet)
            {
                MessageBox.Show("Form not found");
                return;
            }

            do
            {
                m_listWordForms.Add(wordform);
                AnalysisPanel ap = new AnalysisPanel(iWordform);
//                ap.Location = new System.Drawing.Point(0, iWordform * ap.Size.Height + 4);
                string sWordForm = wordform.sWordForm();
                MarkStress(ref sWordForm, wordform);
                ap.sWordform       = sWordForm;
                ap.sID             = wordform.llLexemeId().ToString();
                ap.eoPOS           = wordform.ePos();
                ap.eoAspect        = wordform.eAspect();
                ap.eoGender        = wordform.eGender();
                ap.eoCase          = wordform.eCase();
                ap.eoNumber        = wordform.eNumber();
                ap.eoAnimacy       = wordform.eAnimacy();
                ap.eoPerson        = wordform.ePerson();
                ap.eoReflexiveness = wordform.eReflexive();
                ap.eoSubparadigm   = wordform.eSubparadigm();
                iWordform          = 0;
                iPreviousID        = (int)wordform.llLexemeId();
                TabPage tab_Lexeme = new TabPage(wordform.sWordForm());
//                tab_Lexeme.Text = wordform.sWordForm();
                tab_Lexeme.AutoScroll = true;
                tab_Lexeme.Controls.Add(ap);
                tabControl.TabPages.Add(tab_Lexeme);
                tab_Lexeme.Show();
                tab_Lexeme.Focus();
                ++iWordform;
                ap.Show();

                eRet = (EM_ReturnCode)m_Parser.eGetNextWordForm(ref wordform);
            } while (EM_ReturnCode.H_NO_ERROR == eRet);
        }   //  ShowParseOutput()