I’ve just finished, and really enjoyed, Cormac McCarthy’s All the Pretty Horses. I thought of writing a review, but lots of other people have already done this so I couldn’t see the point.
Something that struck me about the book, however, was McCarthy’s refusal to use speech marks when writing dialogue – indeed, there is a tendency towards the more literary end of the market for writers to dispense with speech marks and other punctuation. I couldn’t help wondering, however, whether McCarthy found himself accidentally typing the odd inverted comma when he was writing the book. After all, the habits of writing become ingrained over the years and are difficult to break.
So it occurred to me to write the Java program at the end of this entry. It uses a regular expression to remove the speech marks from text, thus converting your writing into McCarthy’s style without having to unlearn all those habits you’ve developed over the years.
So, for example, if your plaintext read
“This is Cormac McCarthy style” said Susan. Susan picked up the tortilla.
The LitConvertor makes it
This is Cormac McCarthy style said Susan. Susan picked up the tortilla.
Of course, this would be more Cormac McCarthy like if it read
This is Cormac McCarthy style said Susan and Susan picked up the tortilla.
Adding the following line after the first replaceAll should sort that out.
literaryText = literaryText.replaceAll(“\\.[^$]”, ” and”);
This is quite a nice exercise for students learning regular expressions – the next step would be a Roddy Doyle conversion
“From this,” he said
-To something like this.
Anyway, here’s the program.