src/main/java/eu/digitisation/distance/EditDistance.java
public static int distance(String first, String second,
            int chunkLen, EditDistanceType type)
            throws NoSuchMethodException {
        switch (type) {
            case OCR_CHAR:
                EdOpWeight w = new OcrOpWeight();
                return charDistance(first, second, w, chunkLen);
            case OCR_WORD:
                return wordDistance(first, second, chunkLen)[2];
            default:
                throw new java.lang.NoSuchMethodException(type
                        + " distance still to be implemented");

        }
    }
/**
     *
     * @param first the first string.
     * @param second the second string.
     * @param chunkLen the length of the chunks analyzed at every step
     * @param type the type of distance to be computed
     * @return the distance between first and second (defaults to Levenshtein)
     * @throws java.lang.NoSuchMethodException
     */
@param first the first string.
@param second the second string.
@param chunkLen the length of the chunks analyzed at every step
@param type the type of distance to be computed
@return the distance between first and second (defaults to Levenshtein)
@throws java.lang.NoSuchMethodException
@param first the first string . @param second the second string . @param chunkLen the length of the chunks analyzed at every step @param type the type of distance to be computed @return the distance between first and second ( defaults to Levenshtein ) @throws java . lang . NoSuchMethodException
public static int distance(String first, String second,
            int chunkLen, EditDistanceType type)
            throws NoSuchMethodException {
        switch (type) {
            case OCR_CHAR:
                EdOpWeight w = new OcrOpWeight();
                return charDistance(first, second, w, chunkLen);
            case OCR_WORD:
                return wordDistance(first, second, chunkLen)[2];
            default:
                throw new java.lang.NoSuchMethodException(type
                        + " distance still to be implemented");
        }
    }
public static int distance ( String first , String second , int chunkLen , EditDistanceType type ) throws NoSuchMethodException { switch ( type ) { case OCR_CHAR : EdOpWeight w = new OcrOpWeight ( ) ; return charDistance ( first , second , w , chunkLen ) ; case OCR_WORD : return wordDistance ( first , second , chunkLen ) [ 2 ] ; default : throw new java . lang . NoSuchMethodException ( type + " distance still to be implemented" ) ; } }
@param first the first string.
@param first the first string .