Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public static List <Word> FillTheAdverbCharacteristics(List <Word> wordsInf, string textData, string wordFromText)
        {
            Adverb adv = new Adverb();

            adv.TextWord           = wordFromText;
            adv.RankOfAdv          = Analyzer.SelectRank(textData);
            adv.lexicalAndGramRank = Analyzer.SelectLexicalGramRank(textData);

            return(wordsInf);
        }