@Test public void testLevenshteinSpeedTest() { System.out.println("Advanced Levenshtein speed test"); EditDistance edit = new EditDistance(Math.max(H1N1.length(), H1N5.length())); for (int i = 0; i < 100; i++) { edit.d(H1N1, H1N5); } }
@Override public double d(String x, String y) { if (weight != null) return weightedEdit(x, y); else if (FKP == null || x.length() == 1 || y.length() == 1) return damerau ? damerau(x, y) : levenshtein(x, y); else return br(x, y); }
EditDistance implements Metric<String> { @Override public double d(String x, String y) { if (weight != null) return weightedEdit(x, y); else if (FKP == null || x.length() == 1 || y.length() == 1) return damerau ? damerau(x, y) : levenshtein(x, y); else return br(x, y); } }
EditDistance implements Metric<String> { @Override public double d(String x, String y) { if (weight != null) return weightedEdit(x, y); else if (FKP == null || x.length() == 1 || y.length() == 1) return damerau ? damerau(x, y) : levenshtein(x, y); else return br(x, y); } EditDistance();  EditDistance(boolean damerau);  EditDistance(int maxStringLength);  EditDistance(int maxStringLength, boolean damerau);  EditDistance(int[][] weight);  EditDistance(int[][] weight, double radius); }
EditDistance implements Metric<String> { @Override public double d(String x, String y) { if (weight != null) return weightedEdit(x, y); else if (FKP == null || x.length() == 1 || y.length() == 1) return damerau ? damerau(x, y) : levenshtein(x, y); else return br(x, y); } EditDistance();  EditDistance(boolean damerau);  EditDistance(int maxStringLength);  EditDistance(int maxStringLength, boolean damerau);  EditDistance(int[][] weight);  EditDistance(int[][] weight, double radius); @Override String toString(); @Override double d(String x, String y); double d(char[] x, char[] y); static int levenshtein(String x, String y); static int levenshtein(char[] x, char[] y); static int damerau(String x, String y); static int damerau(char[] x, char[] y); }
EditDistance implements Metric<String> { @Override public double d(String x, String y) { if (weight != null) return weightedEdit(x, y); else if (FKP == null || x.length() == 1 || y.length() == 1) return damerau ? damerau(x, y) : levenshtein(x, y); else return br(x, y); } EditDistance();  EditDistance(boolean damerau);  EditDistance(int maxStringLength);  EditDistance(int maxStringLength, boolean damerau);  EditDistance(int[][] weight);  EditDistance(int[][] weight, double radius); @Override String toString(); @Override double d(String x, String y); double d(char[] x, char[] y); static int levenshtein(String x, String y); static int levenshtein(char[] x, char[] y); static int damerau(String x, String y); static int damerau(char[] x, char[] y);  }