diff --git a/src/estonian/CatEst.gf b/src/estonian/CatEst.gf index 29c857538..0b8b5cc6a 100644 --- a/src/estonian/CatEst.gf +++ b/src/estonian/CatEst.gf @@ -82,8 +82,8 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in { V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ; V2, VA, V2Q, V2S = Verb2 ; V2A, V3 = Verb3 ; - VV = Verb1 ** {vi : InfForm} ; - V2V = Verb2 ** {vi : InfForm} ; -- infinitive form + VV = Verb1 ** {vi : InfForms} ; + V2V = Verb2 ** {vi : InfForms} ; A = Adjective ** {infl : Infl} ; A2 = A ** {c2 : Compl} ; diff --git a/src/estonian/DocumentationEstFunctor.gf b/src/estonian/DocumentationEstFunctor.gf index a8e683430..a40affde8 100644 --- a/src/estonian/DocumentationEstFunctor.gf +++ b/src/estonian/DocumentationEstFunctor.gf @@ -142,6 +142,8 @@ oper --verb = sverb2verbSep verb0 ; vfin : ResEst.VForm -> Str = \f -> verb.s ! f ; + vinf : ResEst.InfForms -> Str = \if -> + applyInfFormsV if verb.s ; nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 -> (S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP n2))).s ; @@ -218,15 +220,16 @@ oper heading3 (heading infinitive_Parameter) ++ frameTable ( tr (intagAttr "th" "rowspan=2" "da" ++ - th (heading nominative_Parameter) ++ td (vfin (Inf InfDa))) ++ - tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfDes))) ++ + th (heading nominative_Parameter) ++ td (vinf InfDa)) ++ + tr (th (heading inessive_Parameter) ++ td (vinf InfDes)) ++ - tr (intagAttr "th" "rowspan=5" "ma" ++ - th (heading illative_Parameter) ++ td (vfin (Inf InfMa))) ++ - tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfMas))) ++ - tr (th (heading elative_Parameter) ++ td (vfin (Inf InfMast))) ++ - tr (th (heading abessive_Parameter) ++ td (vfin (Inf InfMata))) ++ - tr (th (heading translative_Parameter) ++ td (vfin (Inf InfMaks))) + tr (intagAttr "th" "rowspan=6" "ma" ++ + th (heading illative_Parameter) ++ td (vinf InfMa)) ++ + tr (th (heading inessive_Parameter) ++ td (vinf InfMas)) ++ + tr (th (heading elative_Parameter) ++ td (vinf InfMast)) ++ + tr (th (heading abessive_Parameter) ++ td (vinf InfMata)) ++ + tr (th (heading abessive_Parameter) ++ td (vinf InfMaks)) ++ + tr (th (heading translative_Parameter) ++ td (vinf InfMine)) ) ++ heading3 (heading participle_Parameter) ++ diff --git a/src/estonian/ExtendEst.gf b/src/estonian/ExtendEst.gf index 0e3c230e9..c953be653 100644 --- a/src/estonian/ExtendEst.gf +++ b/src/estonian/ExtendEst.gf @@ -40,7 +40,7 @@ concrete ExtendEst of Extend = Prelude, MorphoEst, LexiconEst, - ParadigmsEst in { + ParadigmsEst in { --------------------------------- -- VPS, VPI, VPS2 + list versions @@ -176,7 +176,7 @@ concrete ExtendEst of Extend = A2VPSlash a2 = UseComp (CompAP (UseA2 a2)) ** {c2 = a2.c2} ; -- : VP -> Adv ; - ByVP vp = {s = vp2adv vp True (VIInf InfDes)} ; + ByVP = GerundAdv ; --------------------------------- -- C @@ -220,15 +220,8 @@ concrete ExtendEst of Extend = lin - {- TODO: need to change VP to get EmbedPresPart and various Gerunds to work: - 1) Add "mine" form into VP (or switch to a BIND solution and just add a stem) - 2) Change s2 in VP so that we can manipulate the complement to be in genitive! - - -- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore) - EmbedPresPart vp = - let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! } - {s = vp2adv vp True VI } ; - -} + -- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore) / ___ga abielus olemine, + EmbedPresPart vp = {s = infVP (NPCase Gen) Pos (agrP3 Sg) vp InfMine } ; EmbedSSlash s = {s = s.s ++ s.c2.s} ; @@ -302,14 +295,13 @@ concrete ExtendEst of Extend = GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ; -- : VP -> Adv - GerundAdv vp = {s = vp2adv vp True (VIInf InfDes)} ; - + GerundAdv vp = {s = infVPdefault vp InfDes} ; -- : VP -> CN -- publishing of the document (can get a determiner) --- GerundCN vp = {} ; + GerundCN vp = {s = \\nf => infVPdefault vp InfMine} ; -- : VP -> NP -- publishing the document (by nature definite) --- GerundNP vp = {} ; + GerundNP vp = MassNP (GerundCN vp) ; --------------------------------- -- I - N @@ -322,9 +314,8 @@ concrete ExtendEst of Extend = -- : Adv -> IAdv ; -- "how often" IAdvAdv adv = { s = "kui" ++ adv.s } ; - -- : VP -> Adv - InOrderToVP vp = -- et raamatut paremini näha - { s = "et" ++ vp2adv vp True (VIInf InfDa) } ; + -- : VP -> Adv -- et raamatut paremini näha + InOrderToVP vp = {s = "et" ++ infVPdefault vp InfDa} ; -- : N2 -> VPSlash N2VPSlash n2 = UseComp (CompCN (UseN2 n2)) ** {c2 = n2.c2} ; @@ -380,7 +371,7 @@ concrete ExtendEst of Extend = in existClause noSubj (agrP3 Sg) heaOlla ; -- : IAdv -> VP -> QCl ; -- how to walk? - PredIAdvVP iadv vp = {s = \\t,a,p => iadv.s ++ vp2adv vp True (VIInf InfMa)} ; + PredIAdvVP iadv vp = {s = \\t,a,p => iadv.s ++ infVPdefault vp InfMa} ; PrepCN prep cn = PrepNP prep (MassNP cn) ; @@ -391,12 +382,19 @@ concrete ExtendEst of Extend = PurposeVP = InOrderToVP ; --- is there a difference? oper + -- calling infVP with the "default arguments": NPCase Nom, Pos, agrP3 Sg + infVPdefault : VP -> InfForms -> Str = infVP (NPCase Nom) Pos (agrP3 Sg) ; + vp2adv : R.VP -> Bool -> VIForm -> Str = \vp,sentIsPos,vif -> - vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut - ++ vp.adv -- paremini - ++ vp.p -- ära - ++ (mkVPForms vp.v ! vif ! Simul ! Pos ! agrP3 Sg).fin -- tunda/tundes/tundmata/... - ++ vp.ext ; + let vpforms : {fin,inf : Str} = case vif of { + VIInf if => applyInfFormsVP {stem=if ; suf="a"} vp ; --- this oper shouldn't be used if you want to use an InfForm but just trying to be robust here + _ => mkVPForms vp.v ! vif ! Simul ! Pos ! agrP3 Sg} ; + in vp.s2 ! sentIsPos ! Pos ! agrP3 Sg -- raamatut + ++ vp.adv -- paremini + ++ vp.p -- ära + ++ vpforms.fin -- tunda/tundes/tundmata/... + ++ vpforms.inf -- TODO is this necessary??? + ++ vp.ext ; --------------------------------- -- S - W @@ -415,14 +413,11 @@ concrete ExtendEst of Extend = UttDatIP ip = {s = ip.s ! NPCase Part} ; -- is partitive a reasonable translation? UttDatNP np = {s = np.s ! NPCase Part} ; - -- : VP -> Utt ; -- There's no "short form", so just using InfMa instead of InfDa - UttVPShort vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ; - --TODO: maybe InfMa should be default in PhraseEst and InfDa here? + -- : VP -> Utt ; -- There's no "short form", so just using InfDa instead of InfMa + UttVPShort vp = {s = infVPdefault vp InfDa} ; - - - WithoutVP vp = -- ilma raamatut nägemata - { s = "ilma" ++ vp2adv vp False (VIInf InfMata) } ; + -- : VP -> Adv ; -- ilma raamatut nägemata + WithoutVP vp = {s = "ilma" ++ infVPdefault vp InfMata} ; } diff --git a/src/estonian/ExtraEst.gf b/src/estonian/ExtraEst.gf index 63d32741c..3de8e8b56 100644 --- a/src/estonian/ExtraEst.gf +++ b/src/estonian/ExtraEst.gf @@ -27,18 +27,24 @@ concrete ExtraEst of ExtraEstAbs = CatEst ** lin CN { s = \\nf => np.s ! NPCase c ++ cn.s ! nf } ; lincat - VPI = {s : InfForm => Str} ; - [VPI] = {s1,s2 : InfForm => Str} ; + VPI = {s : InfStem => Str} ; + [VPI] = {s1,s2 : InfStem => Str} ; -- VPI = {s : Str} ; -- [VPI] = {s1,s2 : Str} ; lin - BaseVPI = twoTable InfForm ; - ConsVPI = consrTable InfForm comma ; + BaseVPI = twoTable InfStem ; + ConsVPI = consrTable InfStem comma ; - MkVPI vp = {s = \\i => infVP (NPCase Nom) Pos (agrP3 Sg) vp i} ; - ConjVPI = conjunctDistrTable InfForm ; + MkVPI vp = {s = \\i => infVPIF (NPCase Nom) Pos (agrP3 Sg) vp i} ; + ConjVPI = conjunctDistrTable InfStem ; ComplVPIVV vv vpi = - insertObj (\\_,_,_ => vpi.s ! vv.vi) (predV vv) ; + insertObj (\\_,_,_ => vpi.s ! vv.vi.stem) (predV vv) ; + + oper + -- Version that uses InfStem + infVPIF : NPForm -> Polarity -> Agr -> VP -> InfStem -> Str = \sc,pol,agr,vp,if -> + infVPAnt Simul sc pol agr vp {stem=if ; suf="a"} ; + lincat VPS = { diff --git a/src/estonian/IdiomEst.gf b/src/estonian/IdiomEst.gf index a57c8964d..59c1b9ef6 100644 --- a/src/estonian/IdiomEst.gf +++ b/src/estonian/IdiomEst.gf @@ -41,18 +41,10 @@ concrete IdiomEst of Idiom = CatEst ** GenericCl vp = mkClause noSubj (agrP3 Sg) (passiveVP vp) ; - ProgrVP vp = - let - inf = (mkVPForms vp.v ! VIInf InfMas ! Simul ! Pos ! agrP3 Sg).fin ; - on = predV olla - in { - v = verbOlema ; - s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ inf ; - adv = vp.adv ; - p = vp.p ; - ext = vp.ext ; - sc = vp.sc ; - } ; + ProgrVP vp = vp ** { + v = verbOlema ; + s2 = \\b,p,a => vp.s2 ! b ! p ! a ++ (applyInfFormsVP InfMas vp).fin ; + } ; -- This gives "otetaan oluet" instead of "ottakaamme oluet". -- The imperative is not available in a $VP$. diff --git a/src/estonian/ParadigmsEst.gf b/src/estonian/ParadigmsEst.gf index 5f74e4725..432f622f5 100644 --- a/src/estonian/ParadigmsEst.gf +++ b/src/estonian/ParadigmsEst.gf @@ -27,6 +27,7 @@ resource ParadigmsEst = open (Predef=Predef), Prelude, MorphoEst, + (ResEst=ResEst), HjkEst, CatEst in { @@ -62,6 +63,8 @@ oper abessive : Case ; -- e.g. "karbita" comitative : Case ; -- e.g. "karbiga" + InfForm : Type ; + infDa : InfForm ; -- e.g. "lugeda" infDes : InfForm ; -- e.g. "lugedes" infMa : InfForm ; -- e.g. "lugema" @@ -69,6 +72,7 @@ oper infMaks : InfForm ; -- e.g. "lugemaks" infMast : InfForm ; -- e.g. "lugemast" infMata : InfForm ; -- e.g. "lugemata" + infMine : InfForm ; -- e.g. "lugemine" -- The following type is used for defining *rection*, i.e. complements -- of many-place verbs and adjective. A complement can be defined by @@ -293,8 +297,10 @@ oper abessive = Abess ; comitative = Comit ; + -- combination of stem + suffix, e.g. infDes = {stem = InfD ; suf = "es"} ; + InfForm = ResEst.InfForms ; infDa = InfDa ; infMa = InfMa ; infMast = InfMast ; - infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; + infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; infMine = InfMine ; prePrep : Case -> Str -> Prep = \c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ; @@ -856,7 +862,7 @@ oper mkVV : V -> VV = \v -> mkVVf v infDa ; mkVV : Str -> VV = \str -> mkVVf (mkV str) infDa ; } ; - mkVVf v f = v ** {vi = f ; lock_VV = <>} ; + mkVVf v f = lin VV (v ** {vi = f}) ; mkVQ = overload { mkVQ : V -> VQ = \v -> v ** {lock_VQ = <>} ; mkVQ : Str -> VQ = \str -> (mkV str) ** {lock_VQ = <>} ; diff --git a/src/estonian/PhraseEst.gf b/src/estonian/PhraseEst.gf index 904528395..0557107b1 100644 --- a/src/estonian/PhraseEst.gf +++ b/src/estonian/PhraseEst.gf @@ -12,7 +12,7 @@ concrete PhraseEst of Phrase = CatEst ** open ResEst, (P = Prelude) in { UttIP ip = {s = ip.s ! NPCase Nom} ; UttIAdv iadv = iadv ; UttNP np = {s = np.s ! NPCase Nom} ; - UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfDa} ; + UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp InfMa} ; UttAdv adv = adv ; UttCN np = {s = np.s ! NCase Sg Nom} ; UttAP np = {s = np.s ! P.False ! NCase Sg Nom} ; diff --git a/src/estonian/ResEst.gf b/src/estonian/ResEst.gf index c6ce9643f..f34eb9970 100644 --- a/src/estonian/ResEst.gf +++ b/src/estonian/ResEst.gf @@ -81,7 +81,7 @@ oper param VForm = - Inf InfForm + Inf InfStem | Presn Number Person | Impf Number Person | Condit Number Person @@ -99,16 +99,32 @@ param Voice = Act | Pass ; - InfForm = - InfDa -- lugeda - | InfDes -- lugedes - | InfMa -- lugema - | InfMas -- lugemas - | InfMast -- lugemast - | InfMata -- lugemata - | InfMaks -- lugemaks + InfStem = + InfD -- luge+da/des, but can be irregular: tulla, tulles + | InfM -- lugema/mas/mast/maks/mata/mine ; +oper + InfForms : Type = {stem : InfStem ; suf : Str} ; + InfDa, InfDes, InfMa, InfMas, InfMast, InfMata, InfMaks, InfMine : InfForms ; + InfDa = {stem = InfD ; suf = "a"} ; -- lugeda + InfDes = {stem = InfD ; suf = "es"} ; -- lugedes + InfMa = {stem = InfM ; suf = "a"} ; -- lugema + InfMas = {stem = InfM ; suf = "as"} ; -- lugemas + InfMast = {stem = InfM ; suf = "ast"} ; -- lugemast + InfMata = {stem = InfM ; suf = "ata"} ; -- lugemata + InfMaks = {stem = InfM ; suf = "aks"} ; -- lugemaks + InfMine = {stem = InfM ; suf = "ine"} ; -- lugemine + + applyInfFormsVP : InfForms -> VP -> {fin,inf : Str} = \if,vp -> + let vpforms : VPForms = mkVPForms vp.v ; + stemOnly : {fin,inf : Str} = vpforms ! VIInf if.stem ! Simul ! Pos ! agrP3 Sg ; + in stemOnly ** {fin = glue stemOnly.fin if.suf} ; -- Despite the name, the infinite form is in the "fin" field, "inf" contains participle + + applyInfFormsV : InfForms -> (VForm => Str) -> Str = \if,vf -> + glue (vf ! Inf if.stem) if.suf ; + +param SType = SDecl | SQuest | SInv ; --2 For $Relative$ @@ -180,13 +196,12 @@ param 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 ; + linV2, linV : Verb -> Str = \v -> applyInfFormsV InfMa v.s ++ v.p ; param VIForm = VIFin Tense - | VIInf InfForm + | VIInf InfStem | VIPass Tense | VIPresPart | VIImper @@ -276,7 +291,7 @@ oper } ; predV : Verb1 -> VP = \verb -> { - v = verb ; -- ignoring the subject + v = verb ; -- ignoring the subject case of Verb, it is stored in VP.sc later s2 = \\_,_,_ => [] ; adv = [] ; ext = [] ; --relative clause @@ -405,17 +420,18 @@ oper subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b -> appCompl False b {s = [] ; c = sc ; isPre = True} np ; - infVP : NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = infVPAnt Simul ; + infVP : NPForm -> Polarity -> Agr -> VP -> InfForms -> Str = infVPAnt Simul ; - infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = + infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForms -> Str = \ant,sc,pol,agr,vp,vi -> let - fin = case sc of { -- subject case - NPCase Nom => True ; -- mina tahan joosta - _ => False -- minul peab auto olema + complCase = case sc of { -- choosing case for the complement. sometimes this function is called so that sc is the VP's subject case, but other times it's some other form. + NPCase Nom => True ; + _ => False } ; - verb = mkVPForms vp.v ! VIInf vi ! ant ! Pos ! agr ; -- no "ei" - compl = vp.s2 ! fin ! pol ! agr ; -- but compl. case propagated + verbStem = mkVPForms vp.v ! VIInf vi.stem ! ant ! Pos ! agr ; -- no "ei" + verb = verbStem ** {fin = glue verbStem.fin vi.suf} ; + compl = vp.s2 ! complCase ! pol ! agr ; -- but compl. case propagated adv = vp.adv in -- inverted word order; e.g. @@ -512,8 +528,8 @@ oper tulgu = (init tulge) + "u" ; in {s = table { - Inf InfDa => tulla ; - Inf InfDes => tulles ; + Inf InfD => tull_ ; + Inf InfM => init tulema ; Presn Sg P1 => tule_ + "n" ; Presn Sg P2 => tule_ + "d" ; Presn Sg P3 => tuleb ; @@ -547,12 +563,7 @@ oper PresPart Act => laulev ; PresPart Pass => tuld_ + "av" ; --d or t PastPart Act => tulnud ; - PastPart Pass => tuldud ; - Inf InfMa => tulema ; - Inf InfMas => tulema + "s" ; - Inf InfMast => tulema + "st" ; - Inf InfMata => tulema + "ta" ; - Inf InfMaks => tulema + "ks" + PastPart Pass => tuldud } ; sc = NPCase Nom ; p = []