Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-31-2013, 02:14 PM   #1
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
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
Cool Regex s&r for dashes used where emdashes should be

I need a pair of regex s&r strings for dashes used where emdashes should have been used?

alansplace is online now   Reply With Quote
Old 07-31-2013, 02:31 PM   #2
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,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.
Jellby is offline   Reply With Quote
Advert
Old 07-31-2013, 06:14 PM   #3
Sabardeyn
Guru
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
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.
Sabardeyn is offline   Reply With Quote
Old 07-31-2013, 06:47 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
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....
PeterT is offline   Reply With Quote
Old 07-31-2013, 08:47 PM   #5
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
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:
It is immaterial whether the restriction of a recipe's use is made possible by institutional conditions--such as patents and copyright laws--or by the fact that a formula is kept secret and other people fail to guess it.
#2:

Quote:
It is immaterial whether the restriction of a recipe's use is made possible by institutional conditions -- such as patents and copyright laws -- or by the fact that a formula is kept secret and other people fail to guess it.
#3:

Quote:
It is immaterial whether the restriction of a recipe's use is made possible by institutional conditions-such as patents and copyright laws-or by the fact that a formula is kept secret and other people fail to guess it.
After #1:

Quote:
It is immaterial whether the restriction of a recipe's use is made possible by institutional conditions—such as patents and copyright laws—or by the fact that a formula is kept secret and other people fail to guess it.
After #2:

Quote:
It is immaterial whether the restriction of a recipe's use is made possible by institutional conditions — such as patents and copyright laws — or by the fact that a formula is kept secret and other people fail to guess it.
If it is #1 or #2, those can be done with a simple search and replace.

#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.
Attached Thumbnails
Click image for larger version

Name:	SpellcheckHyphens.png
Views:	174
Size:	12.6 KB
ID:	108776  

Last edited by Tex2002ans; 07-31-2013 at 08:49 PM.
Tex2002ans is offline   Reply With Quote
Advert
Old 08-01-2013, 12:56 AM   #6
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
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
cybmole is offline   Reply With Quote
Old 08-01-2013, 10:16 AM   #7
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
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
Cool Thanks

Thanks to Jellby, Sabardeyn, PeterT, Tex2002ans and cybmole for their replys. I'll report here if any of your suggestions work out for me!

alansplace is online now   Reply With Quote
Old 08-02-2013, 07:48 AM   #8
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Originally Posted by alansplace View Post
I need a pair of regex s&r strings for dashes used where emdashes should have been used?
What are your rules for 'should have been used'?

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
phossler is offline   Reply With Quote
Old 08-02-2013, 09:48 AM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
Paul
Personal style wins every time (unless the customer is PAYING you to do it their way)
theducks is offline   Reply With Quote
Old 08-02-2013, 07:04 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,629
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
Paul
Personal style wins every time (unless the customer is PAYING you to do it their way)
"In matters of style, swim with the current; in matters of principle, stand like a rock." Thomas Jefferson

BR
BetterRed is offline   Reply With Quote
Old 08-02-2013, 08:21 PM   #11
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
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
Cool over-complicating the problem

Quote:
Originally Posted by phossler View Post
What are your rules for 'should have been used'?

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
Was looking for a way/method to change the character being used where a dash was being used that was not in a standardly hyphenated, or compound word but instead was being used to set off a phrase or indicate a pause.

alansplace is online now   Reply With Quote
Old 08-02-2013, 10:53 PM   #12
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
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])
Replace:

Code:
\1—\2
This will work on hyphens like in my Case #3 above.

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])
Replace:

Code:
\1–\2

Last edited by Tex2002ans; 08-02-2013 at 10:58 PM.
Tex2002ans is offline   Reply With Quote
Old 08-02-2013, 11:05 PM   #13
alansplace
Grand Sorcerer
alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.alansplace ought to be getting tired of karma fortunes by now.
 
alansplace's Avatar
 
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
Cool Thanks!

Quote:
Originally Posted by Tex2002ans View Post
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])
Replace:

Code:
\1—\2
This will work on hyphens like in my Case #3 above.
Oh thanks for that. I'd already tried that method before I started this thread and since it had almost 900 hits I decided not to proceed.

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.

alansplace is online now   Reply With Quote
Old 08-02-2013, 11:40 PM   #14
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
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.
Tex2002ans is offline   Reply With Quote
Old 08-07-2013, 01:05 AM   #15
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,629
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Tex2002ans View Post
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.
I've had such a thing in Word since they first supported custom dictionaries, I think I filched from one of Xerox's boat-anchors.

BR

Last edited by BetterRed; 08-07-2013 at 01:24 AM.
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 12:33 PM.


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