/** * Constructor. Damerau-Levenshtein distance. * @param maxStringLength the maximum length of strings that will be * feed to this algorithm. * @param damerau if true, calculate Damerau-Levenshtein distance instead * of plain Levenshtein distance. */ public EditDistance(int maxStringLength, boolean damerau) { FKP = new int[2*maxStringLength+1][maxStringLength+2]; damerauDistance = damerau; if (damerau) brf = new BRF2(); else brf = new BRF1(); }