Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2020, 09:56 AM   #106
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,961
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Your suggestion of '\d\d[^0-9'] is not a bad one. There might be some things that fall through the cracks when the British style of single-quotes is employed, but they were going to be wrongly interpreted under the old rule too.

Give this beta version a workout. There's only three lines changed from version 0.3.3 of the plugin (lines 631-633 of newsmartypants.py), and two of those are comments.
Attached Files
File Type: zip PunctuationSmarten_v0.3.4b.zip (18.4 KB, 223 views)

Last edited by DiapDealer; 05-12-2020 at 10:27 AM.
DiapDealer is online now   Reply With Quote
Old 05-12-2020, 10:47 AM   #107
Thomas_AR
Zealot
Thomas_AR began at the beginning.
 
Thomas_AR's Avatar
 
Posts: 131
Karma: 10
Join Date: Jan 2015
Location: Buenos Aires
Device: Android
Folks, just one more question.
I know this plugin works best in English books. As i am mostly working with German Books is there an adapted plugin as some signs are very different. Or is it language independent.

Thanks and sorry for the noop question

Thomas
Thomas_AR is offline   Reply With Quote
Advert
Old 05-12-2020, 11:51 AM   #108
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,961
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
To be honest, this plugin is basically just a wrapper around someone else's work: the SmartyPants Python smartening algorithm (which was nowhere near perfect--or even complete--in the first place). I've just tweaked it where I can. I would say that SmartyPants is definitely English-centric.

There may be some language specific (or agnostic) smartening algorithms out there, but I've not run into them.
DiapDealer is online now   Reply With Quote
Old 05-13-2020, 09:13 AM   #109
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 674
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DiapDealer View Post
Give this beta version a workout.
Yep, that works.


<p>Month '1' in '84 was a good year. He had a '317' average and solved the '3 body problem'.</p>

to

<p>Month ‘1’ in ’84 was a good year. He had a ‘317’ average and solved the ‘3 body problem’. </p>


I see the previous version checked for '80s and '90s, etc. But not particular years.

There are some cases that fail: A '12-gauge shotgun'. But 'NN years are much more common.


When you update it, you could include the plugin.png icon.
If you don't have one, here's the one I use, found in another thread a while ago.
Attached Images
 

Last edited by AlanHK; 05-14-2020 at 01:31 PM.
AlanHK is offline   Reply With Quote
Old 05-26-2020, 12:18 PM   #110
thosp
Member
thosp began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2014
Device: laptop & tablet
Odd change

Greetings,

I use this in Sigil to 'correct' files downloaded form ... everywhere. Recently, I noticed a perceived problem.

The file in question had this, " -- " or {[space][hyphen][hyphen][space]} and changed it to "—" or (EM DASH}.

The writer meant to have a space before and after the punctuation mark, why was it changed the way it was? The proper change, in my view, would be to " – " or {[space]EN DASH][space]} as this makes the epub a better read.

Thank You
thosp is offline   Reply With Quote
Advert
Old 05-26-2020, 01:59 PM   #111
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,961
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Every style guide I know of (with the exception of the Associated Press style guide) states that there should be no spaces between an em dash and the adjacent words.

You can easily turn off dash smartening altogether in the plugin's config section if you want to handle your own non-standard manual conversion of the double-dashes. But I'm not changing the default behavior of the plugin's dash smartening to something non-standard.

Last edited by DiapDealer; 05-26-2020 at 02:02 PM.
DiapDealer is online now   Reply With Quote
Old 05-27-2020, 03:07 AM   #112
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 674
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DiapDealer View Post
Every style guide I know of (with the exception of the Associated Press style guide) states that there should be no spaces between an em dash and the adjacent words.
US style is em-dash, no spaces—like this.

UK style is a spaced en-dash – like this (except in number ranges: pages 80–81).

Some publishers do use spaced em dashes though, not that common.

I do dashes manually by S&R, as there is often a mix of hyphens and various dashes, spaced or unspaced. And then spend a while fixing ellipses, since I prefer spaced periods.

