View Single Post
Old 02-02-2020, 12:10 PM   #275
Markismus
Guru
Markismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicing
 
Markismus's Avatar
 
Posts: 959
Karma: 149907
Join Date: Jul 2013
Location: Rotterdam
Device: HiSenseA5ProCC, Cracked OnyxNotePro, Note5, Kobo Glo, Aura
TLDR: The dictionary is not encrypted nor binary. Conversion will probably take a little programming, but not much. Maybe someone recognizes which dictionary format uses the described structure (sqlite3 database for index and zipped textfiles for meaning) and you can use that knowledge to use a converter.

I downloaded them and it appears that the dict-file is actually an archive file containing markup text in 120 files numbered c_1 to c_120. The idx-file is actually a sqlite3-database that can be browsed with any sqlite browser. (I used sqlitebrowser.)

In the database there are 4 tables. One table is called T_DictIndex and holds per row a Word, an Offset, a Size and the Chunk number:
Code:
F_Word	F_Offset	F_Size	F_ChunckNum
a	0		574	1
In chunk c_1, the first 564 characters are:
Code:
<b>A,</b> N.&nbsp;m. [<f>&a;</f>] ou [<f>&â;</f>] Voyelle et première lettre de l'alphabet. <i>Une panse d' <i>a </i>, </i>la première partie d'un petit <i>a </i> dans l'écriture. <f>&os;</f>&nbsp;<i>N'avoir pas fait une panse d' <i>a </i>, </i>c'est-à-dire n'avoir rien écrit. <f>&ns;</f>&nbsp;<i>Prouver par A + B, </i>avec précision et rigueur. <f>&ns;</f>&nbsp;<i>De A à Z, </i>du début à la fin. <f>&ns;</f>&nbsp;<i>A4, </i>format d'une feuille de papier de 21&nbsp; X &nbsp;29,7&nbsp;cm. <i>A3, </i>format 29,7&nbsp; X &nbsp;42&nbsp;cm. <f>&ns;</f>&nbsp;La.

Code:
F_Word	F_Offset	F_Size	F_ChunckNum
à	574		2523	1
In chunk c_1, the next 2444 chars are:
Code:
<b>À,</b> Prép. [<f>&a;</f>] (lat. <i>ad</i>, mouvement, direction, proximité, lat. <i>ab</i>, séparation, origine, et lat. <i>apud</i>, relation, accompagnement) <f>&os;</f>&nbsp;Marque direction, tendance&nbsp;: <i>aller à Rome &nbsp;; aimer à lire. </i>&nbsp;<f>&os;</f>&nbsp;S'emploie devant le régime indirect des verbes actifs&nbsp;: <i>donner de l'argent à un pauvre. </i>&nbsp;<f>&os;</f>&nbsp;Sert à déterminer le lieu où est quelque chose, où s'exécute une action&nbsp;: <i>résider à Paris &nbsp;; être à sa place. </i>&nbsp;<f>&os;</f>&nbsp;Sert à indiquer le temps, le moment, etc.&nbsp;: <i>à la fin du mois. </i>&nbsp;<f>&os;</f>&nbsp;Marque appartenance, possession&nbsp;: <i>rendez à César ce qui est à César &nbsp;; il a un style à lui. </i>&nbsp;<f>&os;</f>&nbsp;Avec un complément indique l'espèce&nbsp;: <i>vache à lait &nbsp;; </i>la qualité&nbsp;: <i>or à vingt-deux carats &nbsp;; </i>la forme ou la structure&nbsp;: <i>clou à crochet, table à tiroir &nbsp;; </i>la destination&nbsp;: <i>marché à la volaille &nbsp;; </i>la conformité, la convenance&nbsp;: <i>à mon avis &nbsp;; </i>l'instrument&nbsp;: <i>pêcher à la ligne &nbsp;; </i>la mesure, le poids, la quantité&nbsp;: <i>vendre à la livre, à la douzaine &nbsp;; </i>le prix, la valeur&nbsp;: <i>pain à vingt centimes la livre, dîner à trois francs &nbsp;; </i>l'intention&nbsp;: <i>à regret &nbsp;; </i>la cause&nbsp;: <i>se ruiner à jouer &nbsp;; </i>l'effet, le résultat&nbsp;: <i>blesser à mort. </i>&nbsp;<f>&os;</f>&nbsp;<i>À </i> précédé et suivi du même mot marque succession, gradation, ordre&nbsp;: <i>deux à deux &nbsp;; </i>jonction&nbsp;: <i>bout à bout &nbsp;; </i>opposition&nbsp;: <i>face à face. </i>&nbsp;<f>&os;</f>&nbsp;<i>À </i> se place après certains adjectifs pour en déterminer le sens&nbsp;: <i>fa cile à dire &nbsp;; prêt à combattre. </i>&nbsp;<f>&os;</f>&nbsp;<i>À </i> suivi d'un infinitif équivaut souvent au participe précédé de <i>en </i>&nbsp;: <i>à vrai dire. </i>&nbsp;<f>&os;</f>&nbsp;<i>À </i> devant un infinitif peut quelquefois s'expliquer par<i>de quoi </i>&nbsp;: <i>verser à boire. </i>&nbsp;<f>&os;</f>&nbsp;<i>À </i> indique ce qu'on doit faire&nbsp;: <i>c'est un avis à suivre &nbsp;; </i>ce qui doit être la suite d'un événement&nbsp;: <i>c'est une affaire à vous perdre. </i>&nbsp;<f>&os;</f>&nbsp;<i>À </i> s'emploie dans certaines phrases elliptiques&nbsp;: <i>à moi &nbsp;! au feu &nbsp;! à ta santé &nbsp;! </i>
So the way the index count is not characters, but probably bytes. There are a lot of &nbsp; and &os; that only code for one symbol and there are a lot of accented characters that have higher unicodes, so are coded by more than 1 byte.

All in all, it's close enough to see the pattern: The index words are surrounded by <b> bold start and </b> stop tags. However, the description also holds start and stop tags.

So if you
(1) take the index words from the table and
(2) search for the text between two following index words and
(3)put the first index word and found text separated by a delimiter such as a comma on a line and
(4) repeat that for all 69389 entries,
than you have reconstructed your dictionary in Stardict csv-format, which can be converted to pocketbook format.

You could also use the found terms and place them directly in a xdxf-format. From xdxf-format you can use pocketbooks converter.exe to convert it to pocketbook's dic-format.

Last edited by Markismus; 02-02-2020 at 01:08 PM.
Markismus is offline   Reply With Quote