07-13-2014, 09:21 AM | #16 | |
Perfectionist
Posts: 62
Karma: 12802
Join Date: Apr 2014
Device: none
|
Quote:
- ‘This is the end of the sentence.’ - most cases, covered by pass one - He played Billy Holiday’s ‘I Cover the Waterfront’ all night.... - various names (books, songs, movies) and expressions in the middle of the sentence are not covered by pass one, but by pass two (no punctuation before the closing quote, and a space after the closing quote). Other punctuation marks in pass two are probably overkill, but will do no harm. If one is averse to using them, the pass two could be shortened to: Search: ’([ ]) Replace: ”\1 |
|
07-15-2014, 09:41 PM | #17 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
07-15-2014, 09:42 PM | #18 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
07-17-2014, 12:43 PM | #19 |
Dead account. Bye
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
Be really careful when detecting straight single quotes BEFORE words as in English there are at least two very different uses:
'em >>> Contractions, so you should substitute by a RIGHT/CLOSING curly quote. 'Start of dialogue' >>> so you should substitute by a LEFT/OPENING curly quote. |
07-17-2014, 08:56 PM | #20 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Note: That is a LEFT single quote in the Search. Search: ‘([Tt]was\b) Replace: ’\1 Search: ‘([Tt]is\b) Replace: ’\1 Search: ‘([Ee]m\b) Replace: ’\1 This works on your common words: 'twas, 'tis, 'em. (I am not too sure how many others there are, but those three are the only ones I run across in the books I work on). I also do a Regex for this one and replace on a case-by-case basis for this one: Search: ‘([0-9]) Replace: ’\1 Which is typically used when shortening decades: ’90s, ’00s, ’60s, ... Last edited by Tex2002ans; 07-17-2014 at 08:58 PM. |
|
07-17-2014, 11:57 PM | #21 |
Obsessively Dedicated...
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
Another frequent failure for "Smarten" routines happens when they hit a quoted phrase followed by an em-dash. Often the quote marks preceding the em-dash get reversed.
So instead of seeing John said: “I told you,“’twas brillig’”—a hush fell. you see ... “‘twas brillig‘“—a hush fell. Ah, "smartened" curly quotes do make life interesting. |
07-18-2014, 01:45 AM | #22 | |
Dead account. Bye
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
Quote:
'twixt, 'tween, 'sheart, 'twill, 'twere, 'twould, 'swounds, ... And of course 'n' as in Guns 'n' Roses. |
|
07-18-2014, 02:08 AM | #23 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Code:
‘(em|cause|Cause|cos|til|bout|er|um|tis) |
|
07-18-2014, 02:29 AM | #24 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Rock ’n’ Roll as well.
Quote:
And speaking of the decades rule I mentioned.... The book I am converting just this second uses the WORD FORM of it: ’eighties ’nineties Never ran across that before. Coincidence? I think not! |
|
07-26-2014, 05:49 AM | #25 |
Wizard
Posts: 1,176
Karma: 2431850
Join Date: Sep 2008
Device: IPad Mini 2 Retina
|
I want to widen the original question if I may: "Is there a way to limit the scope of a search/replace to the actual text that is displayed to the reader?" E.g., we can currently set the scope to "Current file", "All text files" etc. I was thinking of an additional option to set the scope, e.g., "All inner text". I believe this is what smarty pants does (could be wrong).
This option would enable us to roll our own smarty pants using the Saved searches, without worrying about false positive matches on the xml tags. I currently have a regex to match punctuation that is also matching <> in the xml elements. I guess I could try to exclude these from the regex, but it would be safer if the match scope was limited to inner text. |
07-28-2014, 07:55 AM | #26 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
Add 'cuz to the list for a slang/jargon version of 'cause, et al.
Although this might lead to confusion with cuz (cousin), as in "this is my cuz". Or would it be spelled cous? Anyway, something to consider. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reducing file size for straight-text epub? | Christi H | ePub | 5 | 01-10-2013 10:09 PM |
Looking for a tool to find/fix mis-matched quotes... | therealjoeblow | Calibre | 4 | 09-04-2011 01:25 AM |
convert straight quotes to curly quotes | alansplace | Calibre | 3 | 09-25-2010 03:51 PM |
What's with all the straight quotes (inch marks)? | DGReader | ePub | 35 | 03-03-2010 02:48 PM |
Pielrf - Text to LRF with Easy TOC, Headers, Curly-Quotes, etc. (Mac!) | EatingPie | LRF | 104 | 01-12-2009 12:35 PM |