Last edited by AlanHK; 05-27-2020 at 03:12 AM.
AlanHK is offline   Reply With Quote
Old 05-31-2020, 04:14 AM   #113
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 thosp View Post
The file in question had this, " -- " or {[space][hyphen][hyphen][space]} and changed it to "—" or (EM DASH}.

The writer meant to have a space before and after the punctuation mark, why was it changed the way it was? The proper change, in my view, would be to " – " or {[space]EN DASH][space]} as this makes the epub a better read.
If you change your "(EM/EN)-Dash Setting" to:

'--' = em dash (no en dash support)

Click image for larger version

Name:	SmartenPunctuation.-.EM.EN.Dash.Setting.png
Views:	207
Size:	4.9 KB
ID:	179611

I tested on this:

Code:
<p>This is a -- sample.</p>
and it changed to this:

Code:
<p>This is a — sample.</p>
Then you could search for (SPACE + EM DASH + SPACE):

Search:

then replace with (SPACE + EN DASH + SPACE):

Replace:

You could setup a Sigil Saved Search if you find you're doing this correction often. Then you could just run SmartenPunctuation, then the Saved Search right after.

Quote:
Originally Posted by DiapDealer View Post
You can easily turn off dash smartening altogether in the plugin's config section if you want to handle your own non-standard manual conversion of the double-dashes. But I'm not changing the default behavior of the plugin's dash smartening to something non-standard.
Agreed. I always keep the options for dashes + ellipses off, then correct that stuff on my own.

But maybe how you have that "(no en dash support)", you can have the opposite:

' -- ' = spaced en dash (no em dash support)

Note: Just tested in LibreOffice / Word, their AutoCorrect by default changes:

"--" -> en dash
" -- " -> spaced en dash
"sample-- " (two hyphens + space) -> unspaced em dash

Quote:
Originally Posted by DiapDealer View Post
Every style guide I know of (with the exception of the Associated Press style guide) states that there should be no spaces between an em dash and the adjacent words.
On parenthetical expressions, also see:

https://en.wikipedia.org/wiki/Dash#P...sentence_level

And I agree with AlanHK. From what I've read over the years:

The spaced EN DASH seems to be used more in British publications (and newspapers).

The EM DASH tends to be used more in American.

Spacing Side Note: On spacing around em dashes... there's "open-set" and "close-set":

Open-set = Both sides use hair or thin space (or, disgustingly, normal spaces)
Close-set = No space on either side

See Robert Bringhurst, "Elements of Typographic Style", Chapter 5:

Quote:
5.2 DASHES, SLASHES & DOTS

5.2.1 Use spaced en dashes – rather than close-set em dashes or spaced hyphens – to set off phrases.


Standard computer keyboards and typewriters include only one dash: the hyphen. Any normal font of text type, either roman or italic, includes at least three. These are the hyphen and two sizes of long dash: the en dash – which is one en (half an em, M/2) in width – and the em dash-which is one em (two ens) wide. Many fonts also include a subtraction sign, which may or may not be the same length and weight as the en dash, and some include a figure dash (equal to the width of a standard numeral). The three-quarter em dash, and the three-to-em dash, which is one third of an em (M/3) in length, are often missing but perfectly easy to make.

In typescript, a double hyphen (--) is often used for a long dash. Double hyphens in a typeset document are a sure sign that the type was set by a typist, not a typographer. A typographer will use an em dash, three-quarter em, or en dash, depending on context or personal style. The em dash is the nineteenth-century standard, still prescribed in many editorial style books, but the em dash is too long for use with the best text faces. Like the oversized space between sentences, it belongs to the padded and corseted aesthetic of Victorian typography.

Used as a phrase marker – thus – the en dash is set with a normal word space either side.

Last edited by Tex2002ans; 05-31-2020 at 04:20 AM.
Tex2002ans is offline   Reply With Quote
Old 06-23-2020, 05:37 PM   #114
dynabook
Techno-geek
dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.
 
