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 01-13-2013, 07:54 PM   #166
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
Simple question about quotes

I have two very basic questions. First about finding straight quotes (") and replacing them with curved opening quotes [A-Z] then the different curved closing quotes using maybe [," or ." or ?" or !"].

And here's why. . . I want to eventually find paragraghs with broken quotes. Paragraphs that have a “ (opening quote) but not a ” (closing quote).

Does this make sense?

So this is a two part question.

Thanks so much . . . I know you brainyachs will have a solution.

I am using Sigil v 0.6.2
ReaderRabbit is offline   Reply With Quote
Old 01-13-2013, 08:24 PM   #167
theducks
Grand Sorcerer
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: 15,268
Karma: 6022733
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by ReaderRabbit View Post
I have two very basic questions. First about finding straight quotes (") and replacing them with curved opening quotes [A-Z] then the different curved closing quotes using maybe [," or ." or ?" or !"].

And here's why. . . I want to eventually find paragraghs with broken quotes. Paragraphs that have a “ (opening quote) but not a ” (closing quote).

Does this make sense?

So this is a two part question.

Thanks so much . . . I know you brainyachs will have a solution.

I am using Sigil v 0.6.2

Good luck
How do you tell where the missing quote belongs?
"That's nice," she said.
"I'll take it from here."

'Smarty' can handle most straight=>curly conversions, but I don't think it comes with a Ouija board plugin
theducks is offline   Reply With Quote
 
Advertisement
Old 01-13-2013, 08:32 PM   #168
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
There would be an opening quote in one paragraph and the closing quote in the next paragraph. I want to bring the two paragraphs together. I also prefer the curved quotes to the straight quotes in books.
ReaderRabbit is offline   Reply With Quote
Old 01-13-2013, 08:37 PM   #169
theducks
Grand Sorcerer
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: 15,268
Karma: 6022733
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by ReaderRabbit View Post
There would be an opening quote in one paragraph and the closing quote in the next paragraph. I want to bring the two paragraphs together. I also prefer the curved quotes to the straight quotes in books.
You need to fix the missing/join part. (There is a 'Saved Search: Join Paragraphs' that might help yo step through fairly quick Make a backup )
Smarty (is used in Calibre and may be available elsewhere), can then do the curly conversion.
theducks is offline   Reply With Quote
Old 01-13-2013, 08:41 PM   #170
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: 9,540
Karma: 44002482
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
This is simply something that regex doesn't lend itself very well to. Heuristic algorithms are better suited for this job (but can still fall short of being perfect).
DiapDealer is online now   Reply With Quote
Old 01-13-2013, 08:59 PM   #171
ReaderRabbit
Member
ReaderRabbit began at the beginning.
 
ReaderRabbit's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2011
Location: Colorado
Device: Cruz Tablet
OK, I will check into making changes in Calibre tho I would not know how to distinguish between Opening and Closing quotes when straight quotes are used in the original text. I thought Regex would probably be good at that.

My thanks to theducks and DiapDealer

Last edited by ReaderRabbit; 01-13-2013 at 09:02 PM.
ReaderRabbit is offline   Reply With Quote
Old 01-14-2013, 04:10 AM   #172
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 2,131
Karma: 4938208
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by ReaderRabbit View Post
I have two very basic questions. First about finding straight quotes (") and replacing them with curved opening quotes [A-Z] then the different curved closing quotes using maybe [," or ." or ?" or !"].
If the source text currently contains no curly quotation marks at all, you could use kiwidude's Modify ePub plugin. It has a Smarten Punctuation option that'll replace all straight quotes with curly quotes using a heuristic algorithm, which is pretty good, but not perfect.
Doitsu is offline   Reply With Quote
Old 01-15-2013, 12:47 PM   #173
Ahu Lee
Junior Member
Ahu Lee began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2013
Location: Moscow, RF
Device: none
I'm sorry I have gone through the thread, but couldn't find anything that would work for my needs. I've read the wiki article, tried in vain many different combinations, but I'm obviously doing something wrong.

I would appreciate a little help on this:
I need to make a simple match to grab this thing with whatever characters within the id name:
<h2 class="story_title" id="(whatever)">

Many many thanks!

----------Edited------------

I found one in the "Saved Searches" in Sigil, touched it up a bit and it did the job.
(?sU)<h2([^>]*>.*)

Last edited by Ahu Lee; 01-15-2013 at 06:51 PM. Reason: Found the solution. \ TypoS
Ahu Lee is offline   Reply With Quote
Old 01-15-2013, 09:20 PM   #174
theducks
Grand Sorcerer
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: 15,268
Karma: 6022733
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Ahu Lee View Post
I'm sorry I have gone through the thread, but couldn't find anything that would work for my needs. I've read the wiki article, tried in vain many different combinations, but I'm obviously doing something wrong.

I would appreciate a little help on this:
I need to make a simple match to grab this thing with whatever characters within the id name:
<h2 class="story_title" id="(whatever)">

Many many thanks!

----------Edited------------

I found one in the "Saved Searches" in Sigil, touched it up a bit and it did the job.
(?sU)<h2([^>]*>.*)
You mean, like:
Code:
<h2 class="story_title" id="(.+?)">
which grabs whatever when enclosed wit all the other stuff shown
theducks is offline   Reply With Quote
Old 01-16-2013, 02:58 PM   #175
Ahu Lee
Junior Member
Ahu Lee began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2013
Location: Moscow, RF
Device: none
Quote:
Originally Posted by theducks View Post
You mean, like:
Code:
<h2 class="story_title" id="(.+?)">
which grabs whatever when enclosed wit all the other stuff shown
Well, yes, I had tried that as well, but it didn't (and still doesn't \ I've just tried it again just in case) match anything. No matches found.

Though, I'm not sure I understand this (not English-wise, but just what it's all about ):
Quote:
...when enclosed with all the other stuff shown
Could you elaborate on that for the newbie like me? Perhaps that's where the problem is.

Thank you very much!

Last edited by Ahu Lee; 01-16-2013 at 03:02 PM.
Ahu Lee is offline   Reply With Quote
Old 01-16-2013, 10:09 PM   #176
theducks
Grand Sorcerer
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: 15,268
Karma: 6022733
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Ahu Lee View Post
Well, yes, I had tried that as well, but it didn't (and still doesn't \ I've just tried it again just in case) match anything. No matches found.

Though, I'm not sure I understand this (not English-wise, but just what it's all about ):


Could you elaborate on that for the newbie like me? Perhaps that's where the problem is.

Thank you very much!
If that does not match, then, maybe :
1) you are not in REGEX mode
2) you have accidentally included a Leading or trailing space in the search selection <<< I choose this one

