Difference between revisions of "Cross Model"

From Apertium
Jump to navigation Jump to search
Line 30: Line 30:
<e>
<e>
&lt;p>
&lt;p>
<l>'''lemmaA'''<s n="'''n'''"/><s n="'''X1'''"/></l>
<l>'''$lemmaA'''<s n="'''n'''"/><s n="'''$X'''"/></l>
<r>'''lemmaB'''<s n="'''n'''"/><s n="'''X2'''"/></r>
<r>'''$lemmaB'''<s n="'''n'''"/><s 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 45: Line 45:
<e>
<e>
&lt;p>
&lt;p>
<l>'''lemmaA'''<s n="'''n'''"/><s n="'''X1'''"/></l>
<l>'''$lemmaA'''<s n="'''n'''"/><s n="'''$X'''"/></l>
<r>'''lemmaC'''<s n="'''n'''"/><s n="'''X2'''"/></r>
<r>'''$lemmaC'''<s n="'''n'''"/><s n="'''$Y'''"/></r>
</p>
</p>
</e>
</e>

Revision as of 08:53, 8 February 2008

Main article: Crossdics

Cross Model

By default, the crossdics tool uses a simple cross model (schemas/cross-model-test.xml) 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.

These patterns and actions are described in XML, as follows:

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

Click on each element in the schema above or read more about cross model elements.

Example of pattern-action

Pattern

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

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

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

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

Example of how this cross action could be applied.

See also

External links