Simplyfied hyphen removal regex

This commit is contained in:
Dominique Eifländer 2021-07-29 13:15:07 +02:00
parent 6c375b5b7a
commit 77ece8b0d6

View File

@ -12,7 +12,7 @@ public class TextNormalizationUtilities {
* @return Text without line-break hyphenation. * @return Text without line-break hyphenation.
*/ */
public static String removeHyphenLineBreaks(String text) { public static String removeHyphenLineBreaks(String text) {
return text.replaceAll("([^\\s\\d\\-]{2,})[\\-\\u00AD]\\R|\n\r(.+ )", "$1$2"); return text.replaceAll("([^\\s\\d\\-]{2,})[\\-\\u00AD]\\R", "$1");
} }
} }