Esempio n. 1
0
        static Analyser()
        {
            foreach (var item in Verbs.GetAll())
            {
                foreach (var w in new HashSet <string>(Verbs.schemas[item.SchemaIndex].GetAllForms(item.Word)))
                {
                    Items.Add(new WordForm {
                        Form = w, SourceForm = item.Word, Type = WordType.Verb
                    });
                }
            }

            foreach (var item in Nouns.GetAll())
            {
                foreach (var w in new HashSet <string>(Nouns.schemas[item.SchemaIndex].GetAllForms(item.Word)))
                {
                    Items.Add(new WordForm {
                        Form = w, SourceForm = item.Word, Type = WordType.Noun
                    });
                }
            }

            foreach (var item in Adjectives.GetAll())
            {
                foreach (var w in new HashSet <string>(Adjectives.schemas[item.SchemaIndex].GetAllForms(item.Word)))
                {
                    Items.Add(new WordForm {
                        Form = w, SourceForm = item.Word, Type = WordType.Adjective
                    });
                }
            }

            foreach (var set in Pronouns.Items)
            {
                foreach (var item in set)
                {
                    if (item != "")
                    {
                        Items.Add(new WordForm {
                            Form = item, SourceForm = item, Type = WordType.Pronoun
                        });
                    }
                }
            }

            Items.Sort();
        }
Esempio n. 2
0
 /// <summary>
 /// Совершенные формы глагола
 /// </summary>
 public IEnumerable <Verb> Perfects(Voice voice)
 {
     if (Aspect == VerbAspect.Perfect)
     {
         yield return(this);
     }
     else
     {
         var word = Infinitive(voice);
         if (word != null)
         {
             foreach (var res in Verbs.FindPerfects(word))
             {
                 yield return(res);
             }
         }
     }
 }