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
SN-GEN
  • <SN.GEN>
  • <SN.GEN.*>
SN-ADE
  • <SN.ade>
  • <SN.*.ade>
  • <SN.ade.*>
SN-NOM-PAR
  • <SN.nom>
  • <SN.nom.*>
  • <SN.par>
  • <SN.par.*>
PERS
  • <SN.pers.*>
SN
  • <SN>
  • <SN.*>
SV
  • <SV>
  • <SV.*>
  • <SV.*.*>
V-COP
  • <SV.COP>
  • <SV.COP.*>
ADV
  • <ADV>
POST
  • <POST>
SENT
  • <SENT>

Attributes

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

Attribute set name Tags
a_nbr
  • <sg>
  • <pl>
  • <sp>
  • <ND>
a_cas
  • <nom>
  • <acc>
  • <ine>
  • <ela>
  • <ill>
  • <ade>
  • <abl>
  • <all>
  • <abe>
  • <ins>
  • <com>
a_poss
  • <px1sg>
  • <px2sg>
  • <px3sg>
  • <px1pl>
  • <px2pl>
  • <px3pl>
  • <px3ps>
a_prs
  • <p1.sg>
  • <p2.sg>
  • <p3.sg>
  • <p1.pl>
  • <p2.pl>
  • <p3.pl>
a_mood
  • <cond>
  • <pot>
  • <imp>

Macros

Macros are helper functions in apertium transfer files.

insert-prep1

Parametres: 1
  1. let $PREP ≔ ""
    1. if
      1. [1]['a_cas'] ≟ <ine>
    2. then:
      1. let $PREP ≔ "^prep" <PREP> "{^in" <pr> "$}$ "
    3. elseif
      1. [1]['a_cas'] ≟ <ela>
    4. then:
      1. let $PREP ≔ "^prep" <PREP> "{^from" <pr> "$}$ "
    5. elseif
      1. [1]['a_cas'] ≟ <ill>
    6. then:
      1. let $PREP ≔ "^prep" <PREP> "{^to" <pr> "$}$ "
    7. elseif
      1. [1]['a_cas'] ≟ <ade>
    8. then:
      1. let $PREP ≔ "^prep" <PREP> "{^in" <pr> "$}$ "
    9. elseif
      1. [1]['a_cas'] ≟ <abl>
    10. then:
      1. let $PREP ≔ "^prep" <PREP> "{^from" <pr> "$}$ "
    11. elseif
      1. [1]['a_cas'] ≟ <all>
    12. then:
      1. let $PREP ≔ "^prep" <PREP> "{^to" <pr> "$}$ "
    13. elseif
      1. [1]['a_cas'] ≟ <abe>
    14. then:
      1. let $PREP ≔ "^prep" <PREP> "{^without" <pr> "$}$ "
    15. elseif
      1. [1]['a_cas'] ≟ <ins>
    16. then:
      1. let $PREP ≔ "^prep" <PREP> "{^with" <pr> "$}$ "
    17. elseif
      1. [1]['a_cas'] ≟ <com>
    18. then:
      1. let $PREP ≔ "^prep" <PREP> "{^alongside" <pr> "$}$ "

insert-det1

Parametres: 1
    1. if
      1. $POSS ≟ ""
      2. $PREP ≟ ""
    2. then:
      1. let $DET ≔ "^det" <DET> "{^the" <det.def.sp> "$}$ "
    3. else:
      1. let $DET ≔ ""

insert-poss1

Parametres: 1
  1. let $POSS ≔ ""
    1. if
      1. [1]['a_poss'] ≟ <px1sg>
    2. then:
      1. let $POSS ≔ "^poss" <POSS> "{^my" <det.pos.sp> "$}$ "
    3. elseif
      1. [1]['a_poss'] ≟ <px2sg>
    4. then:
      1. let $POSS ≔ "^poss" <POSS> "{^your" <det.pos.sp> "$}$ "
    5. elseif
      1. [1]['a_poss'] ≟ <px3sg>
    6. then:
      1. let $POSS ≔ "^poss" <POSS> "{^their" <det.pos.sp> "$}$ "
    7. elseif
      1. [1]['a_poss'] ≟ <px1pl>
    8. then:
      1. let $POSS ≔ "^poss" <POSS> "{^our" <det.pos.sp> "$}$ "
    9. elseif
      1. [1]['a_poss'] ≟ <px2pl>
    10. then:
      1. let $POSS ≔ "^poss" <POSS> "{^your" <det.pos.sp> "$}$ "
    11. elseif
      1. [1]['a_poss'] ≟ <px3pl>
    12. then:
      1. let $POSS ≔ "^poss" <POSS> "{^their" <det.pos.sp> "$}$ "
    13. elseif
      1. [1]['a_poss'] ≟ <px3sp>
    14. then:
      1. let $POSS ≔ "^poss" <POSS> "{^they" <det.pos.sp> "$}$ "

