public string ComposePast(string verb)
        {
            int  ilen = verb.Length;
            char last = char.ToLower(verb[ilen - 1]);

            TwoTuple <string, string> found;

            if (verbsData.base_past.TryGetValue(verb, out found)) // if verb is in irregular verb table
            {
                return(found.one);
            }
            else
            {
                if (last == 'e')
                {
                    return(verb + "d");
                }
                else if ((last == 'y') && AuxString.IsConsonant(verb, ilen - 2))
                {
                    return(verb.Substring(0, ilen - 1) + "ied");
                    //base ends (consonant [or qu] + vowel + consonant)
                }
                else if ((AuxString.IsConsonant(verb, ilen - 1)) && (AuxString.IsVowel(verb, ilen - 2)) &&
                         ((AuxString.IsConsonant(verb, ilen - 3)) ||
                          ((verb[ilen - 4] == 'q') && (verb[ilen - 3] == 'u'))))
                {
                    if (last == 'c')
                    {
                        return(verb + "ked");
                    }
                    else if ((last == 'x') || (last == 'y') || (last == 'w'))
                    {
                        return(verb + "ed");
                    }
                    else if (last == 'g')
                    {
                        return(verb = "ged");
                    }
                    else if (last == 'l')
                    {
                        return(verb + "led");
                    }
                    else if (verbsData.todouble.ContainsKey(verb))
                    {
                        return(verb + last + "ed");
                    }
                    else
                    {
                        return(verb + "ed");
                    }
                }
                else
                {
                    return(verb + "ed");
                }
            }
        }
        public int CountVowels(string input)
        {
            int vct = 0;

            for (int cct = 0; cct < input.Length; cct++)
            {
                if (AuxString.IsVowel(input, cct))
                {
                    vct++;
                }
            }

            return(vct);
        }
Exemplo n.º 3
0
        // Get the base (and possible alternative base) of a verb ending in ed
        // assumes all special cases (e.g belied, etc) have been removed */
        public void CheckEDVerb(ref string input, out string alt)
        {
            alt = "";           // initialise possible alternative

            int ilen = input.Length;

            // if input ends ed and has at least one other vowel
            if (input.EndsWith("ed") && conjugator.CountVowels(input) > 1)
            {
                // If input ends ied change ied to y
                if (input.EndsWith("ied"))
                {
                    input = input.Substring(0, ilen - 3) + "y";
                }
                else if (input.EndsWith("cked") || input.EndsWith("ffed") || input.EndsWith("lled") ||
                         input.EndsWith("ooed") || input.EndsWith("ssed") || input.EndsWith("wed") ||
                         input.EndsWith("yed") || input.EndsWith("xed") || input.EndsWith("zzed"))
                {
                    input = input.Substring(0, ilen - 2);   // remove ed
                }
                else if (ilen > 4 && input[ilen - 3] == input[ilen - 4] && AuxString.IsConsonant(input, ilen - 3))
                {
                    // word ends in two identical consonats + ed
                    input = input.Substring(0, ilen - 3);
                }
                else if (input.EndsWith("ced") || input.EndsWith("sed") || input.EndsWith("ued") ||
                         input.EndsWith("ved") || input.EndsWith("ized"))
                {
                    input = input.Substring(0, ilen - 1);
                }
                else if (ilen > 5 && AuxString.IsConsonant(input, ilen - 5) &&
                         AuxString.IsVowel(input, ilen - 4) && AuxString.IsConsonant(input, ilen - 3) && conjugator.CountVowels(input) == 2)
                {
                    // word consists of one or more consanants + single vowel + consonant + ed
                    input = input.Substring(0, ilen - 1);   // remove finial 'd'
                }
                else if (ilen > 3 && AuxString.IsConsonant(input, ilen - 3))
                {
                    // word ends in consonant + ed
                    input = input.Substring(0, ilen - 1);   // remove final d
                    alt   = input;                          // possible alternative
                    input = input.Substring(0, ilen - 2);   // remove e as well
                }
                else
                {
                    input = input.Substring(0, ilen - 1);   // remove final d
                }
            }
        }
