コード例 #1
0
    def setUp(self):
        #make some words
        self.story = Word("story", "NOUN")
        self.hero = Word("hero", "NOUN")
        self.case = Word("case", "NOUN")

        #Irreg
        self.goose = Word("goose", "NOUN", features={"plural": "geese"})

        #Proper
        self.Harry = Word("Harry", "NOUN", features={"proper": True})
コード例 #2
0
 def testPresentParticiple(self):
     morph = pynlg.morphology
     self.assertEqual("walking", morph.verb_present_participle(self.walk))
     self.assertEqual("welcoming",
                      morph.verb_present_participle(self.welcome))
     self.assertEqual("programming",
                      morph.verb_present_participle(self.program))
     self.assertEqual("being", morph.verb_present_participle(self.be))
     self.assertEqual("worrying", morph.verb_present_participle(self.worry))
     self.assertEqual("kissing", morph.verb_present_participle(self.kiss))
     eat = Word("eat", "VERB")
     self.assertEqual("eating", morph.verb_present_participle(eat))
コード例 #3
0
 def setUp(self):
     self.good = Word("good",
                      "ADJECTIVE",
                      features={
                          "superlative": "best",
                          "comparative": "better"
                      })
     self.tall = Word("tall", "ADJECTIVE")
     self.large = Word("large", "ADJECTIVE")
     self.big = Word("big", "ADJECTIVE")
     self.happy = Word("happy", "ADJECTIVE")
     self.beautiful = Word("beautiful", "ADJECTIVE")
コード例 #4
0
 def setUp(self):
     self.walk = Word("walk", "VERB")
     self.be = Word("be",
                    "VERB",
                    features={
                        "present": "is",
                        "presentparticiple": "being",
                        "to-infinitive": "to be",
                        "infinitive": "be",
                        "past": "was"
                    })
     self.welcome = Word("welcome", "VERB")
     self.program = Word("program", "VERB")
     self.worry = Word("worry", "VERB")
     self.kiss = Word("kiss", "VERB")