Finnish–English dictionary for rule-based machine translation
This is a visualisation of some rules in apertium transfer.
These are the categories Apertium is using in order to chunk, re-order and transfer lexemes.
| Category | Items | 
|---|---|
| SN-GEN | 
 | 
| SN-ADE | 
 | 
| SN-NOM-PAR | 
 | 
| PERS | 
 | 
| SN | 
 | 
| SV | 
 | 
| V-COP | 
 | 
| ADV | 
 | 
| POST | 
 | 
| SENT | 
 | 
These are the morphological analysis value (tag) sets that can be processed in the transfer.
| Attribute set name | Tags | 
|---|---|
| a_nbr | 
 | 
| a_cas | 
 | 
| a_poss | 
 | 
| a_prs | 
 | 
| a_mood | 
 | 
Macros are helper functions in apertium transfer files.
               
                  
                  - 
                     let 
                     $PREP ≔ 
                     ""
                     
                  
- 
                     
                        
                        - if 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <ine>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^in"
                                 <pr>
                                 "$}$ "
                                 
                              
 
 
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <ela>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^from"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <ill>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^to"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <ade>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^in"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <abl>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^from"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <all>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^to"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <abe>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^without"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <ins>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^with"
                                 <pr>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_cas'] ≟ <com>
                                 
 
then:
                              - 
                                 let 
                                 $PREP ≔ 
                                 "^prep"
                                 <PREP>
                                 "{^alongside"
                                 <pr>
                                 "$}$ "
                                 
                              
            
            
               
                  
                  - 
                     
                        
                        - if 
                           
- 
                              
                                 
                                 - 
                                    $POSS ≟ 
                                    ""
                                    
                                 
- 
                                    $PREP ≟ 
                                    ""
                                    
                                 
 
then:
                              - 
                                 let 
                                 $DET ≔ 
                                 
                                 "^det"
                                 <DET>
                                 "{^the"
                                 <det.def.sp>
                                 "$}$ "
                                 
                                 
                              
 
 
- else:
                           
                              
                              - 
                                 let 
                                 $DET ≔ 
                                 ""
                                 
                              
 
            
            
               
                  
                  - 
                     let 
                     $POSS ≔ 
                     ""
                     
                  
- 
                     
                        
                        - if 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px1sg>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^my"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
 
 
- elseif 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px2sg>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^your"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px3sg>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^their"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px1pl>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^our"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px2pl>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^your"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px3pl>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^their"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_poss'] ≟ <px3sp>
                                 
 
then:
                              - 
                                 let 
                                 $POSS ≔ 
                                 "^poss"
                                 <POSS>
                                 "{^they"
                                 <det.pos.sp>
                                 "$}$ "
                                 
                              
            
            
               
                  
                  - 
                     let 
                     $PRS ≔ 
                     ""
                     
                  
- 
                     
                        
                        - if 
                           
- 
                              
                                 - [1]['a_prs'] ≟ <p1.sg>
                                 
 
then:
                              - 
                                 let 
                                 $PRS ≔ 
                                 "^prs"
                                 <PRS>
                                 "{^prpers"
                                 <prn.subj.p1.mf.sg>
                                 "$}$ "
                                 
                              
 
 
- elseif 
                           
- 
                              
                                 - [1]['a_prs'] ≟ <p2.sg>
                                 
 
then:
                              - 
                                 let 
                                 $PRS ≔ 
                                 "^prs"
                                 <PRS>
                                 "{^prpers"
                                 <prn.subj.p2.mf.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_prs'] ≟ <p1.pl>
                                 
 
then:
                              - 
                                 let 
                                 $PRS ≔ 
                                 "^prs"
                                 <PRS>
                                 "{^prpers"
                                 <prn.subj.p1.mf.pl>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_prs'] ≟ <p2.pl>
                                 
 
then:
                              - 
                                 let 
                                 $PRS ≔ 
                                 "^prs"
                                 <PRS>
                                 "{^prpers"
                                 <prn.subj.p2.mf.sp>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_prs'] ≟ <p3.pl>
                                 
 
then:
                              - 
                                 let 
                                 $PRS ≔ 
                                 "^prs"
                                 <PRS>
                                 "{^prpers"
                                 <prn.subj.p3.mf.pl>
                                 "$}$ "
                                 
                              
            
            
               
                  
                  - 
                     let 
                     $AUX ≔ 
                     ""
                     
                  
- 
                     
                        
                        - if 
                           
- 
                              
                                 - [1]['a_mood'] ≟ <cond>
                                 
 
