public List <Word> SelectPartOfSpeech() { string wordInf = ""; for (int i = 0; i < words.Count; i++)//цикл по элементам-строкам words { wordInf = words[i]; for (int j = 0; j < partsOfSpeech.Count; j++)//цикл по частям речи (поиск) { if (wordInf.Contains(partsOfSpeech[j])) { PartsOfSpeech part = (PartsOfSpeech)j; switch (part) { case PartsOfSpeech.Noun: Noun.FillTheNounCharacteristics(wordsInf, words[i], wordsFromText[i]); break; case PartsOfSpeech.Adjective: Adjective.FillTheAdjCharacteristics(wordsInf, words[i], wordsFromText[i]); break; case PartsOfSpeech.Numeral: Numeral.FillTheNumCharacteristics(wordsInf, words[i], wordsFromText[i]); break; case PartsOfSpeech.Verb: Verb.FillTheVerbCharacteristics(wordsInf, words[i], wordsFromText[i]); break; case PartsOfSpeech.Adverb: Adverb.FillTheAdverbCharacteristics(wordsInf, words[i], wordsFromText[i]); break; case PartsOfSpeech.Pronoun: Pronoun.FillThePronCharacteristics(wordsInf, words[i], wordsFromText[i]); break; case PartsOfSpeech.Conjunction: Word.FillTheWordCharacteristics(wordsInf, words[i], wordsFromText[i], PartsOfSpeech.Conjunction); break; case PartsOfSpeech.Predicative: Word.FillTheWordCharacteristics(wordsInf, words[i], wordsFromText[i], PartsOfSpeech.Predicative); break; } break; } else if (j == partsOfSpeech.Count - 1) { Word.FillTheWordCharacteristics(wordsInf, words[i], wordsFromText[i], PartsOfSpeech.NoData); } } } return(wordsInf); }
public static List <Word> FillTheNounCharacteristics(List <Word> wordsInf, string textData, string wordFromText) { Noun noun = new Noun(); noun.TextWord = wordFromText; textData.Replace("'", "").Replace(wordFromText, ""); noun.Plural = Analyzer.SelectPlural(textData); noun.Gend = Analyzer.SelectGend(textData); noun.NounCase = Analyzer.SelectCase(textData); if (textData.Contains(Analyzer.GetCasesInDict(0)))//Если падеж именительный { noun.InitialForm = true; } if (textData.Contains("одуш"))// Если существительное одушевленное { noun.Animated = true; } wordsInf.Add(noun); return(wordsInf); }