input: Write a function to compare two strings for equality, difference, and similarity using a given threshold.
  assert compare_strings("apple", "apple").is_equal()==True
  assert compare_strings("apple", "banana").is_different()==True
  assert compare_strings("apple", "aple", 0.2).is_similar()==True
output: def compare_strings(str1, str2, threshold=0.0):
      class StringComparison:
          def __init__(self, str1, str2, threshold):
              self.str1 = str1
              self.str2 = str2
              self.threshold = threshold
  
          def is_equal(self):
              return self.str1 == self.str2
  
          def is_different(self):
              return self.str1 != self.str2
  
          def is_similar(self):
              max_len = max(len(self.str1), len(self.str2))
              if max_len == 0:
                  return True
              diff_count = sum(1 for a, b in zip(self.str1, self.str2) if a != b) + abs(len(self.str1) - len(self.str2))
              similarity = 1 - diff_count / max_len
              return similarity >= (1 - self.threshold)
  
      return StringComparison(str1, str2, threshold)