public FindWordForm ( string wordform ) : |
||
wordform | string | |
return |
public bool ProcessSample(string line) { int occurence_count = 0; // Морфологический разбор using (SolarixGrammarEngineNET.AnalysisResults tokens = gren.AnalyzeMorphology(line, LanguageID, SolarixGrammarEngineNET.GrammarEngine.MorphologyFlags.SOL_GREN_COMPLETE_ONLY)) { for (int i = 1; i < tokens.Count - 1; ++i) { SolarixGrammarEngineNET.SyntaxTreeNode token = tokens[i]; string word = token.GetWord().ToLower(); if (retrieve_omonyms_from_samples) { if (omonyms.Contains(word)) { occurence_count++; omonym_processors[word].ProcessSample(line, tokens, LanguageID, gren); } else if (!not_omonyms.Contains(word) && omonyms.Count < MaxOmonymPerSession) { bool is_omonym = false; if (!ignore_omonyms.Contains(word)) { // сделаем проекцию слова int id_class0 = -1; using (SolarixGrammarEngineNET.WordProjections projs = gren.FindWordForm(word)) { for (int j = 0; j < projs.Count; ++j) { int id_entry = projs.GetEntryKey(j); int id_class = gren.GetEntryClass(id_entry); if (id_class0 == -1) { id_class0 = id_class; } else if (id_class0 != id_class) { is_omonym = true; break; } } } if (is_omonym) { omonyms.Add(word); OmonymProcessor processor = new OmonymProcessor(word); omonym_processors.Add(word, processor); occurence_count++; omonym_processors[word].ProcessSample(line, tokens, LanguageID, gren); } else { not_omonyms.Add(word); } } } } else if (omonyms.Contains(word)) { occurence_count++; omonym_processors[word].ProcessSample(line, tokens, LanguageID, gren); } } } return(occurence_count > 0); }