Difference between revisions of "Cross Model Elements"

From Apertium
Jump to navigation Jump to search
Line 71: Line 71:
<e>
<e>
&lt;p>
&lt;p>
<l>lemmaA<s n="n"/><s n="..."/>...<s n="..."/></l>
<l>$lemmaA<s n="n"/><s n="..."/>...<s n="..."/></l>
<r>lemmaC<s n="n"/><s n="..."/>...<s n="..."/></r>
<r>$lemmaC<s n="n"/><s n="..."/>...<s n="..."/></r>
</p>
</p>
</e>
</e>

Revision as of 08:53, 8 February 2008

Main article: Cross Model

cross-model element

cross-model element is a set of cross actions (cross-action elements).

<!DOCTYPE cross-model SYSTEM "crossmodel.dtd">
<cross-model>
  <cross-action id="pattern-1" a="author">
  ...
  </cross-action>
  <cross-action id="pattern-2" a="author">
  ...
  </cross-action>
  ...
  <cross-action id="pattern-n" a="author">
  ...
  </cross-action>
</cross-model>

cross-action element

Each cross actions consists of a pair (pattern,action-set).

<cross-action id="pattern-1" a="author">
  <description>Cross action 1</description>
  <pattern>
    ...
  </pattern>
  <action-set>
    <action>
      ...
    </action>
    ...
    <action>
      ...
    </action>
  </action-set>
</cross-action>

pattern element

<pattern>
  <!-- Element in bilingual dictionary AB-->
  <e>
    <p>
      <l>$lemmaA...</l>
      <r>$lemmaB...</r>

  </e>
  <!-- Element in bilingual dictionary BC-->
  <e r="RL">
    <p>
      <l>$lemmaB...</l>
      <r>$lemmaC...</r>

  </e>
</pattern>
  • The lemmas are not taken into account (you could write anything else in there). Only candidate elements, that is, elements that can be crossed (with coinciding lemmaB), will be processed.

action-set element

The action-set element is a list of actions to be performed when a pair of candidate elements matches the pattern.

<action-set>
  <action>
    <e>
      <p>
        <l>$lemmaA...</l>
        <r>$lemmaC...</r>

    </e>
  </action>
  <action>
  ...
  </action>
</action-set>

Values for <s> element