本文整理汇总了Python中bot.Bot.tell方法的典型用法代码示例。如果您正苦于以下问题:Python Bot.tell方法的具体用法?Python Bot.tell怎么用?Python Bot.tell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bot.Bot
的用法示例。
在下文中一共展示了Bot.tell方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_noun_verb2
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_noun_verb2(self):
bot = Bot()
bot_input = "David is running quickly"
bot.tell(bot_input)
verbs = bot.knowledge.get_verbs()
verb = verbs[0]
self.assertEqual(verb.word, "running")
示例2: test_person_adj_inquiry_false
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_person_adj_inquiry_false(self):
bot = Bot()
bot_input1 = "David is sweet"
bot_input2 = "is David cute?"
expected_response = "I don't have that information."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例3: test_noun_verb_inquiry_who_no_obj_match
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_noun_verb_inquiry_who_no_obj_match(self):
bot = Bot()
bot_input1 = "David is hugging a tomato"
bot_input2 = "Who is hugging?"
expected_response = "David."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例4: test_adj_inquiry2
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_adj_inquiry2(self):
bot = Bot()
bot_input1 = "David is cute"
bot_input2 = "who is cute?"
expected_response = "David."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例5: test_noun_is_noun_false
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_noun_is_noun_false(self):
bot = Bot()
bot_input1 = "the giraffe is an animal"
bot_input2 = "the animal is a giraffe"
expected_response = "That is impossible."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例6: test_personal_inquiry4
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_personal_inquiry4(self):
bot = Bot()
bot_input1 = "David is cute."
bot_input2 = "tell me about David?"
expected_response = "David is cute."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例7: test_noun_verb_inquiry_who_obj_no_match
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_noun_verb_inquiry_who_obj_no_match(self):
bot = Bot()
bot_input1 = "David is eating a giraffe"
bot_input2 = "Who is eating a cake?"
expected_response = "No one."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例8: test_person_adj_inquiry_true
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_person_adj_inquiry_true(self):
bot = Bot()
bot_input1 = "David is cute"
bot_input2 = "is David cute?"
expected_response = "Yes."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例9: test_noun_verb_inquiry_false1
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_noun_verb_inquiry_false1(self):
bot = Bot()
bot_input1 = "David is running quickly"
bot_input2 = "Is David eating?"
expected_response = "No."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例10: test_noun_verb_inquiry_false2
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_noun_verb_inquiry_false2(self):
bot = Bot()
bot_input1 = "David is hugging a tomato"
bot_input2 = "Is David hugging a cucumber?"
expected_response = "No."
bot.tell(bot_input1)
response = bot.tell(bot_input2)
self.assertEqual(response, expected_response)
示例11: test_adj_inquiry3
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_adj_inquiry3(self):
bot = Bot()
bot_input1 = "David is cute"
bot_input2 = "Brandon is cute"
bot_input3 = "who is cute?"
bot.tell(bot_input1)
bot.tell(bot_input2)
response = bot.tell(bot_input3)
self.assertIn("David", response)
self.assertIn("Brandon", response)
示例12: test_adj_removal
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_adj_removal(self):
bot = Bot()
bot_input1 = "David is cute"
bot_input2 = "David is sweet"
bot_input3 = "David is not cute"
bot_input4 = "is David cute?"
expected_response = "No."
bot.tell(bot_input1)
bot.tell(bot_input2)
bot.tell(bot_input3)
response = bot.tell(bot_input4)
self.assertEqual(response, expected_response)
示例13: test_random_statement
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_random_statement(self):
bot = Bot()
bot_input = "asdasdas"
expected_response = "Ok."
response = bot.tell(bot_input)
self.assertEqual(response, expected_response)
示例14: test_personal_inquiry2
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_personal_inquiry2(self):
bot = Bot()
bot_input = "tell me about David?"
expected_response = "I don't know anything about David"
response = bot.tell(bot_input)
self.assertEqual(response, expected_response)
示例15: test_adj_noun_negated
# 需要导入模块: from bot import Bot [as 别名]
# 或者: from bot.Bot import tell [as 别名]
def test_adj_noun_negated(self):
bot = Bot()
bot_input = "David is not cute"
expected_response = "I see."
response = bot.tell(bot_input)
self.assertEqual(response, expected_response)