private int distance(FingerPrint fp1, FingerPrint fp2) {

        int ret = 0;

        if (fp1.lines > 0 && fp2.lines > 0) {
            if (fp1.pars > 0 && fp2.pars > 0) {
                // document distance
            } else {
                // paragraph distance
                ret = normal_distance(fp1.chars, fp2.chars);
            }
        } else {
            ret = normal_distance(fp1.chars, fp2.chars);
            // line distance
        }

        return ret;
    }