Exemplo n.º 4
0
        protected Dictionary <string, string> GlomDictionary(string filename, string error)
        {
            string[] lines = File.ReadAllLines(filename);
            if (lines == null)
            {
                throw new FileLoadException("Failed to open transitive verbal phrase table");
            }

            Dictionary <string, string> result = new Dictionary <string, string>();

            foreach (string line in lines)
            {
                if (line.Length == 0)
                {
                    break;
                }
                AuxString auxstr = new AuxString(line);
                AppendString(result, auxstr.Word(0), auxstr.Word(1), "#");
            }

            return(result);
        }
        public string ComposePresent(string verb)
        {
            if (verb == "have")
            {
                return("has");
            }
            else if (verb == "go")
            {
                return("goes");
            }
            else if (verb == "do")
            {
                return("does");
            }
            else
            {
                int  ilen = verb.Length;
                char last = char.ToLower(verb[ilen - 1]);

                //end consonant + y
                if ((ilen > 2) && (last == 'y') &&
                    (AuxString.IsConsonant(verb, ilen - 2)))
                {
                    // replace y with ies
                    return(verb.Substring(0, ilen - 1) + "ies");
                }
                else if ((ilen > 1) && ((last == 's') ||
                                        (last == 'z') || (last == 'x') ||
                                        (verb.EndsWith("ch")) || (verb.EndsWith("sh"))))
                {
                    return(verb + "es");    // add 'es'
                }
                else
                {
                    return(verb + "s");
                }
            }
        }
