예제 #1
0
 def dispatch(self, *args):
     from askers import BaseAsker
     assert(isinstance(args[0], BaseAsker))
     result = super(Dispatcher, self).dispatch(*args)
     if result is not None:
         return result
     import convert
     asker = args[0]
     term_args = args[1:]
     new_args = tuple(convert.reduce(asker, arg)  for arg in term_args)
     return super(Dispatcher, self).dispatch(asker, *new_args)
예제 #2
0
 def simple_translate(asker, property, update, input, output):
     reduced_update = convert.reduce(asker, update)
     if reduced_update.head not in exclude:
         return asker.reply(answer=properties.simple_add_modifier(output, property))