class_docstr: Unit tests for the BestMatch logic adapter.
class_docstr_tok: ["Unit","tests","for","the","BestMatch","logic","adapter","."]
docstr: Test that a close match is found when the text_search algorithm is used.
docstr_tok: ["Test","that","a","close","match","is","found","when","the","text_search","algorithm","is","used","."]
code: def test_text_search_algorithm(self):
      """
      Test that a close match is found when the text_search algorithm is used.
      """
      self.adapter = BestMatch(
          self.chatbot, search_algorithm_name="text_search"
      )
  
      self.chatbot.storage.create(text="I am hungry.")
      self.chatbot.storage.create(
          text="Okay, what would you like to eat?",
          in_response_to="I am hungry.",
      )
      self.chatbot.storage.create(text="Can you help me?")
      self.chatbot.storage.create(
          text="Sure, what seems to be the problem?",
          in_response_to="Can you help me?",
      )
  
      statement = Statement(text="Could you help me?")
      match = self.adapter.process(statement)
  
      self.assertEqual(match.confidence, 0.82)
      self.assertEqual(
          match.text, "Sure, what seems to be the problem?"
      )
  
file_path: ChatterBot/tests/logic/test_best_match.py
imports: from chatterbot.logic import BestMatch
  from chatterbot.conversation import Statement
  from tests.base_case import ChatBotTestCase
label_desc: Use image node_id 10 for calling the BestMatchTestCase obj's underlying member method code with example usage: obj.test_text_search_algorithm() without return types