View Single Post
Old 11-07-2012, 04:40 PM   #39
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
Ok, here is the recipe for creating your own dictionary.

1) Create a working directory, say /tmp/mydict/

2) In /tmp/mydict/, create as many XX.html files are needed, where XX are the first two letters of each word being defined in XX.html. Use 11.html for all non-starting-with-a-letter-words. The syntax for each such .html file is as follows:

Code:
<?xml version="1.0" encoding="utf-8"?>
<html>
<w>
<p><a name="WORD"/>DEFINITION OF WORD, you <b>can</b> use HTML tags. </p>
</w>
</html>
with as many <w> elements as needed. You can also use variants, see one of the original files for that.

3) gzip all these .html files individually, removing the ".gz" extension after compressing them

4) build a text file with one word per line, say "index.txt", and create the index with:

Code:
$ ./marisa-build index.txt > words
5) compress the whole thing with:

Code:
$ zip ../dicthtml-LL.zip *html words
where LL is the dictionary language (LL="en" or "it" or "fr" ecc.)

6) copy the resulting zip file to .kobo/dict/ and you are done!

(You might want to change the dictionary to another one and then back to the newly created, so that the index "words" is reloaded.)

Last edited by AlPe; 11-07-2012 at 04:42 PM.
AlPe is offline   Reply With Quote