xxyzz / WordDumb

A calibre plugin that generates Kindle Word Wise and X-Ray files for KFX, AZW3, MOBI and EPUB eBook.
https://xxyzz.github.io/WordDumb/
GNU General Public License v3.0
376 stars 19 forks source link

Try to remove commas while string is too long #187

Closed Vuizur closed 7 months ago

Vuizur commented 7 months ago

Definitions that are too long are currently not displayed and have to be clicked on. This PR tries to make more definitions directly visible in the text by taking the definitions that are split by commas and removing what's right to the the rightmost comma.

I tested it a bit with my the current French ebook and found it to be a clear improvement. At least with English glosses the error rate seems to be pretty low, I couldn't find one yet, maybe with other language pairs it's more problematic.

(Of course I understand if you want to do it some other way.)

xxyzz commented 7 months ago

The short definition strings are created from the Proficiency repo : https://github.com/xxyzz/Proficiency/blob/7aa6f8ce270d662bf84eb6ebdb71f31ddb0f4116/src/proficiency/util.py#L19-L32

It's better to split commas at there.