obsolete/HACKING.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Thu, 15 Sep 2016 20:13:18 +0300
changeset 558 53fd793e345d
parent 337 33b08a8b7fb1
permissions -rw-r--r--
Add shortcut to deploy to HG repos.

.. -*- coding: utf-8 -*-

=======================
 gadict HACKING guide.
=======================
.. contents::
   :local:

Dictionary source file format.
==============================

For source file format used dictd C5 file format. See::

  $ man 1 dictfmt

Shortly:

 * Headwords was preceded by 5 or more underscore characters ``_`` and a blank
   line.
 * All text until the next headword is considered the definition.
 * Any leading ``@`` characters are stripped out, but the file is otherwise
   unchanged.

For convenience also used such assumptions:

 * Headwords was separated by ``;<SPACE>`` (and all was placed on single line).
 * UTF-8 encoding was used.
 * Lines started with ``#`` striped out (comment syntax).
 * First line with ``ABOUT:`` used as description of dictionary.
 * First URL (line with ``http://``) used as dictionary home page.

Comment syntax convention.
==========================

As 'dictd -c5' format does not support comment syntax we filter out all lines
that start with '#'.

Dictionary file name convention.
================================

BNF form::

  FILE ::= PREFIX "-" NAME "-" LANG ".dict-c5"
  PREFIX ::= "gadict"
  LANG ::= ISOCODE | ISOCODE "-" ISOCODE

where ``ISOCODE`` is ISO 639-1 language (2 letter) code, currently ``en``,
``ru``, ``uk`` in use, ``NAME`` is dictionary abbreviated name.