Posts: 225
Karma: 1116651
Join Date: Nov 2006
Location: Mississippi, USA
Device: PRS-T1 (Black), PRS-T3S (Black), Kobo Aura ONE
I haven't used PunctuationSmarten for awhile but used it successfully in the past. I tried to use it today several times and each time it logged me out of my user and went to the multi-user login screen.

I am running Sigil version 0.9.18 on MacOSX 10.14.6 (Mojave). The plugin version is 0.3.3 and I just removed and re-downloaded it fro MR and re-installed. Same results. I have been having crashes (memory issues?) with Sigil for a while but only when I close it after a heavy editing session not during use.

Any help or suggestion would be appreciated - even upgrading to v.1.2.0. I have not upgraded because 0.9.18 works for me and I am not sure waht advantage 1.2.0 would give me. Maybe I could install v.1.2.0 and try it.
--MH
dynabook is offline   Reply With Quote
Old 06-23-2020, 06:04 PM   #115
dynabook
Techno-geek
dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.
 
Posts: 225
Karma: 1116651
Join Date: Nov 2006
Location: Mississippi, USA
Device: PRS-T1 (Black), PRS-T3S (Black), Kobo Aura ONE
I have downloaded ver. 1.2.0 and tried the plugin with the same results.
--MH
dynabook is offline   Reply With Quote
Old 06-23-2020, 06:10 PM   #116
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
If you check out the release announcements, we explain all of the new features and bugs fixed included with each release.
KevinH is online now   Reply With Quote
Old 06-23-2020, 06:54 PM   #117
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,961
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I have no idea how a python plugin could crash Sigil hard enough that it would end the current user session of the OS. Something else has to be in play, here. When does it happen? After selecting the parameters for the run, or as soon as you launch the plugin?

Last edited by DiapDealer; 06-23-2020 at 07:04 PM.
DiapDealer is online now   Reply With Quote
Old 06-23-2020, 07:42 PM   #118
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
Could you be using a shortcut key sequence assigned to fast user login switching?

Please disable fast user login in Apple preferences and then try again and let us know what happens? If Sigil 1.2.0 actually crashes it should generate a crash report. Please post is here or pm KevinH here with a link.
KevinH is online now   Reply With Quote
Old 06-23-2020, 10:41 PM   #119
dynabook
Techno-geek
dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.dynabook ought to be getting tired of karma fortunes by now.
 
Posts: 225
Karma: 1116651
Join Date: Nov 2006
Location: Mississippi, USA
Device: PRS-T1 (Black), PRS-T3S (Black), Kobo Aura ONE
The plugin crashes as soon as it starts to run. When I restart, the python launcher is in my recent dock items. Since I have done Sigil upgrades since using the plugin is there some parameters that got saved or could there be corruption in the exceptions file?

I will empty or delete the exceptions file and try again.
--MH

Last edited by dynabook; 06-23-2020 at 10:41 PM. Reason: typo
dynabook is offline   Reply With Quote
Old 06-23-2020, 10:51 PM   #120
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,109
Karma: 5450184
Join Date: Nov 2009
Device: many
What exactly do you mean by the plugin "crashing" and needing to "restart"? Getting the user login sounds like something else is going on. No plugin should not be able crash the Finder or the macOS kernel.. If it do see an actual crash, please enable the macOS Crash Report and post it. Do all other plugins work?

Does this plugin have a gui? Have you updated your Tk/Tcl version as recommended in the release notes for Sigil on macOS?
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
epubcheck plugin for Sigil Doitsu Plugins 524 10-06-2024 06:18 PM
[Plugin] ePub3-itizer - epub3 output plugin for Sigil KevinH Plugins 435 01-19-2023 09:46 PM
[Plugin] KindleImport Sigil plugin DiapDealer Plugins 187 07-04-2022 10:11 AM
icarus Sigil plugin AlPe Plugins 26 12-05-2017 10:03 AM
smoothRemove_v010 plugin for Sigil kbanelas Plugins 15 01-27-2017 05:51 PM


All times are GMT -4. The time now is 08:02 AM.


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