forked from GitHub/gf-core
stemming in Fin also for verbs now
This commit is contained in:
@@ -126,4 +126,156 @@ oper
|
||||
} ;
|
||||
|
||||
|
||||
-- verbs
|
||||
|
||||
oper
|
||||
SVForm : Type = Predef.Ints 12 ;
|
||||
SVerb : Type = {s : SVForm => Str ; h : Harmony} ;
|
||||
|
||||
-- used in Cat
|
||||
SVerb1 = {s : SVForm => Str ; sc : NPForm ; h : Harmony ; p : Str} ;
|
||||
|
||||
sverb2verbBind : SVerb -> Verb = sverb2verb True ;
|
||||
sverb2verbSep : SVerb -> Verb = sverb2verb False ;
|
||||
|
||||
vforms2sverb : VForms -> SVerb = \vf -> {
|
||||
s = table {
|
||||
0 => (vf ! 0) ; -- tulla
|
||||
1 => Predef.tk 1 (vf ! 1) ; -- tule(n)
|
||||
2 => (vf ! 2) ; -- tulee
|
||||
3 => Predef.tk 3 (vf ! 3) ; -- tule(vat)
|
||||
4 => Predef.tk 2 (vf ! 4) ; -- tulk(aa)
|
||||
5 => Predef.tk 2 (vf ! 5) ; -- tulla(an)
|
||||
6 => Predef.tk 1 (vf ! 6) ; -- tuli(n)
|
||||
7 => (vf ! 7) ; -- tuli
|
||||
8 => (vf ! 8) ; -- tulisi
|
||||
9 => Predef.tk 2 (vf ! 9) ; -- tull(ut)
|
||||
10 => (vf ! 10) ; -- tultu
|
||||
11 => weakGrade (vf ! 10) ; -- tullu(n)
|
||||
12 => Predef.tk 1 (vf ! 11) -- tulle(e)
|
||||
} ;
|
||||
h = aHarmony (last (vf ! 0)) ;
|
||||
} ;
|
||||
|
||||
sverb2verb : Bool -> SVerb -> Verb = \b,sverb ->
|
||||
let
|
||||
plus = plusIf b ;
|
||||
vh = sverb.s ;
|
||||
|
||||
tulla = vh ! 0 ;
|
||||
tule_ = vh ! 1 ; -- tule(n)
|
||||
tulee = vh ! 2 ;
|
||||
tule__ = vh ! 3 ; -- tule(vat)
|
||||
tulk_ = vh ! 4 ; -- tulk(aa)
|
||||
tulla_ = vh ! 5 ; -- tulla(an)
|
||||
tuli_ = vh ! 6 ; -- tuli(n)
|
||||
tuli = vh ! 7 ;
|
||||
tulisi = vh ! 8 ;
|
||||
tull_ = vh ! 9 ; -- tull(ut)
|
||||
tultu = vh ! 10 ;
|
||||
tullu__ = vh ! 11 ; -- tullu(n)
|
||||
tulle_ = vh ! 12 ; -- tulle(e)
|
||||
|
||||
a = harmonyA sverb.h ;
|
||||
o = harmonyV "o" "ö" sverb.h ;
|
||||
u = harmonyV "u" "y" sverb.h ;
|
||||
|
||||
tulko = plus tulk_ o ;
|
||||
tulkoo = plus tulko o ;
|
||||
tullee = plus tull_ "ee" ;
|
||||
tulle = plus tull_ "e" ;
|
||||
tullu_ = plus tull_ u ;
|
||||
tullut = plus tullu_ "t" ;
|
||||
tullun = plus tullu_ "n" ;
|
||||
|
||||
tullutN : Noun = snoun2noun b {
|
||||
s = table SNForm [
|
||||
tullut ;
|
||||
tullee ;
|
||||
plus tullut ("t" + a) ;
|
||||
plus tullee ("n" + a) ;
|
||||
plus tullee "see" ;
|
||||
plus tulle "ide" ;
|
||||
plus tulle ("it" + a) ;
|
||||
plus tulle "i" ;
|
||||
plus tulle "i" ;
|
||||
plus tulle "isii"
|
||||
] ;
|
||||
h = sverb.h
|
||||
} ;
|
||||
|
||||
tultuN : Noun = snoun2noun b {
|
||||
s = table SNForm [
|
||||
tultu ;
|
||||
tullu__ ;
|
||||
plus tultu a ;
|
||||
plus tultu ("n" + a) ;
|
||||
plus tultu u ;
|
||||
plus tultu "je" ;
|
||||
plus tultu ("j" + a) ;
|
||||
plus tultu "i" ;
|
||||
plus tullu__ "i" ;
|
||||
plus tultu "ihi"
|
||||
] ;
|
||||
h = sverb.h
|
||||
} ;
|
||||
|
||||
|
||||
tulema = plus tule__ ("m" + a) ;
|
||||
vat = "v" + a + "t"
|
||||
in
|
||||
{s = table {
|
||||
Inf Inf1 => tulla ;
|
||||
Presn Sg P1 => plus tule_ "n" ;
|
||||
Presn Sg P2 => plus tule_ "t" ;
|
||||
Presn Sg P3 => tulee ;
|
||||
Presn Pl P1 => plus tule_ "mme" ;
|
||||
Presn Pl P2 => plus tule_ "tte" ;
|
||||
Presn Pl P3 => plus tule__ vat ;
|
||||
Impf Sg P1 => plus tuli_ "n" ; --# notpresent
|
||||
Impf Sg P2 => plus tuli_ "t" ; --# notpresent
|
||||
Impf Sg P3 => tuli ; --# notpresent
|
||||
Impf Pl P1 => plus tuli_ "mme" ; --# notpresent
|
||||
Impf Pl P2 => plus tuli_ "tte" ; --# notpresent
|
||||
Impf Pl P3 => plus tuli vat ; --# notpresent
|
||||
Condit Sg P1 => plus tulisi "n" ; --# notpresent
|
||||
Condit Sg P2 => plus tulisi "t" ; --# notpresent
|
||||
Condit Sg P3 => tulisi ; --# notpresent
|
||||
Condit Pl P1 => plus tulisi "mme" ; --# notpresent
|
||||
Condit Pl P2 => plus tulisi "tte" ; --# notpresent
|
||||
Condit Pl P3 => plus tulisi vat ; --# notpresent
|
||||
Imper Sg => tule_ ;
|
||||
Imper Pl => plus tulk_ (a + a) ;
|
||||
ImperP3 Sg => plus tulkoo "n" ;
|
||||
ImperP3 Pl => plus tulkoo "t" ;
|
||||
ImperP1Pl => plus tulk_ (a + a + "mme") ;
|
||||
ImpNegPl => tulko ;
|
||||
Pass True => plus tulla_ (a + "n") ;
|
||||
Pass False => tulla_ ;
|
||||
PastPartAct (AN n) => tullutN.s ! n ;
|
||||
PastPartAct AAdv => plus tullee "sti" ;
|
||||
PastPartPass (AN n) => tultuN.s ! n ;
|
||||
PastPartPass AAdv => plus tullu__ "sti" ;
|
||||
Inf Inf3Iness => plus tulema ("ss" + a) ;
|
||||
Inf Inf3Elat => plus tulema ("st" + a) ;
|
||||
Inf Inf3Illat => plus tulema (a + "n") ;
|
||||
Inf Inf3Adess => plus tulema ("ll" + a) ;
|
||||
Inf Inf3Abess => plus tulema ("tt" + a)
|
||||
} ;
|
||||
sc = NPCase Nom ;
|
||||
lock_V = <>
|
||||
} ;
|
||||
|
||||
predSV : SVerb1 -> VP = \sv ->
|
||||
predV (sverb2verbSep sv ** {p = sv.p ; sc = sv.sc ; qp = case sv.h of {Back => True ; Front => False}}) ;
|
||||
-- (Verb ** {sc : NPForm ; qp : Bool ; p : Str}) -> VP = \verb -> {
|
||||
|
||||
|
||||
-- auxiliary
|
||||
|
||||
plusIf : Bool -> Str -> Str -> Str = \b,x,y -> case b of {
|
||||
True => x + y ;
|
||||
False => glue x y
|
||||
} ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user