input: Write a function that receives two strings and determines if they are equal, different, or similar up to a provided threshold using a StringComparator class with corresponding methods.
  class StringComparator:
  
  def __init__(self, string1, string2):
   self.string1 = string1
   self.string2 = string2
  
  def is_equal(self):
   return self.string1 == self.string2
  
  def is_different(self):
   return self.string1 != self.string2
  
  def is_similar(self, threshold=0.5):
   distance = edit_distance(self.string1, self.string2)
   max_length = max(len(self.string1), len(self.string2))
  
   return distance / max_length < threshold
  
  assert StringComparator("hello", "hello").is_equal()==True
  assert StringComparator("hello", "hello").is_different()==False
  assert StringComparator("hello", "hexlo").is_similar()==True
  assert StringComparator("hello", "world").is_similar(threshold=0.2)==False
  assert StringComparator("hello", "world").is_equal()==False
  assert StringComparator("hello", "world").is_different()==True
output: def compare_strings(string1, string2, threshold=0.5):
      comparator = StringComparator(string1, string2)
      if comparator.is_equal():
          return "equal"
      elif comparator.is_different():
          if comparator.is_similar(threshold):
              return "similar"
          else:
              return "different"