MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   How about a plugin to hyphenate? (https://www.mobileread.com/forums/showthread.php?t=270701)

dhdurgee 02-08-2016 11:32 AM

How about a plugin to hyphenate?
 
Calibre has a plugin, "Hyphenate This!", that will insert soft hyphens into a document using a Libre Office foundation hyphenation dictionary. It would be very nice to have a similar capability in Sigil.

I don't know if the two plugin approaches are similar enough for this to be helpful, but in case here is the thread about the Calibre plugin:

https://www.mobileread.com/forums/sho...d.php?t=208534

Dave

KevinH 02-08-2016 12:02 PM

There is a pure python hyphennate.py that uses the standard tex based hyphenation dictionary (like Libre/Open Office, Sigil, etc). So yes a hyphenation dictionary would be a very easy to do and nice edit plugin for Sigil.

See this link:

https://pypi.python.org/pypi/hyphenator/0.5.1

That code can be unpacked and hyphenator.py can easily be added to a plugin. It is LGPL so it is license compatible with Sigil.

eschwartz 02-08-2016 12:52 PM

Which for the record is the same module the calibre plugin uses.

dhdurgee 02-08-2016 01:33 PM

Unless building a Sigil plugin is a very simple exercise I suspect someone other than me will need to do it. I am glad you agree that it would be a useful feature to add to Sigil.

Dave

KevinH 02-08-2016 02:16 PM

Have you asked the calibre plugin author if they would like to modify their plugin to run with Sigil? If not, I am sure someone here could throw one together using the calibre one as a base since only the gui would be different, where-as both support html5lib, lxml, etc and of course python and parsing of xhtml is easily achieved in both. So unless it uses some special interfaces specific to calibre, most if it should be re-usable. What license does the calibre plugin use?

dhdurgee 02-08-2016 02:46 PM

The last Calibre plugin update was in August, 2014 leading me to wonder if the author is still active at this point. His last post here was in May, 2015 giving me further doubts about contacting him.

Given this perhaps one of the developers here could take a look at his work and the tool it is based on.

Dave

dhdurgee 02-08-2016 02:52 PM

There is another point that someone brought to my attention over in the Kindle Developer's forum. Perhaps this is not the greatest idea for an edit plugin, unless the intent is to use it immediately before a KindleGen and then discarding the changes. You can see the full post here:

https://www.mobileread.com/forums/sho...99#post3256199

Quoting his main point "Most ePub rederers (such as ADE/RMDSK) will not properly display the hyphens and if you need to make changes to the ePub, the hyphens will get in the way. Also searching breaks with the hyphens."

Dave

DiapDealer 02-08-2016 04:08 PM

I would never recommend mass soft-hyphen insertion (pollution) for anything other than personal use. It doesn't make sense to use it for books you plan to disseminate to others. It should be reserved as an end-user option, rather than a creation option in my opinion.

Toxaris 02-08-2016 04:30 PM

Perhaps as pre-plugin for the kindlegen plugin?

dhdurgee 02-08-2016 05:09 PM

Quote:

Originally Posted by Toxaris (Post 3256277)
Perhaps as pre-plugin for the kindlegen plugin?

That is kind of what I was thinking of. Perhaps there is even a way the hyphenation could be incorporated into the Kindlegen plugin as an output option. My current understanding is that this is only effective in the kf8(.azw3) format, so I don't know how that would impact the production of the .mobi file.

Of course if Amazon were to add proper hyphenation support into the Kindle this would not be a problem. They however seem uninterested in doing so.

Dave

DiapDealer 02-08-2016 05:37 PM

Not everyone likes hyphenation. Why force it on them (and take away their ability to search the text as a consequence)? Just make books and allow the readers to use the apps/devices/formats whose features they're most comfortable with (or that offer the customization options they value most). Hyphenation, line-height, letter-spacing, font-sizes, font-faces: these are all things that should be left up to the reader to tweak if they're so inclined (when speaking of standard body text). If hyphenation is important enough to them, they'll already be using a device/app/format that offers them the choice of enabling it (or disabling it).

RbnJrg 02-08-2016 06:15 PM

Quote:

Originally Posted by dhdurgee (Post 3256205)
Quoting his main point "Most ePub rederers (such as ADE/RMDSK) will not properly display the hyphens...

ADE/RMDSK readers have a built-in hyphenator feature. They don't need soft hyphens in the text of an ebook.

RbnJrg 02-08-2016 06:21 PM

Quote:

Originally Posted by dhdurgee (Post 3256301)

Of course if Amazon were to add proper hyphenation support into the Kindle this would not be a problem. They however seem uninterested in doing so.

Actually, Amazon finally is adding support for hyphens in its devices. With its new .kfx format, Amazon added hyphens to its books. Read this article:

http://www.amazon.com/b?_encoding=UTF8&node=11516960011

And speaking by me, I like hyphens.

Regards
Rubén

dhdurgee 02-08-2016 10:17 PM

Quote:

Originally Posted by RbnJrg (Post 3256335)
Actually, Amazon finally is adding support for hyphens in your devices. With its new .kfx format, Amazon added hyphens to its books. Read this article:

http://www.amazon.com/b?_encoding=UTF8&node=11516960011

And speaking by me, I like hyphens.

Regards
Rubén


So now we have a reason to want to get the kfx format opened up. I wonder how long that will take?

Dave

Toxaris 02-09-2016 05:16 AM

Quote:

Originally Posted by RbnJrg (Post 3256331)
ADE/RMDSK readers have a built-in hyphenator feature. They don't need soft hyphens in the text of an ebook.

Correct, but only the newer versions. Older readers do not have hyphenation. Then again, these older readers also cannot handle soft hyphens.


All times are GMT -4. The time now is 08:30 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.