apertium-fin-eng

Finnish–English dictionary for rule-based machine translation


Project maintained by apertium Hosted on GitHub Pages – Theme by mattgraham

Apertium-fin-eng: Finnish–English machine translation rules

This is a visualisation of some rules in apertium transfer.

Categories (parts of chunks)

These are the categories Apertium is using in order to chunk, re-order and transfer lexemes.

Category Items
AP
  • <AP>
  • <AP.*>
NP
  • <NP>
  • <NP.*>
PREP
  • <PR>
SENT
  • <SENT>

Attributes

These are the morphological analysis value (tag) sets that can be processed in the transfer.

Attribute set name Tags
a_adp
  • <pr>
  • <post>
a_nbr
  • <sg>
  • <pl>
  • <sp>
  • <ND>
a_cas
  • <nom>
  • <acc>
  • <ine>
  • <gen>
  • <ins>
  • <loc>
  • <abl>
  • <CD>

Macros

Macros are helper functions in apertium transfer files.

prep1

Parametres: 1
  1. let $prepcase ≔ <nom>
  2. let $POST ≔ ""
    1. if
      1. [1]['lem'] ≟ "in"
    2. then:
      1. let $prepcase ≔ <ine>
    3. elseif
      1. [1]['lem'] ≟ "of"
    4. then:
      1. let $prepcase ≔ <ela>
    5. elseif
      1. [1]['lem'] ≟ "into"
    6. then:
      1. let $prepcase ≔ <ill>
    7. elseif
      1. [1]['lem'] ≟ "as a"
    8. then:
      1. let $prepcase ≔ <ess>
    9. elseif
      1. [1]['lem'] ≟ "as"
    10. then:
      1. let $prepcase ≔ <tra>
    11. elseif
      1. [1]['lem'] ≟ "for"
    12. then:
      1. let $prepcase ≔ <all>
    13. elseif
      1. [1]['lem'] ≟ "to"
    14. then:
      1. let $prepcase ≔ <all>
    15. elseif
      1. [1]['lem'] ≟ "at"
    16. then:
      1. let $prepcase ≔ <ine>
    17. elseif
      1. [1]['lem'] ≟ "on"
    18. then:
      1. let $prepcase ≔ <ade>
    19. elseif
      1. [1]['lem'] ≟ "from"
    20. then:
      1. let $prepcase ≔ <abl>
    21. elseif
      1. [1]['lem'] ≟ "without"
    22. then:
      1. let $prepcase ≔ <abe>
    23. elseif
      1. [1]['lem'] ≟ "with"
    24. then:
      1. let $prepcase ≔ <gen>
      2. let $POST ≔ " ^post" <POST> "{^kanssa" <post> "$}$"
    25. else:
      1. let $prepcase ≔ <gen>
      2. let $POST
      3. b1
      4. " "
      5. [
        1. b1
        ]

Rules

The actual rules concerning stuff.

Sääntö: PR AP NP

Matching pattern:

  1. PREP
  2. AP
  3. NP

Action:

  1. prep1( $1 )
  2. let [2]['a_cas'] ≔ $prepcase
  3. let [3]['a_cas'] ≔ $prepcase
  4. Output:
    1. [
        ]
      1. b2
      2. [
          ]
        1. $POST

      Sääntö: PR NP

      Matching pattern:

      1. PREP
      2. NP

      Action:

      1. prep1( $1 )
      2. let [2]['a_cas'] ≔ $prepcase
      3. Output:
        1. [
            ]
          1. $POST

        REGLA: SN

        Matching pattern:

        1. NP

        Action:

        1. let [1]['a_cas'] ≔ <nom>
        2. Output:
          1. [
              ]