Beispiel #1
0
        public void Add(Word verb)
        {
            if (!verb.IsTypeOf(typeof(VerbType)))
            {
                throw new Exception(verb + " is not verb!");
            }

            foreach (WordType type in verb.types)
            {
                if (type is VerbType)
                {
                    VerbType tv = (type as VerbType);

                    tv.table = this;

                    string tense = (tv.tense != null ? tv.tense : "");
                    Person person = (tv.person != null ? tv.person : new Person(0, 0, "", "", ""));

                    if (!this.table.ContainsKey(tv.mood)) this.table.Add(tv.mood, new Dictionary<string, Dictionary<Person, Word>>());
                    if (!this.table[tv.mood].ContainsKey(tense)) this.table[tv.mood].Add(tense, new Dictionary<Person, Word>());

                    this.table[tv.mood][tense].Add(person, verb);

                }
            }
        }
Beispiel #2
0
        private void setBase(Word verbBase)
        {
            if (!verbBase.IsTypeOf(typeof(VerbType)))
            {
                throw new Exception(verbBase + " is not verb!");
            }

            this.verbBase = verbBase;
            this.Add(this.verbBase);
        }
Beispiel #3
0
 public static bool IsNotVerb(Word w)
 {
     return !w.IsTypeOf(typeof(VerbType));
 }