Exemplo n.º 6
0
        public void ReadNounNumber(string filename, Dictionary <string, string> toSingular, Dictionary <string, string> toPlural)
        {
            string[] lines = File.ReadAllLines(filename);
            if (lines == null)
            {
                throw new FileLoadException("Failed to open noun number data");
            }

            for (int ii = 0; ii < lines.Length; ii += 2)
            {
                if (lines[ii].Length == 0)
                {
                    break;
                }
                AuxString auxstr1 = new AuxString(lines[ii]);
                AuxString auxstr2 = new AuxString(lines[ii + 1]);

                string t1, line1;
                if (auxstr1.WordCount() > 1)
                {
                    t1    = auxstr1.Word(1);
                    line1 = auxstr1.Word(0).ToLower();
                }
                else
                {
                    t1    = "";
                    line1 = lines[ii].ToLower();
                }

                string t2, line2;
                if (auxstr2.WordCount() > 1)
                {
                    t2    = auxstr2.Word(1);
                    line2 = auxstr2.Word(0).ToLower();
                }
                else
                {
                    t2    = "";
                    line2 = lines[ii + 1].ToLower();
                }

                if (t1 == "P" || t1 == "TP")
                {
                    toSingular.Add(line2, "#");
                }
                else if (t2 == "P")
                {
                    toSingular.Add(line2, "");
                }
                else if (t1 != "S")
                {
                    if (t1.Length > 0 && t1 != "T")
                    {
                        Console.WriteLine(string.Format("T1={0}", t1));
                    }
                    toSingular.Add(line2, line1);
                }

                if (t1 == "S")
                {
                    toPlural.Add(line1, "#");
                }
                else
                {
                    toPlural.Add(line1, line2);
                }

                if (t2.Length > 0 && t2 != "P")
                {
                    if (t2.Length == 1 && t2 != "T")
                    {
                        Console.WriteLine(string.Format("T2={0}", t2));
                    }
                    else if (t2 != "T")
                    {
                        toSingular.Add(t2, line2);
                    }
                }
            }
        }
        public void ReadNounNumber(string filename, Dictionary<string, string> toSingular, Dictionary<string, string> toPlural)
        {
            string[] lines = File.ReadAllLines(filename);
            if (lines == null)
                throw new FileLoadException("Failed to open noun number data");

            for (int ii = 0; ii < lines.Length; ii += 2) {
                if (lines[ii].Length == 0)
                    break;
                AuxString auxstr1 = new AuxString(lines[ii]);
                AuxString auxstr2 = new AuxString(lines[ii + 1]);

                string t1, line1;
                if (auxstr1.WordCount() > 1) {
                    t1 = auxstr1.Word(1);
                    line1 = auxstr1.Word(0).ToLower();
                } else {
                    t1 = "";
                    line1 = lines[ii].ToLower();
                }

                string t2, line2;
                if (auxstr2.WordCount() > 1) {
                    t2 = auxstr2.Word(1);
                    line2 = auxstr2.Word(0).ToLower();
                } else {
                    t2 = "";
                    line2 = lines[ii + 1].ToLower();
                }

                if (t1 == "P" || t1 == "TP")
                    toSingular.Add(line2, "#");
                else if (t2 == "P")
                    toSingular.Add(line2, "");
                else if (t1 != "S") {
                    if (t1.Length > 0 && t1 != "T")
                        Console.WriteLine(string.Format("T1={0}", t1));
                    toSingular.Add(line2, line1);
                }

                if (t1 == "S")
                    toPlural.Add(line1, "#");
                else
                    toPlural.Add(line1, line2);

                if (t2.Length > 0 && t2 != "P") {
                    if (t2.Length == 1 && t2 != "T")
                        Console.WriteLine(string.Format("T2={0}", t2));
                    else if (t2 != "T")
                        toSingular.Add(t2, line2);
                }
            }
        }
        public string ComposePrespart(string verb)
        {
            int ilen = verb.Length;

            if (ilen > 2)
            {
                char last = char.ToLower(verb[ilen - 1]);

                if ((last == 'e') && ((verb[ilen - 2] == 'u') || (AuxString.IsConsonant(verb, ilen - 2))))
                {
                    //check exceptions
                    if ((verb == "dye") || (verb == "singe") ||
                        (verb == "age") || (verb == "eye") ||
                        (verb == "swinge") || (verb == "whinge"))
                    {
                        return(verb + "ing"); // add ing
                    }
                    else                      // change e to ing
                    {
                        return(verb.Substring(0, ilen - 1) + "ing");
                    }
                }
                else if (verb.EndsWith("ie"))         // replace 'ie' with 'ying'
                {
                    return(verb.Substring(0, ilen - 2) + "ying");
                    //base ends (consonant [or qu] + vowel + consonant)
                }
                else if (AuxString.IsConsonant(verb, ilen - 1) && AuxString.IsVowel(verb, ilen - 2) &&
                         (AuxString.IsConsonant(verb, ilen - 3) ||
                          (ilen > 3 && verb[ilen - 4] == 'q' && verb[ilen - 3] == 'u')))
                {
                    if (last == 'c')
                    {
                        return(verb + "king");
                    }
                    else if ((last == 'x') || (last == 'y') || (last == 'w'))
                    {
                        return(verb + "ing");
                    }
                    else if (last == 'g')
                    {
                        return(verb + "ging");
                    }
                    else if (last == 'l')
                    {
                        return(verb + "ling");
                    }
                    else if (verbsData.todouble.ContainsKey(verb))
                    {
                        return(verb + last + "ing");
                    }
                    else
                    {
                        return(verb + "ing");
                    }
                }
                else
                {
                    return(verb + "ing");
                }
            }
            else
            {
                return(verb + "ing");
            }
        }
        //extract base from verbs ending in d
        public string DItBase(string input)
        {
            int ilen = input.Length;

            if (input.EndsWith("ed"))          //check for input ending 'ed'
            // ends in 'eed'
            {
                if ((ilen > 3) && char.ToLower(input[ilen - 3]) == 'e')
                {
                    // leave unchanged
                    return(input);
                }
                else if ((ilen > 3) && char.ToLower(input[ilen - 3]) == 'i')
                {
                    // check exceptions
                    if ((input == "belied") || (input == "died") || (input == "lied") ||
                        (input == "tied") || (input == "vied"))
                    {
                        return(input.Substring(0, ilen - 1)); // remove final d
                    }
                    else if (input == "taxied")
                    {
                        return("taxi");
                    }
                    else
                    {
                        //change 'ied' to 'y'
                        return(input.Substring(0, ilen - 3) + "y");
                    }
                }
                else if ((input.EndsWith("cked")) || (input.EndsWith("ffed")) ||
                         (input.EndsWith("ooed")) || (input.EndsWith("lled")) ||
                         (input.EndsWith("wed")) ||
                         (input.EndsWith("ssed")) || (input.EndsWith("yed")) ||
                         (input.EndsWith("xed")) || (input.EndsWith("zzed")))
                {
                    //exceptions
                    if ((input == "axed") || (input == "annexed") ||
                        (input == "finessed") || (input == "dyed") ||
                        (input == "eyed"))
                    {
                        //change ed to e
                        return(input.Substring(0, ilen - 1));
                    }
                    else if ((input == "gassed") || (input == "bussed") ||
                             (input == "trafficked") || (input == "panicked") ||
                             (input == "mimicked") || (input == "frolicked") ||
                             (input == "shellacked") || (input == "tarmacked"))
                    {
                        // remove sed or ked
                        return(input.Substring(0, ilen - 3));
                    }
                    else
                    {
                        // remove ed
                        return(input.Substring(0, ilen - 2));
                    }
                }
                else if (CountVowels(input) == 1)
                {
                    if (input == "typed")
                    {
                        return("type");
                    }
                    // leave unchanged
                    return(input);
                }
                else if ((CountVowels(input) == 2) && input.EndsWith("lled"))
                {
                    return(input.Substring(0, ilen - 2));
                }
                else if ((ilen > 4) && (input[ilen - 3] == input[ilen - 4]) &&
                         AuxString.IsConsonant(input, ilen - 3))
                {
                    if ((input == "boycotted") ||
                        (input == "blackballed") || (input == "recalled") ||
                        (input == "overcalled") || (input == "mis-spelled") ||
                        (input == "installed") || (input == "unrolled") ||
                        (input == "overfilled") || (input == "whirred") ||
                        (input == "putted") ||
                        (input == "purred") || (input == "erred"))
                    {
                        // remove ed
                        return(input.Substring(0, ilen - 2));
                    }
                    else
                    {
                        // remove last ed and changed double const. to single
                        string result = input.Substring(0, ilen - 3);
                        if (!verbsData.todouble.ContainsKey(result))
                        {
                            result += input[result.Length - 1];
                        }
                        return(result);
                    }
                }
                else if (input.EndsWith("ced") ||
                         input.EndsWith("fed") ||
                         input.EndsWith("led") ||
                         input.EndsWith("sed") ||
                         input.EndsWith("ued") ||
                         input.EndsWith("ized") ||
                         input.EndsWith("ved"))
                {
                    if (input == "summonsed")
                    {
                        return("summons");
                    }

                    return(input.Substring(0, ilen - 1));
                    // one-or-more-consonants + single-vowel + single-consonant + ed
                }
                else if ((ilen > 5) &&
                         AuxString.IsConsonant(input, ilen - 5) &&
                         AuxString.IsVowel(input, ilen - 4) &&
                         AuxString.IsConsonant(input, ilen - 3))
                {
                    return(input.Substring(0, ilen - 1)); // remove final 'd'
                    //ends  consonant + ed
                }
                else if ((ilen > 3) && AuxString.IsConsonant(input, ilen - 3))
                {
                    if (input == "singed")
                    {
                        return("singe");
                    }
                    else if (input == "swinged")
                    {
                        return("swinge");
                    }
                    else
                    {
                        string result = input.Substring(0, ilen - 1); // try removing 'd'
                        if (!(verbsData.transitive.ContainsKey(result) && verbsData.intransitive.ContainsKey(result) &&
                              verbsData.either.ContainsKey(result) && verbsData.todouble.ContainsKey(result)))
                        {
                            return(result.Substring(0, result.Length - 1));
                        }

                        return(result);
                    }
                }
                else
                {
                    // else change 'ed' to 'e'
                    return(input.Substring(0, ilen - 1));
                }
            }

            return(input);
        }
        //extract base from verbs ending in g
        public string GItBase(string input)
        {
            int ilen = input.Length;

            if ((input.EndsWith("cking")) || (input.EndsWith("ffing")) ||
                (input.EndsWith("wing")) ||
                (input.EndsWith("ssing")) || (input.EndsWith("ying")) ||
                (input.EndsWith("xing")) || (input.EndsWith("zzing")))
            {
                // check for exceptions
                if ((input == "belying") || (input == "dying") || (input == "lying") ||
                    (input == "tying") || (input == "vying"))
                {
                    //change ying to ie
                    return(input.Substring(0, ilen - 4) + "ie");
                }
                else if ((input == "axing") || (input == "annexing") ||
                         (input == "finessing") || (input == "eying"))
                {
                    return(input.Substring(0, ilen - 3) + "e");
                }
                else if ((input == "gassing") || (input == "bussing") ||
                         (input == "panicking") || (input == "mimicking") ||
                         (input == "frolicking") || (input == "shellacking") ||
                         (input == "tarmacking") || (input == "trafficking"))
                {
                    // remove sing or king
                    return(input.Substring(0, ilen - 4));
                }
                else
                {
                    // remove ing
                    return(input.Substring(0, ilen - 3));
                }
                //ends ing & no other vowels
            }
            else if ((input.EndsWith("ing")) && (CountVowels(input) == 1))
            {
                if (input == "typing")
                {
                    return("type");
                }
                // else leave unchanged
                else
                {
                    return(input);
                }
            }
            else if ((input.EndsWith("lling")) && (CountVowels(input) == 2))
            {
                //remove ing
                return(input.Substring(0, ilen - 3));
                // two identical consonants + 'ing'
            }
            else if ((input.EndsWith("ing")) && (ilen > 4) &&
                     (input[ilen - 4] == input[ilen - 5]) &&
                     AuxString.IsConsonant(input, ilen - 4))
            {
                if ((input == "boycotting") ||
                    (input == "blackballing") ||
                    (input == "recalling") ||
                    (input == "overcalling") ||
                    (input == "befalling") ||
                    (input == "mis-spelling") ||
                    (input == "retelling") ||
                    (input == "reselling") ||
                    (input == "overselling") ||
                    (input == "underselling") ||
                    (input == "installing") ||
                    (input == "unrolling") ||
                    (input == "overfilling") ||
                    (input == "whirring") ||
                    (input == "purring") ||
                    (input == "erring"))
                {
                    return(input.Substring(0, ilen - 3));
                }
                else
                {
                    // remove last ing and changed double const. to single
                    string result = input.Substring(0, ilen - 4);
                    if (!verbsData.todouble.ContainsKey(result))
                    {
                        result += result[ilen - 1];
                    }
                    return(result);
                }
            }
            else if (input.EndsWith("cing") ||
                     input.EndsWith("fing") ||
                     input.EndsWith("ling") ||
                     input.EndsWith("sing") ||
                     input.EndsWith("uing") ||
                     input.EndsWith("ving"))
            {
                return(input.Substring(0, ilen - 3) + "e");
            }
            else if ((ilen > 5) && input.EndsWith("ing") &&
                     AuxString.IsConsonant(input, ilen - 6) &&
                     AuxString.IsVowel(input, ilen - 5) &&
                     CountVowels(input) == 2 &&
                     AuxString.IsConsonant(input, ilen - 4))
            {
                return(input.Substring(0, ilen - 3) + "e");
            }
            else if ((ilen > 3) && input.EndsWith("ing") &&
                     AuxString.IsConsonant(input, ilen - 4))
            {
                // check in transtive list to tell us what to do
                string result = input.Substring(0, ilen - 3);
                if (!verbsData.transitive.ContainsKey(input) && !verbsData.intransitive.ContainsKey(input) && !verbsData.either.ContainsKey(input))
                {
                    result += "e";
                }
                return(result);
            }
            else if (input.EndsWith("ing"))
            {
                return(input.Substring(0, ilen - 3));
            }

            return(input);
        }
