예제 #1
0
        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);
        }
예제 #2
0
파일: Pronoun.cs 프로젝트: ShuShaman/morph
        public static List <Word> FillThePronCharacteristics(List <Word> wordsInf, string textData, string wordFromText)
        {
            Pronoun pron = new Pronoun();

            pron.TextWord = wordFromText;
            textData.Replace("'", "").Replace(wordFromText, "");
            pron.Plural        = Analyzer.SelectPlural(textData);
            pron.PronounGender = Analyzer.SelectGend(textData);
            pron.PronounCase   = Analyzer.SelectCase(textData);
            wordsInf.Add(pron);

            return(wordsInf);
        }