Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2013, 02:03 PM   #1
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 320
Karma: 56788
Join Date: Jun 2011
Device: Kindle
Can you match a NON-character...?

I'm trying to correct, in bulk, omissions of apostrophes, such as: Im, cant, wont, couldnt.

Is there a way to match the non-space between "t" and the penultimate letter so i can simple insert an apostrophe as a replace value?

basically, i'm looking for the functional equivalent of:

Code:
(?<=\bI)[non-space, non-character](?=m\b)
ElMiko is offline   Reply With Quote
Old 03-25-2013, 02:16 PM   #2
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: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
not a REGEX solution

Have you tried the Spellcheck feature.

when you select a word in the list, then correct it for all occurrences
theducks is offline   Reply With Quote
Advert
Old 03-25-2013, 04:11 PM   #3
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 320
Karma: 56788
Join Date: Jun 2011
Device: Kindle
DAAAAANG....

I figured as much, but I hoped one of the gurus would have a silver bullet where all my plain-vanilla lead bullets had failed.

Spellcheck doesn't catch several of the most common instances since they are, technically, words: Id, wont, cant. Well, if apostrophe strikes—sorry, i mean, epiphany—let me know...
ElMiko is offline   Reply With Quote
Old 03-25-2013, 04:28 PM   #4
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I'm sure there is a regex for what you want...theducks was just pointing out a non-regex approach.

The Spellcheck window can also list every word in your book, not just the misspelled ones. But even though you could filter on "t" there would probably still be a lot of words to look through. Even a regex would give you a lot of words to check as well if you're just looking for words ending in t.
meme is offline   Reply With Quote
Old 03-25-2013, 04:45 PM   #5
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: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ElMiko View Post
DAAAAANG....

I figured as much, but I hoped one of the gurus would have a silver bullet where all my plain-vanilla lead bullets had failed.

Spellcheck doesn't catch several of the most common instances since they are, technically, words: Id, wont, cant. Well, if apostrophe strikes—sorry, i mean, epiphany—let me know...
wan't the horrors of blind S&R

The spell check approach means you just check a few known words that might need the apostrophe

(you sill need to fix those other spelling errors )
theducks is offline   Reply With Quote
Advert
Old 03-25-2013, 05:37 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not certain I'm entirely following. In your pseudo-regex:
Code:
(?<=\bI)[non-space, non-character](?=m\b)
You seem to want to match the position in between Im (with word boundaries on either side) so you can replace that captured "position" with an apostrophe. But if you're basically going to run a search for "Im"... then why not just replace all instances of \bIm\b with "I'm". Or \b((?i)c)(?-i)ant\b with "\1an't" ? Shouldn't take too long to go through most of the common contractions.
DiapDealer is offline   Reply With Quote
Old 03-25-2013, 06:19 PM   #7
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 320
Karma: 56788
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by DiapDealer View Post
I'm not certain I'm entirely following. In your pseudo-regex:
Code:
(?<=\bI)[non-space, non-character](?=m\b)
You seem to want to match the position in between Im (with word boundaries on either side) so you can replace that captured "position" with an apostrophe. But if you're basically going to run a search for "Im"... then why not just replace all instances of \bIm\b with "I'm". Or \b((?i)c)(?-i)ant\b with "\1an't" ? Shouldn't take too long to go through most of the common contractions.
... because there are actually lots of contractions. And typing each search out and a unique replace value would take a longer than doing what i'm trying to do. Obviously, it can be done the way you are suggesting—it's the way I've done it in the past... it hardly even counts as "RegEx".
ElMiko is offline   Reply With Quote
Old 03-25-2013, 07:27 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by ElMiko View Post
... because there are actually lots of contractions. And typing each search out and a unique replace value would take a longer than doing what i'm trying to do. Obviously, it can be done the way you are suggesting—it's the way I've done it in the past... it hardly even counts as "RegEx".
My bad. I assumed from your example ("Im") that you were typing a similar search for each contraction.

Last edited by DiapDealer; 03-25-2013 at 07:37 PM.
DiapDealer is offline   Reply With Quote
Old 03-25-2013, 08:10 PM   #9
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by ElMiko View Post
Obviously, it can be done the way you are suggesting—it's the way I've done it in the past... it hardly even counts as "RegEx".
There has to be a list of contractions somewhere.

You do the work once, create lots of Sigil Saved Searches replacing all of the unapostrophed with the apostrophe versions, and then spread your Saved Search file to everyone else, so we won't have to do it.
Tex2002ans is offline   Reply With Quote
Old 03-26-2013, 04:26 AM   #10
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Hmm... Would using the {0} multiplier work? Something like:

Code:
(?<=\bI)'{0}(?=m\b)
Maybe you could just use * instead of {0}. It would match one or more instances of the apostrophe, but it doesn't matter if it replaces an apostrophe by itself... and you surely don't want more than one apostrophe anyway
Jellby is offline   Reply With Quote
Old 03-26-2013, 10:18 PM   #11
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,068
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
The list of normal contractions is relatively small (sorry the forum doesn't like tables but you can find it here):

aren't are not
can't cannot
couldn't could not
didn't did not
doesn't does not
don't do not
hadn't had not
hasn't has not
haven't have not
he'd he had; he would
he'll he will; he shall
he's he is; he has
I'd I had; I would
I'll I will; I shall
I'm I am
I've I have
isn't is not
let's let us
mightn't might not
mustn't must not
shan't shall not
she'd she had; she would
she'll she will; she shall
she's she is; she has
shouldn't should not
that's that is; that has
there's there is; there has
they'd they had; they would
they'll they will; they shall
they're they are
they've they have
we'd we had; we would
we're we are
we've we have
weren't were not
what'll what will; what shall
what're what are
what's what is; what has
what've what have
where's where is; where has
who'd who had; who would
who'll who will; who shall
who're who are
who's who is; who has
who've who have
won't will not
wouldn't would not
you'd you had; you would
you'll you will; you shall
you're you are
you've you have

There are multiple duplications that allow a handful of regex's to cover the list. I actually had a saved search group that did this - it was only a half-dozen or so steps. Unfortunately, I lost the group when my hard drive was replaced and haven't recreated it yet.
Turtle91 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Kobo Price Match? Big McLargeHuge Kobo Reader 5 11-14-2012 11:28 PM
Can't match Unicode character atordo Recipes 2 06-15-2012 03:20 PM
how to have regex dot match any character including newline? gnychis Calibre 5 11-30-2010 06:35 PM
SonyStyle Price Match Zen-Diego Sony Reader 3 05-06-2009 03:07 PM


All times are GMT -4. The time now is 10:37 AM.


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