Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 11-02-2008, 02:47 AM   #1
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
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)
Into:
Code:
“ text ”
While I can to (1) reasonably well using a sequence of regexp, I am at a loss with (2) since the apostrophes can appear inside sentences and words (words such as don't). I would rather use something which does most of the work automatically.
pepak is offline   Reply With Quote
Old 11-02-2008, 02:58 AM   #2
AZed
Connoisseur
AZed has a complete set of Star Wars action figures.AZed has a complete set of Star Wars action figures.AZed has a complete set of Star Wars action figures.AZed has a complete set of Star Wars action figures.
 
Posts: 57
Karma: 307
Join Date: Oct 2008
Device: PalmOS PDA
Text::Typography combined with HTML::Entities?
AZed is offline   Reply With Quote
Advert
Old 11-02-2008, 03:11 AM   #3
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
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'.
pepak is offline   Reply With Quote
Old 11-02-2008, 03:17 AM   #4
AZed
Connoisseur
AZed has a complete set of Star Wars action figures.AZed has a complete set of Star Wars action figures.AZed has a complete set of Star Wars action figures.AZed has a complete set of Star Wars action figures.
 
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.
AZed is offline   Reply With Quote
Old 11-02-2008, 03:46 AM   #5
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
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.
pepak is offline   Reply With Quote
Advert
Old 11-02-2008, 03:59 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
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 04:02 AM.
Jellby is offline   Reply With Quote
Old 11-02-2008, 04:55 AM   #7
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
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.
pepak is offline   Reply With Quote
Old 11-03-2008, 10:42 AM   #8
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
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
Quote:
Originally Posted by pepak View Post
I just need something that works most of the time, to give me a basis from which I can start proofreading.
If you have a copy of word or framemaker you can turn on smart quotes and then replace ' with ' and " with " to accomplish a good start.

Dale
DaleDe is offline   Reply With Quote
Old 11-03-2008, 02:46 PM   #9
chorpler
Zealot
chorpler has a complete set of Star Wars action figures.chorpler has a complete set of Star Wars action figures.chorpler has a complete set of Star Wars action figures.
 
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!
chorpler is offline   Reply With Quote
Old 11-04-2008, 02:08 AM   #10
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
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).
pepak is offline   Reply With Quote
Old 11-04-2008, 05:13 AM   #11
Patricia
Reader
Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.Patricia ought to be getting tired of karma fortunes by now.
 
Patricia's Avatar
 
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.
Patricia is offline   Reply With Quote
Old 11-04-2008, 05:21 AM   #12
Richard Herley
Author
Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.Richard Herley ought to be getting tired of karma fortunes by now.
 
Richard Herley's Avatar
 
Posts: 203
Karma: 1164907
Join Date: Feb 2008
Location: Norfolk, England
Device: Kindle Oasis
This thread might be helpful. Quotation marks are a pest!
Richard Herley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change single quotes to double quotes Elfwreck Workshop 16 04-26-2013 10:06 AM
Single quotes to double quotes? lunixer General Discussions 35 10-10-2010 05:47 AM
convert straight quotes to curly quotes alansplace Calibre 3 09-25-2010 03:51 PM
PDF conversion problem with quotes. tadhgadams Calibre 2 09-19-2010 08:47 PM
Quotes novels.books Astak EZReader 4 10-26-2009 09:56 PM


All times are GMT -4. The time now is 06:57 AM.


MobileRead.com is a privately owned, operated and funded community.