Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-18-2013, 03:29 AM   #1
SauliusP.
Plugin Developer
SauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
SauliusP.'s Avatar
 
Posts: 97
Karma: 23854
Join Date: Feb 2012
Location: Lithuania
Device: Kindle
[GUI Plugin] Hyphenate This!

Hyphenate This! will add soft hyphens to your ebook and add even better feel of a real book!

Supports EPUB and AZW3 formats (no MOBI, even with KF8 inside, convert instead).

If you have a Kindle (with AZW3/KF8 support) this plugin will explode the book, add soft-hyphens and rebuild it back.

Use hyphenation dictionaries from Libre Office foundation. Download one and add to the plugin via its settings.

This plugin is primarily targeted for Kindle users reading AZW3/KF8 format books, as Kindle does not support hyphenation itself. However, recent firmwares added support of soft-hyphenation. So if the book is pre-hyphenated, Kindle will display it correctly. Text search and other features remain. Note, that if you hyphenate EPUB or AZW3 and convert to "old" MOBI, hyphenation won't work.

Some EPUB readers have native hyphenation, but if you read some exotic language (like me), hyphenation support might be poor or not present at all. Luckily, Libre/Open Office dictionaries are implemented for quite a lot of languages.

Note. Not all EPUB readers support soft-hyphens in the way expected. Some hyphenate, but do not show dashes. Some display correctly, but lack search feature. So try it yourself and decide if it is any good. As per discussion further in this thread:
  • Sony devices seem to split text on soft-hyphens, but do not display dashes. Not acceptable for Sony users.
  • Kobo seems to display hyphenation correctly, but text search is ruined.

CAUTION! In versions before (and including) 0.9.26 of Calibre there is a flaw with AZW3 explosion/rebuilding. You might loose picture content. So please back-up your AZW3, if it is the only and original version of the book you have!

CAUTION! In versions before 0.9.24 of Calibre there is a flaw in support of AZW3 explode and rebuild workflow. TOC might be corrupted as well as quick jump through chapters! Might not be the case for you, but be warned!

Illustrations. I have added screenshots from my Kindle with English book. However, English is quite compact and hyphenation does not show all its beauty. So I've also added two screenshots with Lithuaniant text, where hyphenation is more obvious. Of course, text will look like wingdings to most of you, but just try too see the difference :-)
Spoiler:

English text, original:


English text, soft-hyphenated:


Lithuanian text, original:


Lithuanian text, soft-hyphenated:




User Guide
Spoiler:

Install plugin and download "OXT" dictionaries from link above. Open plugin's settings via menu and add those dictionaries. After dictionaries are added to the plugin, downloaded files are removed, plugin stores hyphenation information inside it's settings directory.

NOTE. You may also add hyphenation dictionary directly, i.e. appropriate "DIC" file, extracted from "OXT" (OXT is simly a ZIP file). "DIC" file must be named "hyph_<language code>.dic". E.g. "hyph_en_US.dic" or "hyph_ru.dic".

NOTE 2. I have tested lots of "OXT" dictionaries. Surprisingly, some of them include hyphenation file, but it is not included in the descriptor (plugin uses descriptor to find out the hyphenation dictionary inside "OXT" archive). So if you add "OXT" dictionary, but no new dictionary appears in the list, try to open "OXT" file with some archive manager and search for "hyph*.dic" file there. If it is present, extract it and add directly. If not, you're not lucky.

Settings window:



Simple part:
Install or remove dictionaries here and specify the minimum length of the word to be hyphenated.

Advanced part:

Hyphenation limits

Some of the hyphenation dictionaries contain special directions: LEFTHYPHENMIN and RIGHTHYPHENMIN. They limit syllable length on either left or right side of word. Example in the picture is 2 characters on left (overwritten with 3) and 3 characters on right for English dictionary. Some dictionaries do not contain these directions, then default limit is 2. If you don't like default or included limits, you can edit limits for each dictionary separately by marking "Override" tick mark.

Tags to ignore/parse

