Cross-model ro

From Apertium
Revision as of 16:50, 9 January 2011 by Cristipiticul (talk | contribs) (Created page with '{{main|Crossdics}} == Cross Model == === Definirea acţiunilor de încrucişare (cross actions) === Acţiunile de încrucişare sunt necesare pentru încrucişarea corectă a p…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Main article: Crossdics

Cross Model

Definirea acţiunilor de încrucişare (cross actions)

Acţiunile de încrucişare sunt necesare pentru încrucişarea corectă a perechilor de limbi.

Aceste tipare şi acţiuni sunt descrise în XML. De exemplu:

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

Faceţi click pe oricare element din schema de mai sus sau citiţi mai mult despre elementele unui model de încrucişare.

Exemplu de acţiune-tipar (pattern-action)

Tipar

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

Exemplu cum această acţiune de încrucişare ar putea fi aplicată.

Acţiune de încrucişare implicită

Implicit, unealta apertium-crossdics foloseşte un model de încrucişare simplu (schemas/cross-model.xml). Acesta defineşte o singură regulă pattern-action.

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

În exemplul de mai sus:

  • <v n="cat"/> is a variable that can store just one element (for example, ). In this example we use a variable because we need to use the value in the action element. Besides that, we force the value of the first element to be the same. There is another symbol (<v/>) that can be used if we don't want to use the value afterwards.
  • the tag <t/> is a sequence of 0 or more elements.
  • <t n="tailA"/> and <t n="tailC"/> are also sequences of 0 or more elements, but, in this particular case, we store the value in a variable because we need to use it afterwards (in the action element).

These special tags are explained in the section Cross Model Elements

See also

External links