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 12-11-2018, 05:51 PM   #556
BetterRed
null operator
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: 13,056
Karma: 10793226
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Leonatus View Post
I'm at a book where quotations are marked by right- (opening) and left-pointing double angle quotes (» and «).

<snip>

Any help appreciated!
Try doing a search for guillemets (« ») in the Workshop forum. IIRC the Second problem has been discussed in a couple threads, and I recall mention of some older German texts using a convention much like MLA/AP Style Guides for multi-paragraph quotes in English:

Quotations that extend over more than one paragraph must have an opening quotation mark at the beginning of each paragraph and a closing quotation mark at the end of the final paragraph.

BR

Last edited by BetterRed; 12-11-2018 at 06:04 PM.
BetterRed is online now   Reply With Quote
Old 12-11-2018, 09:32 PM   #557
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: 1,173
Karma: 6101597
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Leonatus View Post
I'm at a book where quotations are marked by right- (opening) and left-pointing double angle quotes (» and «).

First problem: Frequently, in the middle of direct speech marked as reported, there are citations that are as well marked by right- and left-pointing double angle quotes. I would like to replace those citations by single angle quotes. Is there a good way to find them (only in the middle of direct speech, not outside)?
Which language are you working in? Slovak?

There was a similar thread in the Calibre Editor subforum discussing guillemets:

Regex Function about «» and “”

where I posted a very basic Regex I use. senhal posted his in Post #9.

You may just have to flip around some of the inner/outer »« directions, and substitute in some ›‹, but the logic should all be the same.

Note: And I still stand by Toxaris's EPUBTools Dialogue Checker being the best tool for this job. This problem really requires something a bit smarter than just Regex.

Quote:
Originally Posted by Leonatus View Post
Second problem: It appears, that at direct speech passages, there is an opening double angle, but the closing one is missing (by error of OCR, perhaps). How can I find (and replace) such items, please?
Edit: Sometimes it's vice-versa: the closing mark is there, but the opening one is missing.
Like BetterRed said, English has an opening quote across multiple paragraphs if it's the same character talking:

Quote:
Sue continued to drone on, “This is a very long example. [...] And she keeps talking.
“And talking.
“And talking.
“And talking until the roosters crow.”
I am not too sure if other languages follow a similar "no closing quote" rule.

Last edited by Tex2002ans; 12-11-2018 at 09:43 PM.
Tex2002ans is offline   Reply With Quote
Advert
Old 12-12-2018, 12:06 AM   #558
BetterRed
null operator
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: 13,056
Karma: 10793226
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Tex2002ans View Post
Note: And I still stand by Toxaris's EPUBTools Dialogue Checker being the best tool for this job. This problem really requires something a bit smarter than just Regex.
↑ ↑ ↑ ✔️

BR
BetterRed is online now   Reply With Quote
Old 12-12-2018, 01:54 AM   #559
Leonatus
Guru
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 662
Karma: 7077424
Join Date: Mar 2013
Location: Berlin, Germany
Device: Kobo Touch
Thank you both, BetterRed and Tex2002ans! The text is in german. And yes, I also find that Toxaris' tool is excellent for this task, but the book has come as epub already; I have to do some modifications (transform in modern spelling and so on). Only that there are quite a lot of mistakes of the reported sort that I wished to mend.
I'll have a look to the recommended threads.
Fyi: In older german books, you'll frequently find the same way of formatting direct speech across multiple paragraghs, i. e. beginning with an opening quote at each paragraph, but ending with the closing one only at the end of the direct speech. This is no longer the case in modern books. the book I'm working on shows this as well, and I changed this. This is not the problem. There are some erroneously missing quotes.

