08-16-2011, 06:25 PM | #1 |
Bookmaker
Posts: 418
Karma: 2143650
Join Date: Sep 2010
Device: Cybook Opus
|
Single-quote/Double-quote
Could someone tell me the simplest tool these days for replacing British-style single-quotes with American-style double-quotes?
|
08-16-2011, 07:16 PM | #2 |
Booklegger
Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
The simplest tool, but neither fast nor reliable, is a text editor and your eyeballs and fingertips...
To be more useful... What kind of text file do you have? Is it 7-bit ASCII or UTF-8? Is it html or xhtml? And, most importantly, is the apostrophe character the same as the right quote? If not, then a simple character substitution would work. However, they are usually the same, so something more sophisticated is required. I use quoter to change straight quotes to curly quotes in my html, and straight apostrophes to right single quotes. I don't know if it will do single quotes to double quotes, however. I found it with google, and it is supplied as a lex/yacc source, so it could be modified, I suppose. |
Advert | |
|
08-16-2011, 09:20 PM | #3 |
Wizard
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Do you have a link for the code for quoter? I know of SmartyPants from Daring Fireball, but would be interested to see some other code that did the same thing.
|
08-16-2011, 10:16 PM | #4 |
Bookmaker
Posts: 418
Karma: 2143650
Join Date: Sep 2010
Device: Cybook Opus
|
The file in question is an epub. As far as I can see, the single quote and apostrophe are the same; both curly, I'm afraid.
|
08-17-2011, 03:34 AM | #5 |
frumious Bandersnatch
Posts: 7,523
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I wouldn't trust anything automatic, this is what I'd do:
1. Replace every left-single with "¬" (or any otherwise unused character) 2. For every "¬", find the matching right-single (not apostrophe), and replace it with "|" (or other) 3. Replace every remaining right-single (apostrophes) with "÷" (or other) 4. Replace every left-double with left-single, and right-double with right-single. 5. Replace every "¬" with left-double, and "|" with right-double. 6. Replace every "÷" with something different from right-single, but which displays the same (for instance, "& #8217;", without space and quotes). |
Advert | |
|
08-17-2011, 04:17 AM | #6 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
I would regard the quoting style as a part of the book, and wouldn't change it, personally.
|
08-17-2011, 05:15 AM | #7 |
frumious Bandersnatch
Posts: 7,523
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
But maybe someone has changed it before
|
08-17-2011, 01:19 PM | #8 | |
Booklegger
Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
Quote:
http://www.dwheeler.com/quoter/ |
|
08-22-2011, 12:28 PM | #9 |
Connoisseur
Posts: 68
Karma: 526028
Join Date: Nov 2009
Location: New York, NY
Device: iphone
|
It's interesting that The Chicago Manual of Style (the publishing industry standard style guide) includes changing quote style in its very limited list of acceptable alterations to a text.
|
09-01-2011, 11:34 AM | #10 |
Groupie
Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Alternate option:
in Sigil/Notepad++ or other software allowing RegExp search/replace mode, and in that mode: 1. replace ([a-z])'([a-z]) with \1<unused char/string>\2 -- almost every apostrophe "escaped" to the <unused char/string> of your choice 2. check for expression like " 'em " in your text, at need, replace each of them with " <unused char/string>em " ... Now, in normal Mode: 3. Follow Jellby 's previous post to switch " and ' 4. Restore <unused char/string> to ' . If right quote/apostrophe are curly, steep 2. is only for those. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unutterably Silly Quote the avatar above you | Cyclops | Lounge | 1681 | 07-07-2022 06:30 PM |
HTML2ePub conversion (question mark instead single quote) | mikij | Calibre | 5 | 08-07-2010 02:15 AM |
Quote Hunter | brewt | Workshop | 3 | 01-05-2008 08:02 PM |
cannot post or quote | Aprilbeginnings | Sony Reader | 21 | 07-23-2007 06:15 PM |