Exemple #1
0
 private static string GetThirdPerson(string verb)
 {
     if (_irregularThirdPersons.ContainsKey(verb))
     {
         return(_irregularThirdPersons[verb]);
     }
     return(EnglishUtils.GetThirdPerson(verb));
 }
Exemple #2
0
        public void GetVerbForms()
        {
            //long vowel or diphthong followed by a consonant or ending in a consonant cluster
            foreach (string root in new[] { "paint", "claim", "devour", "play", "delight", "clamp", "lacquer" })
            {
                Assert.AreEqual(root + "ed", EnglishUtils.GetRegularPast(root));
                Assert.AreEqual(root + "ing", EnglishUtils.GetPresentParticiple(root));
                Assert.AreEqual(root + "s", EnglishUtils.GetThirdPerson(root));
            }

            //short vowel
            foreach (string root in new[] { "chat", "chop", "compel", "quiz", "squat", "quit", "equal", "whiz" })
            {
                char lastChar = root[root.Length - 1];
                Assert.AreEqual(root + lastChar + "ed", EnglishUtils.GetRegularPast(root));
                Assert.AreEqual(root + lastChar + "ing", EnglishUtils.GetPresentParticiple(root));
                if (!root.Equals("quiz") && !root.Equals("whiz")) //irregular third person
                {
                    Assert.AreEqual(root + "s", EnglishUtils.GetThirdPerson(root));
                }
            }

            //consonant followed by e
            foreach (string root in new[] { "dance", "save", "devote", "evolve", "quote" })
            {
                Assert.AreEqual(root + "d", EnglishUtils.GetRegularPast(root));
                Assert.AreEqual(root.Substring(0, root.Length - 1) + "ing", EnglishUtils.GetPresentParticiple(root));
                Assert.AreEqual(root + "s", EnglishUtils.GetThirdPerson(root));
            }

            //sibilants
            foreach (string root in new[] { "kiss", "bless", "box", "polish", "preach", "bias", "box" })
            {
                Assert.AreEqual(root + "ed", EnglishUtils.GetRegularPast(root));
                Assert.AreEqual(root + "ing", EnglishUtils.GetPresentParticiple(root));
                Assert.AreEqual(root + "es", EnglishUtils.GetThirdPerson(root));
            }

            //consonant followed by y
            foreach (string root in new[] { "comply", "copy", "magnify" })
            {
                Assert.AreEqual(root.Substring(0, root.Length - 1) + "ied", EnglishUtils.GetRegularPast(root));
                Assert.AreEqual(root + "ing", EnglishUtils.GetPresentParticiple(root));
                Assert.AreEqual(root.Substring(0, root.Length - 1) + "ies", EnglishUtils.GetThirdPerson(root));
            }
        }