Esempio n. 1
0
        public bool OnParseCurrentWord(object argument)
        {
            CheckDisposed();

            WfiWordform wf = CurrentWordform;

            if (wf == null)
            {
                MessageBox.Show(ParserUIStrings.ksSelectWordFirst);
            }
            else
            {
                if (Connection == null)
                {
                    ConnectToParser(false);
                }
                else
                {
                    ParserScheduler parser = Connection.Parser;
                    if (parser != null)
                    {
                        parser.LoadGrammarAndLexiconIfNeeded();
                    }
                }
                UpdateWordformAsap(wf);
            }

            return(true);               //we handled this.
        }
Esempio n. 2
0
        public bool OnReparseAllWords(object argument)
        {
            CheckDisposed();

            ParserConnection con = Connection;

            if (con != null)
            {
                ParserScheduler parser = con.Parser;
                if (parser != null)
                {
                    parser.ParseAllWordforms = true;
                    parser.LoadGrammarAndLexiconIfNeeded();
                    parser.InvalidateAllWordforms();
                }
            }
            return(true);               //we handled this.
        }
Esempio n. 3
0
        /// <summary>
        /// Put all (unique) wordforms of the text in the medium priority queue of the Parser
        /// </summary>
        /// <param name="text"></param>
        public void UpdateWordformsInText(StText text)
        {
            CheckDisposed();

            int[] aiWordformHvos = text.UniqueWordforms();

            ParserConnection con = Connection;

            if (con != null)
            {
                ParserScheduler parser = con.Parser;
                if (parser != null)
                {
                    parser.LoadGrammarAndLexiconIfNeeded();
                    parser.ScheduleWordformsForUpdate(aiWordformHvos, WordWorks.Parser.ParserScheduler.Priority.soon);
                }
            }
        }