Minor Mod To ApproximatelyEquals

Apr 19, 2017 at 4:51 PM
In the course of things, I ended up using LongestCommonSubstring with an empty string as one of the arguments.

The routine returned a null value which promptly blew up when adding to the comparison results in ApproximatelyEquals (line 66 in my version).

I have changed my version to handle this more gracefully:
comparisonResults.Add(1 - Convert.ToDouble((source.LongestCommonSubstring(target)?.Length ?? 1) / Convert.ToDouble(Math.Min(source.Length, target.Length))));