package com.iqser.red.service.persistence.management.v1.processor.utils;

import lombok.experimental.UtilityClass;

@UtilityClass
public class TextNormalizationUtilities {

    /**
     * Revert hyphenation due to line breaks.
     *
     * @param text Text to be processed.
     * @return Text without line-break hyphenation.
     */
    public static String removeHyphenLineBreaks(String text) {

        return text.replaceAll("\\s(\\S+)[\\-\\u00AD]\\R|\n\r(.+ )", "\n$1$2");
    }

}