Some people pointed out, that there is no real (and aesthetic) need to hyphenate chapter names. Those are usually enclosed in heading tags: h1, h2 etc. I have added possibility to ignore any tags. Defaults are three headings.
You might also want to hyphenate only particular tags' content. In the example these are p and td (paragraph and table cells).
Special note. If in the "parse" tags you enter p, that means all paragraphs will be parsed and hyphenated, including their child tags, like span, em, strong etc. If you want some special tags to be ignored inside p, add them to "ignore" list. In such case you might configure some particular tags inside p to be ignored, like em, for example.

Custom column

Hyphenation status can be saved to custom column of type "Text, column shown in the tag browser". User also can define, what to write to that custom column, when hyphenation was performed and when hyphens were removed. If column name is empty, status is not written anywhere.

Next, everything is simple. Choose book with EPUB and/or AZW3 formats, click plugin's icon, choose one of the formats and click OK. Book will be hyphenated. There is also handy action to remove soft-hyphens from book via menu.


Version history:
Spoiler:
Version 0.0.8 2014-08-08
Get ready for Calibre 2 with Qt5!

Version 0.0.7 2013-04-22
Fix for unicode support of custom text in hyphenated custom column.

Version 0.0.6 2013-04-09
Added custom column to save hyphenation status.

Version 0.0.5 2013-03-29
Community requests and other enhancements
  • Added limits of syllable splits on left and right sides.
  • Added override of the syllable limits via settings.
  • Added "tags to ignore" and "tags to parse" lists via settings.
  • Added nice icon and generally beautified settings dialogue (gets complex).
Inspired by active interest and donations (of course).

Version 0.0.4 2013-03-26
Shortened toolbar button label as per community requests.

Version 0.0.3 2013-03-19
Fixed some issues on user feedback.
Added internal Calibre's HTML parser to avoid encoding problems.
Changed text parsing to XML parsing, much faster and efficient.

Version 0.0.2 2013-03-18
Fixes of the FAIL of first release.

Version 0.0.1 2013-03-18
The very first version of the plugin.
Soft-hyphenation of EPUB and AZW3.
Attached Files
File Type: zip calibre-hyphenate-this.v0.0.8.zip (32.2 KB, 2353 views)

Last edited by SauliusP.; 08-08-2014 at 03:14 AM.
SauliusP. is offline   Reply With Quote
Old 03-18-2013, 03:33 AM   #2
SauliusP.
Plugin Developer
SauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
SauliusP.'s Avatar
 
Posts: 97
Karma: 23854
Join Date: Feb 2012
Location: Lithuania
Device: Kindle
Additional files for illustration.
Attached Thumbnails
Click image for larger version

Name:	english-original.gif
Views:	10763
Size:	35.4 KB
ID:	103083   Click image for larger version

Name:	english-hyphenated.gif
Views:	10226
Size:	35.6 KB
ID:	103084   Click image for larger version

Name:	lithuanian-original.gif
Views:	10045
Size:	20.4 KB
ID:	103256   Click image for larger version

Name:	lithuanian-hyphenated.gif
Views:	10253
Size:	22.0 KB
ID:	103257   Click image for larger version

Name:	hyph-config.png
Views:	8823
Size:	45.2 KB
ID:	104088  

Last edited by SauliusP.; 04-09-2013 at 06:20 AM.
SauliusP. is offline   Reply With Quote
 
Enthusiast
Old 03-19-2013, 10:08 AM   #3
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 191
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, KPW
Trying v0.0.3 on some tough AZW3: it works like a charm!!!
Thank you very much for this excellent plugin!
pirl8 is offline   Reply With Quote
Old 03-19-2013, 10:14 AM   #4
SauliusP.
Plugin Developer
SauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
SauliusP.'s Avatar
 
Posts: 97
Karma: 23854
Join Date: Feb 2012
Location: Lithuania
Device: Kindle
Quote:
Originally Posted by pirl8 View Post
Thank you very much for this excellent plugin!
Thank you for testing and feedback too!
SauliusP. is offline   Reply With Quote
Old 03-19-2013, 10:27 AM   #5
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 191
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, KPW
Just as a report: the overall size of a book increases just sligthly. A 2.57Mb AZW3 book (with images and embedded fonts) is now 2.6Mb. This is obviously due to compression but there's no bloating.

