def similarity(string_a, string_b)
      string_a, string_b = prep_strings(string_a, string_b)
      return 100.0 if string_a == string_b
      score = 0
      total_weight = algorithms.values.inject { |sum, weight| sum + weight }
      algorithms.each do |algorithm, weight|
        next unless weight.positive?
        score+= string_a.send("#{algorithm}_similarity", string_b) * weight
      end
      score / total_weight
    end
def similarity(string_a, string_b)
      string_a, string_b = prep_strings(string_a, string_b)
      return 100.0 if string_a == string_b
      score = 0
      total_weight = algorithms.values.inject { |sum, weight| sum + weight }
      algorithms.each do |algorithm, weight|
        next unless weight.positive?
        score+= string_a.send("#{algorithm}_similarity", string_b) * weight
      end
      score / total_weight
    end
Calculates a percentage match between string a and string b.