pgaskin / dictutil

Tools, documentation, and libraries related to Kobo dictionaries.
https://pgaskin.net/dictutil
MIT License
55 stars 4 forks source link

Custom dict not compatible with "my words"? #17

Open BoboTiG opened 3 years ago

BoboTiG commented 3 years ago

Hello,

Using the latest available firmware for Kobo Libra H2O (4.26.16704), I put a dictionary in custom-dict/dicthtml-fr-fr.zip. Then I select a word from a book and add it to "my words". Later, I go to Activities > My words and select the same word.

Result: the definition is not displayed.

A possible workaround is to move back the dictionary to dict/dicthtml-fr.zip. But this is not something I can say to all users, sadly.

Here is the downstream issue with slightly more details and screenshot: https://github.com/BoboTiG/ebook-reader-dict/issues/999. Does it rings a bell or am I at the wrong place to discuss about that issue?

Thanks a lot for your work anyway, that's awesome :muscle:

pgaskin commented 2 years ago

Since you're not looking for a patch, I think this belongs in the dictutil repo (that's where I'm doing most of the dictionary research). I suspect this is an oversight/choice made by nickel. I'll take a look at the firmware when I have a chance, but for now, can you enable dictionary logging in devtools and see if there's anything relevant in the syslog?

Thovi98 commented 2 years ago

I noticed that when I save (with the custom dictionary) a word which is in the official one, when I go to Activities > My Words, it works normally, but with the definition from the official dictionary.

I’ve tried to make logs, but I don’t understand how to read them... It’s all in Chinese or so. For example, I found this file log-2021.07.25-23.02.54.txt in .kobo/ (I’ve only added the .txt extension so that Github could upload it. Initially it hasn’t any extension.)

pgaskin commented 2 years ago

I noticed that when I save (with the custom dictionary) a word which is in the official one, when I go to Activities > My Words, it works normally, but with the definition from the official dictionary.

I think my initial guess is correct, then. Does it work if you remove the official dictionary?

It’s all in Chinese or so.

Kobo started encrypting the logs a few versions back. You need to either enable dev mode and get the logs with logread over telnet, or you need to use NickelMenu to dump the logs to the internal storage.

Thovi98 commented 2 years ago

I think my initial guess is correct, then. Does it work if you remove the official dictionary?

No, it showes a blank page when I remove the official dictionary. But when I replace the official dictionary by the new one, it works.

Kobo started encrypting the logs a few versions back. You need to either enable dev mode and get the logs with logread over telnet, or you need to use NickelMenu to dump the logs to the internal storage.

Okay I will try, thanks !

Thovi98 commented 2 years ago

I think I’ve found what you asked. I’ve tried with multiple words and then I dumped syslog with NickelMenu.

Jul 26 10:21:21 nickel: (  1274.944 @ 0x1997208 / packetdump.warning) "https://ssl.google-analytics.com/collect?v=1&tid=UA-6177406-38&cid=a4120d1b-b84f-4f5f-a80a-65861ec1e245&uid=6bb14660-0d5a-42f1-a888-893177680b0a&av=4.26.16704&an=nickel&sr=1264x1680&ul=fr-fr&cd73=More&t=event&ec=TabNavigation&ea=Type&el=Home" => "Operation canceled" 
Jul 26 10:21:23 nickel: (  1277.319 @ 0x195af78 / ui.warning) static QByteArray Unzipper::extractFile(const QString&, const QString&) "/mnt/onboard/.kobo/dict/dicthtml-fr.zip" file not found "prefix_exceptions" 
Jul 26 10:21:23 nickel: (  1277.331 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("colline", "COLLINE", "Colline")  for word:  "colline" 
Jul 26 10:21:23 nickel: (  1277.332 @ 0x195af78 / dictionary.debug)  word:  "colline" 
Jul 26 10:21:23 nickel: (  1277.386 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("colline", "COLLINE", "Colline")  for word:  "colline" 
Jul 26 10:21:25 nickel: (  1279.092 @ 0x195af78 / performance.warning) static void QObjectUtil::repolishChildren(QWidget*, Qt::FindChildOptions, int) "statusbarContainer" repolish took 16 
Jul 26 10:21:27 nickel: (  1280.530 @ 0x195af78 / ui.warning) static QByteArray Unzipper::extractFile(const QString&, const QString&) "/mnt/onboard/.kobo/dict/dicthtml-fr.zip" file not found "prefix_exceptions" 
Jul 26 10:21:27 nickel: (  1280.543 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("damer le pion", "DAMER LE PION", "Damer le pion", "Damer Le pion", "Damer Le Pion", "damerlepion")  for word:  "damer le pion" 
Jul 26 10:21:27 nickel: (  1280.546 @ 0x195af78 / dictionary.debug)  word:  "" 
Jul 26 10:21:29 nickel: (  1283.032 @ 0x195af78 / ui.warning) static QByteArray Unzipper::extractFile(const QString&, const QString&) "/mnt/onboard/.kobo/dict/dicthtml-fr.zip" file not found "prefix_exceptions" 
Jul 26 10:21:29 nickel: (  1283.043 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("parapet", "PARAPET", "Parapet")  for word:  "parapet" 
Jul 26 10:21:29 nickel: (  1283.044 @ 0x195af78 / dictionary.debug)  word:  "parapet" 
Jul 26 10:21:29 nickel: (  1283.081 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("parapet", "PARAPET", "Parapet")  for word:  "parapet" 
Jul 26 10:21:33 nickel: (  1287.142 @ 0x195af78 / ui.warning) static QByteArray Unzipper::extractFile(const QString&, const QString&) "/mnt/onboard/.kobo/dict/dicthtml-fr.zip" file not found "prefix_exceptions" 
Jul 26 10:21:33 nickel: (  1287.154 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("encolure", "ENCOLURE", "Encolure")  for word:  "encolure" 
Jul 26 10:21:33 nickel: (  1287.155 @ 0x195af78 / dictionary.debug)  word:  "encolure" 
Jul 26 10:21:33 nickel: (  1287.192 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("encolure", "ENCOLURE", "Encolure")  for word:  "encolure" 
Jul 26 10:21:39 nickel: (  1292.833 @ 0x195af78 / ui.warning) static QByteArray Unzipper::extractFile(const QString&, const QString&) "/mnt/onboard/.kobo/dict/dicthtml-fr.zip" file not found "prefix_exceptions" 
Jul 26 10:21:39 nickel: (  1292.846 @ 0x195af78 / dictionary.debug) got alternative search terms:  ("miroitaient", "MIROITAIENT", "Miroitaient")  for word:  "miroitaient" 
Jul 26 10:21:39 nickel: (  1292.848 @ 0x195af78 / dictionary.debug)  word:  "" 
pgaskin commented 2 years ago

Ok, so I guess this is an oversight or decision of the firmware. It might be possible to patch this, but I don't have time to look into that for at least the next few weeks.

Thovi98 commented 2 years ago

Okay thank you already for your time. In case your look at it, don’t hesitate to ping me if you need some more info.

pgaskin commented 2 years ago

What happens if you rename the dictionary to one which doesn't overlap with the built-in ones and only has one dash (i.e. dicthtml-thing.zip, not dicthtml-thing-thing.zip)?

Thovi98 commented 2 years ago

Kobo still looks for the definition of the official French dictionary... I’ve also tried to save a word with the official English-French dictionary, but the saved word is handled by the official French dictionary too...