class_docstr: Compare two statements based on the Levenshtein distance
  of each statement's text.
  
  For example, there is a 65% similarity between the statements
  "where is the post office?" and "looking for the post office"
  based on the Levenshtein distance algorithm.
class_docstr_tok: ["Compare","two","statements","based","on","the","Levenshtein","distance","of","each","statement","'s","text",".","For","example",",","there","is","a","65","%","similarity","between","the","statements","''","where","is","the","post","office","?","''","and","``","looking","for","the","post","office","''","based","on","the","Levenshtein","distance","algorithm","."]
docstr: Compare the two input statements.
  
  :return: The percent of similarity between the text of the statements.
  :rtype: float
docstr_tok: ["Compare","the","two","input","statements",".",":","return",":","The","percent","of","similarity","between","the","text","of","the","statements",".",":","rtype",":","float"]
code: def compare(self, statement_a, statement_b):
      """
      Compare the two input statements.
  
      :return: The percent of similarity between the text of the statements.
      :rtype: float
      """
  
      # Return 0 if either statement has a falsy text value
      if not statement_a.text or not statement_b.text:
          return 0
  
      # Get the lowercase version of both strings
      statement_a_text = str(statement_a.text.lower())
      statement_b_text = str(statement_b.text.lower())
  
      similarity = SequenceMatcher(
          None, statement_a_text, statement_b_text
      )
  
      # Calculate a decimal percent of the similarity
      percent = round(similarity.ratio(), 2)
  
      return percent
  
file_path: ChatterBot/chatterbot/comparisons.py
imports: from chatterbot.exceptions import OptionalDependencyImportError
  from difflib import SequenceMatcher
label_desc: Use image node_id 1 for calling the LevenshteinDistance obj's underlying member method code with example usage: obj.compare(statement_a, statement_b) and returns: percent, int