Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.59 KB

README.md

File metadata and controls

37 lines (28 loc) · 1.59 KB

Experimental resources for converting from XDXF to DICT format

Requirements

  • xsltproc for converting from XDXF to DICT format
  • dictfmt to compile the DICT source

You can install them on Ubuntu 18.04 with the following command:

$ sudo apt install xsltproc dictfmt

How to

Convert XDXF -> DICT

  1. Create or download a XDXF dictionary source file. If you want to create one yourself, look here for the specifications.
  2. Download the XSL stylesheet xdxf-2-dictc5.xsl. This one contains the information to transform the XDXF source into a DICT source file.
    Compile with:
    $ xsltproc xdxf-2-dictc5.xsl source > output
    where source is your dictionary file and output is the name of the output (e.g. dictionary.txt).
  3. Compile the new file to DICT format by launching:
    dictfmt -c5 --break-headwords --headword-separator ';' --utf8 basename < dictfile
    where basename is the name of your dictionary (e.g. 'mydict') and dictfile is the previously generated DICT source.

Now you can copy the result into your dictionary folder and use it in your application.

Sort XDXF entries

If you would like to sort your dictionary entries, there is also a stylesheet for that:
$ xsltproc xdxf-sort.xsl source > output

Find out number of entries

To analyze a XDXF dictionary and find out how may entries (<ar>) are in there, use the following command:

$ cat dictionary.xdxf | awk '{n += gsub(/\<ar\>/, "")} END {print n " entries"}'
$ 81 entries