当前位置: 首页>>代码示例>>Python>>正文


Python Bot.tell方法代码示例

本文整理汇总了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")
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:9,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:10,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:12,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:14,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:8,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:8,代码来源:pattern_tests.py

示例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)
开发者ID:AxelUlmestig,项目名称:chatterbot,代码行数:8,代码来源:pattern_tests.py


注:本文中的bot.Bot.tell方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。