Apertium has moved from SourceForge to GitHub.
If you have any questions, please come and talk to us on #apertium on irc.freenode.net or contact the GitHub migration team.

Pattern-Action example

From Apertium
Jump to: navigation, search

En français

Main article: Cross Model

[edit] Pattern

<cross-action id="pattern-1" a="ebenimeli">
  <description>Pattern 1</description>
  <pattern>
    <e>
      <p>
        <l>$lemmaA<s n="n"/><v n="X"/></l>
        <r>$lemmaB<s n="n"/><v n="Y"/></r>
      </p>
    </e>
    <e r="RL">
      <p>
        <l>$lemmaB<s n="n"/></l>
        <r>$lemmaC<s n="n"/></r>
      </p>
    </e>
  </pattern>
  <action-set>
    <action>
      <e>
        <p>
          <l>$lemmaA<s n="n"/><v n="X"/></l>
          <r>$lemmaC<s n="n"/><v n="Y"/></r>
        </p>
      </e>
    </action>
  </action-set>
</cross-action>

[edit] Candidate elements

<!-- element in bilingual dictionary es-ca -->
<e a="author1">
  <p>
    <l>almohada<s n="n"/><s n="f"/></l>
    <r>coixí<s n="n"/><s n="m"/></r>
  </p>
</e>
<!-- element in bilingual dictionary ca-fr -->
<e r="RL" a="author2">
  <p>
    <l>coixí<s n="n"/></l>
    <r>oreiller<s n="n"/></r>
  </p>
</e>

In the example shown above, the pair of elements are candidate elements to be crossed because the lemma coixí (pillow in English) for the common language (B) is the same in both.

[edit] Action

<!--
  pattern-1
-->
<e r="RL" a="author1/author2">
  <p>
    <l>almohada<s n="n"/><s n="f"/></l>
    <r>oreiller<s n="n"/><s n="m"/></r>
  </p>
</e>
  • The restriction RL has been resolved automatically.
  • Authors (attribute a) from both elements have been merged.
Personal tools