Ejemplo n.º 1
0
        public static List <Word> FillTheNumCharacteristics(List <Word> wordsInf, string textData, string wordFromText)
        {
            Numeral num = new Numeral();

            num.TextWord = wordFromText;
            textData.Replace("'", "").Replace(wordFromText, "");
            num.Plural  = Analyzer.SelectPlural(textData);
            num.Gender  = Analyzer.SelectGend(textData);
            num.NumCase = Analyzer.SelectCase(textData);
            int indexForInitForm = 0;

            if (textData.Contains(Analyzer.GetCasesInDict(indexForInitForm)) &&
                textData.Contains(Analyzer.GetGendInDict(indexForInitForm)))//Если именительный падеж и мужской род
            {
                num.InitialForm = true;
            }
            if (textData.Contains("поряд"))
            {
                num.Cardinal = false;
            }

            wordsInf.Add(num);

            return(wordsInf);
        }
Ejemplo n.º 2
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);
        }