I don't really want to start a discussion about if you
should do this - this is up to you. For me, I don't want to read cursing in an ebook. Everybody has their own tolerance level for content, but I've had to get rid of more than one physical book and ebooks alike because of bad language. So, I came up with a solution that works fairly well. This won't take a bad
situation out of a book, but it will remove bad language.
Again, this isn't to debate censorship. If I want to scratch words out of my own physical book with a sharpie, that's my choice. I'm doing the same thing here digitally. Use this if you want - I'm sharing it because it might help somebody.
To use this, you have to extract the attached file into a directory where you can find it. Convert your ebook into whatever format you want. Before you hit convert, hit "Search and replace" on the left. Hit "load," and load this file.
This only finds exact matches of the words on the list. Sometimes authors will do things like "woooooow" with curse words. Other times, there are compound curse words and weird stuff that it can't catch either. For me, all the books I'm reading are at least pretty good - this just cleans some scattered language out of them. It won't make a horrible book good, but it will take out the language...
Another note: if you want to add your own word to the list (because this doesn't catch everything), put it in this format at the end of the list (the word you're filtering out is "word":
|\b(W|w)ord\b
-----------------------------
How I did it, if you're interested: I downloaded the mammoth word list, both censored and uncensored, from
http://www.litscape.com/word_tools_m..._searches.html. I dumped the lists of 200,000+ words into excel and compared the lists. Uncensored word list - censored word list = "bad words". I had to scrub the list more because some of the terms didn't make sense to me (for example, the word "cracker" could be a racist term for a white person, but I don't want to pull every instance of the word "cracker" out of a book. This wasn't on the list, but that's the idea). After this, I had to do some regex work (again in excel) to catch upper and lower case words. This tool replaces the words with blanks. Calibre is funny with the search and replace, so I had to break the list into 5 different regular expressions to get it to work.