This project is read-only.
2

Closed

API suggestion

description

Instead of the current ApproximatelyEquals method signature, consider reversing the last two items, and making options a params array instead of a list:
    public static bool ApproximatelyEquals(this string source, string target,
                      FuzzyStringComparisonTolerance tolerance, 
                      params FuzzyStringComparisonOptions[] options )
that way, one could still use the method is essentially the same way as now:
        FuzzyStringComparisonOptions[] options = new FuzzyStringComparisonOptions[5];
        options[0] = FuzzyStringComparisonOptions.UseJaccardDistance;
        options[1] = FuzzyStringComparisonOptions.UseNormalizedLevenshteinDistance;
        options[2] = FuzzyStringComparisonOptions.UseOverlapCoefficient;
        options[3] = FuzzyStringComparisonOptions.UseLongestCommonSubsequence;
        options[4] = FuzzyStringComparisonOptions.CaseSensitive;
        Console.WriteLine(kevin.ApproximatelyEquals(kevyn, 
                            FuzzyStringComparisonTolerance.Weak, options));
while also being able to use the more direct format:
        Console.WriteLine(kevin.ApproximatelyEquals(kevyn, 
                              FuzzyStringComparisonTolerance.Weak, 
                              FuzzyStringComparisonOptions.UseJaccardDistance, 
                              FuzzyStringComparisonOptions.CaseSensitive));

The first way is best if you are using many options on several calls. The second is best for one or two options on a single call.
Closed May 10, 2015 at 5:35 PM by kevinjones

comments

wrote May 10, 2015 at 5:35 PM

Resolved with changeset 95788: Fixes for Work Item 11755 and Feature for Work Item 11050.