I use google-diff-match-patch C# library. I want to measure the similarity between two texts. To do this I make this C# code :
List<DiffMatchPatch.Diff> lDiffs = dmpDiff.diff_main(sTexte1, sTexte2);
int iIndex = dmpDiff.diff_levenshtein(lDiffs);
double dsimilarity = 100 - ((double)iIndex / Math.Max(sTexte1.Length, sTexte2.Length) * 100);
With similarity values between 0 - 100 (0 == perfect match - 100 == totaly different).
Do you think this is a good approach, that this calculation is correct?