Ruby compare two strings similarity percentage

前端 未结 3 1543
醉酒成梦
醉酒成梦 2020-12-31 09:05

Id like to compare two strings in Ruby and find their similarity

I\'ve had a look at the Levenshtein gem but it seems this was last updated in 2008 and

3条回答
  •  余生分开走
    2020-12-31 09:40

    There is now a ruby gem for similar_text. https://rubygems.org/gems/similar_text It provides a similar method that compares two strings and returns a number representing the percent similarity between the two strings.

提交回复
热议问题