xsltproc
for converting from XDXF to DICT formatdictfmt
to compile the DICT source
You can install them on Ubuntu 18.04 with the following command:
$ sudo apt install xsltproc dictfmt
- Create or download a XDXF dictionary source file. If you want to create one yourself, look here for the specifications.
- 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
wheresource
is your dictionary file andoutput
is the name of the output (e.g. dictionary.txt). - Compile the new file to DICT format by launching:
dictfmt -c5 --break-headwords --headword-separator ';' --utf8 basename < dictfile
wherebasename
is the name of your dictionary (e.g. 'mydict') anddictfile
is the previously generated DICT source.
Now you can copy the result into your dictionary folder and use it in your application.
If you would like to sort your dictionary entries, there is also a stylesheet for that:
$ xsltproc xdxf-sort.xsl source > output
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