Esempio n. 1
0
 public void MaryJillAndAnitaHaveRedHair() => Assert.AreEqual("Mary, Jill and Anita have red hair.", Client.Realize(new SPhraseSpec
 {
     subj = new NLGElement[]
     {
         new CoordinatedPhraseElement
         {
             conj  = "and",
             coord = new NLGElement[]
             {
                 Word.Noun("Mary").SetProper(true),
                 Word.Noun("Jill").SetProper(true),
                 Word.Noun("Anita").SetProper(true)
             }
         }
     },
     vp = new VPPhraseSpec
     {
         Head  = Word.Verb("have"),
         Tense = tense.PRESENT,
         compl = new NLGElement[]
         {
             new NPPhraseSpec
             {
                 Head         = Word.Noun("hair"),
                 PreModifiers = new NLGElement[]
                 {
                     Word.Adjective("red")
                 }
             }
         }
     }
 }));
Esempio n. 2
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);
        }
Esempio n. 3
0
 public void TallMan() => Assert.AreEqual("Tall man.",
                                          Client.Realize(new NPPhraseSpec
 {
     head         = Word.Noun("man"),
     PreModifiers = new NLGElement[]
     {
         Word.Adjective("tall")
     }
 }));
Esempio n. 4
0
 public void AnAwfulSituation() => Assert.AreEqual("An awful situation.", Client.Realize(new NPPhraseSpec
 {
     Head         = Word.Noun("situation"),
     Specifier    = Word.Determiner("a"),
     PreModifiers = new NLGElement[]
     {
         Word.Adjective("awful")
     }
 }));
Esempio n. 5
0
 public void LootingAndPillagingArePopularActivitiesAmongMyPeople() => Assert.AreEqual("Looting and pillaging are popular activities among my people.", Client.Realize(new SPhraseSpec
 {
     subj = new NLGElement[]
     {
         new CoordinatedPhraseElement
         {
             Conjunction = "and",
             coord       = new NLGElement[]
             {
                 new VPPhraseSpec
                 {
                     Head = Word.Verb("loot"),
                     Form = form.GERUND
                 },
                 new VPPhraseSpec
                 {
                     Head = Word.Verb("pillage"),
                     Form = form.GERUND
                 }
             }
         }
     },
     vp = new VPPhraseSpec
     {
         Head  = Word.Verb("are"),
         Tense = tense.PRESENT,
         compl = new NLGElement[]
         {
             new NPPhraseSpec
             {
                 Head         = Word.Noun("activities"),
                 PreModifiers = new NLGElement[]
                 {
                     Word.Adjective("popular")
                 }
             },
             new PPPhraseSpec
             {
                 Head        = Word.Preposition("among"),
                 Complements = new NLGElement[]
                 {
                     new NPPhraseSpec
                     {
                         Specifier = new NPPhraseSpec
                         {
                             Head       = Word.Pronoun("me"),
                             Possessive = true
                         },
                         Head = Word.Noun("people")
                     }
                 }
             }
         }
     }
 }));
Esempio n. 6
0
 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")
                     }
                 }
             }
         }
     }
 }));
Esempio n. 7
0
            public void UtterlyAtrocious()
            {
                string realized = Client.Realize(new AdjPhraseSpec
                {
                    head         = Word.Adjective("atrocious"),
                    PreModifiers = new NLGElement[]
                    {
                        Phrase.Adverb("utterly")
                    }
                });

                Assert.AreEqual("Utterly atrocious.", realized);
            }
Esempio n. 8
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);
                }
Esempio n. 9
0
            public void Expensive()
            {
                string realized = Client.Realize(new AdjPhraseSpec
                {
                    head         = Word.Adjective("expensive"),
                    PreModifiers = new NLGElement[]
                    {
                        Phrase.Adverb("most")
                    }
                });

                Assert.AreEqual("Most expensive.", realized);
            }
Esempio n. 10
0
            public void Rounded()
            {
                string realized = Client.Realize(new AdjPhraseSpec
                {
                    head         = Word.Adjective("rounded"),
                    PreModifiers = new NLGElement[]
                    {
                        Phrase.Adverb("more")
                    }
                });

                Assert.AreEqual("More rounded.", realized);
            }
Esempio n. 11
0
            public void Important()
            {
                string realized = Client.Realize(new AdjPhraseSpec
                {
                    head         = Word.Adjective("important"),
                    PreModifiers = new NLGElement[]
                    {
                        Phrase.Adverb("more")
                    }
                });

                Assert.AreEqual("More important.", realized);
            }
Esempio n. 12
0
        public void BeautifulAndTalented()
        {
            string realized = Client.Realize(new CoordinatedPhraseElement
            {
                conj  = "and",
                coord = new NLGElement[]
                {
                    Word.Adjective("beautiful"),
                    Word.Adjective("talented")
                }
            });

            Assert.AreEqual("beautiful and talented", realized);
        }
Esempio n. 13
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")
             }
         }
     }
 }));
Esempio n. 14
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")
             }
         }
     }
 }));
Esempio n. 15
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")
                 }
             }
         }
     }
 }));
Esempio n. 16
0
 public void CitizensAreAngryWithTheHighPrices() => Assert.AreEqual("Citizens are angry with the high prices.", Client.Realize(new SPhraseSpec
 {
     subj = new NLGElement[]
     {
         new NPPhraseSpec
         {
             Head   = Word.Noun("citizen"),
             Number = numberAgreement.PLURAL
         }
     },
     vp = new VPPhraseSpec
     {
         Head  = Word.Verb("are"),
         compl = new NLGElement[]
         {
             new AdjPhraseSpec
             {
                 Head        = Word.Adjective("angry"),
                 Complements = new NLGElement[]
                 {
                     new PPPhraseSpec
                     {
                         Head        = Word.Preposition("with"),
                         Complements = new NLGElement[]
                         {
                             new NPPhraseSpec
                             {
                                 Specifier    = Word.Determiner("the"),
                                 Head         = Word.Noun("prices"),
                                 PreModifiers = new NLGElement[]
                                 {
                                     Word.Adjective("high")
                                 }
                             }
                         }
                     }
                 }
             }
         },
     }
 }));
Esempio n. 17
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);
                }
Esempio n. 18
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);
            }
Esempio n. 19
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);
            }
Esempio n. 20
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")
                     }
                 }
             }
         },
     }
 }));
Esempio n. 21
0
 public void GregIsBad() => Assert.AreEqual("Greg is bad.", Client.Realize(new SPhraseSpec
 {
     Form  = form.NORMAL,
     Tense = tense.PRESENT,
     subj  = new NLGElement[]
     {
         new NPPhraseSpec
         {
             head = Word.Noun("greg").SetProper(true)
         }
     },
     vp = new VPPhraseSpec
     {
         head  = Word.Verb("be"),
         compl = new NLGElement[]
         {
             new AdjPhraseSpec
             {
                 head = Word.Adjective("bad")
             }
         }
     }
 }));
Esempio n. 22
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")
                     }
                 }
             }
         }
     }
 }));
Esempio n. 23
0
 private static string ComparativeFormOf(string adjective) => Client.Realize(new AdjPhraseSpec
 {
     head        = Word.Adjective(adjective),
     Comparative = true
 });
Esempio n. 24
0
 public static AdjPhraseSpec Adjective(string headWord) => new AdjPhraseSpec
 {
     head = Word.Adjective(headWord)
 };