From d403fd0f7f13108b5ec3c12cf01a909ac4ebb4a6 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 4 Jan 2010 14:59:40 +0000 Subject: [PATCH] number agreement in Romance predeterminers --- examples/attempto/AttemptoI.gf | 8 ++++---- examples/attempto/LexAttempto.gf | 2 ++ examples/attempto/LexAttemptoEng.gf | 2 ++ examples/attempto/LexAttemptoFin.gf | 2 ++ examples/attempto/LexAttemptoFre.gf | 4 +++- examples/attempto/LexAttemptoGer.gf | 2 ++ examples/attempto/LexAttemptoIta.gf | 3 ++- examples/attempto/LexAttemptoSwe.gf | 1 + examples/attempto/TestAttemptoFin.gf | 2 +- lib/src/catalan/StructuralCat.gf | 12 ++++++++---- lib/src/french/MakeStructuralFre.gf | 9 ++++++++- lib/src/french/StructuralFre.gf | 16 +++++++++++----- lib/src/italian/MakeStructuralIta.gf | 6 ++++++ lib/src/italian/StructuralIta.gf | 12 ++++++++---- lib/src/romance/CatRomance.gf | 6 +++++- lib/src/romance/CommonRomance.gf | 3 ++- lib/src/romance/NounRomance.gf | 2 +- lib/src/spanish/StructuralSpa.gf | 9 ++++++--- 18 files changed, 74 insertions(+), 27 deletions(-) diff --git a/examples/attempto/AttemptoI.gf b/examples/attempto/AttemptoI.gf index bad6dd342..240cbf969 100644 --- a/examples/attempto/AttemptoI.gf +++ b/examples/attempto/AttemptoI.gf @@ -47,9 +47,9 @@ lin someCollNP = mkNP somePl_Det ; lin allCollNP cn = mkNP all_Predet (mkNP a_Art plNum cn) ; lin noCollNP = mkNP no_Quant plNum ; -lin eachTheNP cn = mkNP (mkNP each_Det) (mkAdv part_Prep (mkNP the_Art plNum cn)) ; -lin eachSomeNP cn = mkNP (mkNP each_Det) (mkAdv part_Prep (mkNP somePl_Det cn)) ; -lin eachNumNP ca cn = mkNP (mkNP each_Det) (mkAdv part_Prep (mkNP ca cn)) ; +lin eachTheNP cn = eachOf (mkNP the_Art plNum cn) ; +lin eachSomeNP cn = eachOf (mkNP somePl_Det cn) ; +lin eachNumNP ca cn = eachOf (mkNP ca cn) ; lin someMassNP = mkNP someSg_Det ; lin allMassNP cn = mkNP all_Predet (mkNP cn) ; @@ -203,7 +203,7 @@ lin commaOr_Conj = comma_or_Conj ; lin for_everyS cn = mkS (mkAdv for_Prep (mkNP every_Det cn)) ; lin for_eachS cn = mkS (mkAdv for_Prep (mkNP each_Det cn)) ; lin for_each_ofS card cn = - mkS (mkAdv for_Prep (mkNP (mkNP each_Det) (mkAdv part_Prep (mkNP card cn)))) ; + mkS (mkAdv for_Prep (eachOf (mkNP card cn))) ; lin for_allMassS cn = mkS (mkAdv for_Prep (mkNP all_Predet (mkNP cn))) ; diff --git a/examples/attempto/LexAttempto.gf b/examples/attempto/LexAttempto.gf index 3d18d3ca4..11f7fa237 100644 --- a/examples/attempto/LexAttempto.gf +++ b/examples/attempto/LexAttempto.gf @@ -23,4 +23,6 @@ oper comma_or_Conj : Conj ; whose_IDet : IDet ; + + eachOf : NP -> NP ; } diff --git a/examples/attempto/LexAttemptoEng.gf b/examples/attempto/LexAttemptoEng.gf index ada776cb9..ed61b66d9 100644 --- a/examples/attempto/LexAttemptoEng.gf +++ b/examples/attempto/LexAttemptoEng.gf @@ -31,4 +31,6 @@ oper whose_IDet = M.mkIDet "whose" singular ; + eachOf np = mkNP (mkNP each_Det) (SyntaxEng.mkAdv part_Prep np) ; + } diff --git a/examples/attempto/LexAttemptoFin.gf b/examples/attempto/LexAttemptoFin.gf index 664facf18..209c80832 100644 --- a/examples/attempto/LexAttemptoFin.gf +++ b/examples/attempto/LexAttemptoFin.gf @@ -31,4 +31,6 @@ oper whose_IDet = mkIDet (M.mkIQuant "kenen") ; + eachOf np = mkNP (mkNP each_Det) (SyntaxFin.mkAdv (casePrep elative) np) ; + } diff --git a/examples/attempto/LexAttemptoFre.gf b/examples/attempto/LexAttemptoFre.gf index b6f983c24..618f37175 100644 --- a/examples/attempto/LexAttemptoFre.gf +++ b/examples/attempto/LexAttemptoFre.gf @@ -1,7 +1,7 @@ instance LexAttemptoFre of LexAttempto = open ExtraFre, SyntaxFre, ParadigmsFre, ConstructX, MakeStructuralFre, - IrregFre in { + IrregFre, (P = Prelude) in { oper possible_A = mkA "possible" ; @@ -25,4 +25,6 @@ oper whose_IDet = mkIDet (mkIQuant "de qui") ; ---- + eachOf np = mkNP (mkPredet "chacun" "chacune" genitive P.True) np ; + } diff --git a/examples/attempto/LexAttemptoGer.gf b/examples/attempto/LexAttemptoGer.gf index 05a4e59ff..58de8a565 100644 --- a/examples/attempto/LexAttemptoGer.gf +++ b/examples/attempto/LexAttemptoGer.gf @@ -25,4 +25,6 @@ oper whose_IDet = mkIDet (mkIQuant "wessen") ; + eachOf np = mkNP (mkNP each_Det) (SyntaxGer.mkAdv part_Prep np) ; ---- gen agr + } diff --git a/examples/attempto/LexAttemptoIta.gf b/examples/attempto/LexAttemptoIta.gf index 04d79cfdb..de18a3ec2 100644 --- a/examples/attempto/LexAttemptoIta.gf +++ b/examples/attempto/LexAttemptoIta.gf @@ -1,6 +1,6 @@ instance LexAttemptoIta of LexAttempto = open ExtraIta, SyntaxIta, ParadigmsIta, ConstructX, - MakeStructuralIta + MakeStructuralIta, (P = Prelude) in { oper @@ -25,4 +25,5 @@ oper whose_IDet = mkIDet (mkIQuant "de chi") ; ---- + eachOf np = mkNP (mkPredet "ciascuno" "ciascuna" genitive P.True) np ; } diff --git a/examples/attempto/LexAttemptoSwe.gf b/examples/attempto/LexAttemptoSwe.gf index c95ce035e..8f71e2b15 100644 --- a/examples/attempto/LexAttemptoSwe.gf +++ b/examples/attempto/LexAttemptoSwe.gf @@ -23,5 +23,6 @@ oper slash_Conj = mkConj [] "/" singular ; whose_IDet = mkIDet (mkIQuant "vems" "vems" "vems" dDefIndef) ; + eachOf np = mkNP (mkNP each_Det) (SyntaxSwe.mkAdv part_Prep np) ; ---- gen agr } diff --git a/examples/attempto/TestAttemptoFin.gf b/examples/attempto/TestAttemptoFin.gf index 7d6789628..bb87f7a7b 100644 --- a/examples/attempto/TestAttemptoFin.gf +++ b/examples/attempto/TestAttemptoFin.gf @@ -77,7 +77,7 @@ lin correct_A = mkA "oikea" ; lin kilogram_Unit = mkkN "kilo" ; -oper mkkN : Str -> CN = \n -> mkCN (ParadigmsFin.mkN n) ; +oper mkkN : Str -> CN = \n -> mkCN (ParadigmsFin.mk1N n) ; lin in_Prep = SyntaxFin.in_Prep ; diff --git a/lib/src/catalan/StructuralCat.gf b/lib/src/catalan/StructuralCat.gf index 002e6d6a4..2cea9e334 100644 --- a/lib/src/catalan/StructuralCat.gf +++ b/lib/src/catalan/StructuralCat.gf @@ -9,7 +9,8 @@ lin after_Prep = {s = ["després"] ; c = MorphoCat.genitive ; isDir = False} ; all_Predet = { s = \\a,c => prepCase c ++ aagrForms "tot" "tota" "tots" "totes" ! a ; - c = Nom + c = Nom ; + a = PNoAg } ; almost_AdA, almost_AdN = ss (variants {"quasi"; "gairebé"}) ; always_AdV = ss "sempre" ; @@ -63,14 +64,16 @@ lin many_Det = { s,sp = \\g,c => prepCase c ++ genForms "molts" "moltes" ! g ; n = Pl ; s2 = []} ; more_CAdv = X.mkCAdv "més" conjThan ; - most_Predet = {s = \\_,c => prepCase c ++ ["la majoria"] ; c = CPrep P_de} ; + most_Predet = {s = \\_,c => prepCase c ++ ["la majoria"] ; c = CPrep P_de ; + a = PNoAg} ; much_Det = { s,sp = \\g,c => prepCase c ++ genForms "molt" "molta" ! g ; n = Sg ; s2 = []} ; must_VV = mkVV (verbV (haver_59 "haver" True)) ; -- + of_Prep no_Utt = ss "no" ; on_Prep = mkPrep "sobre" ; --- one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "una" ! g} ; - only_Predet = {s = \\_,c => prepCase c ++ "nomÈs" ; c = Nom} ; + only_Predet = {s = \\_,c => prepCase c ++ "nomÈs" ; c = Nom ; + a = PNoAg} ; or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ; otherwise_PConj = ss "altrament" ; part_Prep = complGen ; @@ -159,7 +162,8 @@ lin "vosté" "el" "li" "vosté" ["el seu"] ["la seva"] ["els seus"] Masc Pl P2 ; - not_Predet = {s = \\a,c => prepCase c ++ "no pas" ; c = Nom} ; + not_Predet = {s = \\a,c => prepCase c ++ "no pas" ; c = Nom ; + a = PNoAg} ; have_V2 = dirV2 (verbV (tenir_108 "tenir")) ; oper diff --git a/lib/src/french/MakeStructuralFre.gf b/lib/src/french/MakeStructuralFre.gf index 5aa94dcfe..48cd1c1b2 100644 --- a/lib/src/french/MakeStructuralFre.gf +++ b/lib/src/french/MakeStructuralFre.gf @@ -1,6 +1,6 @@ --# -path=.:../romance:../common:../abstract -resource MakeStructuralFre = open CatFre, ParadigmsFre, MorphoFre, Prelude in { +resource MakeStructuralFre = open CatFre, (P = ParadigmsFre), MorphoFre, Prelude in { oper mkConj : Str -> Str -> Number -> Conj = \x,y,n -> @@ -13,4 +13,11 @@ oper mkIQuant : Str -> IQuant = \s -> {s = \\_,_,c => prepCase c ++ s ; lock_IQuant = <>} ; + mkPredet : Str -> Str -> Prep -> Bool -> Predet = \m,f,c,p -> lin Predet { + s = \\g,k => prepCase k ++ case g.g of {Masc => m ; Fem => f} ; + c = c.c ; + a = if_then_else PAgr p (PAg Sg) PNoAg ---- e,g, "chacun de"; other possibilities? + } ; + + } diff --git a/lib/src/french/StructuralFre.gf b/lib/src/french/StructuralFre.gf index f9f4d8923..51c7a4584 100644 --- a/lib/src/french/StructuralFre.gf +++ b/lib/src/french/StructuralFre.gf @@ -13,7 +13,8 @@ lin after_Prep = mkPreposition "après" ; all_Predet = { s = \\a,c => prepCase c ++ aagrForms "tout" "toute" "tous" "toutes" ! a ; - c = Nom + c = Nom ; + a = PNoAg } ; almost_AdA, almost_AdN = ss "presque" ; always_AdV = ss "toujours" ; @@ -32,7 +33,12 @@ lin during_Prep = mkPreposition "pendant" ; either7or_DConj = {s1,s2 = "ou" ; n = Pl} ; everybody_NP = pn2np (mkPN ["tout le monde"] Masc) ; - every_Det = {s,sp = \\_,_ => "chaque" ; n = Sg ; s2 = []} ; ---- sp + every_Det = { + s = \\_,_ => "chaque" ; + sp = \\g,c => prepCase c ++ genForms "chacun" "chacune" ! g ; + n = Sg ; + s2 = [] + } ; everything_NP = pn2np (mkPN ["tout"] Masc) ; everywhere_Adv = ss "partout" ; few_Det = {s,sp = \\g,c => prepCase c ++ "peu" ++ elisDe ; n = Pl ; s2 = []} ; @@ -62,14 +68,14 @@ lin less_CAdv = X.mkCAdv "moins" conjThan ; many_Det = {s,sp = \\_,c => prepCase c ++ "plusieurs" ; n = Pl ; s2 = []} ; more_CAdv = X.mkCAdv "plus" conjThan ; - most_Predet = {s = \\_,c => prepCase c ++ ["la plupart"] ; c = CPrep P_de} ; + most_Predet = {s = \\_,c => prepCase c ++ ["la plupart"] ; c = CPrep P_de ; a = PNoAg} ; much_Det = {s,sp = \\_,c => prepCase c ++ "beaucoup" ++ elisDe ; n = Pl ; s2 = []} ; must_VV = mkVV (devoir_V2 ** {lock_V = <>}) ; ---b no_Phr = ss "non" ; no_Utt = ss "non" ; on_Prep = mkPreposition "sur" ; --- DEPREC one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "une" ! g} ; - only_Predet = {s = \\_,c => prepCase c ++ "seulement" ; c = Nom} ; --- seul(e)(s) + only_Predet = {s = \\_,c => prepCase c ++ "seulement" ; c = Nom ; a = PNoAg} ; --- seul(e)(s) or_Conj = {s1 = [] ; s2 = "ou" ; n = Sg} ; otherwise_PConj = ss "autrement" ; part_Prep = complGen ; @@ -164,7 +170,7 @@ lin "vous" "vous" "vous" "vous" "votre" "votre" "vos" Masc Pl P2 ; - not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom} ; + not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom ; a = PNoAg} ; no_Quant = let aucun : ParadigmsFre.Number => ParadigmsFre.Gender => Case => Str = table { diff --git a/lib/src/italian/MakeStructuralIta.gf b/lib/src/italian/MakeStructuralIta.gf index 4f75b3e7d..6df1d5f93 100644 --- a/lib/src/italian/MakeStructuralIta.gf +++ b/lib/src/italian/MakeStructuralIta.gf @@ -13,4 +13,10 @@ oper mkIQuant : Str -> IQuant = \s -> {s = \\_,_,c => prepCase c ++ s ; lock_IQuant = <>} ; + mkPredet : Str -> Str -> Prep -> Bool -> Predet = \m,f,c,p -> lin Predet { + s = \\g,k => prepCase k ++ case g.g of {Masc => m ; Fem => f} ; + c = c.c ; + a = if_then_else PAgr p (PAg Sg) PNoAg ---- e,g, "chacun de"; other possibilities? + } ; + } diff --git a/lib/src/italian/StructuralIta.gf b/lib/src/italian/StructuralIta.gf index 28e05daeb..4ba35a527 100644 --- a/lib/src/italian/StructuralIta.gf +++ b/lib/src/italian/StructuralIta.gf @@ -11,7 +11,8 @@ lin after_Prep = mkPrep "dopo" ; all_Predet = { s = \\a,c => prepCase c ++ aagrForms "tutto" "tutta" "tutti" "tutte" ! a ; - c = Nom + c = Nom ; + a = PNoAg } ; almost_AdA, almost_AdN = ss "quasi" ; always_AdV = ss "sempre" ; @@ -60,13 +61,15 @@ lin less_CAdv = X.mkCAdv "meno" conjThan ; many_Det = {s,sp = \\g,c => prepCase c ++ genForms "molti" "molte" ! g ; n = Pl ; s2 = []} ; more_CAdv = X.mkCAdv "più" conjThan ; - most_Predet = {s = \\_,c => prepCase c ++ ["la maggior parte"] ; c = CPrep P_di} ; + most_Predet = {s = \\_,c => prepCase c ++ ["la maggior parte"] ; c = CPrep P_di ; + a = PNoAg} ; much_Det = {s,sp = \\g,c => prepCase c ++ genForms "molto" "molta" ! g ; n = Sg ; s2 = []} ; must_VV = mkVV (verboV (dovere_47 "dovere")) ; no_Utt = ss "no" ; on_Prep = {s = [] ; c = CPrep P_su ; isDir = False} ; ---- one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ; - only_Predet = {s = \\_,c => prepCase c ++ "soltanto" ; c = Nom} ; --- solo|a|i|e + only_Predet = {s = \\_,c => prepCase c ++ "soltanto" ; c = Nom ; + a = PNoAg} ; --- solo|a|i|e or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ; otherwise_PConj = ss "altramente" ; part_Prep = complGen ; @@ -152,7 +155,8 @@ lin mkPronoun "Lei" "La" "Le" "Glie" "Lei" "Suo" "Sua" "Suoi" "Sue" Masc Sg P3 ; - not_Predet = {s = \\a,c => prepCase c ++ "non" ; c = Nom} ; + not_Predet = {s = \\a,c => prepCase c ++ "non" ; c = Nom ; + a = PNoAg} ; no_Quant = let aucun : ParadigmsIta.Number => ParadigmsIta.Gender => Case => Str = table { diff --git a/lib/src/romance/CatRomance.gf b/lib/src/romance/CatRomance.gf index 6923d26f0..3254922c0 100644 --- a/lib/src/romance/CatRomance.gf +++ b/lib/src/romance/CatRomance.gf @@ -67,7 +67,11 @@ incomplete concrete CatRomance of Cat = CommonX s2 : Str ; sp : Number => Gender => Case => Str } ; - Predet = {s : AAgr => Case => Str ; c : Case} ; -- c : la plupart de + Predet = { + s : AAgr => Case => Str ; + c : Case ; -- c : la plupart de + a : PAgr -- if an agr is forced, e.g. chacun de nous + } ; Num = {s : Gender => Str ; isNum : Bool ; n : Number} ; Card = {s : Gender => Str ; n : Number} ; Ord = {s : AAgr => Str} ; diff --git a/lib/src/romance/CommonRomance.gf b/lib/src/romance/CommonRomance.gf index 01c05ddf4..3d6c27497 100644 --- a/lib/src/romance/CommonRomance.gf +++ b/lib/src/romance/CommonRomance.gf @@ -118,7 +118,7 @@ param | RCond --# notpresent ; --- Agreement of adjectives, verb phrases, and relative pronouns. +-- Agreement of adjectives, verb phrases, relative pronouns, and predeterminers. oper AAgr : Type = {g : Gender ; n : Number} ; @@ -126,6 +126,7 @@ oper param RAgr = RAg {g : Gender ; n : Number} | RNoAg ; --- AAgr + PAgr = PAg Number | PNoAg ; -- Clitic slots. diff --git a/lib/src/romance/NounRomance.gf b/lib/src/romance/NounRomance.gf index 3bc39aba8..a8e0e5c3e 100644 --- a/lib/src/romance/NounRomance.gf +++ b/lib/src/romance/NounRomance.gf @@ -20,7 +20,7 @@ incomplete concrete NounRomance of Noun = PredetNP pred np = heavyNP { s = \\c => pred.s ! aagr (np.a.g) (np.a.n) ! c ++ (np.s ! pred.c).ton ; - a = np.a ; + a = case pred.a of {PAg n => agrP3 np.a.g n ; _ => np.a} ; hasClit = False } ; diff --git a/lib/src/spanish/StructuralSpa.gf b/lib/src/spanish/StructuralSpa.gf index af3e9230a..df70de138 100644 --- a/lib/src/spanish/StructuralSpa.gf +++ b/lib/src/spanish/StructuralSpa.gf @@ -9,7 +9,8 @@ lin after_Prep = {s = ["despues"] ; c = MorphoSpa.genitive ; isDir = False} ; all_Predet = { s = \\a,c => prepCase c ++ aagrForms "todo" "toda" "todos" "todas" ! a ; - c = Nom + c = Nom ; + a = PNoAg } ; almost_AdA, almost_AdN = ss "casi" ; always_AdV = ss "siempre" ; @@ -64,14 +65,16 @@ lin many_Det = { s,sp = \\g,c => prepCase c ++ genForms "muchos" "muchas" ! g ; n = Pl ; s2 = []} ; more_CAdv = X.mkCAdv "más" conjThan ; - most_Predet = {s = \\_,c => prepCase c ++ ["la mayor parte"] ; c = CPrep P_de} ; + most_Predet = {s = \\_,c => prepCase c ++ ["la mayor parte"] ; c = CPrep P_de ; + a = PNoAg} ; much_Det = { s,sp = \\g,c => prepCase c ++ genForms "mucho" "mucha" ! g ; n = Sg ; s2 = []} ; must_VV = mkVV (verboV (deber_6 "deber")) ; no_Utt = ss "no" ; on_Prep = mkPrep "sobre" ; --- one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ; - only_Predet = {s = \\_,c => prepCase c ++ "solamente" ; c = Nom} ; + only_Predet = {s = \\_,c => prepCase c ++ "solamente" ; c = Nom ; + a = PNoAg} ; or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ; otherwise_PConj = ss "otramente" ; part_Prep = complGen ;