class_docstr: Test that the search algorithm works correctly with the
  spacy similarity comparison function.
class_docstr_tok: ["Test","that","the","search","algorithm","works","correctly","with","the","spacy","similarity","comparison","function","."]
docstr: Note, the content of the in_response_to field for each of the
  test statements is only required because the logic adapter will
  filter out any statements that are not in response to a known statement.
docstr_tok: ["Note",",","the","content","of","the","in_response_to","field","for","each","of","the","test","statements","is","only","required","because","the","logic","adapter","will","filter","out","any","statements","that","are","not","in","response","to","a","known","statement","."]
code: def test_get_closest_statement(self):
      """
      Note, the content of the in_response_to field for each of the
      test statements is only required because the logic adapter will
      filter out any statements that are not in response to a known statement.
      """
      self.chatbot.storage.create_many(
          [
              Statement(
                  text="This is a lovely bog.",
                  in_response_to="This is a lovely bog.",
              ),
              Statement(
                  text="This is a beautiful swamp.",
                  in_response_to="This is a beautiful swamp.",
              ),
              Statement(
                  text="It smells like a swamp.",
                  in_response_to="It smells like a swamp.",
              ),
          ]
      )
  
      statement = Statement(text="This is a lovely swamp.")
      results = list(self.search_algorithm.search(statement))
  
      self.assertIsLength(results, 2)
      self.assertEqual(results[-1].text, "This is a beautiful swamp.")
      self.assertGreater(results[-1].confidence, 0)
  
imports: from tests.base_case import ChatBotTestCase
  from chatterbot.conversation import Statement
  from chatterbot.search import TextSearch, IndexedTextSearch
  from chatterbot import comparisons
label_desc: Use image node_id 2 for calling the TextSearchComparisonFunctionSpacySimilarityTests obj's underlying member method code with example usage: obj.test_get_closest_statement() without return types