src/main/java/eu/digitisation/output/ErrorMeasure.java
public static double cer(String s1, String s2) {
        int l1 = s1.length();
        int l2 = s2.length();
        double delta = (100.00 * Math.abs(l1 - l2)) / (l1 + l2);

        if (delta > 20) {
            Messages.warning("Files differ a "
                    + String.format("%.2f", delta) + " % in character length");
        }

        return StringEditDistance.distance(s1, s2, EditDistanceType.LEVENSHTEIN)
                / (double) l1;
    }
/**
     * Compute character error rate using Levenshtein distance
     *
     * @param s1 the reference text
     * @param s2 fuzzy text
     * @return character error rate with respect to the reference file
     */
Compute character error rate using Levenshtein distance
@param s1 the reference text
@param s2 fuzzy text
@return character error rate with respect to the reference file
Compute character error rate using Levenshtein distance @param s1 the reference text @param s2 fuzzy text @return character error rate with respect to the reference file
public static double cer(String s1, String s2) {
        int l1 = s1.length();
        int l2 = s2.length();
        double delta = (100.00 * Math.abs(l1 - l2)) / (l1 + l2);
        if (delta > 20) {
            Messages.warning("Files differ a "
                    + String.format("%.2f", delta) + " % in character length");
        }
        return StringEditDistance.distance(s1, s2, EditDistanceType.LEVENSHTEIN)
                / (double) l1;
    }
public static double cer ( String s1 , String s2 ) { int l1 = s1 . length ( ) ; int l2 = s2 . length ( ) ; double delta = ( 100.00 * Math . abs ( l1 - l2 ) ) / ( l1 + l2 ) ; if ( delta > 20 ) { Messages . warning ( "Files differ a " + String . format ( "%.2f" , delta ) + " % in character length" ) ; } return StringEditDistance . distance ( s1 , s2 , EditDistanceType . LEVENSHTEIN ) / ( double ) l1 ; }
Compute character error rate using Levenshtein distance
 @param s1 the reference text
 @param s2 fuzzy text
 @return character error rate with respect to the reference file
Compute character error rate using Levenshtein distance @param s1 the reference text @param s2 fuzzy text @return character error rate with respect to the reference file