then:
                              - 
                                 let 
                                 $AUX ≔ 
                                 "^mood"
                                 <MOOD>
                                 "{^would"
                                 <vaux.pres>
                                 "$}$ "
                                 
                              
 
 
- elseif 
                           
- 
                              
                                 - [1]['a_mood'] ≟ <imp>
                                 
 
then:
                              - 
                                 let 
                                 $AUX ≔ 
                                 "^mood"
                                 <MOOD>
                                 "{^should"
                                 <vaux.pres>
                                 "$}$ "
                                 
                              
- elseif 
                           
- 
                              
                                 - [1]['a_mood'] ≟ <pot>
                                 
 
then:
                              - 
                                 let 
                                 $AUX ≔ 
                                 "^mood"
                                 <MOOD>
                                 "{^may"
                                 <vaux.pres>
                                 "$}$ "
                                 
                              
            
            
            The actual rules concerning stuff.
               
                  
                  - 
                     
                        - if 
                           
- 
                              
                                 - [1]['lem'] ≟ 
                                    "neg-cop"
                                    
                                 
 
then:
                              - 
                                 let 
                                 $NOT ≔             
                                 " ^not"
                                 
                                 <ADV.NEG>
                                 
                                 "{^not"
                                 
                                 <adv>
                                 
                                 "$}$"
                                 
                                 
                              
 
 
Output: 
                     
                        
                        - 
                           [
                           
 ]
$NOT- b1
 
- 
                           [
                           
 ]
- b2
 
- 
                           [
                           
 ]
- b3
 
- 
                           [
                           
 ]
 
                  
                  
                     let 
                     $NOT ≔ 
                     ""
                     
                   
                  
               
            
            
            
            
            
               
                  
                  - 
                     
                        - if 
                           
- 
                              
                                 - [2]['lem'] ≟ 
                                    "neg-cop"
                                    
                                 
 
then:
                              - 
                                 let 
                                 $NOT ≔             
                                 " ^not"
                                 
                                 <ADV.NEG>
                                 
                                 "{^not"
                                 
                                 <adv>
                                 
                                 "$}$"
                                 
                                 
                              
 
 
Output: 
                     
                        
                        - 
                           [
                           
 ]
$NOT- b1
 
- 
                           [
                           
 ]
- b2
 
- 
                           [
                           
 ]
 
                  
                  
                     let 
                     $NOT ≔ 
                     ""
                     
                   
                  
               
            
            
            
            
            
               
                  
                  - 
                     
                        - if 
                           
- 
                              
                                 - [2]['lem'] ≟ 
                                    "neg-cop"
                                    
                                 
 
then:
                              - 
                                 let 
                                 $NOT ≔             
                                 " ^not"
                                 
                                 <ADV.NEG>
                                 
                                 "{^not"
                                 
                                 <adv>
                                 
                                 "$}$"
                                 
                                 
                              
 
 
Output: 
                     
                        
                        - 
                           [
                           
 ]
- b1
 
- 
                           [
                           
 ]
$NOT- b2
 
- 
                           [
                           
 ]
 
                  
                  
                     let 
                     $NOT ≔ 
                     ""
                     
                   
                  
               
            
            
            
            
            
               
                  
                  - Output: 
                     
                        
                        - 
                           [
                           
 ]
- b1
 
- 
                           [
                           
 ]
 
            
            
            
            
            
               
                  
                  - insert-prep1(
                     $1
                     )
                  
- insert-poss1(
                     $1
                     )
                  
- insert-det1(
                     $1
                     )
                  
- Output: 
                     
                        
                        $PREP
                        
                        $POSS
                        
                        $DET
                        
                        - 
                           [
                           
 ]
 
            
            
            
            
               
                  
                  - insert-aux1(
                     $1
                     )
                  
- 
                     
                        
                        - if 
                           
- 
                              
                                 
                                 - [1]['a_prs'][2]['a_prs'] ≟ 
                                 
 
then:
 
 
Output: 
                     
                        
                        - 
                           [
                           
 ]
- b1
 
$PRS
                        
                        $AUX- 
                           [
                           
 ]
 
                  
                  
                     let 
                     $PRS ≔ 
                     ""
                     
                   
                  
               
            
            
            
            
            
               
                  
                  - insert-prs1(
                     $1
                     )
                  
- insert-aux1(
                     $1
                     )
                  
- Output: 
                     
                        
                        $PRS
                        
                        $AUX
                        
                        - 
                           [
                           
 ]
 
- 
                     let 
                     $PRS ≔ 
                     ""