Are there any libraries out there that make it easy to compare the "likeness" of 2 strings in C#? What I am thinking is if you have the strings,
"This is a test" // 100%
"THIS IS A TEST" // 95%
" This is a test" // 98%
"This is" // 60%
"Foobar" // 0%
"this test is a" // 70%
etc. They would each be given a score compared to a base string.
Have a look at Levenstein.
The Levenshtein distance is the difference between two strings. I use it in a web crawler application to compare the new and old versions of a web page. If it has changed enough, I update it in my database.
CodeProject has an implementation of this at http://www.codeproject.com/KB/recipes/Levenshtein.aspx.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With