BoboTiG / ebook-reader-dict

Finally decent dictionaries based on the Wiktionary for your beloved eBook reader. Daily updates & 13 languages supported so far.
http://www.tiger-222.fr/?d=2020/04/17/22/14/21-un-dictionnaire-alternatif-et-complet-pour-votre-liseuse
MIT License
408 stars 24 forks source link

Change the dictionary source #33

Closed BoboTiG closed 4 years ago

BoboTiG commented 4 years ago

I did not find out how to change the dictionary name: kobo-libra-dicthtml-fr-name

Le Robert Micro © 2013 Dictionnaires Le Robert

What I tried so far:

If someone has more ideas to try, I would lve to give a try.

Note: there is the encrypted file BookReader.sqlite that I could not check as it is password protected.

BoboTiG commented 4 years ago

OK this is not good for us, it seems hardcoded in the Kobo:

$ strings usr/local/Kobo/libnickel.so.1.0.0 | grep " Robert"   
Le Robert Micro 
 2013 Dictionnaires Le Robert
"Why should I avenge Edward Stark? The man was nothing to me. Oh, Robert loved him, to be sure. Loved...
BoboTiG commented 4 years ago

More interesting strings:

void DictionaryFileManager::deleteDictionary(Dictionary&, const Device&)
void DictionaryFileManager::createDictionaryEmptyFile(Dictionary&, const Device&)
.zip
%1/dicthtml%2
/dicthtml
/mnt/onboard/.kobo/dict/dicthtml%1
-%1-%2
xxdjs
en-fr
fr-en
en-de
de-en
en-es
es-en
en-it
it-en
Source: Merriam-Webster's %1 Dictionary
en-nl
Van Dale Pocketwoordenboek Engels-Nederlands<br/>
 2015 Van Dale Uitgevers
Quelle: Duden - Das Bedeutungsw
rterbuch und Das Fremdw
rterbuch<br/>Gro
rterbuch Deutsch als Fremdsprache
 Langenschiedt 2015
Van Dale Pocketwoordenboek Nederlands<br/>
 2011 Van Dale Uitgevers
Le Robert Micro 
 2013 Dictionnaires Le Robert
il Devoto-Oli - Vocabolario della lingua italiana<br/>Copyright 
 2012 Mondadori Education S.p.A., in licenza a Oxford University Press. Tutti i diritti riservati.
en-tr
Copyright 
 2012 by Oxford University Press<br/>All rights reserved.
-en-ja
-en-ja-pgs
dicthtml*
/export/jenkins/n/Nickel/src/io/dict/DictionaryFileManager.cpp
Operation cancelled before
Failed to create empty dictionary file
-de-en
-en-de
-en-es
-en-fr
-en-it
-en-pt
-es-en
-fr-en
-it-en
-pt-en
-jaxxdjs
-en-nl
-en-tr
N6marisa9ExceptionE
bool parseTrie(const QString&)
static QString DictionaryParser::searchForJapaneseWordExactMatch(const QString&, const QString&)
QStringList searchTermAlternatives(const QString&)
static QString DictionaryParser::htmlForWord(const QString&)
static QStringList DictionaryParser::wordsFromLetters(const QString&)
static QString DictionaryParser::queryHtmlDefinitionForJapanese(const QString&)
any16byteswilldo
JFIF
<a name=".*" />
(<a name="
([%1-%2]?)
/default.css
Hey, your keyboard sucks -- swallowing event
words
/words
/export/jenkins/n/Nickel/src/io/dict/DictionaryParser.cpp
> DictionaryParser: No trie file found at : 
. Dictionary will not work!
en-ja
%1-%2
(<a name="%1" />.*</w>)
SearchForJapaneseWordInHtml: => index: 
Regex: 
(<a name="%1.*" />.*</w>)
got alternative search terms: 
 for word: 
<variant name="%1"
</w>
(<a name="%1".*</w>)
search words from letters: 
 HtmlForJapanese: 
 (originally: 
) => prefix: 
HtmlForJapanese: 
 => In file: 
epub://

And

DictionaryProvider
DictionaryAutoCompleteProvider
DictionaryViewFooter
_ZN21DictionaryFileManager16dictionarySourceERK7QString
_Z9dictTracev
_ZN16DictionaryParser13additionalCssEv
_ZN18DictionaryProvider16dictionarySourceEv
_ZN14DictionaryView20dictionarySourceTextEv
_ZTV20DictionaryViewFooter
_ZN20DictionaryViewFooter16staticMetaObjectE
BoboTiG commented 4 years ago

https://github.com/geek1011/kobo-mods may be an immensely good resource. An idea would be to make usage of LD_PRELOAD to catch arguments. But my skills are a little rusty :)

What would be useful is to check if strings like "Le Robert Micro" are fallback values: maybe another thing is checked first and if not found, then use that string. Who knows?

BoboTiG commented 4 years ago

Another idea, when seeing _ZN16DictionaryParser13additionalCssEv, would be to check what is the additionnal CSS? Is it a file included from the dictionary? If so, we could guess (very unlikely but ... ) the current HTML layout and set a CSS rule to hide the current dict name and add ours.

BoboTiG commented 4 years ago

OK, the 2nd idea has an answer: https://github.com/geek1011/dictutil/issues/5 This looks awesome, let's try it!

BoboTiG commented 4 years ago

This is the new source :) screen_004