View Single Post
Old 02-04-2020, 06:17 AM   #11
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,830
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Brett Merkey View Post
@RbnJrg

Very nice regex. A keeper.
Thank you, glad that the code was able to help you too.


Quote:
I tested it in Calibre with 300 chars instead of 999 and the result looked much nicer than I had expected. I expected all the paragraphs to appear too similar in length, which is not cool. However, (esp. with "Dot All") the number of screen lines per paragraph varied in a nice way—I am not sure why.
Take in count that the regex will split the paragraphs not exactly in 300 chars (your case) but with a "few" chars more (until to find the end of the sentence). So, in some cases, those "few" more chars could be 30-50 more letters.

And also affect the output the place where the previous split was done. Suppose the case when after splitting, the ammount of letters before reaching the next </p> is 150. Then the next paragraph would splitted at with 150 chars (more or less) instead of 300. For that reason the paragraphs don't have all the same lenght.
RbnJrg is offline   Reply With Quote