06-21-2020, 05:50 AM | #16 | |
Enthusiast
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
|
Hi jhowell!
So it's taken me a while, but I have finally edited my Catalan dictionary. I'm still in the middle of testing, and there are a few things I need to clean up and/or automate, but I was able to dump my `content.opf` file into KindlePreviewer and a dictionary was produced. It looks alright and I'd like to test to see if it does act like a look-up dictionary in my Kindle Paperwhite. But I have a few questions/problems first. I used KindlePreviewer because from what I read it was going to be the quickest way: just open the `content.opf` and wait 30 minutes. But here's my first issue: KindlePreviewer will not let me "export" the ebook it produced. Any workaround? I'm on MacOS, is the ebook somewhere in a hidden directory? This is what KindlePreviewer says about exporting: Quote:
Note that every Catalan ebook I throw at KindlePreviewer lists the language as English, so it seems that KindlePreviewer has limited support for languages. Perhaps I need to use KindleGen instead? I'm curious to see if I can get my Kindle to pop-up some definition. If only I could find the book that KindlePreviewer made and is hiding from me! On another note, I'm pretty sure my effort will need to be refined, as I haven't done anything about `<idx:infl>` for instance (each entry is empty right now). My code is on Github, but I'm a little embarrased to show it right now. I have mostly used Python/BeautifulSoup. I have some undesired white spaces caused by my editing and the `xhtml` code is not indented properly, but I checked an online tool that did not detect problems in the `xml` structure. |
|
06-21-2020, 07:46 AM | #17 | |||
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
/Applications/Kindle Previewer 3.app/Contents/MacOS/lib/kindlegen/fc/bin/kindlegen Quote:
Quote:
Spoiler:
and Catalan language codes to the books that you tested them with? Spoiler:
Last edited by Doitsu; 06-21-2020 at 07:50 AM. |
|||
06-21-2020, 09:27 AM | #18 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
|
Wow thanks for replying so fast! Looks like I have omitted a thing or two. Will fix it and attempt to recompile again in a couple of days.
One issue I had noticed before but forgotten about is that calibre encodes Catalan as "cat" rather than "ca". So the metadata of all my Catalan books have <dc:language>cat</dc:language> instead of: <dc:language>ca</dc:language> As far as I remember the official code is ca. Will try to change that and see if it helps. EDIT: The language metadata is 'ca' in the epub, but 'cat' in the azw converted by calibre. Looks like a bug... no? How can I edit the metadata and make it stick? Right now when I click on "edit book" and edit the metadata, the edits do not get saved. I tried to "save a copy" of the book from within the "edit book" window, but again the edit was not saved... Thanks again! Last edited by annoporci; 06-21-2020 at 09:43 AM. |
07-12-2020, 06:16 AM | #19 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
|
I eventually managed to produce a dictionary that works as a look-up!
The file is quite large at about 70MB. I wonder if there's anything I could do to reduce its size. Any suggestions? Is there an open source mono-lingual look-up dictionary in html/xhtml format that I could look at? My only source so far is Amazon's Create a Dictionary page. Thanks! It turns out that "ca" and "cat" are both valid codes for "Catalan". One is an ISO 639-2 code the other is an ISO 639-3 code. Not sure what exactly was going wrong in my earlier attempts. I still need to properly code "inflections" and clean a few things up, but that may have to wait the upcoming second covid lockdown. Last edited by annoporci; 07-12-2020 at 06:20 AM. |
07-12-2020, 07:55 AM | #20 | |||
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Quote:
Also, many of the older Mobipocket .prc dictionaries contain inflections. (The dictionary format hasn't changed that much.) Quote:
Google Open Source Catalan POS (part-of-speech) taggers. There might be one whose data files you could reformat and use to add inflections. |
|||
07-12-2020, 05:43 PM | #21 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
|
Thank you so much Doitsu! I'll get back to this thread once I've managed to fix the size and I'll also try to set styles that make the definitions more compact, because right now, on my Kindle Paperwhite, the pop-up definition covers a little less than half the screen, which forces me to scroll to read the definition. I'll have the code on github.
|
09-10-2020, 01:49 AM | #22 |
Enthusiast
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
|
This is embarrassing: I haven't been able to go back and polish my code since last July. And it looks like I may not be able to for quite a while. So never mind, here is my unfinished code, together with a sample of the dictionary. I only tested a few words with it. I'll get back to it if I get a lull in my real life. In the meantime, anyone is free to borrow/read the code and/or sample dictionary (it is inside the 'output' directory):
https://github.com/ptoche/GDLC |
Tags |
dictionary, dictionary language, edit book, kindle |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Make Dictionary layout look Pretty | lotteryticket | KOReader | 2 | 12-01-2019 03:45 AM |
How to make Kindle *not* recognize dictionary | benjavi | Amazon Kindle | 1 | 07-17-2017 12:18 AM |
Is it possible to make 2 languages dictionary in the same file | animal1234 | Kindle Formats | 2 | 09-01-2016 10:28 PM |
Can anyone make a new dictionary for prs? | zcqsimon | Sony Reader | 0 | 10-23-2010 09:54 AM |