![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,895
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
|
![]()
I need a pair of regex s&r strings for dashes used where emdashes should have been used?
![]() |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
There's no such thing, without actually understanding the language.
I don't want to go up-stairs (it used to be written with a hyphen in "old" times) I don't want to go up—stairs or not (maybe not the best sentence, but you get my point) At most, you can maybe catch some common mistakes, like a hyphen at the end of the sentence. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
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)
|
Not to mention that in many cases in previously edited ebooks many users will change dashes/en dashes/em dashes to comply with their own display preferences. For instance, word—word is frequently changed to word - word (note the added spaces). While grammatically incorrect (per Chicago Manual of Style), it is frequently changed to something similar to allow for better line breaks, or as a form of "soft hyphening".
Last edited by Sabardeyn; 07-31-2013 at 06:18 PM. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,306
Karma: 78876004
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
@saberdyn: I'm not sure I would say "grammatically incorrect"; "stylistically incorrect" maybe....
|
![]() |
![]() |
![]() |
#5 | |||||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Also, if you want help with Regex, please post samples to test. Sometimes it is very hard to figure out exactly what is wanted.
Are we talking: #1: Quote:
Quote:
Quote:
Quote:
Quote:
#3 will involve checking nearly every hyphenation in the book, and may or may not be worth it. I would recommend using the Sigil Spellchecker for that (Tools - Spellcheck - Spellcheck (Alt+Q)), and in the search box typing a hyphen. This will give you every single word with a hyphen in it (see attached image). I recommend at least two passes when fixing hyphenation this way. First with "Show All Words" off, and then one pass with "Show All Words" on. Last edited by Tex2002ans; 07-31-2013 at 08:49 PM. |
|||||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
what I do , sometimes, is set up a search to find dash and replace with em or endash but then manually step thru the text- hit the find button to find 1st instance then either hit replace+find to change it or hit find again to leave it as-is & move on. This is better done AFTER reading the book if you don't want to see plot spoilers! you can visually make a context-sensitive decision in less than a second so it does not take too long.
you can automate the special case of a dash immediately before a closing quote if that bugs you |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,895
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
|
![]()
Thanks to Jellby, Sabardeyn, PeterT, Tex2002ans and cybmole for their replys. I'll report here if any of your suggestions work out for me!
![]() ![]() |
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
I've seem many house rules and personal preferences for those darn things, all the way from "They're old fashioned--don't use them" up to "No space before or after unless ..." For the dead trees versions, in MS Word I have a macro that does (something like) replace variations of 'space+double dash+space' with an an em-dash and 'number+dash+number' with an en-dash. But again, that's personal style. Sometimes depending on the typeface, I'll do it differently Paul |
|
![]() |
![]() |
![]() |
#9 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,908
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
![]() Personal style wins every time (unless the customer is PAYING you to do it their way) |
![]() |
![]() |
![]() |
#10 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,629
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,895
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
|
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
There is also this regex that I use, but be warned again, this will find (nearly) every single hyphen... and takes forever to click through the entire book one by one.
This is why I initially recommended the Sigil Spellcheck method. Search: Code:
([A-Za-z])-([A-Za-z]) Code:
\1—\2 And again, I like to stress... SAMPLES SAMPLES SAMPLES. They really help everyone figure out what you mean, and allows us to help better. ![]() As a side note, I use a variation of this regex to handle adding en dashes between years/page numbers: Search: Code:
([0-9])-([0-9]) Code:
\1–\2 Last edited by Tex2002ans; 08-02-2013 at 10:58 PM. |
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,895
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
|
![]() Quote:
Concerning the spell checker in the Sigil that I use, 0.6.2, doesn't work like what you posted. I suppose you're using version 7. ![]() |
|
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Indeed. The spellcheck list was added in version ~0.7.0 due to my recommendation.
In 0.6, I was hackishly using the Index Editor to try to find every hyphenated word that was misspelled (I was probably the only person who exists who used it like that?). The spellcheck list is infinitely better than anything else I have used. I have zero clue why it isn't in your typical word processor program. Now I can't live without it, and it saves me hours of time fixing typos. |
![]() |
![]() |
![]() |
#15 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,629
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR Last edited by BetterRed; 08-07-2013 at 01:24 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dashed Dashes -- Befuddled by EN and EM Dashes (Apple Pages to EPUB) | planewryter | Conversion | 1 | 07-22-2012 09:52 PM |
Regex F&R problem? | Jabby | Sigil | 6 | 06-12-2012 04:18 AM |
RegEx & Unicode | capnm | Library Management | 14 | 12-01-2011 08:23 PM |
Search & Replace/Regex help!! | millertime13 | Conversion | 4 | 07-22-2011 02:40 AM |
em-dashes & Kindle | hkdorama | Kindle Formats | 7 | 07-27-2010 09:12 AM |