( ) delineate the captured (stuff ) text
theducks is offline   Reply With Quote
Old 01-17-2013, 08:43 AM   #177
LightFromMoon
Junior Member
LightFromMoon began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2013
Device: Kobo Glo
Could anybody help me in this case?:

There is a code from EPUB:
Quote:
you</p>

<p class="calibre2">need
I need replace in whole document those symbols to a empty space to get only string "you need" and so on.
I tried to use:
(*[a-z])</p>

 <p class="calibre2">([a-z]*) <-- did not worked. Is said. that no match found.

Last edited by LightFromMoon; 01-17-2013 at 08:46 AM.
LightFromMoon is offline   Reply With Quote
Old 01-17-2013, 09:04 AM   #178
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 163
Karma: 86115
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
this should work, but i'd still go through the file and replace them one at a time. it'll match a </p> not preceded by a non-alphanumeric character (like ?, ., !, etc.)

Code:
find:

(?<!\W)</p>\s+<p[^>]*>

rep:

 <---- this is a single space

Last edited by mzmm; 01-17-2013 at 09:07 AM.
mzmm is offline   Reply With Quote
Old 01-17-2013, 09:19 AM   #179
LightFromMoon
Junior Member
LightFromMoon began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2013
Device: Kobo Glo
Quote:
Originally Posted by mzmm View Post
this should work, but i'd still go through the file and replace them one at a time. it'll match a </p> not preceded by a non-alphanumeric character (like ?, ., !, etc.)

Code:
find:

(?<!\W)</p>\s+<p[^>]*>

rep:

 <---- this is a single space

Excuse me, but it didn't work for me. No matches found ....
LightFromMoon is offline   Reply With Quote
Old 01-17-2013, 09:22 AM   #180
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 163
Karma: 86115
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by LightFromMoon View Post
Excuse me, but it didn't work for me. No matches found ....
what are you using to edit the html?

it matches in sigil, make sure you have regex mode turned on.
mzmm 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
Examples of Subgroups emonti8384 Lounge 32 02-26-2011 07:00 PM
Accessories Pen examples Gunnerp245 enTourage Archive 15 02-21-2011 04:23 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 09:24 PM
Examples kafkaesque1978 iRiver Story 1 07-26-2010 04:49 PM
Looking for examples of typos in eBooks Tonycole General Discussions 1 05-05-2010 05:23 AM


All times are GMT -4. The time now is 11:07 AM.


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