diff --git a/src/estonian/CatEst.gf b/src/estonian/CatEst.gf index 6207874f..29c85753 100644 --- a/src/estonian/CatEst.gf +++ b/src/estonian/CatEst.gf @@ -80,21 +80,24 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in { -- Open lexical classes, e.g. Lexicon V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ; - V2, VA, V2Q, V2S = Verb1 ** {c2 : Compl} ; - V2A = Verb1 ** {c2, c3 : Compl} ; - VV = Verb1 ** {vi : InfForm} ; ---- infinitive form - V2V = Verb1 ** {c2 : Compl ; vi : InfForm} ; ---- infinitive form - V3 = Verb1 ** {c2, c3 : Compl} ; + V2, VA, V2Q, V2S = Verb2 ; + V2A, V3 = Verb3 ; + VV = Verb1 ** {vi : InfForm} ; + V2V = Verb2 ** {vi : InfForm} ; -- infinitive form A = Adjective ** {infl : Infl} ; A2 = A ** {c2 : Compl} ; N = Noun ; - N2 = Noun ** {c2 : Compl ; isPre : Bool ; lock_N2 : {}} ; - N3 = Noun ** {c2,c3 : Compl ; isPre,isPre2 : Bool ; lock_N3 : {}} ; + N2 = Noun ** {c2 : Compl ; isPre : Bool} ; + N3 = Noun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ; PN = {s : Case => Str} ; -oper Verb1 = Verb ** { sc : NPForm} ; --what is this for? --subject case, i.e. "ma näen kassi"/"mul on kass" + linref + VP = \vp -> linV vp.v ; + V,VS,VQ = linV ; + V2,VA,V2S,V2Q = linV2 ; + } diff --git a/src/estonian/ExtendEst.gf b/src/estonian/ExtendEst.gf index 1103c5b7..0e3c230e 100644 --- a/src/estonian/ExtendEst.gf +++ b/src/estonian/ExtendEst.gf @@ -395,7 +395,7 @@ concrete ExtendEst of Extend = vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut ++ vp.adv -- paremini ++ vp.p -- ära - ++ (vp.s ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/... + ++ (mkVPForms vp.v ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/... ++ vp.ext ; --------------------------------- diff --git a/src/estonian/ExtraEst.gf b/src/estonian/ExtraEst.gf index 16ba9ea7..63d32741 100644 --- a/src/estonian/ExtraEst.gf +++ b/src/estonian/ExtraEst.gf @@ -60,7 +60,7 @@ concrete ExtraEst of ExtraEstAbs = CatEst ** } ; MkVPS t p vp = { -- Temp -> Pol -> VP -> VPS ; - s = \\a => let vps = vp.s ! VIFin t.t ! t.a ! p.p ! a + s = \\a => let vps = mkVPForms vp.v ! VIFin t.t ! t.a ! p.p ! a in t.s ++ p.s ++ vps.fin ++ vps.inf ++ diff --git a/src/estonian/IdiomEst.gf b/src/estonian/IdiomEst.gf index c4e3657a..a57c8964 100644 --- a/src/estonian/IdiomEst.gf +++ b/src/estonian/IdiomEst.gf @@ -39,21 +39,14 @@ concrete IdiomEst of Idiom = CatEst ** ImpersCl vp = mkClause noSubj (agrP3 Sg) vp ; - GenericCl vp = mkClause noSubj (agrP3 Sg) { - s = \\_ => vp.s ! VIPass Pres ; - s2 = vp.s2 ; - adv = vp.adv ; - p = vp.p ; - ext = vp.ext ; - sc = vp.sc ; - } ; + GenericCl vp = mkClause noSubj (agrP3 Sg) (passiveVP vp) ; ProgrVP vp = let - inf = (vp.s ! VIInf InfMas ! Simul ! Pos ! agrP3 Sg).fin ; + inf = (mkVPForms vp.v ! VIInf InfMas ! Simul ! Pos ! agrP3 Sg).fin ; on = predV olla in { - s = on.s ; + v = verbOlema ; s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ inf ; adv = vp.adv ; p = vp.p ; @@ -65,7 +58,7 @@ concrete IdiomEst of Idiom = CatEst ** -- The imperative is not available in a $VP$. ImpPl1 vp = - let vps = vp.s ! VIPass Pres ! Simul ! Pos ! Ag Pl P1 + let vps = mkVPForms vp.v ! VIPass Pres ! Simul ! Pos ! Ag Pl P1 in {s = vps.fin ++ vps.inf ++ vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.p ++ vp.ext diff --git a/src/estonian/ResEst.gf b/src/estonian/ResEst.gf index 1e123dd4..cbcece30 100644 --- a/src/estonian/ResEst.gf +++ b/src/estonian/ResEst.gf @@ -176,6 +176,13 @@ param p : Str -- particle verbs } ; + Verb1 : Type = Verb ** {sc : NPForm} ; --subject case, i.e. "ma näen kassi"/"mul on kass" + Verb2 : Type = Verb1 ** {c2 : Compl} ; + Verb3 : Type = Verb2 ** {c3 : Compl} ; + + linV : Verb -> Str = \v -> v.s ! Inf InfMa ++ v.p ; + linV2 : Verb -> Str = \v -> v.s ! Inf InfMa ++ v.p ; + param VIForm = VIFin Tense @@ -187,7 +194,7 @@ param oper VP : Type = { - s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ; + v : Verb ; s2 : Bool => Polarity => Agr => Str ; -- raamat/raamatu/raamatut adv : Str ; p : Str ; --uninflecting component in multi-word verbs @@ -195,48 +202,63 @@ oper sc : NPForm ; } ; - predV : (Verb ** {sc : NPForm}) -> VP = \verb -> { - s = \\vi,ant,b,agr0 => - let - agr = verbAgr agr0 ; - verbs = verb.s ; - part : Str = case vi of { - VIPass _ => verbs ! (PastPart Pass) ; - _ => verbs ! (PastPart Act) - } ; + passiveVerb : Verb -> Verb = \verb -> verb ** { + s = table { + Presn _ _ => verb.s ! PassPresn True ; + Impf _ _ => verb.s ! PassImpf True ; --# notpresent + Condit _ _ => verb.s ! ConditPass ; --# notpresent + ImperP3|ImperP1Pl|Imper _ => verb.s ! ImperPass ; + PresPart _ => verb.s ! PresPart Pass ; + PastPart _ => verb.s ! PastPart Pass ; + x => verb.s ! x } + } ; - einegole : Str * Str * Str = case of { - => <"ei", verbs ! Imper Sg, "ole"> ; - => <"ei", verbs ! Imper Sg, "ole"> ; - => <"ei", verbs ! Condit Sg P3, "oleks"> ; - => <"ei", part, "olnud"> ; - => <"ära", verbs ! Imper Sg, "ole"> ; - => <"ärge", verbs ! Imper Pl, "olge"> ; - => <"ei", verbs ! PassPresn False, "ole"> ; - => <"ei", verbs ! PassPresn False, "ole"> ; --# notpresent - => <"ei", verbs ! ConditPass, "oleks"> ; --# notpresent - => <"ei", verbs ! PassImpf False, "olnud"> ; --# notpresent - => <"ei", verbs ! PresPart Act, "olev"> ; --# notpresent - => <"ei", verbs ! Inf i, verbOlema.s ! Inf i> + -- NB. only chooses passive verb forms, to get subject case need compl2subjcase, used in PassV2 + passiveVP : VP -> VP = \vp -> vp ** {v = passiveVerb vp.v} ; - } ; + VPForms : Type = VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ; - ei : Str = einegole.p1 ; - neg : Str = einegole.p2 ; - ole : Str = einegole.p3 ; + mkVPForms : Verb -> VPForms = \verb -> \\vi,ant,b,agr0 => + let + agr = verbAgr agr0 ; + verbs = verb.s ; + part : Str = case vi of { + VIPass _ => verbs ! PastPart Pass ; + _ => verbs ! PastPart Act + } ; - olema : VForm => Str = verbOlema.s ; + einegole : Str * Str * Str = case of { + => <"ei", verbs ! Imper Sg, "ole"> ; + => <"ei", verbs ! Imper Sg, "ole"> ; + => <"ei", verbs ! Condit Sg P3, "oleks"> ; + => <"ei", part, "olnud"> ; + => <"ära", verbs ! Imper Sg, "ole"> ; + => <"ärge", verbs ! Imper Pl, "olge"> ; + => <"ei", verbs ! PassPresn False, "ole"> ; + => <"ei", verbs ! PassPresn False, "ole"> ; --# notpresent + => <"ei", verbs ! ConditPass, "oleks"> ; --# notpresent + => <"ei", verbs ! PassImpf False, "olnud"> ; --# notpresent + => <"ei", verbs ! PresPart Act, "olev"> ; --# notpresent + => <"ei", verbs ! Inf i, verbOlema.s ! Inf i> - vf : Str -> Str -> {fin, inf : Str} = \x,y -> {fin = x ; inf = y} ; + } ; - mkvf : VForm -> {fin, inf : Str} = \p -> case of { - => vf (verbs ! p) [] ; - => vf (olema ! p) part ; - => vf (ei ++ neg) [] ; - => vf (ei ++ ole) part - } ; + ei : Str = einegole.p1 ; + neg : Str = einegole.p2 ; + ole : Str = einegole.p3 ; - passPol = case b of {Pos => True ; Neg => False} ; + olema : VForm => Str = verbOlema.s ; + + vf : Str -> Str -> {fin, inf : Str} = \x,y -> {fin = x ; inf = y} ; + + mkvf : VForm -> {fin, inf : Str} = \p -> case of { + => vf (verbs ! p) [] ; + => vf (olema ! p) part ; + => vf (ei ++ neg) [] ; + => vf (ei ++ ole) part + } ; + + passPol = case b of {Pos => True ; Neg => False} ; in case vi of { VIFin Past => mkvf (Impf agr.n agr.p) ; --# notpresent @@ -252,6 +274,8 @@ oper VIInf i => mkvf (Inf i) } ; + predV : Verb1 -> VP = \verb -> { + v = verb ; -- ignoring the subject s2 = \\_,_,_ => [] ; adv = [] ; ext = [] ; --relative clause @@ -329,7 +353,7 @@ oper NPCase Nom => ; _ => -- minule meeldib, minul on } ; - verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ; + verb = mkVPForms vp.v ! VIFin t ! a ! b ! agrfin.p1 ; in {subj = sub b ; fin = verb.fin ; inf = verb.inf ; @@ -389,7 +413,7 @@ oper NPCase Nom => True ; -- mina tahan joosta _ => False -- minul peab auto olema } ; - verb = vp.s ! VIInf vi ! ant ! Pos ! agr ; -- no "ei" + verb = mkVPForms vp.v ! VIInf vi ! ant ! Pos ! agr ; -- no "ei" compl = vp.s2 ! fin ! pol ! agr ; -- but compl. case propagated adv = vp.adv in @@ -590,8 +614,7 @@ oper } ; } ; - Noun = {s : NForm => Str} ; - + Noun : Type = {s : NForm => Str} ; -- To form an adjective, it is usually enough to give a noun declension: the -- adverbial form is regular. @@ -660,7 +683,7 @@ oper -- Converts 6 given strings (Nom, Gen, Part, Illat, Gen, Part) into Noun -- http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=226 - nForms2N : NForms -> Noun = \f -> + nForms2N : NForms -> Noun = \f -> let jogi = f ! 0 ; joe = f ! 1 ; diff --git a/src/estonian/SentenceEst.gf b/src/estonian/SentenceEst.gf index f14b1e96..7209fc20 100644 --- a/src/estonian/SentenceEst.gf +++ b/src/estonian/SentenceEst.gf @@ -11,7 +11,7 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in { ImpVP vp = { s = \\pol,agr => let - verb = vp.s ! VIImper ! Simul ! pol ! agr ; + verb = mkVPForms vp.v ! VIImper ! Simul ! pol ! agr ; compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto) in --(ära) loe raamat(ut) läbi verb.fin ++ verb.inf ++ compl ++ vp.p ; diff --git a/src/estonian/VerbEst.gf b/src/estonian/VerbEst.gf index 3c8344a3..3f5f0c3d 100644 --- a/src/estonian/VerbEst.gf +++ b/src/estonian/VerbEst.gf @@ -79,13 +79,7 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in { ReflVP v = insertObjPre (\\fin,b,agr => appCompl fin b v.c2 (reflPron agr)) v ; - PassV2 v = - let vp = predV v in vp ** { - s = \\vf => case vf of { - VIFin t => vp.s ! VIPass t ; - -- VIImper => v.s ! ImperPass ; -- TODO: include these forms from V into VP - -- VIPresPart => v.s ! PresPart Pass ; - x => vp.s ! x } ; + PassV2 v = let vp : VP = passiveVP (predV v) in vp ** { sc = compl2subjcase v.c2 -- koer valitakse ; koerale räägitakse } ;