Reputation: 1020
I want to compare two strings, such as:
str1 = "this is a dynamic data";
str2 = "this is a <data_1> data";
Is there any method that will find the nearest match? I have used Ternary Search Tree (TST) Dictionary functions. Are there any other ways to do this kind of thing?
Upvotes: 1
Views: 458
Reputation: 20969
What about the Jaccard similarity coefficient
?
http://en.wikipedia.org/wiki/Jaccard_index
It's easy to implement and gives a good similarity score. You have to tokenize your sentences though ;)
Upvotes: 1
Reputation: 154
In am not sure about this thing in C#, but yes that is there in SQL,
select difference('this is a dynamic data','this is a dynamic')
Upvotes: 1