Aard Dictionary container format is a binary file format that combines dictionary metadata, lookup index and compressed article data.
Aard files have the following layout: header, metadata, index 1, index 2, articles
Aard files start with a fixed size header described by the following specification:
HEADER_SPEC = (('signature', '>4s'),
('sha1sum', '>40s'),
('version', '>H'),
('uuid', '>16s'),
('volume', '>H'),
('of', '>H'),
('meta_length', '>L'),
('index_count', '>L'),
('article_offset', '>L'),
('index1_item_format', '>4s'),
('key_length_format', '>2s'),
('article_length_format', '>2s'),
)
Metadata is a dictionary stored as a JSON-encoded string. Aard Dictionary viewer uses the following metadata keys:
Index 1 is a sequence of fixed-size items containing two values: pointer to Index 2 item and pointer to article item.
Index 2 is a sequence of variable-length items containing two values: length of dictionary key text and key text itself.
Articles is a sequence of variable length items containing two values: length of article text and article text itself.
See also
From container format perspective article is just a string that is stored either as is or compressed with gzip or bz2 whichever takes less space. Thus articles in Aard files may be in any format that can be represented as string, for example plain text or HTML.
Aard Dictionary 0.7.x can only display JSON-encoded articles (aar-JSON). Aard Dictionary 0.8.0 supports both aar-JSON and aar-HTML. Aard Dictionary 0.9.0 and Aard Dictionary for Android support only aar-HTML.