Last edited by Leonatus; 12-12-2018 at 01:58 AM.
Leonatus is offline   Reply With Quote
Old 12-12-2018, 11:45 AM   #560
Leonatus
Guru
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 662
Karma: 7077424
Join Date: Mar 2013
Location: Berlin, Germany
Device: Kobo Touch
Your "simple" check:
Code:
(»[^«]*)</p>
found me missing closing quotes within a paragraph, whereas
Code:
»([^«]*)»
found me as well missing closing quotes as the "citation problem", also across multiple paragraphs.
That's indeed very helpful!
Leonatus is offline   Reply With Quote
Advert
Old 12-30-2018, 01:57 PM   #561
cereburn
Junior Member
cereburn began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2018
Device: Android/MoonReader
New to Regex - not sure where I went wrong

I've got a PDF that I used Calibre to convert to ePUB but at the top of each page in the PDF was a piece of page bling next to the page number that is now mixed in with the text of the doc.

Code:
file:///K|/eMule/Incoming/88%20sci-fi%20aWizard.html (77 of 309)16-8-2007 23:50:31
When I try to search for this just using:

Code:
\A file
it doesn't result at all

if I use:

Code:
\A file:///K|/eMule/Incoming/88
then it finds and highlights eMule/Incoming/88

I've tried adding \ to each of the escape required characters above, but that breaks the search back to where I was when I started.

My goal is to setup a search and replace for everything starting with file up to and including the first following <p>
cereburn is offline   Reply With Quote
Old 04-19-2019, 04:48 AM   #562
famfam
Enthusiast
famfam began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Oct 2013
Device: Kobo Touch
Better text structuring with regex

Better text structuring with regex:
Better text structuring allows better orientation in reading and thus better understanding of the texts. Of course this applies in particular to extensive and complicated texts.
That's why I came up with the idea. To emphasize sentence beginnings by increasing the first letter of each sentence two degrees and bold.
This can be easily implemented in Word with regex. But since I also want to do that with Sigil in finished epubs, I'm looking for the right regex solution for Sigil.
Here is my approach:
Search: [.?!] [A-Z]
Replace: ^ &

At this point I do not know, because I do not know if and how you can achieve the character formatting on fat when replacing.

With Word, as I said, that's no problem. But how can I do that in Sigil with the finished epub?

Does anyone have a suggestion?

In german:
Bessere Textstrukturierung mit Regex:
Bessere Textstrukturierung ermöglicht bessere Orientierung beim Lesen und dadurch besseres Verstehen der Texte. Das gilt natürlich insbesondere für umfangreiche und komplizierte Texte.
Daher bin ich auf die Idee gekommen. Satzanfänge herforzuheben, indem ich den ersten Buchstaben jedes Satzes zwei Grad vergrößere und fett markieren.
Dies läßt sich in Word problemlos mit regex realisieren. Da ich aber das auch mit Sigil in fertigen epubs machen möchte, suche ich nach der passenden regex-Lösung für Sigil.
Hier mein Ansatz:
Suchen: [.?!] [A-Z]
Ersetzen: ^&

An dieser Stelle weiß ich nicht weiter, weil ich nicht weiß, ob bzw. wie man beim Ersetzen die Zeichenformatierung auf Fett erreichen kann.

Mit Word, wie gesagt, ist das kein Problem. Aber wie kann ich das in Sigil mit dem fertigen epub hinkriegen?

Hat jemand einen Vorschlag?
famfam is offline   Reply With Quote
Old 04-19-2019, 05:44 AM   #563
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: 4,520
Karma: 14554225
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by famfam View Post
To emphasize sentence beginnings by increasing the first letter of each sentence two degrees and bold.
If your reading app supports pseudo elements, you don't need to use any regular expressions at all. Simply add the following code to your main style-sheet:

Code:
p::first-letter {font-size: 2em; font-weight: bold; }
Doitsu is offline   Reply With Quote
Old 04-19-2019, 06:22 AM   #564
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: 20,141
Karma: 103978634
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm curious what the replace expression is that makes this "easily implemented in Word with regex"?

