From 862c50e9361dbe1e85f4cb726e194c48bf18036a Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 13 Sep 2021 15:15:17 +0800 Subject: [PATCH] (Romance) Remove Degree from A, new field for comp --- src/romance/AdjectiveRomance.gf | 41 +++++++++++++-------------------- src/romance/AdverbRomance.gf | 14 +++++------ src/romance/CatRomance.gf | 8 +++---- src/romance/CommonRomance.gf | 11 +++++++-- src/romance/NounRomance.gf | 10 ++++++-- 5 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/romance/AdjectiveRomance.gf b/src/romance/AdjectiveRomance.gf index d929e4ab6..f5caab654 100644 --- a/src/romance/AdjectiveRomance.gf +++ b/src/romance/AdjectiveRomance.gf @@ -3,24 +3,23 @@ incomplete concrete AdjectiveRomance of Adjective = flags coding=utf8; lin - PositA a = a ** { - s = a.s ! Posit ; - } ; + PositA a = a ; -- A is a subtype of AP: we lose the fields isDeg and compar ComparA a np = a ** { s = \\af => let compar : Str = case a.isDeg of { - True => a.s ! Compar ! af ; -- bueno, mejor - False => piuComp ++ a.s ! Posit ! af } ; -- cher, plus cher + True => a.compar ! af2num af ; -- bueno, mejor + False => piuComp ++ a.s ! af } ; -- cher, plus cher in compar ++ conjThan ++ (np.s ! Nom).ton ; isPre = False ; } ; - CAdvAP ad ap np = { + CAdvAP ad ap np = ap ** { s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ (np.s ! Nom).ton ; isPre = False ; - copTyp = ap.copTyp } ; UseComparA a = a ** { - s = \\af => a.s ! Compar ! af ; + s = \\af => case a.isDeg of { + True => a.compar ! af2num af ; + False => piuComp ++ a.s ! af } } ; AdjOrd ord = { s = \\af => ord.s ! aform2aagr af ; ---- @@ -30,42 +29,34 @@ incomplete concrete AdjectiveRomance of Adjective = -- $SuperlA$ belongs to determiner syntax in $Noun$. - ComplA2 adj np = { - s = \\af => adj.s ! Posit ! af ++ appCompl adj.c2 np ; + ComplA2 adj np = adj ** { + s = \\af => adj.s ! af ++ appCompl adj.c2 np ; isPre = False ; - copTyp = adj.copTyp } ; - ReflA2 adj = { + ReflA2 adj = adj ** { s = \\af => - adj.s ! Posit ! af ++ + adj.s ! af ++ adj.c2.s ++ prepCase adj.c2.c ++ reflPron Sg P3 Nom ; --- agr isPre = False ; - copTyp = adj.copTyp } ; - SentAP ap sc = { + SentAP ap sc = ap ** { s = \\a => ap.s ! a ++ sc.s ! dative ; -- prête à dormir --- mood isPre = False ; - copTyp = ap.copTyp } ; - AdAP ada ap = { + AdAP ada ap = ap ** { s = \\a => ada.s ++ ap.s ! a ; - isPre = ap.isPre ; - copTyp = ap.copTyp } ; - UseA2 a = { - s = a.s ! Posit ; + UseA2 a = a ** { isPre = False ; ---- A2 has no isPre - copTyp = a.copTyp - } ; + } ; -- other than that, AP is a subtype of A2 - AdvAP ap adv = { + AdvAP ap adv = ap ** { s = \\a => ap.s ! a ++ adv.s ; isPre = False ; - copTyp = ap.copTyp } ; diff --git a/src/romance/AdverbRomance.gf b/src/romance/AdverbRomance.gf index 88a955414..33abc5a23 100644 --- a/src/romance/AdverbRomance.gf +++ b/src/romance/AdverbRomance.gf @@ -1,17 +1,17 @@ -incomplete concrete AdverbRomance of Adverb = +incomplete concrete AdverbRomance of Adverb = CatRomance ** open CommonRomance, ResRomance, Prelude in { lin PositAdvAdj a = { - s = a.s ! Posit ! AA + s = a.s ! AA } ; - + ComparAdvAdj cadv a np = { - s = cadv.s ++ a.s ! Posit ! AA ++ cadv.p ++ (np.s ! Nom).ton + s = cadv.s ++ a.s ! AA ++ cadv.p ++ (np.s ! Nom).ton } ; - + ComparAdvAdjS cadv a s = { - s = cadv.s ++ a.s ! Posit ! AA ++ cadv.p ++ s.s ! Conjunct --- ne + s = cadv.s ++ a.s ! AA ++ cadv.p ++ s.s ! Conjunct --- ne } ; PrepNP prep np = {s = prep.s ++ (np.s ! prep.c).ton} ; @@ -19,7 +19,7 @@ incomplete concrete AdverbRomance of Adverb = AdAdv = cc2 ; PositAdAAdj a = { - s = a.s ! Posit ! AA + s = a.s ! AA } ; SubjS subj s = { diff --git a/src/romance/CatRomance.gf b/src/romance/CatRomance.gf index 0cf2bc356..4f708cc7d 100644 --- a/src/romance/CatRomance.gf +++ b/src/romance/CatRomance.gf @@ -104,8 +104,8 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol] V3, V2A, V2V = Verb ** {c2,c3 : Compl} ; VS = Verb ** {m : RPolarity => Mood} ; - A = {s : Degree => AForm => Str ; isPre : Bool ; copTyp : CopulaType ; isDeg : Bool} ; - A2 = {s : Degree => AForm => Str ; c2 : Compl ; copTyp : CopulaType ; isDeg : Bool} ; + A = {s : AForm => Str ; compar : Number => Str ; isPre : Bool ; copTyp : CopulaType ; isDeg : Bool} ; + A2 = {s : AForm => Str ; compar : Number => Str ; c2 : Compl ; copTyp : CopulaType ; isDeg : Bool} ; N = Noun ; N2 = Noun ** {c2 : Compl} ; @@ -133,8 +133,8 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol] NP = \np -> (np.s ! Nom).comp ; Conj = \c -> c.s2 ; - A = \a -> a.s ! Posit ! ASg Masc APred ; - A2 = \a -> a.s ! Posit ! ASg Masc APred ++ a.c2.s ; + A = \a -> a.s ! ASg Masc APred ; + A2 = \a -> a.s ! ASg Masc APred ++ a.c2.s ; N = \n -> n.s ! Sg ; N2 = \n -> n.s ! Sg ++ n.c2.s ; diff --git a/src/romance/CommonRomance.gf b/src/romance/CommonRomance.gf index e92932825..8bce2e475 100644 --- a/src/romance/CommonRomance.gf +++ b/src/romance/CommonRomance.gf @@ -46,6 +46,13 @@ param oper AF : Gender -> Number -> AForm = \g,n -> case n of {Sg => ASg g AAttr ; Pl => APl g} ; +-- helper functions for comparative/superlative forms +oper + af2num : AForm -> Number = \af -> case af of { + APl _ => Pl ; + _ => Sg -- singular and adverbial use Sg form. As of 2021, there are no funs from AP to Adv, so it doesn't matter. + } ; + -- The following coercions are useful: oper @@ -267,8 +274,8 @@ oper vpAgrNone : VPAgr = VPAgrClit Masc Sg ; oper - mkOrd : {s : Degree => AForm => Str} -> {s : AAgr => Str} ; - mkOrd x = {s = \\ag => x.s ! Posit ! aagr2aform ag } ; + mkOrd : Adj -> {s : AAgr => Str} ; + mkOrd x = {s = \\ag => x.s ! aagr2aform ag } ; -- This is used in Spanish and Italian to bind clitics with preceding verb. diff --git a/src/romance/NounRomance.gf b/src/romance/NounRomance.gf index d52fa224e..d7ed7e385 100644 --- a/src/romance/NounRomance.gf +++ b/src/romance/NounRomance.gf @@ -101,9 +101,15 @@ incomplete concrete NounRomance of Noun = AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum ; n = num.n} ; - OrdSuperl adj = {s = \\a => adj.s ! Superl ! genNum2Aform a.g a.n} ; + OrdSuperl adj = { + s = \\a => case adj.isDeg of { + True => adj.compar ! a.n ; + False => piuComp ++ adj.s ! genNum2Aform a.g a.n } + } ; - OrdNumeralSuperl num adj = {s = \\a => num.s ! NOrd a.g a.n ++ adj.s ! Superl ! genNum2Aform a.g a.n} ; -- la terza più grande + OrdNumeralSuperl num adj = + let ordSuperl : Ord = OrdSuperl adj + in {s = \\a => num.s ! NOrd a.g a.n ++ ordSuperl.s ! a} ; -- la terza più grande ---- could be discontinuous: la terza città più grande DefArt = {