def ask(self, msg): match = re.match(ur'^(ask|问) (\w+|[\u4e00-\u9fa5]+)', msg.content) if match: # logging.info("问答测试...") command = match.group(1) info = match.group(2) # logging.info("info:") # logging.info(msg.content) if command == 'ask' or command == u'问': # self.reply("我开始查询" + city + "的天气啦") query = Turing() info = query.getReply(info) # logging.info(str(info)) self.reply(str(info)) return True return False
def ask(self, msg): match = re.match(ur'^(ask|问) (\w+|[\u4e00-\u9fa5]+)', msg.content) if match: # logging.info("问答测试...") print msg.content command = match.group(1) info = match.group(2) # logging.info("info:") logging.info(msg.content) # print info if command == 'ask' or command == u'问': # self.reply("我开始查询" + city + "的天气啦") query = Turing() info = query.getReply(info) logging.info(str(info)) self.reply(str(info)) return True return False
def ask(self, msg): match = re.match(ur'^(ask|问) (\w+|[\u4e00-\u9fa5]+)', msg.content) if match: # logging.info("问答测试...") print msg.content command = match.group(1) info = match.group(2) # logging.info("info:") logging.info("RUNTIMELOG 图灵问答语句: " + msg.content) # print info if command == 'ask' or command == u'问': # self.reply("我开始查询" + city + "的天气啦") query = Turing() info = query.getReply(info) logging.info("RESPONSE " + str(info)) self.reply(str(info)) return True return False