Last edited by DiapDealer; 04-19-2019 at 08:31 AM.
DiapDealer is offline   Reply With Quote
Old 04-19-2019, 07:52 AM   #565
BetterRed
null operator
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: 13,056
Karma: 10793226
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
i'm curious what the replace expression is that makes this "easily implemented in Word with regex"?
I would guess the OP means using the Formats->Fonts modifiers on the Replace, something like this:

Click image for larger version

Name:	Annotation 2019-04-19 214257.jpg
Views:	26
Size:	97.5 KB
ID:	170779

That Find will not find all sentences, e.g. those following speech where writer's style is to punctuate inside the quotes. For that reason alone I would use a VBA macro.

BR
BetterRed is online now   Reply With Quote
Old 04-19-2019, 08:36 AM   #566
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: 20,141
Karma: 103978634
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BetterRed View Post
I would guess the OP means using the Formats->Fonts modifiers on the Replace, something like this:
Ahhh... that makes sense. Thanks. So not actually regex, then. An additional F&R feature. I thought maybe Word had some sort proprietary regular expression syntax that allowed text formatting to be specified in the replace expression.
DiapDealer is offline   Reply With Quote
Old 04-19-2019, 08:47 AM   #567
BetterRed
null operator
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: 13,056
Karma: 10793226
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
Ahhh... that makes sense. Thanks. So not actually regex, then. An additional F&R feature. I thought maybe Word had some sort proprietary regular expression syntax that allowed text formatting to be specified in the replace expression.
If you're looking for something to do you could reverse engineer it into Sigil
BetterRed is online now   Reply With Quote
Old 04-19-2019, 09:28 AM   #568
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: 20,141
Karma: 103978634
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BetterRed View Post
If you're looking for something to do you could reverse engineer it into Sigil
Zero interest on my part. But since the regex module has always been a part of Sigil's bundled Python, there's nothing to stop someone from creating a plugin that could combine regex find-and-replace with css styling.

Though regardless of how it was handled (plugin or inherent Sigil feature), it would very hard to ensure that no pre-existing styling would ever get stomped on in the process.
DiapDealer is offline   Reply With Quote
Old 04-20-2019, 05:09 AM   #569
Klecks
Enthusiast
Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.Klecks never is beset by a damp, drizzly November in his or her soul.
 
Klecks's Avatar
 
Posts: 36
Karma: 59154
Join Date: May 2010
Location: Stuttgart, Germany
Device: Kobo H2O, PocketBook Touch HD, Tolino Vision 4
Quote:
Originally Posted by famfam View Post
... To emphasize sentence beginnings by increasing the first letter of each sentence two degrees and bold.

You can try the following expression:

search for:
Code:
(?<!St|Mr|Mrs|<|\d)(<p[^>]*>|\!|\?|\.|…|:)( ?)(»|«|“|”|„)?( ?)([A-ZÖÄÜ])
replace with:
Code:
\1\2\3\4<b>\5</b>
and in the CSS:

Code:
b
{font-weight: bold;
 font-size:1.2em;
 line-height:0.7em;}
Greatings
Klecks.
Klecks is offline   Reply With Quote
Old 04-22-2019, 02:12 PM   #570
famfam
Enthusiast
famfam began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Oct 2013
Device: Kobo Touch
@Doitsu
Yes, the code works, but only for the first character od paragraphe. Thanks a lot.
@Klecks
Yes, that seems to work very good. I just tried it and will prove it more and mor the next day. My reading of long and complicated ebooks will be better with this new orientationsystem, and better understandig will be the result of that.
Thank you so much.
famfam 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 06:00 PM
Accessories Pen examples Gunnerp245 enTourage Archive 15 02-21-2011 03:23 PM
Stylesheet examples? Skitzman69 Sigil 15 09-24-2010 08:24 PM
Examples kafkaesque1978 iRiver Story 1 07-26-2010 03:49 PM
Looking for examples of typos in eBooks Tonycole General Discussions 1 05-05-2010 04:23 AM


All times are GMT -4. The time now is 05:09 PM.


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