From 61f93263d4fe03a97c3af6c62fdf35868edc08da Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 7 Oct 2026 11:57:31 +0200 Subject: [PATCH] extensions by Codex --- src/estonian/ConstructionEst.gf | 7 ++++++ src/estonian/ExtendEst.gf | 44 +++++++++++++++++++++++++-------- src/estonian/IdiomEst.gf | 9 ++++++- src/estonian/NamesEst.gf | 4 +++ src/estonian/NounEst.gf | 20 +++++++++++++++ src/estonian/NumeralEst.gf | 40 ++++++++++++++++++++++++++++++ src/estonian/SentenceEst.gf | 6 +++++ src/estonian/VerbEst.gf | 4 +++ 8 files changed, 123 insertions(+), 11 deletions(-) diff --git a/src/estonian/ConstructionEst.gf b/src/estonian/ConstructionEst.gf index 9b3f2eedc..37bbb93c5 100644 --- a/src/estonian/ConstructionEst.gf +++ b/src/estonian/ConstructionEst.gf @@ -34,6 +34,13 @@ lin x_inches_AdA : AdA = lin AdA (mkUtt x_inches_NP) ; in mkAP x_inches_AdA ; + n_units_of_NP card cn np = + mkNP (mkNP ) + (SyntaxEst.mkAdv part_Prep ) ; + + cup_of_CN np = + mkCN (lin N2 (mkN2 (mkN "tass") (casePrep partitive))) ; + {- glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (casePrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (casePrep partitive))) (lin NP np) ; diff --git a/src/estonian/ExtendEst.gf b/src/estonian/ExtendEst.gf index 967408791..a17529cb3 100644 --- a/src/estonian/ExtendEst.gf +++ b/src/estonian/ExtendEst.gf @@ -58,6 +58,19 @@ concrete ExtendEst of Extend = VPS = X.linVPS (agrP3 Sg) ; VPI = X.linVPI InfMa ; + lincat + [Comp] = {s1,s2 : Agr => Str} ; + [Imp] = {s1,s2 : Polarity => Agr => Str} ; + + lin + BaseComp = twoTable Agr ; + ConsComp = consrTable Agr comma ; + ConjComp conj xs = conjunctDistrTable Agr conj xs ; + + BaseImp = twoTable2 Polarity Agr ; + ConsImp = consrTable2 Polarity Agr comma ; + ConjImp conj xs = conjunctDistrTable2 Polarity Agr conj xs ; + lin MkVPS = X.MkVPS ; BaseVPS = X.BaseVPS ; @@ -109,10 +122,8 @@ concrete ExtendEst of Extend = -- : Num -> CN -> RNP ; -- my car(s) ReflPoss num cn = { - s = \\a,npf => possPron ! a ++ num.s ! Sg ! Nom ++ - case npf of { - NPCase c => cn.s ! NCase num.n c ; - NPAcc => cn.s ! NCase num.n Gen } ; + s = \\_,npf => possPron ! a ++ num.s ! Sg ! Nom ++ + cn.s ! NCase num.n (npform2case num.n npf) ; } ; PredetRNP predet rnp = { @@ -129,19 +140,31 @@ concrete ExtendEst of Extend = Cons_rr_RNP x xs = consrTable2 Agr NPForm comma x xs ; Cons_nr_RNP x xs = consrTable2 Agr NPForm comma {s = \\a => x.s} xs ; -{- -- : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children PossPronRNP pron num cn rnp = + let np = DetCN (DetQuant (PossPron pron) num) cn in + np ** {postmod = np.postmod ++ rnp.s ! pron.a ! NPCase Gen} ; -- : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife - AdvRAP adv rp = + AdvRNP np prep rnp = { + s = \\agr,npf => linNP npf np ++ appCompl True Pos prep (rnp2np agr rnp) + } ; -- : VP -> Prep -> RNP -> VP ; -- lectured about her travels - AdvRNP adv rp = + AdvRVP vp prep rnp = + insertObj (\\_,b,agr => appCompl True b prep (rnp2np agr rnp)) vp ; -- : AP -> Prep -> RNP -> AP ; -- adamant in his refusal - AdvRVP adv rp = - -} + AdvRAP ap prep rnp = ap ** { + s = \\isMod,af => ap.s ! isMod ! af ++ + appCompl True Pos prep (rnp2np (agrP3 Sg) rnp) + } ; + + ReflPossPron = { + s,sp = \\_,_ => "oma" ; + isNum = False ; + isDef = True + } ; oper possPron : Agr => Str = table { @@ -217,7 +240,8 @@ concrete ExtendEst of Extend = -- ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++ infVP v.typ vp a.a p.p agr) -- (predVV v) ; - -- ComplSlashPartLast vps np = {} ; --- AR 7/3/2013 + ComplSlashPartLast vps np = + insertObj (\\fin,b,_ => appCompl fin b vps.c2 np) vps ; --------------------------------- -- E - F diff --git a/src/estonian/IdiomEst.gf b/src/estonian/IdiomEst.gf index 06d8c694f..ff62b0e0b 100644 --- a/src/estonian/IdiomEst.gf +++ b/src/estonian/IdiomEst.gf @@ -11,6 +11,14 @@ concrete IdiomEst of Idiom = CatEst ** vp = insertObj (\\_,b,_ => "olemas" ++ linNP (cas b) np) (predV olla) in existClause noSubj (agrP3 Sg) vp ; + ExistNPAdv np adv = + let cas : Polarity -> NPForm = \p -> case p of { + Pos => NPCase Nom ; + Neg => NPCase Part } ; + vp = insertObj (\\_,b,_ => linNP (cas b) np) + (insertAdv adv.s (predV olla)) + in existClause noSubj (agrP3 Sg) vp ; + ExistIP ip = let cas : NPForm = NPCase Nom ; ---- also partitive in Extra vp : MorphoEst.VP = insertObj (\\_,b,_ => "olemas") (predV olla) ; @@ -55,4 +63,3 @@ concrete IdiomEst of Idiom = CatEst ** noSubj : Polarity -> Str = \_ -> [] ; } - diff --git a/src/estonian/NamesEst.gf b/src/estonian/NamesEst.gf index 38eee3e19..b87956d1e 100644 --- a/src/estonian/NamesEst.gf +++ b/src/estonian/NamesEst.gf @@ -41,4 +41,8 @@ lin InLN pn = { }) } ; +lin AdjLN ap ln = ln ** { + s = \\c => ap.s ! True ! NCase ln.n c ++ ln.s ! c + } ; + } diff --git a/src/estonian/NounEst.gf b/src/estonian/NounEst.gf index 96e4489d8..243d05542 100644 --- a/src/estonian/NounEst.gf +++ b/src/estonian/NounEst.gf @@ -70,6 +70,10 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in AdvNP np adv = np ** {postmod = np.postmod ++ adv.s} ; + ExtAdvNP np adv = np ** { + postmod = np.postmod ++ SOFT_BIND ++ "," ++ adv.s + } ; + DetQuantOrd quant num ord = { s = \\c => quant.s ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ; sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ; @@ -109,6 +113,22 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in PossNP cn np = np ** {s = \\nf => linNP (NPCase Gen) np ++ cn.s ! nf} ; + PartNP cn np = cn ** { + postmod = cn.postmod ++ linNP (NPCase Part) np + } ; + + CountNP det np = + let n : Number = case det.isNum of { + True => Sg ; + _ => det.n + } + in emptyNP ** { + s = \\c => let k = npform2case n c in + det.sp ! k ++ linNP (NPCase Elat) np ; + a = agrP3 det.n ; + isPron = False + } ; + NumSg = {s = \\_,_ => [] ; isNum = False ; n = Sg} ; NumPl = {s = \\_,_ => [] ; isNum = False ; n = Pl} ; diff --git a/src/estonian/NumeralEst.gf b/src/estonian/NumeralEst.gf index 0fb7dd316..fccaa31c2 100644 --- a/src/estonian/NumeralEst.gf +++ b/src/estonian/NumeralEst.gf @@ -58,6 +58,7 @@ lin s = \\_,c => d.s ! NumAttr ! c ++ nBIND d.n ++ sataaN.s ! d.n ! c ++ e.s ! NumIndep ! c } ; + pot21 = pot2 pot01 ; pot2as3 n = {n = n.n ; s = n.s ! NumIndep} ; pot3 d = {n = Pl ; s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c} ; pot3plus d e = { @@ -65,8 +66,26 @@ lin s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c ++ e.s ! NumIndep ! c } ; + pot31 = {n = Pl ; s = tuhatN.s} ; pot3as4 n = n ; + pot3decimal d = {n = Pl ; s = \\_ => d.s ! NCard (NCase Sg Nom) ++ "tuhat"} ; + + pot41 = {n = Pl ; s = miljonN.s} ; + pot4 d = {n = Pl ; s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljonitN.s ! d.n ! c} ; + pot4plus d e = { + n = Pl ; + s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljonitN.s ! d.n ! c ++ e.s ! c + } ; pot4as5 n = n ; + pot4decimal d = {n = Pl ; s = \\_ => d.s ! NCard (NCase Sg Nom) ++ "miljonit"} ; + + pot51 = {n = Pl ; s = miljardN.s} ; + pot5 d = {n = Pl ; s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljarditN.s ! d.n ! c} ; + pot5plus d e = { + n = Pl ; + s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljarditN.s ! d.n ! c ++ e.s ! c + } ; + pot5decimal d = {n = Pl ; s = \\_ => d.s ! NCard (NCase Sg Nom) ++ "miljardit"} ; oper co : (c,o : {s : NForm => Str}) -> {s : CardOrd => Str} = \c,o -> { @@ -98,6 +117,9 @@ oper (mkN "tuhat" "tuhande" "tuhandet" "tuhandesse" "tuhandete" "tuhandeid") (mkN "tuhandes" "tuhandenda" "tuhandendat" "tuhandendasse" "tuhandete" "tuhandendaid") ; + miljonN = co (mkN "miljon") (mkN "miljones") ; + miljardN = co (mkN "miljard") (mkN "miljardes") ; + kymmendN = {s = table { NCard (NCase Sg Nom) => "kümmend" ; @@ -123,6 +145,24 @@ oper } } ; + miljonitN : {s : MorphoEst.Number => CardOrd => Str} = {s = table { + Sg => miljonN.s ; + Pl => table { + NCard (NCase Sg Nom) => "miljonit" ; + k => miljonN.s ! k + } + } + } ; + + miljarditN : {s : MorphoEst.Number => CardOrd => Str} = {s = table { + Sg => miljardN.s ; + Pl => table { + NCard (NCase Sg Nom) => "miljardit" ; + k => miljardN.s ! k + } + } + } ; + lincat Dig = TDigit ; diff --git a/src/estonian/SentenceEst.gf b/src/estonian/SentenceEst.gf index 4ed8b7082..839643869 100644 --- a/src/estonian/SentenceEst.gf +++ b/src/estonian/SentenceEst.gf @@ -17,6 +17,10 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in { verb.fin ++ verb.inf ++ compl ++ vp.p ; } ; + AdvImp adv imp = { + s = \\pol,agr => adv.s ++ imp.s ! pol ! agr + } ; + -- The object case is formed at the use site of $c2$, in $Relative$ and $Question$. SlashVP np vp = mkClause (subjForm np vp.sc) np.a vp ** { @@ -60,4 +64,6 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in { RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ; ---- mikä + SSubjS s1 subj s2 = {s = s1.s ++ SOFT_BIND ++ "," ++ subj.s ++ s2.s} ; + } diff --git a/src/estonian/VerbEst.gf b/src/estonian/VerbEst.gf index 2376aec77..a2d68a616 100644 --- a/src/estonian/VerbEst.gf +++ b/src/estonian/VerbEst.gf @@ -75,8 +75,12 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in { AdvVP vp adv = insertAdv adv.s vp ; + ExtAdvVP vp adv = insertAdv (SOFT_BIND ++ "," ++ adv.s) vp ; + AdvVPSlash vp adv = insertAdv adv.s vp ** vp ; + AdVVPSlash adv vp = insertAdv adv.s vp ** vp ; + VPSlashPrep vp prep = vp ** {c2 = prep} ; AdVVP adv vp = insertAdv adv.s vp ;