I have numerous OCR-ed texts with hyphenated words in the middle of lines.
Example:
This is a text with a hyphen- ated word in the middle of the sentence. But it also has - dashes - like the ones in the second sentence. The latter should not be modified.
I would like to have a cleaned text like the one below where the hyphenated words are merged:
This is a text with a hyphenated word in the middle. But it also has - dashes - like the ones in the second sentence. The latter should not be modified.
By removing the hyphen, this -\s*\r?\n\s*\r?\n? regex merges the hyphenated words if the hyphen is located at the end of the lines. How to modify this regex to do the above job? The number of spaces after the hyphen can be 1, 2 or 3 like hyphen- ated, hyphen- ated, hyphen- ated.