Prerequisites for using the plugin

To use the plugin, firstly you need to have the dictionary files which contain the words (index) and their description - dict.index and dict.desc, respectively - on /.rockbox/rocks/apps/ folder.

The dictionary files can be created by yourself (see "Creating a dictionary file" section, below), or you can get them crafted from the web (see "Sources for dictionary files" section).

Using the plugin

Now that you already have the two necessary files in place, you can launch the dict plugin (under Applications on the Browse plugins menu). The first thing you will see is the text input screen.

Type part of a word (or the whole word) or anything the dict files have a definition to and accept the text input. The plugin will search for matching entries on the dict.index file and display according description/meaning contained in the dict.desc file.

If no matches are found on the dictionary, a Not found. message will be displayed and the plugin will exit. You can do another search by relaunching the plugin.

The rockbox dictionary format

The input format for rdf2binary is very simple at this moment. It's one line per word, starting with the word, then a tab and then the description. The only thing you should be aware of when creating this files is that they must be in alphabetical order, and all words should be in lowercase.

The binary format

The binary format used for the index is pretty simple, the struct is like this one:

struct {
char word[WORDLEN];
long offset;
};

WORDLEN is a define in the rdf2binary tool, and the plugin. And the offset is an offset in dict.desc where the description is stored.

The improved binary format

This is still an idea under construction, but the new format would be just 1 file containing:

When searching for a word with hash X, the plugin looks up the offset for X and X+1 in the offset table. It reads the data between those offsets on looks for the word, we were searching for. It's just a hash table with chaining.