12

Is there any reasonably easy way to remove "hard" hyphens from an eBook? For example, I am reading a book by Ted Dekker where there are many places where a word has a hy-phen in the middle. (Not picking on Ted here -- lots of books seem to have the problem.)

Each one acts like a visual "speed-bump" to me. It seems that someone at some point manually hyphenated line endings, forgetting that a different screen size, font choice/size, etc. would require different hyphenation.

Ideas?

3
  • 1
    It seems to be a non-trivial problem ;) Commented Jan 25, 2014 at 5:06
  • Nice! But when I do that "-<br>" I get white space that breaks up the word. Tried to figure out the calibre manual, but no luck with my skill..
    – user778
    Commented Mar 2, 2014 at 18:45
  • This looks like a comment not an answer Commented Mar 2, 2014 at 19:10

3 Answers 3

8

If the book has not a DRM and you are free to edit/convert it, you can use Calibre to convert to the same format (i.e. you can use an .epub as a source file and still convert to an .epub output.

In the Heuristic processing tab make sure to enable both the processing and Remove unnecessary hyphenation; if you want you can also enable other options here if you need to.

enter image description here

This method use the source document as a dictionary to verify if the hyphenated word is also spelled as a single word. Of course, if a given hyphenated word has a single occurrence it won't be corrected. From Calibre user manual:

calibre will analyze all hyphenated content in the document when this option is enabled. The document itself is used as a dictionary for analysis. This allows calibre to accurately remove hyphens for any words in the document in any language, along with made-up and obscure scientific words. The primary drawback is words appearing only a single time in the document will not be changed. Analysis happens in two passes, the first pass analyzes line endings. Lines are only unwrapped if the word exists with or without a hyphen in the document. The second pass analyzes all hyphenated words throughout the document, hyphens are removed if the word exists elsewhere in the document without a match.

If you happen to have the the source .pdf, where all hyphenated words are placed at the end of their respective lines, you can use the Search & Replace tab to add another tweak (I've personally tested and used it many times).

enter image description here

You must enter -<br> in the Search box and leave completely blank the Replacement one, and be sure to click Add to, well, add the rule to the conversion. This only works, as I've stated, if the hyphens are correctly placed at the end of their lines, so, in most cases, you need to have access to the source file. You can also click on the Wizard button to open a preview of the file, where you can preview what your source regex code (in this case -<br>) will select and delete (because we left blank the replacement box).

2
  • Great suggestion! I tried the Heuristic processing, and it helped quite a bit -- inexplicably, however, still failed to clean up things like 'sum-mer' and 'cut-ting'. But, like I said, better than before. All hail Calibre!
    – Ed Stout
    Commented Jan 9, 2014 at 22:24
  • Maybe because these were the only occurrences of these words. The check is made by using the document as a dictionary. For those few leftover hyphens it should be easy to manually correct them with a simple search inside it.
    – Sekhemty
    Commented Jan 10, 2014 at 12:01
1

Such hard hyphens are usually the result of a bad conversion from pdf to epub/mobi. I got them in books I regularly bought, so it's not a problem of piracy: my impression is that even today publishers start with a pdf file (made with InDesign or similar), and they forgot that some words are hyphenated. If the book had no DRM, sometimes I decided to use Sigil and painstakingly search for all occurrences, but this is time-consuming.

0

Effective Solution for Correcting Hyphenation in EPUB Files Using Calibre

I've successfully resolved similar issues using Calibre. Here’s a concise guide:

  1. Opening and Editing the EPUB:

    • Open your EPUB file in Calibre.
    • Begin editing by selecting the 'Edit book' option.
  2. Using the Find-and-Replace Tool:

    • Access this tool by pressing Ctrl+F on Windows.
    • To correct hyphenation errors, search for - (hyphen followed by a space) and replace it with - (hyphen without a space). This action removes unnecessary spaces after hyphens, common in errors like per- fect which should be perfect.

    Find-and-Replace Tool

  3. Employing the Spell-Check Tool:

    • With the book still open in the editor, run the spell-check tool. It will likely highlight many words as misspelled due to formatting issues.
    • To efficiently manage these false positives:
      • Ignore Punctuation Mistakes: Search for the period symbol . and select all instances. Right-click and choose to ignore all, as these are often mistaken for errors in web links or decimal numbers.
      • Sorting Hyphens Sensitively: Search for the hyphen - and select the 'case sensitive sort' option. This helps group proper nouns or geographical names at the beginning, which you can then selectively ignore.
      • Managing Prefixes: Identify prefixes such as pre-, socio-, etc. Select these and add the correct forms to your dictionary. For others, manually adjust each entry by clicking on the Change selected word to: option.

The whole process should take between 5 to 10 minutes, depending on the length and complexity of the text.

Spell-Check Tool

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.