Difference between revisions of "Crossdics Example"
m (SVN -> Github links) |
|||
(23 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
[[Exemple d'utilisation de Crossdics|En français]] |
|||
{{TOCD}} |
{{TOCD}} |
||
Getting '''English-Galician'''<ref>[http://xixona.dlsi.ua.es/~ebenimeli/files/crossdics/cross-test-en-es-gl.tar.gz Download this full example for English-Galician]</ref> (A-C) language pair '''from English-Spanish'''<ref>[http://apertium.svn.sourceforge.net/viewvc/apertium/trunk/apertium-en-es/ Browse apertium-en-es files on sourceforge.net]</ref> (A-B) '''and Spanish-Galician'''<ref>[http://sourceforge.net/project/showfiles.php?group_id=143781&package_id=170010 Download apertium-es-gl files on sourceforge.net]</ref> (B-C). |
|||
== Obtaining apertium-crossdics == |
== Obtaining apertium-crossdics == |
||
Line 5: | Line 9: | ||
=== Download === |
=== Download === |
||
<pre> |
<pre> |
||
$ |
$ git clone https://github.com/apertium/apertium-dixtools |
||
</pre> |
</pre> |
||
Line 20: | Line 24: | ||
== What you need == |
== What you need == |
||
=== Dictionaries === |
|||
To get an '''English-Galician (A-C)''' language pair from '''English-Spanish (A-B)''' and '''Spanish-Galician (B-C)''', you need at least this linguistic data: |
|||
To get an '''English-Galician (A-C)''' language pair from '''English-Spanish (A-B)''' and '''Spanish-Galician (B-C)''', you need the following dictionaries: |
|||
* '''Morphological A''': apertium-en-es.en. |
* '''Morphological A''': apertium-en-es.en.metadix |
||
* '''Morphological C''': apertium-es-gl.gl.dix |
* '''Morphological C''': apertium-es-gl.gl.dix |
||
* '''Bilingual AB''': apertium-en-es.en-es.dix |
* '''Bilingual AB''': apertium-en-es.en-es.dix |
||
* '''Bilingual BC''': apertium-es-gl.es-gl.dix |
* '''Bilingual BC''': apertium-es-gl.es-gl.dix |
||
* '''Cross Model ABC''': cross-model-en-es-gl.dix |
|||
All this data must be specified in a Linguistic Resources Document. |
|||
=== Linguistic Resources Document === |
|||
Example of '''en-es-gl-ling-resources.xml''' document: |
|||
<pre> |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- Linguistic resources--> |
|||
<ling-resources> |
|||
<name>My linguistic resources</name> |
|||
<description>My linguistics resources: morphological and bilingual dictionaries, cross models, corpora, etc.</description> |
|||
<resource-set> |
|||
<name>My linguistic resources to get English-Galician language pair.</name> |
|||
<description>Morphological and bilingual dictionaries.</description> |
|||
<!-- cross model en-es-gl --> |
|||
<resource> |
|||
<property name="name" value="cross-model-en-es-gl"/> |
|||
<property name="type" value="cross-model"/> |
|||
<property name="sl" value="en"/> |
|||
<property name="tl" value="gl"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="cross-model-en-es-gl.xml"/> |
|||
<property name="version" value="stable"/> |
|||
</resource> |
|||
<!-- cross model gl-es-en --> |
|||
<resource> |
|||
<property name="name" value="cross-model-gl-es-en"/> |
|||
<property name="type" value="cross-model"/> |
|||
<property name="sl" value="gl"/> |
|||
<property name="tl" value="en"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<!-- note that we use the same cross model file --> |
|||
<property name="src" value="cross-model-en-es-gl.xml"/> |
|||
<property name="version" value="stable"/> |
|||
</resource> |
|||
<!-- 'en' morphological dictionary --> |
|||
<resource> |
|||
<property name="name" value="apertium-en"/> |
|||
<property name="type" value="mon"/> |
|||
<property name="sl" value="en"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-en-ca.en.metadix"/> |
|||
<property name="version" value="stable"/> |
|||
</resource> |
|||
<!-- 'gl' morphological dictionary --> |
|||
<resource> |
|||
<property name="name" value="apertium-gl"/> |
|||
<property name="type" value="mon"/> |
|||
<property name="sl" value="gl"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-es-gl.gl.dix"/> |
|||
<property name="version" value="stable"/> |
|||
</resource> |
|||
<!-- 'en-es' bilingual dictionary --> |
|||
<resource> |
|||
<property name="name" value="apertium-es-ca"/> |
|||
<property name="type" value="bil"/> |
|||
<property name="sl" value="en"/> |
|||
<property name="tl" value="es"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-en-es.en-es.dix"/> |
|||
<property name="version" value="stable"/> |
|||
</resource> |
|||
<!-- 'es-gl' bilingual dictionary --> |
|||
<resource> |
|||
<property name="name" value="apertium-es-gl"/> |
|||
<property name="type" value="bil"/> |
|||
<property name="sl" value="es"/> |
|||
<property name="tl" value="gl"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-es-gl.es-gl.dix"/> |
|||
<property name="version" value="stable"/> |
|||
</resource> |
|||
</resource-set> |
|||
</ling-resources> |
|||
</pre> |
|||
Read more about [[Linguistic Resources Document|How to create a Linguistic Resources Document]] |
|||
=== Cross Model Document === |
=== Cross Model Document === |
||
You will also need a: |
|||
* '''Cross Model ABC''': cross-model-en-es-gl.dix |
|||
A cross model document must contain at least a default pattern-action. Here you have a very simple example of '''cross-model-en-es-gl.xml''' document. |
A cross model document must contain at least a default pattern-action. Here you have a very simple example of '''cross-model-en-es-gl.xml''' document. |
||
Line 155: | Line 71: | ||
Read more in [[Cross Model|How to create a Cross Model Document]]. |
Read more in [[Cross Model|How to create a Cross Model Document]]. |
||
=== Linguistic Resources Document === |
|||
Finally, a document with references to the linguistic resources needed. |
|||
Example of '''en-es-gl-ling-resources.xml''' document: |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- Linguistic resources--> |
|||
<ling-resources> |
|||
<name>My linguistic resources</name> |
|||
<description>My linguistics resources: morphological and bilingual dictionaries, cross models, corpora, etc.</description> |
|||
<resource-set> |
|||
<name>My linguistic resources to get English-Galician language pair.</name> |
|||
<description>Morphological and bilingual dictionaries.</description> |
|||
<!-- '''cross model en-es-gl''' --> |
|||
<resource> |
|||
<property name="name" value="cross-model-en-es-gl"/> |
|||
<property name="type" value="cross-model"/> |
|||
<property name="sl" value="en"/> |
|||
<property name="tl" value="gl"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="cross-model-en-es-gl.xml"/> |
|||
</resource> |
|||
<!-- '''cross model gl-es-en''' --> |
|||
<resource> |
|||
<property name="name" value="cross-model-gl-es-en"/> |
|||
<property name="type" value="cross-model"/> |
|||
<property name="sl" value="gl"/> |
|||
<property name="tl" value="en"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<!-- note that we use the same cross model file --> |
|||
<property name="src" value="cross-model-en-es-gl.xml"/> |
|||
</resource> |
|||
<!-- ''''en' morphological dictionary''' --> |
|||
<resource> |
|||
<property name="name" value="apertium-en"/> |
|||
<property name="type" value="mon"/> |
|||
<property name="sl" value="en"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-en-es.en.metadix"/> |
|||
</resource> |
|||
<!-- ''''gl' morphological dictionary''' --> |
|||
<resource> |
|||
<property name="name" value="apertium-gl"/> |
|||
<property name="type" value="mon"/> |
|||
<property name="sl" value="gl"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-es-gl.gl.dix"/> |
|||
</resource> |
|||
<!-- ''''en-es' bilingual dictionary''' --> |
|||
<resource> |
|||
<property name="name" value="apertium-en-es"/> |
|||
<property name="type" value="bil"/> |
|||
<property name="sl" value="en"/> |
|||
<property name="tl" value="es"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-en-es.en-es.dix"/> |
|||
</resource> |
|||
<!-- ''''es-gl' bilingual dictionary''' --> |
|||
<resource> |
|||
<property name="name" value="apertium-es-gl"/> |
|||
<property name="type" value="bil"/> |
|||
<property name="sl" value="es"/> |
|||
<property name="tl" value="gl"/> |
|||
<property name="for-crossing" value="yes"/> |
|||
<property name="src" value="apertium-es-gl.es-gl.dix"/> |
|||
</resource> |
|||
</resource-set> |
|||
</ling-resources> |
|||
Read more about [[Linguistic Resources Document|How to create a Linguistic Resources Document]] |
|||
== Crossing dictionaries == |
== Crossing dictionaries == |
||
Line 163: | Line 163: | ||
You will get the crossed dictionaries in '''dix''' folder. |
You will get the crossed dictionaries in '''dix''' folder. |
||
dix/apertium-en-gl.'''en-gl'''-crossed.dix |
|||
dix/apertium-en-gl.'''en'''-crossed.dix |
|||
dix/apertium-en-gl.'''gl'''-crossed.dix |
|||
== Notes == |
|||
<references/> |
|||
== See also == |
|||
* [[Crossdics|About apertium-crossdics]] |
|||
* [[List of language pairs|List of language pairs]] |
|||
* [[Cross Model|Cross Model Document]] |
|||
* [[Linguistic Resources Document|Linguistic Resources Document]] |
|||
[[Category:Dixtools]] |
|||
[[Category:Documentation in English]] |
Latest revision as of 22:58, 25 October 2018
Getting English-Galician[1] (A-C) language pair from English-Spanish[2] (A-B) and Spanish-Galician[3] (B-C).
Obtaining apertium-crossdics[edit]
Download[edit]
$ git clone https://github.com/apertium/apertium-dixtools
You will need to install Ant and Java Development Kit 6 (JDK6)
$ sudo apt-get install ant sun-java6-jdk
Compiling and installing[edit]
$ cd apertium-crossdics $ ant jar $ sudo ant install
What you need[edit]
Dictionaries[edit]
To get an English-Galician (A-C) language pair from English-Spanish (A-B) and Spanish-Galician (B-C), you need the following dictionaries:
- Morphological A: apertium-en-es.en.metadix
- Morphological C: apertium-es-gl.gl.dix
- Bilingual AB: apertium-en-es.en-es.dix
- Bilingual BC: apertium-es-gl.es-gl.dix
Cross Model Document[edit]
You will also need a:
- Cross Model ABC: cross-model-en-es-gl.dix
A cross model document must contain at least a default pattern-action. Here you have a very simple example of cross-model-en-es-gl.xml document.
<?xml version="1.0" encoding="UTF-8"?> <cross-model> <cross-action id="default" a="ebenimeli"> <description>Default pattern</description> <pattern> <e> <p> <l>$lemmaA<v n="cat"/><t n="tailA"/></l> <r>$lemmaB<v n="cat"/><t/></r>
</e> <e> <p> <l>$lemmaB<v n="cat"/><t/></l> <r>$lemmaC<v n="cat"/><t n="tailC"/></r>
</e> </pattern> <action-set> <action> <e> <p> <l>$lemmaA<v n="cat"/><t n="tailA"/></l> <r>$lemmaC<v n="cat"/><t n="tailC"/></r>
</e> </action> </action-set> </cross-action> </cross-model>
Read more in How to create a Cross Model Document.
Linguistic Resources Document[edit]
Finally, a document with references to the linguistic resources needed.
Example of en-es-gl-ling-resources.xml document:
<?xml version="1.0" encoding="UTF-8"?> <ling-resources> <name>My linguistic resources</name> <description>My linguistics resources: morphological and bilingual dictionaries, cross models, corpora, etc.</description> <resource-set> <name>My linguistic resources to get English-Galician language pair.</name> <description>Morphological and bilingual dictionaries.</description> <!-- cross model en-es-gl --> <resource> <property name="name" value="cross-model-en-es-gl"/> <property name="type" value="cross-model"/> <property name="sl" value="en"/> <property name="tl" value="gl"/> <property name="for-crossing" value="yes"/> <property name="src" value="cross-model-en-es-gl.xml"/> </resource> <!-- cross model gl-es-en --> <resource> <property name="name" value="cross-model-gl-es-en"/> <property name="type" value="cross-model"/> <property name="sl" value="gl"/> <property name="tl" value="en"/> <property name="for-crossing" value="yes"/> <property name="src" value="cross-model-en-es-gl.xml"/> </resource> <!-- 'en' morphological dictionary --> <resource> <property name="name" value="apertium-en"/> <property name="type" value="mon"/> <property name="sl" value="en"/> <property name="for-crossing" value="yes"/> <property name="src" value="apertium-en-es.en.metadix"/> </resource> <!-- 'gl' morphological dictionary --> <resource> <property name="name" value="apertium-gl"/> <property name="type" value="mon"/> <property name="sl" value="gl"/> <property name="for-crossing" value="yes"/> <property name="src" value="apertium-es-gl.gl.dix"/> </resource> <!-- 'en-es' bilingual dictionary --> <resource> <property name="name" value="apertium-en-es"/> <property name="type" value="bil"/> <property name="sl" value="en"/> <property name="tl" value="es"/> <property name="for-crossing" value="yes"/> <property name="src" value="apertium-en-es.en-es.dix"/> </resource> <!-- 'es-gl' bilingual dictionary --> <resource> <property name="name" value="apertium-es-gl"/> <property name="type" value="bil"/> <property name="sl" value="es"/> <property name="tl" value="gl"/> <property name="for-crossing" value="yes"/> <property name="src" value="apertium-es-gl.es-gl.dix"/> </resource> </resource-set> </ling-resources>
Read more about How to create a Linguistic Resources Document
Crossing dictionaries[edit]
To use apertium-crossdics:
$ apertium-crossdics -f en-es-gl-ling-resources.xml en-gl
You will get the crossed dictionaries in dix folder.
dix/apertium-en-gl.en-gl-crossed.dix dix/apertium-en-gl.en-crossed.dix dix/apertium-en-gl.gl-crossed.dix