Exemplo n.º 11
0
        public VerbsData(string basedir)
        {
            base_past = new Dictionary<string, TwoTuple<string,string>>();
            past_base = new Dictionary<string, TwoTuple<string,string>>();
            base_pastpart = new Dictionary<string,string>();
            pastpart_base = new Dictionary<string,string>();
            verb_tobase = new Dictionary<string,string>();

            string[] lines = File.ReadAllLines(basedir + "verb_table.txt");
            if (lines == null)
                throw new FileLoadException(string.Format("Failed to open verb table"));

            foreach (string line in lines) {
                if (line.Length == 0)
                    break;
                AuxString auxstr = new AuxString(line);
                base_past[auxstr.Word(0)] = new TwoTuple<string, string>(auxstr.Word(1), auxstr.Word(3));
                past_base[auxstr.Word(1)] = new TwoTuple<string, string>(auxstr.Word(0), auxstr.Word(3));
                base_pastpart[auxstr.Word(0)] = auxstr.Word(2);
                pastpart_base[auxstr.Word(2)] = auxstr.Word(0);
            }

            lines = File.ReadAllLines(basedir + "verb_exceptions.txt");
            if (lines == null)
                throw new FileLoadException("Failed to open verb exceptions");

            for (int ii = 0; ii < lines.Length; ii += 2) {
                if (lines[ii].Length == 0)
                    break;
                verb_tobase.Add(lines[ii], lines[ii + 1]);
            }

            todouble = FillBag(basedir + "verb_todouble.txt", "Failed to open verb double table");

            either = FillBag(basedir + "verb_either.txt", "Failed to open verb either table");
            transitive = FillBag(basedir + "verb_transitive.txt", "Failed to open verb transitive table");
            intransitive = FillBag(basedir + "verb_intransitive.txt", "Failed to open verb intransitive table");

            phrVerbT = GlomDictionary(basedir + "verb_adv_transitive.txt", "Failed to open transitive verbal phrase table");
            phrVerbI = GlomDictionary(basedir + "verb_adv_intransitive.txt", "Failed to open intransitive verbal phrase table");
            phrVerbE = GlomDictionary(basedir + "verb_adv_either.txt", "Failed to open either verbal phrase table");

            lines = File.ReadAllLines(basedir + "verb_adv_prep.txt");
            if (lines == null)
                throw new FileLoadException("Failed to open either verbal phrase table");

            phrVAP = new Dictionary<string,string>();

            foreach (string line in lines) {
                if (line.Length == 0)
                    break;
                AuxString auxstr = new AuxString(line);
                AppendString(phrVAP, auxstr.Word(0), auxstr.Word(1) + " " + auxstr.Word(2), "#");
            }

            verb_ING = new Dictionary<string, TwoTuple<string,string>>();
            verb_ED = new Dictionary<string, TwoTuple<string,string>>();
            verb_S = new Dictionary<string, TwoTuple<string,string>>();

            lines = File.ReadAllLines(basedir + "verb_special.txt");
            if (lines == null)
                throw new FileLoadException(string.Format("Failed to open verb special table"));

            foreach (string line in lines) {
                if (line.Length == 0)
                    break;
                AuxString auxstr = new AuxString(line);
                if (auxstr.Letter(0) != '#') // ignore comments
                {
                    if (auxstr.WordCount() == 0)
                        continue;
                    if (auxstr.WordCount() != 5)
                        throw new FieldAccessException(string.Format("Bad format in special table at \"{0}\"", line));
                    else
                    {
                        string base_word = auxstr.Word(0);
                        string base_ing = auxstr.Word(1);
                        string base_ed = auxstr.Word(2);
                        string base_s = auxstr.Word(3);
                        string type = auxstr.Word(4);

                        if (base_ing != "-")
                            verb_ING.Add(base_ing, new TwoTuple<string, string>(base_word, type));

                        if (base_ed != "-")
                            verb_ED.Add(base_ed, new TwoTuple<string, string>(base_word, type));

                        if (base_s != "-")
                            verb_S.Add(base_s, new TwoTuple<string, string>(base_word, type));
                    }
                }
            }
        }