Furthermore, the option to keep the ePub as is and to modify just the AZW3 for kindles is just awesome!
pirl8 is offline   Reply With Quote
Old 03-25-2013, 08:34 AM   #6
PoP
Fᵘᶻᶻʸ⅓⋚¹¹⫽₃₃⪓¹¹¹⫻₃₃₃ Mᵃᵗʰ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 493
Karma: 4504893
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3.₄, PRS-350, SGS3, Rπ, iPad Air
Thanks for sharing your plugin. Quick and easy to use. Provides a much enhanced reading experience.
PoP is offline   Reply With Quote
Old 03-25-2013, 08:40 AM   #7
veezh
plus ça change
veezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beauty
 
veezh's Avatar
 
Posts: 97
Karma: 32134
Join Date: Dec 2009
Location: France
Device: Kindle PW2
This is great. Thank you, SauliusP.
veezh is offline   Reply With Quote
Old 03-25-2013, 01:00 PM   #8
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
seems very good thing but is it possible to shortness name of button it take a long space on the toolbar

thanks in advance
Khan-Dam is offline   Reply With Quote
Old 03-25-2013, 01:49 PM   #9
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,785
Karma: 43933000
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
Maybe just Hyphenate the name?
PeterT is offline   Reply With Quote
Old 03-25-2013, 05:15 PM   #10
calvin
DRM remover
calvin began at the beginning.
 
calvin's Avatar
 
Posts: 84
Karma: 10
Join Date: Dec 2009
Location: North of Germany
Device: Kindle 3, 4 & Touch, iPhone/iPad, Hanvon N516 (OpenInkpot)
Many many thanks for this plugin. This was one reason for not upgrading my Touch to the latest version for maybe loosing the jbpatch hyphen function.... but now it is working on azw as well
So now it is possible to use custom fonts and hyphenation at the same time on kindle!!
calvin is offline   Reply With Quote
Old 03-25-2013, 05:53 PM   #11
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: 14,646
Karma: 5629001
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
dash-it
theducks is offline   Reply With Quote
Old 03-25-2013, 06:21 PM   #12
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 6,785
Karma: 43933000
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
Quote:
Originally Posted by theducks View Post
dash-it
+ 1
Nice
PeterT is offline   Reply With Quote
Old 03-26-2013, 02:55 AM   #13
SauliusP.
Plugin Developer
SauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane AustenSauliusP. has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
SauliusP.'s Avatar
 
Posts: 97
Karma: 23854
Join Date: Feb 2012
Location: Lithuania
Device: Kindle
I'm more than happy to get some positive reactions. Thank you all. And here's also version 0.0.4 with shortened text in toolbar. Sorry, as all programmers, I am lazy at testing. I have my text labels turned off in the toolbar. I prefer icons :-)
SauliusP. is offline   Reply With Quote
Old 03-26-2013, 12:13 PM   #14
veezh
plus ça change
veezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beautyveezh does all things with Zen-like beauty
 
veezh's Avatar
 
Posts: 97
Karma: 32134
Join Date: Dec 2009
Location: France
Device: Kindle PW2
@SauliusP.: Would you consider implementing a feature to ignore or remove soft hyphens if a break would result in fewer than, say, three letters to a line?

For example, in English, there's a style rule that says that publishers should not 'hy-
phenate' a word unless the division will leave at least three 'let-
ters' on both lines.

Thanks again for the plugin!
veezh is offline   Reply With Quote
Old 03-26-2013, 01:42 PM   #15
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 191
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, KPW
Quote:
Originally Posted by veezh View Post
Would you consider implementing a feature to ignore or remove soft hyphens if a break would result in fewer than, say, three letters to a line?
I'm afraid this is not possible.

The plugin inserts soft hyphens into the HTML code and it's impossible to know how long a line would be before rendering it on the display.

The feature you request should be implemented into the Kindle rendering engine. Actually this plugin exists because Kindle device don't implement hyphenation (yet).
pirl8 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
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 260 09-15-2014 04:41 PM
[GUI Plugin] SmartEject JimmXinu Plugins 27 09-08-2014 05:26 PM
[GUI Plugin] Open With kiwidude Plugins 228 07-31-2014 01:06 AM
[GUI Plugin] Wordpress frescogamba Plugins 8 05-20-2014 12:22 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 12:27 AM.


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