1
Vote

Result for "UseHammingDistance" option is always "0"

description

Hi there!

I added the "FuzzyStringComparisonOptions.UseHammingDistance" option to the options list for run the "ApproximatelyEquals" function, but it always return cero. Checking the code I found the reason: the calculation doesn't convert the integer value into double.

I corrected this issue changing this line:
comparisonResults.Add(source.HammingDistance(target) / target.Length);
to this:
comparisonResults.Add((double)source.HammingDistance(target)/ target.Length);
into the "ApproximatelyEquals.cs" file.

It works fine! ;)

comments