예제 #1
0
        public void EvolutionGoneHorriblyWrong()
        {
            string realized = Client.Realize(new NPPhraseSpec
            {
                Head          = Word.Noun("evolution"),
                PostModifiers = new NLGElement[]
                {
                    new VPPhraseSpec
                    {
                        Form          = form.PAST_PARTICIPLE,
                        Head          = Word.Verb("go"),
                        PostModifiers = new NLGElement[]
                        {
                            new AdjPhraseSpec
                            {
                                PreModifiers = new NLGElement[]
                                {
                                    Word.Adverb("horribly")
                                },
                                Head = Word.Adjective("wrong")
                            }
                        }
                    }
                }
            });

            Assert.AreEqual("Evolution gone horribly wrong.", realized);
        }
예제 #2
0
파일: Insults.cs 프로젝트: GregWickham/Flex
 public void CoordinatedComplement() => Assert.AreEqual("Greg is an incompetent fool, an imbecile and a wildly mendacious narcissist.", Client.Realize(new SPhraseSpec
 {
     Form  = form.NORMAL,
     Tense = tense.PRESENT,
     subj  = new NLGElement[]
     {
         Word.Noun("greg").SetProper(true)
     },
     vp = new VPPhraseSpec
     {
         head  = Word.Verb("be"),
         compl = new NLGElement[]
         {
             new CoordinatedPhraseElement
             {
                 conj  = "and",
                 coord = new NLGElement[]
                 {
                     new NPPhraseSpec
                     {
                         preMod = new NLGElement[]
                         {
                             Word.Adjective("incompetent")
                         },
                         head = Word.Noun("fool"),
                         spec = Word.Determiner("a")
                     },
                     new NPPhraseSpec
                     {
                         head = Word.Noun("imbecile"),
                         spec = Word.Determiner("a")
                     },
                     new NPPhraseSpec
                     {
                         preMod = new NLGElement[]
                         {
                             new AdjPhraseSpec
                             {
                                 head   = Word.Adjective("mendacious"),
                                 preMod = new NLGElement[]
                                 {
                                     Word.Adverb("wildly")
                                 }
                             }
                         },
                         head = Word.Noun("narcissist"),
                         spec = Word.Determiner("a")
                     }
                 }
             }
         }
     }
 }));
예제 #3
0
                public void MuchBetter()
                {
                    string realized = Client.Realize(new AdjPhraseSpec
                    {
                        head         = Word.Adjective("better"),
                        PreModifiers = new NLGElement[]
                        {
                            Word.Adverb("much")
                        }
                    });

                    Assert.AreEqual("Much better.", realized);
                }
예제 #4
0
        public void DroveAway()
        {
            string realized = Client.Realize(new VPPhraseSpec
            {
                Tense         = tense.PAST,
                Head          = Word.Verb("drive"),
                PostModifiers = new NLGElement[]
                {
                    Word.Adverb("away")
                }
            });

            Assert.AreEqual("Drove away.", realized);
        }
예제 #5
0
        public void StartsOut()
        {
            string realized = Client.Realize(new VPPhraseSpec
            {
                Tense         = tense.PRESENT,
                Head          = Word.Verb("start"),
                PostModifiers = new NLGElement[]
                {
                    Word.Adverb("out")
                }
            });

            Assert.AreEqual("Starts out.", realized);
        }
예제 #6
0
        public void LookedUp()
        {
            string realized = Client.Realize(new VPPhraseSpec
            {
                Tense         = tense.PAST,
                Head          = Word.Verb("look"),
                PostModifiers = new NLGElement[]
                {
                    Word.Adverb("up")
                }
            });

            Assert.AreEqual("Looked up.", realized);
        }
예제 #7
0
        public void TakingOff()
        {
            string realized = Client.Realize(new VPPhraseSpec
            {
                Tense         = tense.PRESENT,
                Form          = form.PRESENT_PARTICIPLE,
                Head          = Word.Verb("take"),
                PostModifiers = new NLGElement[]
                {
                    Word.Adverb("off")
                }
            });

            Assert.AreEqual("Taking off.", realized);
        }
예제 #8
0
 public void AnExtremelyBadSituation() => Assert.AreEqual("A extremely bad situation.", Client.Realize(new NPPhraseSpec
 {
     Head         = Word.Noun("situation"),
     Specifier    = Word.Determiner("a"),
     PreModifiers = new NLGElement[]
     {
         new AdjPhraseSpec
         {
             Head         = Word.Adjective("bad"),
             PreModifiers = new NLGElement[]
             {
                 Word.Adverb("extremely")
             }
         }
     }
 }));
예제 #9
0
 public void AMuchTallerBuilding() => Assert.AreEqual("A much taller building.",
                                                      Client.Realize(new NPPhraseSpec
 {
     head         = Word.Noun("building"),
     spec         = Word.Determiner("a"),
     PreModifiers = new NLGElement[]
     {
         new AdjPhraseSpec
         {
             head        = Word.Adjective("tall"),
             Comparative = true,
             preMod      = new NLGElement[]
             {
                 Word.Adverb("much")
             }
         }
     }
 }));
