I'm looking for any libraries that can help to match two words with misspelling. For instance, the gem should mark the following statements as true (it's just an example, not necessary to have standard strings extended)

'Start' == 'Strat'
'woodpecker' == 'Wodpekcer'

Any ruby gems for data quality checking?

有帮助吗?

解决方案 2

You know about Levenshtein?

https://github.com/anjlab/rubyfish is just one gem you can install

其他提示

As you stated that you are looking for libraries/gems, here are some gems implementing string distance and fuzzy matching:

The libraries do not extend core classes, so you would not be able to compare the strings using the == operator, but you can calculate their similarity and find similar strings.

For Soundex, Metaphone and similar, you can use the wonderful text gem. It may be a bit more involving using phonetic algorithms, as they may work better or worse depending on the language. What works perfectly for English might not work for other languages.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top