View Single Post
Old 03-20-2015, 12:43 PM   #4
RobertDDL
Whatever...
RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.
 
RobertDDL's Avatar
 
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
Quote:
Originally Posted by adv_dp_fan View Post
My problem with a simple regex is things like possessives or other times when you have a ' in the middle of a line. That's why I was looking for a tool that did a little more analysis of the text before making changes. It isn't an easy thing to just convert them I know, just wondered if anyone knew of any tool that did so.
‘’Twas Zeus’ will, wasn’t it?’

I think that any ’ followed by a letter is an apostroph, and any ’ preceded by a letter is an apostroph, too? Because if it were a closing quote, it would be preceded by a punctuation mark? If I'm right, then you can use regular expressions to replace ’[a-zA-Z] and [a-zA-Z]’ with anything you like that doesn't appear in the text, then replace single quotes with double quotes (if opening and closing ones have the same numbers that's a good sign), and finally restore the apostrophs. And then check if this really worked

Hm, you may still have to deal with nested quotes... replace opening and closing double quotes with something else before you do the above, and replace them with single ones as the final step. Never entirely trust any automated process, though...
RobertDDL is offline   Reply With Quote