예제 #10
0
                public void WayMoreImportant()
                {
                    string realized = Client.Realize(new AdjPhraseSpec
                    {
                        head         = Word.Adjective("important"),
                        PreModifiers = new NLGElement[]
                        {
                            new AdvPhraseSpec
                            {
                                head   = Word.Adverb("more"),
                                preMod = new NLGElement[]
                                {
                                    Word.Adverb("way")
                                }
                            }
                        }
                    });

                    Assert.AreEqual("Way more important.", realized);
                }
예제 #11
0
 public void AMorePefectUnion() => Assert.AreEqual("A more perfect union.",
                                                   Client.Realize(new NPPhraseSpec
 {
     head         = Word.Noun("union"),
     spec         = Word.Determiner("a"),
     PreModifiers = new NLGElement[]
     {
         new AdjPhraseSpec
         {
             head   = Word.Adjective("perfect"),
             preMod = new NLGElement[]
             {
                 new AdvPhraseSpec
                 {
                     head = Word.Adverb("more")
                 }
             }
         }
     }
 }));
예제 #12
0
                public void CompletelyAndTotallyIncompetent()
                {
                    string realized = Client.Realize(new AdjPhraseSpec
                    {
                        head         = Word.Adjective("incompetent"),
                        PreModifiers = new NLGElement[]
                        {
                            new CoordinatedPhraseElement
                            {
                                Conjunction = "and",
                                coord       = new NLGElement[]
                                {
                                    Word.Adverb("completely"),
                                    Word.Adverb("totally")
                                }
                            }
                        }
                    });

                    Assert.AreEqual("Completely and totally incompetent.", realized);
                }
예제 #13
0
            public void MoreBeautifulAndTalented()
            {
                string realized = Client.Realize(new CoordinatedPhraseElement
                {
                    Category = phraseCategory.ADJECTIVE_PHRASE,
                    conj     = "and",
                    coord    = new NLGElement[]
                    {
                        new AdjPhraseSpec
                        {
                            Head   = Word.Adjective("beautiful"),
                            preMod = new NLGElement[]
                            {
                                Word.Adverb("more")
                            }
                        },
                        Word.Adjective("talented")
                    }
                });

                Assert.AreEqual("More beautiful and talented.", realized);
            }
예제 #14
0
            public void MostIncompetentAndCorrupt()
            {
                string realized = Client.Realize(new CoordinatedPhraseElement
                {
                    Category = phraseCategory.ADJECTIVE_PHRASE,
                    conj     = "and",
                    coord    = new NLGElement[]
                    {
                        new AdjPhraseSpec
                        {
                            Head   = Word.Adjective("incompetent"),
                            preMod = new NLGElement[]
                            {
                                Word.Adverb("most")
                            }
                        },
                        Word.Adjective("corrupt")
                    }
                });

                Assert.AreEqual("Most incompetent and corrupt.", realized);
            }
예제 #15
0
 public void AMuchMoreImportantAndUltimatelyDecisiveFactor() => Assert.AreEqual("A much more important and ultimately decisive factor.",
                                                                                Client.Realize(new NPPhraseSpec
 {
     head         = Word.Noun("factor"),
     spec         = Word.Determiner("a"),
     PreModifiers = new NLGElement[]
     {
         new CoordinatedPhraseElement
         {
             conj  = "and",
             coord = new NLGElement[]
             {
                 new AdjPhraseSpec
                 {
                     head   = Word.Adjective("important"),
                     preMod = new NLGElement[]
                     {
                         new AdvPhraseSpec
                         {
                             head   = Word.Adverb("more"),
                             preMod = new NLGElement[]
                             {
                                 Word.Adverb("much")
                             }
                         }
                     }
                 },
                 new AdjPhraseSpec
                 {
                     head   = Word.Adjective("decisive"),
                     preMod = new NLGElement[]
                     {
                         Word.Adverb("ultimately")
                     }
                 }
             }
         },
     }
 }));
예제 #16
0
 public void AMuchMoreAmusingJoke() => Assert.AreEqual("A much more amusing joke.",
                                                       Client.Realize(new NPPhraseSpec
 {
     head         = Word.Noun("joke"),
     spec         = Word.Determiner("a"),
     PreModifiers = new NLGElement[]
     {
         new AdjPhraseSpec
         {
             head   = Word.Adjective("amusing"),
             preMod = new NLGElement[]
             {
                 new AdvPhraseSpec
                 {
                     head   = Word.Adverb("more"),
                     preMod = new NLGElement[]
                     {
                         Word.Adverb("much")
                     }
                 }
             }
         }
     }
 }));
예제 #17
0
파일: Phrase.cs 프로젝트: GregWickham/Echo
 public static AdvPhraseSpec Adverb(string headWord) => new AdvPhraseSpec
 {
     head = Word.Adverb(headWord)
 };