apertium-fin-nor

Finnish–Norwegian dictionary for rule-based machine translation


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

Apertium-fin-nor: Finnish–Norwegian 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
noun
  • <n.*>
  • <np.*>
propn
  • <np.*>
adp
  • <pr>
cnjcoo
  • <cnjcoo>
  • <cnjcoo.*>
card
  • <det.qnt.un.pl>
  • <det.qnt.un.pl.*>
  • <num.card.*>
for
  • for<pr>
i
  • i<pr>
  • I<pr>
å
  • å<part>
ord
  • <adj.ord.*>
adj
  • <adj.*>
har
  • ha<vblex.pres>
  • ha<vaux.pres>
participle
  • <vblex.pp>
  • <vblex.pstv.pp>
passive
  • <vblex.*.pasv>
verb
  • <vblex.*>
  • <vaux.*>
finverb
  • <vblex.pret>
  • <vblex.imp>
  • <vblex.pres>
  • <vblex.pstv.pres>
infverb
  • <vblex.inf>
  • <vblex.pstv.inf>
personal
  • <prn.pers.*>
art
  • en<det.*>
  • den<det.*>
  • denne<det.*>
  • dette<det.*>
pron
  • <prn.*>
  • <det.*>
punct
  • <sent>
  • <punct>
  • <sym>
  • <cm>
  • <cm.*>
  • <lquot>
  • <rquot>

Attributes

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

Attribute set name Tags
a_case
  • <nom>
a_noun
  • <n>
  • <np>
a_verb
  • <vblex>
  • <vaux>
a_pron
  • <prn>
  • <det>
  • <adj>
  • <adj.pst>
  • <num>
  • <num.card>
a_tense
  • <pres>
  • <pret>
  • <pri>
  • <past>
  • <imp>
a_ord
  • <adj.ord>
a_adj
  • <adj>
  • <adj.ord>
a_number
  • <sg>
  • <sp>
  • <pl>
a_person
  • <p1>
  • <p2>
  • <p3>
a_comp
  • <comp>
  • <pst>
  • <sup>
a_punct
  • <punct>
  • <sym>
a_cnjcoo
  • <cnjcoo>

Macros

Macros are helper functions in apertium transfer files.

adp-mangler

Parametres: 1
    1. if
      1. sl[1]['lem'] ≟ "I"
    2. then:
      1. let $adpcase ≔ <ine>
      2. let $maybeadp ≔ ""
    3. elseif
      1. sl[1]['lem'] ≟ "i"
    4. then:
      1. let $adpcase ≔ <ine>
      2. let $maybeadp ≔ ""
    5. elseif
      1. sl[1]['lem'] ≟ "fra"
    6. then:
      1. let $adpcase ≔ <ela>
      2. let $maybeadp ≔ ""
    7. elseif
      1. sl[1]['lem'] ≟ "om"
    8. then:
      1. let $adpcase ≔ <ela>
      2. let $maybeadp ≔ ""
    9. elseif
      1. sl[1]['lem'] ≟ "frå"
    10. then:
      1. let $adpcase ≔ <ela>
      2. let $maybeadp ≔ ""
    11. elseif
      1. sl[1]['lem'] ≟ "til"
    12. then:
      1. let $adpcase ≔ <ill>
      2. let $maybeadp ≔ ""
    13. elseif
      1. sl[1]['lem'] ≟ "på"
    14. then:
      1. let $adpcase ≔ <ade>
      2. let $maybeadp ≔ ""
    15. elseif
      1. sl[1]['lem'] ≟ "ved"
    16. then:
      1. let $adpcase ≔ <ade>
      2. let $maybeadp ≔ ""
    17. elseif
      1. sl[1]['lem'] ≟ "av"
    18. then:
      1. let $adpcase ≔ <abl>
      2. let $maybeadp ≔ ""
    19. elseif
      1. sl[1]['lem'] ≟ "for"
    20. then:
      1. let $adpcase ≔ <all>
      2. let $maybeadp ≔ ""
    21. elseif
      1. sl[1]['lem'] ≟ "uten"
    22. then:
      1. let $adpcase ≔ <abe>
      2. let $maybeadp ≔ ""
    23. elseif
      1. sl[1]['lem'] ≟ "som"
    24. then:
      1. let $adpcase ≔ <ess>
      2. let $maybeadp ≔ ""
    25. elseif
      1. sl[1]['lem'] ≟ "På"
    26. then:
      1. let $adpcase ≔ <tra>
      2. let $maybeadp ≔ ""
    27. else:
      1. let $adpcase ≔ <gen>
      2. let $maybeadptl[1]['whole']

personal-mangler