Exemplo n.º 12
0
        protected Dictionary<string, string> GlomDictionary(string filename, string error)
        {
            string[] lines = File.ReadAllLines(filename);
            if (lines == null)
                throw new FileLoadException("Failed to open transitive verbal phrase table");

            Dictionary<string, string> result = new Dictionary<string,string>();

            foreach (string line in lines) {
                if (line.Length == 0)
                    break;
                AuxString auxstr = new AuxString(line);
                AppendString(result, auxstr.Word(0), auxstr.Word(1), "#");
            }

            return result;
        }
Exemplo n.º 13
0
        public VerbsData(string basedir)
        {
            base_past     = new Dictionary <string, TwoTuple <string, string> >();
            past_base     = new Dictionary <string, TwoTuple <string, string> >();
            base_pastpart = new Dictionary <string, string>();
            pastpart_base = new Dictionary <string, string>();
            verb_tobase   = new Dictionary <string, string>();

            string[] lines = File.ReadAllLines(basedir + "verb_table.txt");
            if (lines == null)
            {
                throw new FileLoadException(string.Format("Failed to open verb table"));
            }

            foreach (string line in lines)
            {
                if (line.Length == 0)
                {
                    break;
                }
                AuxString auxstr = new AuxString(line);
                base_past[auxstr.Word(0)]     = new TwoTuple <string, string>(auxstr.Word(1), auxstr.Word(3));
                past_base[auxstr.Word(1)]     = new TwoTuple <string, string>(auxstr.Word(0), auxstr.Word(3));
                base_pastpart[auxstr.Word(0)] = auxstr.Word(2);
                pastpart_base[auxstr.Word(2)] = auxstr.Word(0);
            }

            lines = File.ReadAllLines(basedir + "verb_exceptions.txt");
            if (lines == null)
            {
                throw new FileLoadException("Failed to open verb exceptions");
            }

            for (int ii = 0; ii < lines.Length; ii += 2)
            {
                if (lines[ii].Length == 0)
                {
                    break;
                }
                verb_tobase.Add(lines[ii], lines[ii + 1]);
            }

            todouble = FillBag(basedir + "verb_todouble.txt", "Failed to open verb double table");

            either       = FillBag(basedir + "verb_either.txt", "Failed to open verb either table");
            transitive   = FillBag(basedir + "verb_transitive.txt", "Failed to open verb transitive table");
            intransitive = FillBag(basedir + "verb_intransitive.txt", "Failed to open verb intransitive table");

            phrVerbT = GlomDictionary(basedir + "verb_adv_transitive.txt", "Failed to open transitive verbal phrase table");
            phrVerbI = GlomDictionary(basedir + "verb_adv_intransitive.txt", "Failed to open intransitive verbal phrase table");
            phrVerbE = GlomDictionary(basedir + "verb_adv_either.txt", "Failed to open either verbal phrase table");

            lines = File.ReadAllLines(basedir + "verb_adv_prep.txt");
            if (lines == null)
            {
                throw new FileLoadException("Failed to open either verbal phrase table");
            }

            phrVAP = new Dictionary <string, string>();

            foreach (string line in lines)
            {
                if (line.Length == 0)
                {
                    break;
                }
                AuxString auxstr = new AuxString(line);
                AppendString(phrVAP, auxstr.Word(0), auxstr.Word(1) + " " + auxstr.Word(2), "#");
            }

            verb_ING = new Dictionary <string, TwoTuple <string, string> >();
            verb_ED  = new Dictionary <string, TwoTuple <string, string> >();
            verb_S   = new Dictionary <string, TwoTuple <string, string> >();

            lines = File.ReadAllLines(basedir + "verb_special.txt");
            if (lines == null)
            {
                throw new FileLoadException(string.Format("Failed to open verb special table"));
            }

            foreach (string line in lines)
            {
                if (line.Length == 0)
                {
                    break;
                }
                AuxString auxstr = new AuxString(line);
                if (auxstr.Letter(0) != '#') // ignore comments
                {
                    if (auxstr.WordCount() == 0)
                    {
                        continue;
                    }
                    if (auxstr.WordCount() != 5)
                    {
                        throw new FieldAccessException(string.Format("Bad format in special table at \"{0}\"", line));
                    }
                    else
                    {
                        string base_word = auxstr.Word(0);
                        string base_ing  = auxstr.Word(1);
                        string base_ed   = auxstr.Word(2);
                        string base_s    = auxstr.Word(3);
                        string type      = auxstr.Word(4);

                        if (base_ing != "-")
                        {
                            verb_ING.Add(base_ing, new TwoTuple <string, string>(base_word, type));
                        }

                        if (base_ed != "-")
                        {
                            verb_ED.Add(base_ed, new TwoTuple <string, string>(base_word, type));
                        }

                        if (base_s != "-")
                        {
                            verb_S.Add(base_s, new TwoTuple <string, string>(base_word, type));
                        }
                    }
                }
            }
        }