input: Write a function that receives two strings and performs the following tasks on them: determine if the strings are equal, different, or similar up to a provided threshold. Using the Edit distance metric, calculate the similarity. 
  
  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_equal()==False
  assert StringComparator("hello", "world").is_different()==True
  assert StringComparator("hello", "helo").is_similar()==True
  assert StringComparator("hello", "world").is_similar()==False
output: def is_similar(self, threshold=0.5):
      def edit_distance(s1, s2):
          if len(s1) > len(s2):
              s1, s2 = s2, s1
          distances = range(len(s1) + 1)
          for i2, c2 in enumerate(s2):
              distances_ = [i2+1]
              for i1, c1 in enumerate(s1):
                  if c1 == c2:
                      distances_.append(distances[i1])
                  else:
                      distances_.append(1 + min((distances[i1], distances[i1 + 1], distances_[-1])))
              distances = distances_
          return distances[-1]
  
      distance = edit_distance(self.string1, self.string2)
      max_length = max(len(self.string1), len(self.string2))
      return distance / max_length < threshold