Difference between revisions of "Crossdics"

From Apertium
Jump to navigation Jump to search
m
m (Links to "How to define a new cross schema")
Line 1: Line 1:
''(Main article: [[Building dictionaries|Building dictionaries]])''

== Download ==
== Download ==


Line 24: Line 26:
Please note that:
Please note that:
* all dictionaries must be in the form:
* all dictionaries must be in the form:
** apertium-xx-yy.xx-yy.dix (bilingual dictionaries)
** <code>apertium-xx-yy.xx-yy.dix</code> (bilingual dictionaries)
** apertium-xx-yy.xx.dix (morphological dictionaries)
** <code>apertium-xx-yy.xx.dix</code> (morphological dictionaries)
* the common language (B) must be in the left side, that is, dictionaries in the form B-A and B-C
* 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 apertium-bb-aa.bb-aa.dix)
* use "-r" instead of "-n" if the dictionary has to be [[Reverse a dictionary|reversed]] (apertium-aa-bb.aa-bb.dix to apertium-bb-aa.bb-aa.dix)




Line 34: Line 36:
./dictools cross '''monA.dix''' -n '''bilAB.dix''' -n '''bilBC-dix''' '''monC.dix'''
./dictools cross '''monA.dix''' -n '''bilAB.dix''' -n '''bilBC-dix''' '''monC.dix'''


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


<pre>
<pre>
./dictools cross dics/apertium-es-ca.ca.dix -n dics/apertium-es-ca.es-ca.dix -n dics/apertium-es-pt.es-pt.dix dics/apertium-es-pt.pt.dix
./dictools cross dics/apertium-es-ca.ca.dix -n dics/apertium-es-ca.es-ca.dix -n dics/apertium-es-pt.es-pt.dix dics/apertium-es-pt.pt.dix
</pre>
</pre>

== Customizing cross actions ==

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 [[List of language pairs|language pairs]] correctly. [[Cross Model|Defining a new cross schema]] with concrete pattern-action elements solves this problem.

== See also ==
* [[Cross Model|How to define a new cross schema]]
* [[List of language pairs|List of available language pairs]]
<!--
* [[Reverse a dictionary|How to reverse a bilingual dictionary]]
* [[Sort a dictionary|How to sort a dictionary]]
* [[Merge dictionaries|How to merge dictionaries]]
-->


[[Category:Documentation]]
[[Category:Documentation]]

Revision as of 14:52, 11 July 2007

(Main article: Building dictionaries)

Download

svn co https://apertium.svn.sourceforge.net/svnroot/apertium/crossdics crossdics

Compiling

$ cd crossdics
$ ant compile

Crossing dictionaries

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

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


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 apertium-bb-aa.bb-aa.dix)


Use the dictools script to cross the dictionaries:

./dictools cross monA.dix -n bilAB.dix -n bilBC-dix monC.dix

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

./dictools cross dics/apertium-es-ca.ca.dix -n dics/apertium-es-ca.es-ca.dix -n dics/apertium-es-pt.es-pt.dix dics/apertium-es-pt.pt.dix

Customizing cross actions

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.

See also