@Test public void findThreeMinumums() { List<String> ss = Arrays.asList("Holla", "World", "Hello", "Hippo", "Hiplo"); Collection<String> min = Levenshtein.findMinimum(ss, "Hillo", 3, 5); assertEquals(Arrays.asList("Hello", "Hiplo", "Holla"), min); }
public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) { int min = Integer.MAX_VALUE; T result = null; for (T s : ss) { int d = LevenshteinDistance.getDefaultInstance().apply(s, t); if (d < min) { min = d; result = s; } } return result; }
Levenshtein { public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) { int min = Integer.MAX_VALUE; T result = null; for (T s : ss) { int d = LevenshteinDistance.getDefaultInstance().apply(s, t); if (d < min) { min = d; result = s; } } return result; } }
Levenshtein { public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) { int min = Integer.MAX_VALUE; T result = null; for (T s : ss) { int d = LevenshteinDistance.getDefaultInstance().apply(s, t); if (d < min) { min = d; result = s; } } return result; }  }
Levenshtein { public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) { int min = Integer.MAX_VALUE; T result = null; for (T s : ss) { int d = LevenshteinDistance.getDefaultInstance().apply(s, t); if (d < min) { min = d; result = s; } } return result; }  static T findMinimum(Collection<T> ss,
            CharSequence t); static Collection<T> findMinimum(
            Collection<T> ss, CharSequence t, int n, int threshold); static Collection<T> findSimilar(
            Collection<T> ss, CharSequence t); }
Levenshtein { public static <T extends CharSequence> T findMinimum(Collection<T> ss, CharSequence t) { int min = Integer.MAX_VALUE; T result = null; for (T s : ss) { int d = LevenshteinDistance.getDefaultInstance().apply(s, t); if (d < min) { min = d; result = s; } } return result; }  static T findMinimum(Collection<T> ss,
            CharSequence t); static Collection<T> findMinimum(
            Collection<T> ss, CharSequence t, int n, int threshold); static Collection<T> findSimilar(
            Collection<T> ss, CharSequence t);  }