From Apertium
Revision as of 13:29, 6 October 2017 by Jimregan (talk | contribs) (B-A, not A-B)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

En français

Main article: Building dictionaries

Crossdics (part of apertium-dixtools) is a program that can be used to "cross" language pairs. That is, given language pairs aa-bb and bb-cc it will create a new language pair for aa-cc.


See apertium-dixtools.

Using apertium-crossdics[edit]

$ apertium-dixtools cross

Crossing dictionaries[edit]

Using a Linguistic Resources Document[edit]

You can define a Linguistic Resources Document (LRD) and use it to indicate which dictionaries will be used for crossing:

$ apertium-dixtools cross -f my-linguistic-resources.xml sl-tl

Therefore, only 2 parameters are needed:

  • my-linguistic-resources.xml: a document specifying a set of linguistic resources (dictionaries, cross models, corpora, other LRD files, etc).
  • sl-tl: source language (sl) and target language (tl).

Without a Linguistic Resources Document[edit]

First of all, copy linguistic data into folder "dics"

  • Bilingual dictionary B-A:
  • Bilingual dictionary B-C:
  • Morphological dictionary A: apertium-bb-aa.aa.dix
  • Morphological dictionary C:

Please note that:

  • all dictionaries must be in the form:
    • apertium-xx-yy.xx-yy.dix (bilingual dictionaries)
    • apertium-xx-yy.xx.dix (morphological dictionaries)
  • the common language (B) must be in the left side, that is, dictionaries in the form B-A and B-C
  • use "-r" instead of "-n" if the dictionary has to be reversed (apertium-aa-bb.aa-bb.dix to

Use the apertium-dixtools script to cross the dictionaries:

$ apertium-dixtools cross-param monA.dix -n bilBA.dix -n bilBC-dix monC.dix

An example crossing es-ca and es-pt to get the ca-pt pair.

$ apertium-dixtools cross-param dics/ -n dics/ -n dics/ dics/
I was not able to do this without appending /usr/local/apertium-dixtools/schemas/cross-model.xml to the end of the command. --unhammer (talk) 21:19, 14 April 2015 (CEST)

Customising cross actions[edit]

By default, the crossdics tool uses a simple cross model defining very simple rules for crossing two sets of dictionaries. However, more specific cross actions might be needed in order to cross certain language pairs correctly. Defining a new cross schema with concrete pattern-action elements solves this problem.


NullPointerException in crossing sections
[9] Crossing sections 'main' and 'main'

Exception in thread "main" java.lang.NullPointerException
        at dictools.cross.DicCross.crossSections(
        at dictools.cross.DicCross.crossDictionaries(

If you get this error, try and remove unused sections from the bilingual dictionaries until you have only the 'main' sections left.

Comparison method violates its general contract!
Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!
        at java.util.TimSort.mergeHi(
        at java.util.TimSort.mergeAt(
        at java.util.TimSort.mergeForceCollapse(
        at java.util.TimSort.sort(
        at java.util.TimSort.sort(
        at java.util.Arrays.sort(
        at java.util.Collections.sort(
        at dictools.cross.DicCross.crossDictionaries(
        at dictools.cross.DicCross.actionCross(
        at dictools.cross.DicCross.doCross(
        at dictools.ProcessDics.process_cross_param(
        at dictools.ProcessDics.processArguments(
        at dictools.ProcessDics.main(
        at ProcessDics.main(

This means your java is too fresh. Get an older java (1.6 seems to work).

See also[edit]