Difference between revisions of "Pattern-Action example"

From Apertium
Jump to navigation Jump to search
m
(Link to French page)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Exemple modèle-action|En français]]

{{main|Cross Model}}
{{main|Cross Model}}


Line 7: Line 9:
<e>
<e>
&lt;p>
&lt;p>
<l>'''lemmaA'''<s n="'''n'''"/><s n="'''X1'''"/></l>
<l>'''$lemmaA'''<s n="'''n'''"/><v n="'''X'''"/></l>
<r>'''lemmaB'''<s n="'''n'''"/><s n="'''X2'''"/></r>
<r>'''$lemmaB'''<s n="'''n'''"/><v n="'''Y'''"/></r>
</p>
</p>
</e>
</e>
<e r="RL">
<e r="RL">
&lt;p>
&lt;p>
<l>'''lemmaB'''<s n="'''n'''"/></l>
<l>'''$lemmaB'''<s n="'''n'''"/></l>
<r>'''lemmaC'''<s n="'''n'''"/></r>
<r>'''$lemmaC'''<s n="'''n'''"/></r>
</p>
</p>
</e>
</e>
Line 22: Line 24:
<e>
<e>
&lt;p>
&lt;p>
<l>'''lemmaA'''<s n="'''n'''"/><s n="'''X1'''"/></l>
<l>'''$lemmaA'''<s n="'''n'''"/><v n="'''X'''"/></l>
<r>'''lemmaC'''<s n="'''n'''"/><s n="'''X2'''"/></r>
<r>'''$lemmaC'''<s n="'''n'''"/><v n="'''Y'''"/></r>
</p>
</p>
</e>
</e>
Line 31: Line 33:


== Candidate elements ==
== Candidate elements ==

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.


''&lt;!-- element in bilingual dictionary es-ca -->
''&lt;!-- element in bilingual dictionary es-ca -->
Line 49: Line 49:
</p>
</p>
</e>
</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.


== Action ==
== Action ==
Line 67: Line 69:
* Authors (attribute <code>a</code>) from both elements have been ''merged''.
* Authors (attribute <code>a</code>) from both elements have been ''merged''.


[[Category:Documentation]]
[[Category:Dixtools]]
[[Category:Documentation in English]]

Latest revision as of 09:28, 6 October 2014

En français

Main article: Cross Model

Pattern[edit]

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

    </e>
    <e r="RL">
      <p>
        <l>$lemmaB</l>
        <r>$lemmaC</r>

    </e>
  </pattern>
  <action-set>
    <action>
      <e>
        <p>
          <l>$lemmaA<v n="X"/></l>
          <r>$lemmaC<v n="Y"/></r>

      </e>
    </action>
  </action-set>
</cross-action>

Candidate elements[edit]

<!-- element in bilingual dictionary es-ca -->
<e a="author1">
  <p>
    <l>almohada</l>
    <r>coixí</r>

</e>
<!-- element in bilingual dictionary ca-fr -->
<e r="RL" a="author2">
  <p>
    <l>coixí</l>
    <r>oreiller</r>

</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.

Action[edit]

<!--
  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.