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); } } }
private void setBase(Word verbBase) { if (!verbBase.IsTypeOf(typeof(VerbType))) { throw new Exception(verbBase + " is not verb!"); } this.verbBase = verbBase; this.Add(this.verbBase); }
public static bool IsNotVerb(Word w) { return !w.IsTypeOf(typeof(VerbType)); }