Parametres: 1
    1. if
      1. sl[1]['a_number'] ≟ <sg>
      2. sl[1]['a_person'] ≟ <p1>
    2. then:
      1. let $person ≔ <p1.sg>
      2. let $prodrop ≔ ""
    3. elseif
      1. sl[1]['a_number'] ≟ <sg>
      2. sl[1]['a_person'] ≟ <p2>
    4. then:
      1. let $person ≔ <p2.sg>
      2. let $prodrop ≔ ""
    5. elseif
      1. sl[1]['a_number'] ≟ <sg>
      2. sl[1]['a_person'] ≟ <p3>
    6. then:
      1. let $person ≔ <p3.sg>
      2. let $prodroptl[1]['whole']
    7. elseif
      1. sl[1]['a_number'] ≟ <pl>
      2. sl[1]['a_person'] ≟ <p1>
    8. then:
      1. let $person ≔ <p1.pl>
      2. let $prodrop ≔ ""
    9. elseif
      1. sl[1]['a_number'] ≟ <pl>
      2. sl[1]['a_person'] ≟ <p2>
    10. then:
      1. let $person ≔ <p2.pl>
      2. let $prodrop ≔ ""
    11. elseif
      1. sl[1]['a_number'] ≟ <pl>
      2. sl[1]['a_person'] ≟ <p3>
    12. then:
      1. let $person ≔ <p3.pl>
      2. let $prodroptl[1]['whole']
    13. else:
      1. let $person ≔ <p3.sg>
      2. let $prodroptl[1]['whole']

person-mangler

Parametres: 1
    1. if
      1. sl[1]['a_tense'] ≟ <imp>
    2. then:
      1. let $person ≔ <p2.sg>
    3. elseif
      1. sl[1]['a_tense'] ≟ <pres>
    4. then:
      1. let $person ≔ <p3.sg>
    5. elseif
      1. sl[1]['a_tense'] ≟ <pret>
    6. then:
      1. let $person ≔ <p3.sg>
    7. else:
      1. let $person ≔ <p3.sg>

comp-mangler

Parametres: 1
    1. if
      1. sl[1]['a_comp'] ≟ <comp>
    2. then:
      1. let $comparison ≔ <comp>
    3. else:
      1. let tl[1]['a_comp'] ≔ <pst>
      2. let $comparison ≔ <pst>

tense-mangler

Parametres: 1
    1. if
      1. sl[1]['a_tense'] ≟ <pret>
    2. then:
      1. let $tense ≔ <past>
    3. else:
      1. let tl[1]['a_tense'] ≔ <pri>
      2. let $tense ≔ <pri>

number-mangler

Parametres: 1
    1. if
      1. sl[1]['a_number'] ≟ <sg>
    2. then:
      1. let $number ≔ <sg>
    3. elseif
      1. sl[1]['a_number'] ≟ <pl>
    4. then:
      1. let $number ≔ <pl>
    5. elseif
      1. sl[1]['a_number'] ≟ <sp>
    6. then:
      1. let $number ≔ <sg>
    7. else:
      1. let tl[1]['a_number'] ≔ <sg>
      2. let $number ≔ <sg>

case-mangler

Parametres: 1
    1. if
      1. sl[1]['a_case'] ≟ <acc>
    2. then:
      1. let $case ≔ <gen>
    3. else:
      1. let tl[1]['a_case'] ≔ <nom>
      2. let $case ≔ <nom>

Rules

The actual rules concerning stuff.

adp art adj noun

Matching pattern:

  1. adp
  2. art
  3. adj
  4. noun

Action:

  1. adp-mangler( $1 )
  2. comp-mangler( $3 )
  3. number-mangler( $4 )
  4. Output:
    1. [
      1. tl[3]['lem'] tl[3]['a_adj'] $comparison $number $adpcase
      2. b2
      3. tl[4]['lem'] tl[4]['a_noun'] $number $adpcase
      4. b1
      5. $maybeadp
      ]adpnoun <NP> $adpcase

adp art noun

Matching pattern:

  1. adp
  2. art
  3. noun

Action:

  1. adp-mangler( $1 )
  2. number-mangler( $3 )
  3. Output:
    1. [
      1. tl[3]['lem'] tl[3]['a_noun'] $number $adpcase
      2. b1
      3. $maybeadp
      ]adpnoun <NP> $adpcase

art adj noun

Matching pattern:

  1. art
  2. adj
  3. noun

Action:

  1. number-mangler( $3 )
  2. case-mangler( $3 )
  3. comp-mangler( $2 )
  4. Output:
    1. [
      1. tl[2]['lem'] tl[2]['a_adj'] $comparison $number $case
      2. b2
      3. tl[3]['lem'] tl[3]['a_noun'] $number $case
      ]noun <NP>

har participle

Matching pattern:

  1. har
  2. participle

