code: public int compare(String string2, int maxDistance) {
          switch (algorithm) {
              case Damerau: return DamerauLevenshteinDistance(string2, maxDistance);
          }
          throw new IllegalArgumentException("unknown DistanceAlgorithm");
      }
docs: / <returns>The edit distance (or -1 if maxDistance exceeded).</returns>