/*
 * Copyright (C) 2013 Universidad de Alicante
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package eu.digitisation.io;

/**
 * Normalizes strings: collapse whitespace and use composed form (see
 * java.text.Normalizer.Form)
 *
 * @author R.C.C.
 */
public class StringNormalizer {

    final static java.text.Normalizer.Form decomposed
            = java.text.Normalizer.Form.NFD;
    final static java.text.Normalizer.Form composed
            = java.text.Normalizer.Form.NFC;

    /**
     * Reduce whitespace.
     *
     * @param s a string.
     * @return The string with simple spaces between words.
     */
    public static String reduceWS(String s) {
        return s.replaceAll("\\p{Space}+", " ").trim();
    }

    /**
     * @param s a string
     * @return the canonical representation of the string.
     */
    public static String canonical(String s) {
        return java.text.Normalizer.normalize(s, composed);
    }

    /**
     * @param s a string
     * @return the string with characters <, >, &, " escaped
     */
    public static String encode(String s) {
        StringBuilder result = new StringBuilder();
        for (Character c : s.toCharArray()) {
            if (c.equals('<')) {
                result.append("&lt;");
            } else if (c.equals('>')) {
                result.append("&gt;");
            } else if (c.equals('"')) {
                result.append("&quot;");
            } else if (c.equals('&')) {
                result.append("&amp;");
            } else {
                result.append(c);
            }
        }
        return result.toString();
    }
}

@@ -1184,17 +1184,58 @@
 itespace
-.
+ (including line and paragraph separators)
 %0A     *%0A
@@ -1403,16 +1403,17 @@
 aceAll(%22
+(
 %5C%5Cp%7BSpac
@@ -1414,16 +1414,67 @@
 p%7BSpace%7D
+%7C%5C%5Cp%7Bgeneral_category=Zl%7D%7C%5C%5Cp%7Bgeneral_category=Zp%7D)
 +%22, %22 %22)

Update StringNormalizer.java