From 258cd95ccacedafe9cc3252c1529bce6abead9d5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 17 Sep 2021 11:32:47 +0800 Subject: [PATCH] (Ita) Implement AForm+related opers in DiffIta --- src/italian/DiffIta.gf | 64 ++++++++++++++++++++++++---------------- src/italian/MorphoIta.gf | 8 ++--- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/src/italian/DiffIta.gf b/src/italian/DiffIta.gf index 4e4eb8f6..32988d71 100644 --- a/src/italian/DiffIta.gf +++ b/src/italian/DiffIta.gf @@ -9,7 +9,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, oper contractInf : Bool -> Bool -> Bool = orB ; -- Ita has special contracted inf forms with clitics ------ - param + param Prepos = P_di | P_a | P_da | P_in | P_su | P_con ; VType = VHabere | VEsse | VRefl ; @@ -34,7 +34,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, True => prepCase c ++ case of { => "lui" ; => "lei" ; - <_,Pl> => "loro" + <_,Pl> => "loro" } ; _ => case of { <_, _, CPrep P_di> => prepArt "de" ; @@ -48,7 +48,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, => elision "i" "gli" "gli" ; => "le" } - } + } where { prepArt : Tok -> Tok = \de -> case of { => elision (de + "l") (de + "ll'") (de + "llo") ; @@ -62,30 +62,42 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, -- In these two, "de de/du/des" becomes "de". artIndef = \isNP, g,n,c -> case of { - => prepCase c ++ + => prepCase c ++ genForms "uno" "una" ! g ; - => prepCase c ++ + => prepCase c ++ genForms (pre {"un" ; "uno" / sImpuro}) (elision "una" "un'" "una") ! g ; - => prepCase c ++ + => prepCase c ++ genForms "alcuni" "alcune" ! g ; - _ => prepCase c + _ => prepCase c } ; possCase = artDef False ; - + partitive = \_,c -> prepCase c ; - + {- partitive = \g,c -> case c of { CPrep P_di => "di" ; _ => prepCase c ++ artDef False g Sg (CPrep P_di) } ; -} + +-- AForm and comparatives + param + AFormSimple = AF Gender Number | AA ; + oper + AForm = AFormSimple ; + aform2aagr : AForm -> AAgr = \a -> case a of { + DiffIta.AF g n => aagr g n ; + _ => aagr Masc Sg -- "le plus lentement" + } ; + genNum2Aform : Gender -> Number -> AForm = DiffIta.AF ; + genNumPos2Aform : Gender -> Number -> Bool -> AForm = \g,n,_ -> genNum2Aform g n ; piuComp = "più" ; conjunctCase : Case -> Case = \c -> case c of { Nom => Nom ; - _ => Acc + _ => Acc } ; auxVerb : VType -> (VF => Str) = \vtyp -> case vtyp of { @@ -103,7 +115,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, } ; pronArg = \n,p,acc,dat -> - let + let pacc = case acc of { --- only accusative refl handled CRefl => case p of { P3 => "si" ; @@ -129,14 +141,14 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, infForm n p x y = (pronArg n p x y).p3 ; - mkImperative b p vp = - \\pol,g,n => - let + mkImperative b p vp = + \\pol,g,n => + let pe = case b of {True => P3 ; _ => p} ; agr = {g = g ; n = n ; p = pe} ; refl = case vp.s.vtyp of { VRefl => ; - _ => <[],False> + _ => <[],False> } ; clpr = ; @@ -168,7 +180,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, clitInf b cli inf = inf ++ bindIf b ++ cli ; - relPron : Bool => AAgr => Case => Str = \\b,a,c => + relPron : Bool => AAgr => Case => Str = \\b,a,c => case c of { Nom | Acc => "che" ; CPrep P_di => "cui" ; @@ -181,14 +193,14 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, partQIndir = "ciò" ; - reflPron : Number -> Person -> Case -> Str = - let + reflPron : Number -> Person -> Case -> Str = + let cases : (x,y : Str) -> (Case -> Str) = \me,moi,c -> case c of { Acc | CPrep P_a => me ; _ => moi } ; - in - \n,p -> case of { + in + \n,p -> case of { => cases "mi" "me" ; => cases "ti" "te" ; => cases "ci" "noi" ; -- unlike French with just one alt! @@ -196,21 +208,21 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta, _ => cases "si" "se" } ; - argPron : Gender -> Number -> Person -> Case -> Bool -> Str = - let - cases : (x,y,z : Str) -> Case -> Bool -> Str = + argPron : Gender -> Number -> Person -> Case -> Bool -> Str = + let + cases : (x,y,z : Str) -> Case -> Bool -> Str = \ci,ce,noi,c,isPre -> case c of { Acc | CPrep P_a => if_then_Str isPre ce ci ; _ => noi } ; cases4 : (x,y,z,u : Str) -> Case -> Bool -> Str = \lo,gli,glie,lui,c,isPre -> case c of { - Acc => lo ; + Acc => lo ; CPrep P_a => if_then_Str isPre glie gli ; _ => lui } ; - in - \g,n,p -> case of { + in + \g,n,p -> case of { <_,Sg,P1> => cases "mi" "me" "me" ; <_,Sg,P2> => cases "ti" "te" "te" ; <_,Pl,P1> => cases "ci" "ce" "noi" ; -- unlike French with just one alt! diff --git a/src/italian/MorphoIta.gf b/src/italian/MorphoIta.gf index 3921644b..b584b2fc 100644 --- a/src/italian/MorphoIta.gf +++ b/src/italian/MorphoIta.gf @@ -78,10 +78,10 @@ oper mkAdj : (_,_,_,_,_ : Str) -> Adj = \solo,sola,soli,sole,solamente -> {s = table { - ASg Masc _ => solo ; - ASg Fem _ => sola ; - APl Masc => soli ; - APl Fem => sole ; + AF Masc Sg => solo ; + AF Fem Sg => sola ; + AF Masc Pl => soli ; + AF Fem Pl => sole ; AA => solamente } } ;