Damerau - Levenshtein Distance, adding a threshold
问题 I have the following implementation, but I want to add a threshold, so if the result is going to be greater than it, just stop calculating and return. How would I go about that? EDIT: Here is my current code, threshold is not yet used...the goal is that it is used public static int DamerauLevenshteinDistance(string string1, string string2, int threshold) { // Return trivial case - where they are equal if (string1.Equals(string2)) return 0; // Return trivial case - where one is empty if