(Romance) Remove Degree from A, new field for comp

This commit is contained in:
Inari Listenmaa
2021-09-13 15:15:17 +08:00
parent 3d703856a6
commit 862c50e936
5 changed files with 44 additions and 40 deletions

View File

@@ -3,24 +3,23 @@ incomplete concrete AdjectiveRomance of Adjective =
flags coding=utf8; flags coding=utf8;
lin lin
PositA a = a ** { PositA a = a ; -- A is a subtype of AP: we lose the fields isDeg and compar
s = a.s ! Posit ;
} ;
ComparA a np = a ** { ComparA a np = a ** {
s = \\af => s = \\af =>
let compar : Str = case a.isDeg of { let compar : Str = case a.isDeg of {
True => a.s ! Compar ! af ; -- bueno, mejor True => a.compar ! af2num af ; -- bueno, mejor
False => piuComp ++ a.s ! Posit ! af } ; -- cher, plus cher False => piuComp ++ a.s ! af } ; -- cher, plus cher
in compar ++ conjThan ++ (np.s ! Nom).ton ; in compar ++ conjThan ++ (np.s ! Nom).ton ;
isPre = False ; isPre = False ;
} ; } ;
CAdvAP ad ap np = { CAdvAP ad ap np = ap ** {
s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ (np.s ! Nom).ton ; s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ (np.s ! Nom).ton ;
isPre = False ; isPre = False ;
copTyp = ap.copTyp
} ; } ;
UseComparA a = a ** { 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 = { AdjOrd ord = {
s = \\af => ord.s ! aform2aagr af ; ---- s = \\af => ord.s ! aform2aagr af ; ----
@@ -30,42 +29,34 @@ incomplete concrete AdjectiveRomance of Adjective =
-- $SuperlA$ belongs to determiner syntax in $Noun$. -- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 adj np = { ComplA2 adj np = adj ** {
s = \\af => adj.s ! Posit ! af ++ appCompl adj.c2 np ; s = \\af => adj.s ! af ++ appCompl adj.c2 np ;
isPre = False ; isPre = False ;
copTyp = adj.copTyp
} ; } ;
ReflA2 adj = { ReflA2 adj = adj ** {
s = \\af => s = \\af =>
adj.s ! Posit ! af ++ adj.s ! af ++
adj.c2.s ++ prepCase adj.c2.c ++ reflPron Sg P3 Nom ; --- agr adj.c2.s ++ prepCase adj.c2.c ++ reflPron Sg P3 Nom ; --- agr
isPre = False ; isPre = False ;
copTyp = adj.copTyp
} ; } ;
SentAP ap sc = { SentAP ap sc = ap ** {
s = \\a => ap.s ! a ++ sc.s ! dative ; -- prête à dormir --- mood s = \\a => ap.s ! a ++ sc.s ! dative ; -- prête à dormir --- mood
isPre = False ; isPre = False ;
copTyp = ap.copTyp
} ; } ;
AdAP ada ap = { AdAP ada ap = ap ** {
s = \\a => ada.s ++ ap.s ! a ; s = \\a => ada.s ++ ap.s ! a ;
isPre = ap.isPre ;
copTyp = ap.copTyp
} ; } ;
UseA2 a = { UseA2 a = a ** {
s = a.s ! Posit ;
isPre = False ; ---- A2 has no isPre 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 ; s = \\a => ap.s ! a ++ adv.s ;
isPre = False ; isPre = False ;
copTyp = ap.copTyp
} ; } ;

View File

@@ -3,15 +3,15 @@ incomplete concrete AdverbRomance of Adverb =
lin lin
PositAdvAdj a = { PositAdvAdj a = {
s = a.s ! Posit ! AA s = a.s ! AA
} ; } ;
ComparAdvAdj cadv a np = { 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 = { 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} ; PrepNP prep np = {s = prep.s ++ (np.s ! prep.c).ton} ;
@@ -19,7 +19,7 @@ incomplete concrete AdverbRomance of Adverb =
AdAdv = cc2 ; AdAdv = cc2 ;
PositAdAAdj a = { PositAdAAdj a = {
s = a.s ! Posit ! AA s = a.s ! AA
} ; } ;
SubjS subj s = { SubjS subj s = {

View File

@@ -104,8 +104,8 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
V3, V2A, V2V = Verb ** {c2,c3 : Compl} ; V3, V2A, V2V = Verb ** {c2,c3 : Compl} ;
VS = Verb ** {m : RPolarity => Mood} ; VS = Verb ** {m : RPolarity => Mood} ;
A = {s : Degree => AForm => Str ; isPre : Bool ; copTyp : CopulaType ; isDeg : Bool} ; A = {s : AForm => Str ; compar : Number => Str ; isPre : Bool ; copTyp : CopulaType ; isDeg : Bool} ;
A2 = {s : Degree => AForm => Str ; c2 : Compl ; copTyp : CopulaType ; isDeg : Bool} ; A2 = {s : AForm => Str ; compar : Number => Str ; c2 : Compl ; copTyp : CopulaType ; isDeg : Bool} ;
N = Noun ; N = Noun ;
N2 = Noun ** {c2 : Compl} ; N2 = Noun ** {c2 : Compl} ;
@@ -133,8 +133,8 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
NP = \np -> (np.s ! Nom).comp ; NP = \np -> (np.s ! Nom).comp ;
Conj = \c -> c.s2 ; Conj = \c -> c.s2 ;
A = \a -> a.s ! Posit ! ASg Masc APred ; A = \a -> a.s ! ASg Masc APred ;
A2 = \a -> a.s ! Posit ! ASg Masc APred ++ a.c2.s ; A2 = \a -> a.s ! ASg Masc APred ++ a.c2.s ;
N = \n -> n.s ! Sg ; N = \n -> n.s ! Sg ;
N2 = \n -> n.s ! Sg ++ n.c2.s ; N2 = \n -> n.s ! Sg ++ n.c2.s ;

View File

@@ -46,6 +46,13 @@ param
oper oper
AF : Gender -> Number -> AForm = \g,n -> case n of {Sg => ASg g AAttr ; Pl => APl g} ; 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: -- The following coercions are useful:
oper oper
@@ -267,8 +274,8 @@ oper
vpAgrNone : VPAgr = VPAgrClit Masc Sg ; vpAgrNone : VPAgr = VPAgrClit Masc Sg ;
oper oper
mkOrd : {s : Degree => AForm => Str} -> {s : AAgr => Str} ; mkOrd : Adj -> {s : AAgr => Str} ;
mkOrd x = {s = \\ag => x.s ! Posit ! aagr2aform ag } ; mkOrd x = {s = \\ag => x.s ! aagr2aform ag } ;
-- This is used in Spanish and Italian to bind clitics with preceding verb. -- This is used in Spanish and Italian to bind clitics with preceding verb.

View File

@@ -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} ; 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 ---- could be discontinuous: la terza città più grande
DefArt = { DefArt = {