insert-prs1

Parametres: 1
  1. let $PRS ≔ ""
    1. if
      1. [1]['a_prs'] ≟ <p1.sg>
    2. then:
      1. let $PRS ≔ "^prs" <PRS> "{^prpers" <prn.subj.p1.mf.sg> "$}$ "
    3. elseif
      1. [1]['a_prs'] ≟ <p2.sg>
    4. then:
      1. let $PRS ≔ "^prs" <PRS> "{^prpers" <prn.subj.p2.mf.sp> "$}$ "
    5. elseif
      1. [1]['a_prs'] ≟ <p1.pl>
    6. then:
      1. let $PRS ≔ "^prs" <PRS> "{^prpers" <prn.subj.p1.mf.pl> "$}$ "
    7. elseif
      1. [1]['a_prs'] ≟ <p2.pl>
    8. then:
      1. let $PRS ≔ "^prs" <PRS> "{^prpers" <prn.subj.p2.mf.sp> "$}$ "
    9. elseif
      1. [1]['a_prs'] ≟ <p3.pl>
    10. then:
      1. let $PRS ≔ "^prs" <PRS> "{^prpers" <prn.subj.p3.mf.pl> "$}$ "

insert-aux1

Parametres: 1
  1. let $AUX ≔ ""
    1. if
      1. [1]['a_mood'] ≟ <cond>
    2. then:
      1. let $AUX ≔ "^mood" <MOOD> "{^would" <vaux.pres> "$}$ "
    3. elseif
      1. [1]['a_mood'] ≟ <imp>
    4. then:
      1. let $AUX ≔ "^mood" <MOOD> "{^should" <vaux.pres> "$}$ "
    5. elseif
      1. [1]['a_mood'] ≟ <pot>
    6. then:
      1. let $AUX ≔ "^mood" <MOOD> "{^may" <vaux.pres> "$}$ "

Rules

The actual rules concerning stuff.

REGLA: V-COP ADV SN-ADE SN-NOM-PAR

Matching pattern:

  1. V-COP
  2. ADV
  3. SN-ADE
  4. SN-NOM-PAR

Action:

    1. if
      1. [1]['lem'] ≟ "neg-cop"
    2. then:
      1. let $NOT ≔ " ^not" <ADV.NEG> "{^not" <adv> "$}$"
  1. Output:
    1. [
        ]
      1. $NOT
      2. b1
      3. [
          ]
        1. b2
        2. [
            ]
          1. b3
          2. [
              ]
          3. let $NOT ≔ ""

          REGLA: V-COP SN-ADE SN-NOM-PAR

          Matching pattern:

          1. V-COP
          2. SN-ADE
          3. SN-NOM-PAR

          Action:

            1. if
              1. [2]['lem'] ≟ "neg-cop"
            2. then:
              1. let $NOT ≔ " ^not" <ADV.NEG> "{^not" <adv> "$}$"
          1. Output:
            1. [
                ]
              1. $NOT
              2. b1
              3. [
                  ]
                1. b2
                2. [
                    ]
                3. let $NOT ≔ ""

                REGLA: SN-ADE V-COP SN-NOM-PAR

                Matching pattern:

                1. SN-ADE
                2. V-COP
                3. SN-NOM-PAR

                Action:

                  1. if
                    1. [2]['lem'] ≟ "neg-cop"
                  2. then:
                    1. let $NOT ≔ " ^not" <ADV.NEG> "{^not" <adv> "$}$"
                1. Output:
                  1. [
                      ]
                    1. b1
                    2. [
                        ]
                      1. $NOT
                      2. b2
                      3. [
                          ]
                      4. let $NOT ≔ ""

                      REGLA: SN-GEN POST

                      Matching pattern:

                      1. SN-GEN
                      2. POST

                      Action:

                      1. Output:
                        1. [
                            ]
                          1. b1
                          2. [
                              ]

                          REGLA: SN

                          Matching pattern:

                          1. SN

                          Action:

                          1. insert-prep1( $1 )
                          2. insert-poss1( $1 )
                          3. insert-det1( $1 )
                          4. Output:
                              $PREP $POSS $DET
                            1. [
                                ]

                            REGLA: PERS SV

                            Matching pattern:

                            1. PERS
                            2. SV

                            Action:

                            1. insert-aux1( $1 )
                              1. if
                                1. [1]['a_prs'][2]['a_prs']
                              2. then:
                              3. Output:
                                1. [
                                    ]
                                  1. b1
                                  2. $PRS $AUX
                                  3. [
                                      ]
                                  4. let $PRS ≔ ""

                                  REGLA: SV

                                  Matching pattern:

                                  1. SV

                                  Action:

                                  1. insert-prs1( $1 )
                                  2. insert-aux1( $1 )
                                  3. Output:
                                      $PRS $AUX
                                    1. [
                                        ]
                                    2. let $PRS ≔ ""