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. }
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. }
/// <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); } } }