11-02-2008, 03:47 AM | #1 |
Guru
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
|
Conversion of quotes
Hi!
Does anyone know of a program or an online tool which I could use to convert quotes? I am particularly interested in converting texts which use one of the following formats: Code:
" text " (1) ' text ' (2) Code:
“ text ” |
11-02-2008, 03:58 AM | #2 |
Connoisseur
Posts: 57
Karma: 307
Join Date: Oct 2008
Device: PalmOS PDA
|
Text::Typography combined with HTML::Entities?
|
Advert | |
|
11-02-2008, 04:11 AM | #3 |
Guru
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
|
I am no expert at Perl, but it seems to me that this will convert all apostrophes, not just those that mark speech of the book's characters'.
|
11-02-2008, 04:17 AM | #4 |
Connoisseur
Posts: 57
Karma: 307
Join Date: Oct 2008
Device: PalmOS PDA
|
Ah, you mean you want to completely ignore apostrophes inside words, not just make sure that the apostrophes inside words end up facing the right way.
Probably you want Text::Balanced, then. |
11-02-2008, 04:46 AM | #5 |
Guru
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
|
I did a quick job using regexps meanwhile. They were heavily dependent on the very simple structure of the document, but they seemed to work well enough. I'll see for sure when I get to proofreading.
|
Advert | |
|
11-02-2008, 04:59 AM | #6 |
frumious Bandersnatch
Posts: 7,539
Karma: 19001081
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
For single quotes, since you can have apostrophes at every position ("don't", "teachers'", "'em"), I usually do the following:
1. Replace every ' in the middle of a word with & #8217; (remove the space between & and #, this is a synonym of ’) 2. Check every instance of a ' at the beginning of a word and replace it with ‘ if it's a quote mark, or & #8217; if it's an apostrophe. 3. For every ‘, find the corresponding closing mark (if any) and replace it with ’ 4. Replace every remaning ' with & #8217;. Unfortunatelly, steps 2 and 3 are not easy to automate. Oh... and quotes are not always balanced, when a character's part in a dialogue takes several paragraphs, all paragraphs start with an opening quote mark, but only the last one has a closing mark. Last edited by Jellby; 11-02-2008 at 05:02 AM. |
11-02-2008, 05:55 AM | #7 |
Guru
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
|
I just need something that works most of the time, to give me a basis from which I can start proofreading.
|
11-03-2008, 11:42 AM | #8 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
|
11-03-2008, 03:46 PM | #9 |
Zealot
Posts: 128
Karma: 278
Join Date: Jun 2008
Device: Kindle; PRS-500; MobiPocket on Windows Mobile
|
If you have Microsoft Word, it will do this automatically. Just make sure that "Replace straight quotes with smart quotes" is turned in in the Tools ... AutoCorrect Options ... AutoFormat tab, and then do a search-and-replace, and just type in a regular quote in both the search and replace boxes, and do "Replace All." It automatically converts all the straight quotes into curly quotes. Repeat with an apostrophe in both search and replace boxes if you want apostrophes to be converted to curly apostrophes too.
Of course, that presumes you have access to Word, and that your file is in a format that Word can edit. On edit, I see that DaleDe mentioned this before me. Somehow I missed that post. Oh well. My bad! |
11-04-2008, 03:08 AM | #10 |
Guru
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
|
In any case, I don't have Word.
Doesn't matter, it seems the regexps I used give a good enough result (I am on page 50 or so, and only encountered some six or seven errors in quotes - good enough for me). |
11-04-2008, 06:13 AM | #11 |
Reader
Posts: 11,504
Karma: 8720163
Join Date: May 2007
Location: South Wales, UK
Device: Sony PRS-500, PRS-505, Asus EEEpc 4G
|
[QUOTE=chorpler;282536]If you have Microsoft Word, it will do this automatically. Just make sure that "Replace straight quotes with smart quotes" is turned in in the Tools ... AutoCorrect Options ... AutoFormat tab, and then do a search-and-replace, and just type in a regular quote in both the search and replace boxes, and do "Replace All." It automatically converts all the straight quotes into curly quotes. Repeat with an apostrophe in both search and replace boxes if you want apostrophes to be converted to curly apostrophes too.
QUOTE] I do this. But it needs to be proof-read, especially smart quotes after dashes. And a check for 'em, 'tis, 'twas is necessary because the apostrophe is always wrongly placed, and needs correcting. |
11-04-2008, 06:21 AM | #12 |
Author
Posts: 203
Karma: 1164907
Join Date: Feb 2008
Location: Norfolk, England
Device: Kindle Oasis
|
This thread might be helpful. Quotation marks are a pest!
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change single quotes to double quotes | Elfwreck | Workshop | 16 | 04-26-2013 11:06 AM |
Single quotes to double quotes? | lunixer | General Discussions | 35 | 10-10-2010 06:47 AM |
convert straight quotes to curly quotes | alansplace | Calibre | 3 | 09-25-2010 04:51 PM |
PDF conversion problem with quotes. | tadhgadams | Calibre | 2 | 09-19-2010 09:47 PM |
Quotes | novels.books | Astak EZReader | 4 | 10-26-2009 10:56 PM |