Action:

  1. personal-mangler( $1 )
  2. tense-mangler( $1 )
  3. Output:
    1. [
      1. "olla" <vaux.actv> $tense $person
      2. b0
      3. tl[2]['lem'] tl[2]['a_verb'] <actv.pp.pst.sg.nom>
      ]verb <VP.PERF>

person verb

Matching pattern:

  1. personal
  2. finverb

Action:

  1. personal-mangler( $1 )
  2. tense-mangler( $2 )
  3. Output:
    1. [
      1. $prodrop
      2. b0
      3. tl[2]['lem'] tl[2]['a_verb'] <actv> $tense $person
      ]verb <VP> $tense $person

adp propn propn

Matching pattern:

  1. adp
  2. propn
  3. propn

Action:

  1. adp-mangler( $1 )
  2. number-mangler( $3 )
  3. Output:
    1. [
      1. tl[2]['lem'] tl[2]['a_noun'] $number <nom>
      2. b0
      3. tl[3]['lem'] tl[3]['a_noun'] $number $adpcase
      4. b1
      5. $maybeadp
      ]adpnoun <NP> $adpcase

adp noun

Matching pattern:

  1. adp
  2. noun

Action:

  1. adp-mangler( $1 )
  2. number-mangler( $2 )
  3. Output:
    1. [
      1. tl[2]['lem'] tl[2]['a_noun'] $number $adpcase
      2. b0
      3. $maybeadp
      ]adpnoun <NP> $adpcase

num noun

Matching pattern:

  1. card
  2. noun

Action:

  1. case-mangler( $2 )
  2. comp-mangler( $1 )
  3. Output:
    1. [
      1. tl[1]['lem'] <num> <card> <sg> <nom>
      2. b0
      3. tl[2]['lem'] tl[2]['a_noun'] <sg> <par>
      ]count <NUMP>

stray verb

Matching pattern:

  1. finverb

Action:

  1. person-mangler( $1 )
  2. tense-mangler( $1 )
  3. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_verb'] <actv> $tense $person
      ]verb <V>

passive

Matching pattern:

  1. passive

Action:

  1. tense-mangler( $1 )
  2. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_verb'] <pasv> $tense <impers>
      ]pasv <V.PASV>

i år – vuonna

Matching pattern:

  1. i
  2. card

Action:

  1. number-mangler( $2 )
  2. case-mangler( $2 )
  3. comp-mangler( $2 )
  4. Output:
    1. [
      1. "vuonna" <adv>
      2. b0
      3. tl[2]['lem'] <num> <card> <sg> <nom>
      ]year <NUMP>

num

Matching pattern:

  1. card

Action:

  1. number-mangler( $1 )
  2. case-mangler( $1 )
  3. comp-mangler( $1 )
  4. Output:
    1. [
      1. tl[1]['lem'] <num> <card> <sg> $case
      ]card <NUM>

participle

Matching pattern:

  1. participle

Action:

  1. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_verb'] <pasv.pp.pst.sg.nom>
      ]pcp <ADJ>

for Å infinitive

Matching pattern:

  1. for
  2. å
  3. infverb

Action:

  1. Output:
    1. [
      1. tl[3]['lem'] tl[3]['a_verb'] <actv.infa.tra.px3sp>
      ]inf <V.INF.TRA>

infinitive

Matching pattern:

  1. infverb

Action:

  1. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_verb'] <actv.infa.sg.lat>
      ]inf <V.INF>

pron

Matching pattern:

  1. pron

Action:

  1. case-mangler( $1 )
  2. number-mangler( $1 )
  3. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_pron'] $number $case
      ]pron <PRN>

art noun

Matching pattern:

  1. art
  2. noun

Action:

  1. number-mangler( $2 )
  2. case-mangler( $2 )
  3. Output:
    1. [
      1. tl[2]['lem'] tl[2]['a_noun'] $number $case
      ]noun <NP>

noun

Matching pattern:

  1. noun

Action:

  1. case-mangler( $1 )
  2. number-mangler( $1 )
  3. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_noun'] $number $case
      ]noun <N>

ord

Matching pattern:

  1. ord

Action:

  1. number-mangler( $1 )
  2. case-mangler( $1 )
  3. comp-mangler( $1 )
  4. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_ord'] $number $case
      ]ord <ADJ>

adj

Matching pattern:

  1. adj

Action:

  1. number-mangler( $1 )
  2. case-mangler( $1 )
  3. comp-mangler( $1 )
  4. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_adj'] $comparison $number $case
      ]adj <ADJ>

cnjcoo

Matching pattern:

  1. cnjcoo

Action:

  1. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_cnjcoo']
      ]cnjcoo <CC>

puncts

Matching pattern:

  1. punct

Action:

  1. Output:
    1. [
      1. tl[1]['lem'] tl[1]['a_punct']
      ]sent <SENT>