module String::SimilarityRefinements

provide refinements for the String class

Public Instance Methods

cosine_similarity_to(other) click to toggle source

Returns the cosine similarity to other @see String::Similarity#cosine

# File lib/string/similarity_refinements.rb, line 6
def cosine_similarity_to(other)
  String::Similarity.cosine(self, other)
end
levenshtein_distance_to(other) click to toggle source

Returns the Levenshtein distance to other @see String::Similarity.levenshtein_distance

# File lib/string/similarity_refinements.rb, line 12
def levenshtein_distance_to(other)
  String::Similarity.levenshtein_distance(self, other)
end
levenshtein_similarity_to(other) click to toggle source

Returns the Levenshtein similarity to other @see String::Similarity.levenshtein

# File lib/string/similarity_refinements.rb, line 18
def levenshtein_similarity_to(other)
  String::Similarity.levenshtein(self, other)
end