Editing of EPUB files - Mass correction - Removal of mid-word breaks

Hey @ericmarceau,

I’m not trying to speak as an expert in this response, but as (hopefully) a pointer in a helpful direction. TL;DR: I wasn’t able to find a tool that does exactly what you’re asking (hopefully someone else will).

My initial attempt at looking for a tool, I was able to find a tool called calibre that seems to have some editing capabilities. I installed it, opened up the default epub book that ships with the software, and plugged in your excel lence example (I just picked a random .html file and added the example in, nothing fancy). Then I tried the spellchecker. As expected, it only tried to correct lence to lance. So that doesn’t seem helpful. :frowning:

Calibre does have plugin support, but I wasn’t able to find anything helpful at first glance. Maybe I missed something.

At my current job, I’ve used Natural Language Processing (NLP) by using Python’s Natural Language Toolkit (NLTK) to process customer raised support cases to identify gaps in the knowledge base. In my experience with that project, I had to do quite a bit of spelling checking/word fixing.

Using that angle, I did some googling and ran across this Stack Overflow post with a helpful gist to a Python segmentation script. This functionality seems to both be able to split long strings of characters into words and also remove breaks/spaces between words. I also see that Python has an epub library.

It seems pretty reasonable that a Python script could be put together that handles your functionality for identifying the broken words, offering solutions based on a score, then healing them if you choose to do so.

Maybe some of this information can help you in your search for a tool?

4 Likes