def testExpressList(self): self.assertEquals( self.format( language.ExpressList([ language.ExpressString(u"foo"), u" ", language.ExpressString(u"bar") ])), u"foo bar")
def do(self, player, line, name): srch = player.thing.search(2, iimaginary.IVisible, name) evt = events.Success( actor=player.thing, actorMessage=language.ExpressList( list(iterutils.interlace('\n', (o.visualize() for o in srch))))) evt.broadcast()
def testCapitalization(self): self.assertEquals( self.format(language.ExpressString(u"foo").capitalizeConcept()), u"Foo") self.assertEquals( self.format( language.ExpressList([[[[u"hi"]]]]).capitalizeConcept()), u"Hi") self.assertEquals( self.format( language.ItemizedList([u"foo", u"bar", u"baz"]).capitalizeConcept()), u"Foo, bar, and baz")
def _exitAsConcept(exit): return language.ExpressList( [u'the exit to ', language.Noun(exit.toLocation).nounPhrase()])
def conceptualize(self): return language.ExpressList( [u'the exit to ', language.Noun(self.toLocation).nounPhrase()])