mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
started with past tense
This commit is contained in:
@@ -58,6 +58,7 @@ oper
|
||||
-- Verbs
|
||||
mkV : overload {
|
||||
mkV : (sg3 : Str) -> V ; -- Predictable verb. Takes singular P3 form in present tense.
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,x13 : Str) -> V ; -- Full present, past, and infinitive forms.
|
||||
-- mkV : (nore : Str) -> (hada : V) -> V ; -- Add a prefix to an existing verb, e.g. 노래+하다
|
||||
} ;
|
||||
|
||||
@@ -228,6 +229,11 @@ oper
|
||||
-- s = \\vf => nore + hada.s ! vf} ;
|
||||
mkV : (x1,_,_,_,_,_,x7 : Str) -> V = \sg1,sg2,sg3,pl1,pl2,pl3,inf ->
|
||||
lin V (mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf) ;
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,x13 : Str) -> V =
|
||||
\sg1,sg2,sg3,pl1,pl2,pl3,pastSg1,pastSg2,pastSg3,pastPl1,pastPl2,pastPl3,inf ->
|
||||
lin V (mkVerbFullPast sg1 sg2 sg3 pl1 pl2 pl3
|
||||
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
|
||||
inf) ;
|
||||
} ;
|
||||
|
||||
copula = lin V ResHun.copula ;
|
||||
|
||||
@@ -198,13 +198,14 @@ param
|
||||
|
||||
VForm =
|
||||
VInf
|
||||
| VPres Person Number ;
|
||||
| VPres Person Number
|
||||
| VPast Person Number ;
|
||||
|
||||
oper
|
||||
|
||||
agr2vf : Person*Number -> VForm = \pn ->
|
||||
case <pn.p1,pn.p2> of {
|
||||
<p,n> => VPres p n
|
||||
agr2vf : Tense -> Person*Number -> VForm = \t,pn ->
|
||||
case <t,pn.p1,pn.p2> of {
|
||||
<Past,p,n> => VPast p n ;
|
||||
<_,p,n> => VPres p n
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -395,6 +395,24 @@ oper
|
||||
<P3,Pl> => harm "nak" "nek" -- TODO allomorphs -anak, -enek
|
||||
} ;
|
||||
|
||||
endingsPastIndef : VerbEndings = table {
|
||||
<P1,Sg> => harm3 "tam" "tem" "tem" ;
|
||||
<P2,Sg> => harm "tál" "tél" ;
|
||||
<P3,Sg> => harm1 "t" ;
|
||||
<P1,Pl> => harm "tunk" "tünk" ;
|
||||
<P2,Pl> => harm3 "tatok" "tetek" "tötök" ;
|
||||
<P3,Pl> => harm "tak" "tek"
|
||||
} ;
|
||||
|
||||
endingsPastDef : VerbEndings = table {
|
||||
<P1,Sg> => harm3 "tam" "tem" "tem" ;
|
||||
<P2,Sg> => harm "tad" "ted" ;
|
||||
<P3,Sg> => harm "ta" "te" ;
|
||||
<P1,Pl> => harm "tuk" "tük" ;
|
||||
<P2,Pl> => harm "tátok" "tétek" ;
|
||||
<P3,Pl> => harm "ták" "ték"
|
||||
} ;
|
||||
|
||||
BaseVerb : Type = {
|
||||
sc : SubjCase ; -- subject case
|
||||
} ;
|
||||
@@ -420,7 +438,8 @@ oper
|
||||
|
||||
vtov2 : Verb -> Verb2 = \v -> v ** {
|
||||
s = table {
|
||||
Def => let vDef : Verb = mkVerbReg endingsDef (v.s ! VInf) (v.s ! VPres P3 Sg)
|
||||
Def => let vDef : Verb = mkVerbRegPast endingsDef endingsPastDef
|
||||
(v.s ! VInf) (v.s ! VPres P3 Sg)
|
||||
in vDef.s ;
|
||||
Indef => v.s } ;
|
||||
c2 = Acc
|
||||
@@ -435,7 +454,10 @@ oper
|
||||
}
|
||||
in mkVerbReg endingsIndef inf sg3 ;
|
||||
|
||||
mkVerbReg : VerbEndings -> (inf, stem : Str) -> Verb = \hf,inf,stem ->
|
||||
mkVerbReg : VerbEndings -> (inf, stem : Str) -> Verb =
|
||||
\hf,inf,stem -> mkVerbRegPast hf endingsPastIndef inf stem ;
|
||||
|
||||
mkVerbRegPast : VerbEndings -> VerbEndings -> (inf, stem : Str) -> Verb = \hf,pastHf,inf,stem ->
|
||||
let h : Harm = getHarm stem ;
|
||||
sg1 : Str = stem + hf ! <P1,Sg> ! h ;
|
||||
sg2 : Str = stem + hf ! <P2,Sg> ! h ;
|
||||
@@ -443,10 +465,31 @@ oper
|
||||
pl1 : Str = stem + hf ! <P1,Pl> ! h ;
|
||||
pl2 : Str = stem + hf ! <P2,Pl> ! h ;
|
||||
pl3 : Str = stem + hf ! <P3,Pl> ! h ;
|
||||
in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf ;
|
||||
pastSg1 : Str = stem + pastHf ! <P1,Sg> ! h ;
|
||||
pastSg2 : Str = stem + pastHf ! <P2,Sg> ! h ;
|
||||
pastSg3 : Str = stem + pastHf ! <P3,Sg> ! h ;
|
||||
pastPl1 : Str = stem + pastHf ! <P1,Pl> ! h ;
|
||||
pastPl2 : Str = stem + pastHf ! <P2,Pl> ! h ;
|
||||
pastPl3 : Str = stem + pastHf ! <P3,Pl> ! h ;
|
||||
in mkVerbFullPast sg1 sg2 sg3 pl1 pl2 pl3
|
||||
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
|
||||
inf ;
|
||||
|
||||
mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb =
|
||||
\sg1,sg2,sg3,pl1,pl2,pl3,inf -> {
|
||||
\sg1,sg2,sg3,pl1,pl2,pl3,inf ->
|
||||
let h : Harm = getHarm sg3 ;
|
||||
pastSg1 : Str = sg3 + endingsPastIndef ! <P1,Sg> ! h ;
|
||||
pastSg2 : Str = sg3 + endingsPastIndef ! <P2,Sg> ! h ;
|
||||
pastSg3 : Str = sg3 + endingsPastIndef ! <P3,Sg> ! h ;
|
||||
pastPl1 : Str = sg3 + endingsPastIndef ! <P1,Pl> ! h ;
|
||||
pastPl2 : Str = sg3 + endingsPastIndef ! <P2,Pl> ! h ;
|
||||
pastPl3 : Str = sg3 + endingsPastIndef ! <P3,Pl> ! h ;
|
||||
in mkVerbFullPast sg1 sg2 sg3 pl1 pl2 pl3
|
||||
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
|
||||
inf ;
|
||||
|
||||
mkVerbFullPast : (x1,_,_,_,_,_,_,_,_,_,_,_,x13 : Str) -> Verb =
|
||||
\sg1,sg2,sg3,pl1,pl2,pl3,pastSg1,pastSg2,pastSg3,pastPl1,pastPl2,pastPl3,inf -> {
|
||||
s = table {
|
||||
VInf => inf ;
|
||||
VPres P1 Sg => sg1 ;
|
||||
@@ -454,18 +497,30 @@ oper
|
||||
VPres P3 Sg => sg3 ;
|
||||
VPres P1 Pl => pl1 ;
|
||||
VPres P2 Pl => pl2 ;
|
||||
VPres P3 Pl => pl3
|
||||
VPres P3 Pl => pl3 ;
|
||||
VPast P1 Sg => pastSg1 ;
|
||||
VPast P2 Sg => pastSg2 ;
|
||||
VPast P3 Sg => pastSg3 ;
|
||||
VPast P1 Pl => pastPl1 ;
|
||||
VPast P2 Pl => pastPl2 ;
|
||||
VPast P3 Pl => pastPl3
|
||||
} ;
|
||||
sc = SCNom
|
||||
} ;
|
||||
|
||||
copula : Verb = mkVerbFull
|
||||
copula : Verb = mkVerbFullPast
|
||||
"vagyok"
|
||||
"vagy"
|
||||
"van"
|
||||
"vagyunk"
|
||||
"vagytok"
|
||||
"vannak"
|
||||
"voltam"
|
||||
"voltál"
|
||||
"volt"
|
||||
"voltunk"
|
||||
"voltatok"
|
||||
"voltak"
|
||||
"lenni" ;
|
||||
|
||||
megvan : Verb = copula ** {
|
||||
@@ -521,7 +576,7 @@ oper
|
||||
SCDat => Dat }
|
||||
in linNP' NoPoss subjcase np
|
||||
++ if_then_Pol p [] "nem"
|
||||
++ vp.s ! agr2vf np.agr
|
||||
++ vp.s ! agr2vf t np.agr
|
||||
++ vp.obj -- ! np.agr
|
||||
++ vp.adv
|
||||
++ np.empty -- standard trick for prodrop+metavariable problem
|
||||
@@ -542,7 +597,7 @@ oper
|
||||
++ if_then_Pol p [] "nem"
|
||||
++ vp.obj -- ! <rp.agr.p1,n>
|
||||
++ vp.adv
|
||||
++ vp.s ! VPres rp.agr.p1 n -- variable by number
|
||||
++ vp.s ! agr2vf t <rp.agr.p1,n> -- variable by number
|
||||
} ;
|
||||
|
||||
relSlash : RP -> ClSlash -> RClause = \rp,cls -> {
|
||||
|
||||
@@ -164,9 +164,13 @@ insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** {
|
||||
<SCDat,Nom> =>
|
||||
let agr : Person*Number = case vf of {
|
||||
VPres p n => <p,n> ;
|
||||
VPast p n => <p,n> ;
|
||||
_ => <P3,Sg> } ;
|
||||
objvf : VForm = case vf of {
|
||||
VPast _ _ => VPast np.agr.p1 np.agr.p2 ;
|
||||
_ => VPres np.agr.p1 np.agr.p2 } ;
|
||||
in np.s ! Poss agr.p1 agr.p2 ! vps.c2
|
||||
++ vps.s ! np.objdef ! agr2vf np.agr ;
|
||||
++ vps.s ! np.objdef ! objvf ;
|
||||
|
||||
-- Default case: Verb agrees in person and number with subject
|
||||
_ => vps.s ! np.objdef ! vf } ;
|
||||
|
||||
Reference in New Issue
Block a user