From 1ddd8bd16c98fc6effb9511a5cc69e0b775ad6ad Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sun, 11 Oct 2026 17:32:48 +0200 Subject: [PATCH] extensions by Codex --- src/italian/ConstructionIta.gf | 2 + src/italian/ExtendIta.gf | 129 ++++++++++++++++++++++++++++++++- src/italian/NumeralIta.gf | 29 ++++++++ 3 files changed, 159 insertions(+), 1 deletion(-) diff --git a/src/italian/ConstructionIta.gf b/src/italian/ConstructionIta.gf index 4b72ea33e..c09be4afc 100644 --- a/src/italian/ConstructionIta.gf +++ b/src/italian/ConstructionIta.gf @@ -31,6 +31,7 @@ lin is_wrong_VP = mkVP (reflV (mkV "sbagliare")) ; n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; + n_units_of_NP card cn np = mkNP card (mkCN (lin N2 cn) np) ; bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "bottiglia" feminine) part_Prep)) np ; cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "tazza") part_Prep)) np ; @@ -81,6 +82,7 @@ lin InLanguage l = SyntaxIta.mkAdv (mkPrep "in") (mkNP l) ; lin weekdayN w = w ; + monthN m = m ; weekdayPN w = mkPN w ; monthPN m = mkPN m ; diff --git a/src/italian/ExtendIta.gf b/src/italian/ExtendIta.gf index 2a7786940..b2205ce87 100644 --- a/src/italian/ExtendIta.gf +++ b/src/italian/ExtendIta.gf @@ -1,6 +1,13 @@ --# -path=alltenses:../common:../abstract:../romance concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor - [ + EmptyRelSlash, + BaseVPI, ConsVPI, ConjVPI, MkVPI, ComplVPIVV, + BaseComp, ConsComp, ConjComp, BaseImp, ConsImp, ConjImp, + RNP, ReflRNP, ReflPron, ReflPoss, PredetRNP, + AdvRNP, AdvRVP, AdvRAP, PossPronRNP, + PresPartAP, GerundNP, GerundCN, + CompoundAP, InOrderToVP, CompVP, GenRP, PassVPSlash, PassAgentVPSlash, ExistsNP @@ -17,10 +24,120 @@ concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor - Coordination, Prelude, ParadigmsIta, - IrregIta in { + IrregIta, + (P = ParamX) in { -- put your own definitions here lin + EmptyRelSlash = RelSlash IdRP ; + + lincat + RNP = {s : Agr => Case => Str ; isPron : Bool} ; + VPI = {s : Agr => Str} ; + [VPI] = {s1,s2 : Agr => Str} ; + + lin + MkVPI vp = {s = \\a => infVP vp RPos a} ; + BaseVPI = twoTable Agr ; + ConsVPI = consrTable Agr comma ; + ConjVPI = conjunctDistrTable Agr ; + ComplVPIVV vv vpi = + insertComplement (\\a => prepCase vv.c2.c ++ vpi.s ! a) (predV vv) ; + + lincat [Comp] = {s1,s2 : Agr => Str ; cop : CopulaType} ; + + lin + BaseComp x y = twoTable Agr x y ** {cop = x.cop} ; + ConsComp xs x = consrTable Agr comma xs x ** xs ; + ConjComp conj cs = conjunctDistrTable Agr conj cs ** {cop = cs.cop} ; + + lincat [Imp] = {s1,s2 : RPolarity => P.ImpForm => Gender => Str} ; + + lin + BaseImp = twoTable3 RPolarity P.ImpForm Gender ; + ConsImp = consrTable3 RPolarity P.ImpForm Gender comma ; + ConjImp = conjunctDistrTable3 RPolarity P.ImpForm Gender ; + + -- The simple form is idiomatic in the relative and interrogative + -- contexts where a progressive VPSlash is used, and preserves the gap. + ProgrVPSlash vps = vps ; + + ReflRNP v rnp = case of { + => insertRefl v ; + _ => insertComplement + (\\a => let agr = verbAgr a in + v.c2.s ++ rnp.s ! agr ! v.c2.c) v + } ; + + ReflPron = { + s = \\agr,c => reflPron agr.n agr.p c ; + isPron = True + } ; + + ReflPoss num cn = { + s = \\agr,c => possCase cn.g num.n c ++ + possDet agr num.n cn.g ++ cn.s ! num.n ; + isPron = False + } ; + + PredetRNP pred rnp = { + s = \\agr,c => pred.s ! complAgr agr ! c ++ rnp.s ! agr ! pred.c ; + isPron = False + } ; + + AdvRNP np prep rnp = { + s = \\agr,c => (np.s ! c).ton ++ prep.s ++ rnp.s ! agr ! prep.c ; + isPron = False + } ; + + AdvRVP vp prep rnp = + insertComplement (\\a => prep.s ++ rnp.s ! verbAgr a ! prep.c) vp ; + + AdvRAP ap prep rnp = ap ** { + s = \\af => ap.s ! af ++ prep.s ++ + rnp.s ! (aform2aagr af ** {p = P3}) ! prep.c ; + isPre = False + } ; + + PossPronRNP pron num cn rnp = heavyNP { + s = \\c => possCase cn.g num.n c ++ pron.poss ! num.n ! cn.g ++ + cn.s ! num.n ++ rnp.s ! pron.a ! ResIta.genitive ; + a = agrP3 cn.g num.n ; + hasClit = False ; + isNeg = False + } ; + + PresPartAP vp = { + s = \\af => + let agr = aform2aagr af ** {p = P3} ; + in vp.s.s ! VPresPart ++ vp.comp ! agr ++ vp.ext ! RPos ; + isPre = False ; + copTyp = serCopula + } ; + + GerundNP vp = let agr = Ag Masc Sg P3 in heavyNP { + s = \\_ => infVP vp RPos agr ; + a = agr + } ; + + GerundCN vp = { + s = \\n => infVP vp RPos (Ag Masc n P3) ; + g = Masc + } ; + + CompoundAP noun adj = { + s = \\af => adj.s ! af ++ "da" ++ noun.s ! (aform2number af) ; + isPre = adj.isPre ; + copTyp = adj.copTyp + } ; + + InOrderToVP vp = {s = "per" ++ infStr vp} ; + + CompVP ant pol vp = { + s = \\agr => ant.s ++ pol.s ++ infVP vp pol.p agr ; + cop = serCopula + } ; + GenRP nu cn = { s = \\_b,_aagr,_c => "di cui" ++ num ++ cn.s ! n ; a = aagr g n ; @@ -39,6 +156,16 @@ lin PassVPSlash vps = passVPSlash vps [] ; vps (let by = in by.s ++ (np.s ! by.c).ton) ; oper + possDet : Agr -> Number -> Gender -> Str = \agr,n,g -> + case of { + => i_Pron.poss ! n ! g ; + => youSg_Pron.poss ! n ! g ; + => he_Pron.poss ! n ! g ; + => we_Pron.poss ! n ! g ; + => youPl_Pron.poss ! n ! g ; + => they_Pron.poss ! n ! g + } ; + passVPSlash : VPSlash -> Str -> VP = \vps, agent -> let auxvp = predV auxPassive in diff --git a/src/italian/NumeralIta.gf b/src/italian/NumeralIta.gf index ec675f80b..3e47349eb 100644 --- a/src/italian/NumeralIta.gf +++ b/src/italian/NumeralIta.gf @@ -64,6 +64,10 @@ lin pot1as2 n = n ; lin pot2 d = spl (\\co => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++ (mkTall "cento" [] [] [] "cent").s ! ental indip ! co) ; +lin pot21 = spl (table { + NCard _ => "cento" ; + NOrd g n => regOrdpred "cent" g n + }) ; lin pot2plus d e = {s = table {NCard g => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++"cento" ++ BIND ++e.s ! NCard Masc ; NOrd g n => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++"cento" ++ BIND ++ e.s ! NOrd g n}; @@ -71,11 +75,36 @@ lin pot2plus d e = lin pot2as3 n = n ; lin pot3 n = spl (\\co => n.s ! NCard Masc ++ nBIND n.n ++ (mkTall (mille ! n.n) [] [] [] "mill").s ! ental indip ! co ) ; +lin pot31 = spl (table { + NCard _ => "mille" ; + NOrd g n => regOrdpred "mill" g n + }) ; lin pot3plus n m = {s = \\g => n.s ! NCard Masc ++ nBIND n.n ++ mille ! n.n ++ "e" ++ m.s ! g ; n = Pl} ; +lin pot3decimal d = {s = \\_ => d.s ! NCard Masc ++ "mila" ; n = Pl} ; lin pot3as4 n = n ; +lin pot41 = {s = \\co => case co of { + NCard _ => "un milione" ; + NOrd g n => regOrdpred "milion" g n + } ; n = Sg} ; +lin pot4 n = {s = \\co => n.s ! NCard Masc ++ case co of { + NCard _ => "milioni" ; + NOrd g k => regOrdpred "milion" g k + } ; n = Pl} ; +lin pot4plus n m = {s = \\co => n.s ! NCard Masc ++ "milioni" ++ m.s ! co ; n = Pl} ; +lin pot4decimal d = {s = \\_ => d.s ! NCard Masc ++ "milioni" ; n = Pl} ; lin pot4as5 n = n ; +lin pot51 = {s = \\co => case co of { + NCard _ => "un miliardo" ; + NOrd g n => regOrdpred "miliard" g n + } ; n = Sg} ; +lin pot5 n = {s = \\co => n.s ! NCard Masc ++ case co of { + NCard _ => "miliardi" ; + NOrd g k => regOrdpred "miliard" g k + } ; n = Pl} ; +lin pot5plus n m = {s = \\co => n.s ! NCard Masc ++ "miliardi" ++ m.s ! co ; n = Pl} ; +lin pot5decimal d = {s = \\_ => d.s ! NCard Masc ++ "miliardi" ; n = Pl} ; oper nBIND : Number -> Str = \n -> case n of {Sg => [] ; _ => BIND} ; -- no BIND after silent 1