(Romance) Attributive and predicative adjective forms (#93)

* (Fre,Por) accomodate changes to Romance adjectives
- to support Spanish buen/bueno, gran/grande and catalan bo/bon

* (Cat) Update paradigms to allow predicative and attributive forms of adj

* (Spa) fix argument order in Spanish adjective paradigms

* (Eng) fix missing paradigm invarA

* (Spa) Flip order of args in mkAdj constructor
This commit is contained in:
Inari Listenmaa
2018-12-05 19:16:35 +02:00
committed by GitHub
parent 78cac3725a
commit dadcd386c9
25 changed files with 401 additions and 332 deletions

View File

@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl)))
) )
} ; } ;

View File

@@ -28,7 +28,7 @@ lin
become_VA = reflV (mkV "tornar") ; -- esdevenir become_VA = reflV (mkV "tornar") ; -- esdevenir
beer_N = regFN "cervesa" ; beer_N = regFN "cervesa" ;
beg_V2V = mkV2V (mkV "demanar") accusative dative ; beg_V2V = mkV2V (mkV "demanar") accusative dative ;
big_A = regADeg "gros" ; big_A = mkA "gros" "grossa" ;
bike_N = regFN "bicicleta" ; bike_N = regFN "bicicleta" ;
bird_N = regMN "ocell" ; bird_N = regMN "ocell" ;
black_A = compADeg (mkA "negre" "negra" "negres" "negres" "negrament") ; black_A = compADeg (mkA "negre" "negra" "negres" "negres" "negrament") ;
@@ -92,7 +92,7 @@ lin
girl_N = regFN "noia" ; girl_N = regFN "noia" ;
glove_N = regMN "guant" ; glove_N = regMN "guant" ;
gold_N = regMN "or" ; gold_N = regMN "or" ;
good_A = prefA (mkADeg (mkA "bo" "bona") (mkA "millor")) ; good_A = mkA (prefA "bo" "bon") (mkA "millor") ;
go_V = (verbV (anar_4 "anar")) ; go_V = (verbV (anar_4 "anar")) ;
green_A = regADeg "verd" ; green_A = regADeg "verd" ;
harbour_N = regMN "port" ; harbour_N = regMN "port" ;

View File

@@ -94,14 +94,19 @@ oper
-- Here are some patterns. First one that describes the worst case. -- Here are some patterns. First one that describes the worst case.
-- gcc M2.1 -- gcc M2.1
mkAdj : (_,_,_,_,_ : Str) -> Adj = \prim,prima,prims,primes,primament -> mkAdjFull : (x1,_,_,_,_,x6 : Str) -> Adj = \bon,bo,prima,prims,primes,primament ->
{s = table { {s = table {
AF Masc n => numForms prim prims ! n ; ASg Masc AAttr => bon ;
AF Fem n => numForms prima primes ! n ; ASg Masc APred => bo ;
AA => primament ASg Fem _ => prima ;
APl Masc => prims ;
APl Fem => primes ;
AA => primament
} }
} ; } ;
mkAdj : (x1,_,_,_,x5 : Str) -> Adj = \a,b,c,d,e -> mkAdjFull a a b c d e ;
--- Then the regular and invariant patterns. --- Then the regular and invariant patterns.
adjPrim : Str -> Adj = \prim -> adjPrim : Str -> Adj = \prim ->
@@ -116,16 +121,15 @@ oper
let fond = Predef.tk 1 fondo let fond = Predef.tk 1 fondo
in adjBlau fondo (fond + "a") ; in adjBlau fondo (fond + "a") ;
adjBo : Str -> Adj = \bo -> adjBo : (bo,bon : Str) -> Adj = \bo,bon ->
mkAdj bo (bo + "na") (bo + "ns") (bo + "nes") (bo + "nament") ; mkAdjFull bon bo (bon + "a") (bon + "s") (bon + "es") (bon + "ament") ;
adjFidel : Str -> Adj = \fidel -> adjFidel : Str -> Adj = \fidel ->
let fidels : Str = case (last fidel) of { let fidels : Str = case (last fidel) of {
_ + ("s"|"ç"|"x") => fidel + "os" ; --feliç; capaç _ + ("s"|"ç"|"x") => fidel + "os" ; --feliç; capaç
_ => fidel + "s" _ => fidel + "s"
} ; } ;
in mkAdj fidel fidel fidels fidels in mkAdj fidel fidel fidels fidels (fidel + "ment") ;
(fidel + "ment") ;
--boig, boja, bojos, boges --boig, boja, bojos, boges
--lleig, lletja, lletjos, lletges --lleig, lletja, lletjos, lletges
@@ -300,6 +304,6 @@ oper unaccent : Str -> Str = \vocal ->
-- Determiners, traditionally called indefinite pronouns, are inflected -- Determiners, traditionally called indefinite pronouns, are inflected
-- in gender and number, like adjectives. -- in gender and number, like adjectives.
pronForms : Adj -> Gender -> Number -> Str = \tal,g,n -> tal.s ! AF g n ; pronForms : Adj -> Gender -> Number -> Str = \tal,g,n -> tal.s ! genNum2Aform g n ;
} }

View File

@@ -327,7 +327,11 @@ oper
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ; compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
mk2A a b = compADeg {s = \\_ => (mkAdj2Reg a b).s ; isPre = False ; lock_A = <>} ; mk2A a b = compADeg {s = \\_ => (mkAdj2Reg a b).s ; isPre = False ; lock_A = <>} ;
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ; regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ;
prefA a = {s = a.s ; isPre = True ; lock_A = <>} ; prefA = overload {
prefA : A -> A = \a -> a ** {isPre = True} ;
prefA : Str -> Str -> A = \bo,bon ->
compADeg (lin A {s = \\_ => (adjBo bo bon).s ; isPre = True}) ;
} ;
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
@@ -425,7 +429,7 @@ oper
special_ppV ve pa = { special_ppV ve pa = {
s = table { s = table {
VPart g n => (regA pa).s ! Posit ! AF g n ; VPart g n => (regA pa).s ! Posit ! genNum2Aform g n ;
p => ve.s ! p p => ve.s ! p
} ; } ;
lock_V = <> ; lock_V = <> ;
@@ -504,7 +508,10 @@ oper
mkADeg : A -> A -> A ; mkADeg : A -> A -> A ;
compADeg : A -> A ; compADeg : A -> A ;
regADeg : Str -> A ; regADeg : Str -> A ;
prefA : A -> A ; prefA : overload {
prefA : A -> A ; -- gran
prefA : (bo,bon : Str) -> A -- predicative masc, attributive masc
} ;
prefixA = prefA ; prefixA = prefA ;
mkV = overload { mkV = overload {

View File

@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl)))
) )
} ; } ;

View File

@@ -18,7 +18,7 @@ lin
bad_A = prefA (mkADeg (regA "mauvais") (regA "pire")) ; bad_A = prefA (mkADeg (regA "mauvais") (regA "pire")) ;
bank_N = regGenN "banque" feminine ; bank_N = regGenN "banque" feminine ;
beautiful_A = beautiful_A =
prefA (compADeg (mkA (pre {voyelle => "bel" ; _ => "beau" }) "belle" "beaux" "bellement")) ; prefA (compADeg (mkA "beau" "bel" "beaux" "belle" "bellement")) ;
become_VA = mkVA devenir_V ; become_VA = mkVA devenir_V ;
beer_N = regGenN "bière" feminine ; beer_N = regGenN "bière" feminine ;
beg_V2V = mkV2V (regV "demander") accusative dative ; beg_V2V = mkV2V (regV "demander") accusative dative ;
@@ -129,11 +129,11 @@ lin
music_N = regGenN "musique" feminine ; music_N = regGenN "musique" feminine ;
narrow_A = regA "étroit" ; narrow_A = regA "étroit" ;
new_A = new_A =
prefA (compADeg (mkA (pre {voyelle => "nouvel" ; _ => "nouveau" }) "nouvelle" "nouveaux" "nouvellement")) ; prefA (compADeg (mkA "nouveau" "nouvel" "nouveaux" "nouvelle" "nouvellement")) ;
newspaper_N = regGenN "journal" masculine ; newspaper_N = regGenN "journal" masculine ;
oil_N = regGenN "huile" feminine ; oil_N = regGenN "huile" feminine ;
old_A = old_A =
prefA (compADeg (mkA (pre {voyelle => "vieil" ; _ => "vieux" }) "vieille" "vieux" "vieillement")) ; prefA (compADeg (mkA "vieux" "vieil" "vieux" "vieille" "vieillement")) ;
open_V2 = ouvrir_V2 ; open_V2 = ouvrir_V2 ;
paint_V2A = mkV2A (v2V peindre_V2) accusative (mkPrep "en") ; paint_V2A = mkV2A (v2V peindre_V2) accusative (mkPrep "en") ;
paper_N = regGenN "papier" masculine ; paper_N = regGenN "papier" masculine ;

View File

@@ -72,14 +72,19 @@ oper
-- Adjectives are conveniently seen as gender-dependent nouns. -- Adjectives are conveniently seen as gender-dependent nouns.
-- Here are some patterns. First one that describes the worst case. -- Here are some patterns. First one that describes the worst case.
mkAdj : (_,_,_,_ : Str) -> Adj = \vieux,vieuxs,vieille,vieillement -> mkAdj' : (_,_,_,_,_ : Str) -> Adj ;
{s = table { mkAdj' vieux vieil vieuxs vieille vieillement = {
AF Masc n => numForms vieux vieuxs ! n ; s = table {
AF Fem n => nomReg vieille ! n ; ASg Masc _ => pre {#voyelle => vieil ; "h" => vieil ; _ => vieux} ;
AA => vieillement ASg Fem _ => vieille ;
} APl g => genForms vieuxs (vieille + "s") ! g ;
AA => vieillement
}
} ; } ;
mkAdj : (_,_,_,_ : Str) -> Adj ;
mkAdj bleu bleus bleue bleuement = mkAdj' bleu bleu bleus bleue bleuement ;
-- Then the regular and invariant patterns. -- Then the regular and invariant patterns.
adjReg : Str -> Gender => Number => Str = \bu -> table { adjReg : Str -> Gender => Number => Str = \bu -> table {

View File

@@ -160,9 +160,12 @@ oper
mkA : (banal,banale,banaux : Str) -> A ; mkA : (banal,banale,banaux : Str) -> A ;
-- This is the worst-case paradigm for the positive forms. -- This is the worst-case paradigm for the positive forms, except for "vieux/vieil".
mkA : (banal,banale,banaux,banalement : Str) -> A ; -- worst-case adjective mkA : (banal,banale,banaux,banalement : Str) -> A ; -- almost worst-case adjective
-- This is the worst-case paradigm for the positive forms, used for "vieux/vieil".
mkA : (vieux,vieil,vieille,vieuxs,vieuxment : Str) -> A ; -- worst-case adjetive
-- If comparison forms are irregular (i.e. not formed by "plus", e.g. -- If comparison forms are irregular (i.e. not formed by "plus", e.g.
-- "bon-meilleur"), the positive and comparative can be given as separate -- "bon-meilleur"), the positive and comparative can be given as separate
@@ -387,7 +390,8 @@ oper
mkPN : N -> PN = \x -> lin PN {s = x.s ! Sg ; g = x.g} ; mkPN : N -> PN = \x -> lin PN {s = x.s ! Sg ; g = x.g} ;
} ; } ;
mk4A a b c d = compADeg {s = \\_ => (mkAdj a c b d).s ; isPre = False ; lock_A = <>} ; mk4A a b c d = mk5A a a b c d ;
mk5A a b c d e = compADeg {s = \\_ => (mkAdj' a b c d e).s ; isPre = False ; lock_A = <>} ;
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ; regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ;
prefA a = {s = a.s ; isPre = True ; lock_A = <>} ; prefA a = {s = a.s ; isPre = True ; lock_A = <>} ;
@@ -398,6 +402,7 @@ oper
mkA : (sec,seche : Str) -> A = \sec,seche -> mk4A sec seche (sec + "s") (seche + "ment") ; mkA : (sec,seche : Str) -> A = \sec,seche -> mk4A sec seche (sec + "s") (seche + "ment") ;
mkA : (banal,banale,banaux : Str) -> A = \sec,seche,secs -> mk4A sec seche secs (seche + "ment") ; mkA : (banal,banale,banaux : Str) -> A = \sec,seche,secs -> mk4A sec seche secs (seche + "ment") ;
mkA : (banal,banale,banaux,banalement : Str) -> A = mk4A ; mkA : (banal,banale,banaux,banalement : Str) -> A = mk4A ;
mkA : (vieux,vieil,vieille,vieuxs,vieuxment : Str) -> A = mk5A ;
mkA : A -> A -> A = mkADeg mkA : A -> A -> A = mkADeg
}; };
@@ -471,6 +476,7 @@ oper
regA : Str -> A ; regA : Str -> A ;
mk4A : (banal,banale,banaux,banalement : Str) -> A ; mk4A : (banal,banale,banaux,banalement : Str) -> A ;
mk5A : (vieux,vieil,vieille,vieuxs,vieuxment : Str) -> A ; -- worst-case adjetive
prefA : A -> A ; prefA : A -> A ;

View File

@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl)))
) )
} ; } ;

View File

@@ -15,7 +15,7 @@ oper
mkPredet = overload { mkPredet = overload {
mkPredet : A -> Predet = \adj -> lin Predet { mkPredet : A -> Predet = \adj -> lin Predet {
s = \\a,c => prepCase c ++ adj.s ! Posit ! AF a.g a.n ; s = \\a,c => prepCase c ++ adj.s ! Posit ! genNum2Aform a.g a.n ;
c = Nom ; c = Nom ;
a = PNoAg a = PNoAg
} ; } ;

View File

@@ -78,10 +78,12 @@ oper
mkAdj : (_,_,_,_,_ : Str) -> Adj = \solo,sola,soli,sole,solamente -> mkAdj : (_,_,_,_,_ : Str) -> Adj = \solo,sola,soli,sole,solamente ->
{s = table { {s = table {
AF Masc n => numForms solo soli ! n ; ASg Masc _ => solo ;
AF Fem n => numForms sola sole ! n ; ASg Fem _ => sola ;
AA => solamente APl Masc => soli ;
} APl Fem => sole ;
AA => solamente
}
} ; } ;
-- Then the regular and invariant patterns. -- Then the regular and invariant patterns.
@@ -189,6 +191,6 @@ oper
-- Determiners, traditionally called indefinite pronouns, are inflected -- Determiners, traditionally called indefinite pronouns, are inflected
-- in gender and number, like adjectives. -- in gender and number, like adjectives.
pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! AF g n ; pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! genNum2Aform g n ;
} }

View File

@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl)))
) )
} ; } ;

View File

@@ -127,7 +127,7 @@ concrete ExtendPor of Extend =
} ; } ;
ICompAP ap = { ICompAP ap = {
s =\\a => "o quão" ++ ap.s ! AF a.g a.n ; s =\\a => "o quão" ++ ap.s ! (genNum2Aform a.g a.n) ;
cop = serCopula cop = serCopula
} ; } ;
@@ -165,12 +165,12 @@ concrete ExtendPor of Extend =
ComplBareVS = ComplVS ; ComplBareVS = ComplVS ;
AdjAsCN ap = { AdjAsCN ap = {
s =\\n => ap.s ! AF Masc n ; s =\\n => ap.s ! (genNum2Aform Masc n) ;
g = Masc g = Masc
} ; } ;
AdjAsNP ap = heavyNP { AdjAsNP ap = heavyNP {
s = \\_c => ap.s ! AF Masc Sg ; s = \\_c => ap.s ! ASg Masc APred ;
a = Ag Masc Sg P3 a = Ag Masc Sg P3
} ; } ;
@@ -200,10 +200,8 @@ concrete ExtendPor of Extend =
} ; } ;
CompoundAP noun adj = { CompoundAP noun adj = {
s = \\af => case af of { s = \\af => case (aform2aagr af) of {
AF g n => adj.s ! Posit ! AF noun.g n ++ "de" ++ noun.s ! n ; {n = n} => adj.s ! Posit ! (genNum2Aform noun.g n) ++ "de" ++ noun.s ! n
-- do I need do(s)/da(s)?
_ => adj.s ! Posit ! AF noun.g Sg ++ "de" ++ noun.s ! Sg
} ; } ;
isPre = adj.isPre isPre = adj.isPre
} ; } ;

View File

@@ -118,9 +118,9 @@ oper
mkAdj : (_,_,_,_,_ : Str) -> Adj = mkAdj : (_,_,_,_,_ : Str) -> Adj =
\burro,burra,burros,burras,burramente -> \burro,burra,burros,burras,burramente ->
{s = table { {s = table {
AF Masc n => numForms burro burros ! n ; ASg g _ => genForms burro burra ! g ;
AF Fem n => numForms burra burras ! n ; APl g => genForms burros burras ! g ;
AA => burramente AA => burramente
} }
} ; } ;
@@ -129,7 +129,8 @@ oper
adj = mkAdjReg aj adj = mkAdjReg aj
in { in {
s = table { s = table {
AF g n => adj.s ! AF g n ; ASg g _ => adj.s ! ASg g APred ;
APl g => adj.s ! APl g ;
AA => av AA => av
} }
} ; } ;
@@ -245,11 +246,11 @@ oper
-- inflected in gender and number, like adjectives. -- inflected in gender and number, like adjectives.
pronForms : Adj -> Gender -> Number -> Str = pronForms : Adj -> Gender -> Number -> Str =
\tale,g,n -> tale.s ! AF g n ; \tale,g,n -> tale.s ! (genNum2Aform g n) ;
mkOrdinal : A -> Ord = \adj -> mkOrdinal : A -> Ord = \adj ->
lin Ord { lin Ord {
s = \\ag => adj.s ! Posit ! AF ag.g ag.n ; s = \\ag => adj.s ! Posit ! (genNum2Aform ag.g ag.n) ;
} ; } ;
mkQuantifier : (esse,essa,esses,essas : Str) -> Quant = \esse,essa,esses,essas-> mkQuantifier : (esse,essa,esses,essas : Str) -> Quant = \esse,essa,esses,essas->

View File

@@ -366,7 +366,7 @@ oper
-- deviant past participle, e.g. abrir - aberto -- deviant past participle, e.g. abrir - aberto
special_ppV ve pa = { special_ppV ve pa = {
s = table { s = table {
VPart g n => (adjPreto pa).s ! AF g n ; VPart g n => (adjPreto pa).s ! (genNum2Aform g n) ;
p => ve.s ! p p => ve.s ! p
} ; } ;
lock_V = <> ; lock_V = <> ;

View File

@@ -20,10 +20,7 @@ incomplete concrete AdjectiveRomance of Adjective =
isPre = a.isPre isPre = a.isPre
} ; } ;
AdjOrd ord = { AdjOrd ord = {
s = \\af => ord.s ! (case af of { s = \\af => ord.s ! aform2aagr af ; ----
AF g n => aagr g n ;
_ => aagr Masc Sg ----
}) ;
isPre = False ---- isPre = False ----
} ; } ;

View File

@@ -134,8 +134,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 ! AF Masc Sg ; A = \a -> a.s ! Posit ! ASg Masc APred ;
A2 = \a -> a.s ! Posit ! AF Masc Sg ++ a.c2.s ; A2 = \a -> a.s ! Posit ! 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

@@ -30,7 +30,9 @@ param
-- Comparative adjectives are moreover inflected in degree -- Comparative adjectives are moreover inflected in degree
-- (which in Romance is usually syntactic, though). -- (which in Romance is usually syntactic, though).
AForm = AF Gender Number | AA ; AForm = ASg Gender APosition | APl Gender | AA ;
APosition = AAttr | APred ;
-- Gender is not morphologically determined for first and second person pronouns. -- Gender is not morphologically determined for first and second person pronouns.
@@ -49,18 +51,44 @@ oper
} ; } ;
-- genderpos2gender : GenderPosition -> {p1:Gender,p2:Number} = \gp -> case gp of {
-- MascSg _ => <Masc,Sg> ;
-- MascPl => <Masc,Pl> ;
-- FemSg => <Fem,Sg> ;
-- FemPl => <Fem,Pl>
-- } ;
aform2gender : AForm -> Gender = \a -> case a of { aform2gender : AForm -> Gender = \a -> case a of {
AF g _ => g ; ASg g _ => g ;
_ => Masc -- "le plus lentement" APl g => g ;
_ => Masc -- "le plus lentement"
} ; } ;
aform2number : AForm -> Number = \a -> case a of { aform2number : AForm -> Number = \a -> case a of {
AF _ n => n ; APl _ => Pl ;
_ => Sg -- "le plus lentement" _ => Sg -- "le plus lentement"
} ; } ;
aform2aagr : AForm -> AAgr = \a -> case a of { aform2aagr : AForm -> AAgr = \a -> case a of {
AF g n => aagr g n ; ASg g _ => aagr g Sg ;
_ => aagr Masc Sg -- "le plus lentement" APl g => aagr g Pl ;
_ => aagr Masc Sg -- "le plus lentement"
} ; } ;
aagr2aform : AAgr -> AForm = \gn -> case gn of {
{g=g ; n=Sg} => ASg g APred ;
{g=g ; n=Pl} => APl g
} ;
genNum2Aform : Gender -> Number -> AForm ;
genNum2Aform g n = case n of {
Sg => ASg g APred ;
Pl => APl g
} ;
genNumPos2Aform : Gender -> Number -> Bool -> AForm ;
genNumPos2Aform g n isPre = case n of {
Sg => ASg g (if_then_else APosition isPre AAttr APred) ;
Pl => APl g
} ;
conjGender : Gender -> Gender -> Gender = \m,n -> conjGender : Gender -> Gender -> Gender = \m,n ->
case m of { case m of {
@@ -236,7 +264,7 @@ oper
oper oper
mkOrd : {s : Degree => AForm => Str} -> {s : AAgr => Str} ; mkOrd : {s : Degree => AForm => Str} -> {s : AAgr => Str} ;
mkOrd x = {s = \\ag => x.s ! Posit ! AF ag.g ag.n} ; mkOrd x = {s = \\ag => x.s ! Posit ! 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,9 @@ 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 ! AF a.g a.n} ; OrdSuperl adj = {s = \\a => adj.s ! Superl ! genNum2Aform a.g a.n} ;
OrdNumeralSuperl num adj = {s = \\a => num.s ! NOrd a.g a.n ++ adj.s ! Superl ! AF a.g a.n} ; -- la terza più grande OrdNumeralSuperl num adj = {s = \\a => num.s ! NOrd a.g a.n ++ adj.s ! Superl ! genNum2Aform a.g a.n} ; -- la terza più grande
---- could be discontinuous: la terza città più grande ---- could be discontinuous: la terza città più grande
DefArt = { DefArt = {
@@ -153,7 +153,7 @@ incomplete concrete NounRomance of Noun =
let let
g = cn.g g = cn.g
in { in {
s = \\n => preOrPost ap.isPre (ap.s ! (AF g n)) (cn.s ! n) ; s = \\n => preOrPost ap.isPre (ap.s ! genNumPos2Aform g n ap.isPre) (cn.s ! n) ;
g = g ; g = g ;
} ; } ;
@@ -190,7 +190,7 @@ incomplete concrete NounRomance of Noun =
a = np.a ** {n = det.n} } ; a = np.a ** {n = det.n} } ;
AdjDAP det ap = { AdjDAP det ap = {
s = \\g => det.s ! g ++ ap.s ! AF g det.n ; s = \\g => det.s ! g ++ ap.s ! genNum2Aform g det.n ;
n = det.n ; n = det.n ;
} ; } ;

View File

@@ -18,7 +18,7 @@ incomplete concrete PhraseRomance of Phrase =
UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr
UttAdv adv = adv ; UttAdv adv = adv ;
UttCN n = {s = n.s ! Sg} ; UttCN n = {s = n.s ! Sg} ;
UttAP ap = {s = ap.s ! AF Masc Sg} ; UttAP ap = {s = ap.s ! genNum2Aform Masc Sg} ;
UttCard n = {s = n.s ! Masc} ; UttCard n = {s = n.s ! Masc} ;
UttInterj i = i ; UttInterj i = i ;

View File

@@ -11,7 +11,7 @@ incomplete concrete VerbRomance of Verb =
ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ; ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ;
ComplVQ v q = insertExtrapos (\\_ => q.s ! QIndir) (predV v) ; ComplVQ v q = insertExtrapos (\\_ => q.s ! QIndir) (predV v) ;
ComplVA v ap = ComplVA v ap =
insertComplement (\\a => let agr = complAgr a in ap.s ! AF agr.g agr.n) (predV v) ; insertComplement (\\a => let agr = complAgr a in ap.s ! genNum2Aform agr.g agr.n) (predV v) ;
SlashV2a v = mkVPSlash v.c2 (predV v) ; SlashV2a v = mkVPSlash v.c2 (predV v) ;
@@ -40,13 +40,13 @@ incomplete concrete VerbRomance of Verb =
SlashV2A v ap = SlashV2A v ap =
let af = case v.c3.isDir of { let af = case v.c3.isDir of {
True => AF np.a.g np.a.n ; -- ... bleues True => genNum2Aform np.a.g np.a.n ; -- ... bleues
_ => AF Masc Sg -- il les peint en bleu _ => genNum2Aform Masc Sg -- il les peint en bleu
} }
-} -}
SlashV2A v ap = SlashV2A v ap =
let af = AF Masc Sg let af = genNum2Aform Masc Sg
in in
mkVPSlash v.c2 mkVPSlash v.c2
(insertComplement (insertComplement
@@ -91,7 +91,7 @@ incomplete concrete VerbRomance of Verb =
UseCopula = predV copula ; UseCopula = predV copula ;
CompAP ap = {s = \\ag => let agr = complAgr ag in ap.s ! AF agr.g agr.n ; cop = serCopula} ; CompAP ap = {s = \\ag => let agr = complAgr ag in ap.s ! genNum2Aform agr.g agr.n ; cop = serCopula} ;
CompCN cn = { s = \\ag => CompCN cn = { s = \\ag =>
let agr = complAgr ag in let agr = complAgr ag in
artIndef False cn.g agr.n Nom ++ cn.s ! agr.n ; artIndef False cn.g agr.n Nom ++ cn.s ! agr.n ;
@@ -116,4 +116,3 @@ incomplete concrete VerbRomance of Verb =
c2 = {s = prep.s ; c = prep.c ; isDir = False} c2 = {s = prep.s ; c = prep.c ; isDir = False}
} ; } ;
} }

View File

@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (AF Masc Sg)) ++ td (adj.s ! Posit ! (AF Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! genNum2Aform Masc Sg) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (AF Fem Sg)) ++ td (adj.s ! Posit ! (AF Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! genNum2Aform Fem Sg) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl)))
) )
} ; } ;

View File

@@ -57,12 +57,16 @@ oper
-- Adjectives are conveniently seen as gender-dependent nouns. -- Adjectives are conveniently seen as gender-dependent nouns.
-- Here are some patterns. First one that describes the worst case. -- Here are some patterns. First one that describes the worst case.
mkAdj : (_,_,_,_,_ : Str) -> Adj = \solo,sola,soli,sole,solamente -> mkAdj : (x1,_,_,_,_,_,x7 : Str) -> Adj = \buen,solo,gran,sola,solos,solas,solamente ->
{s = table { {s = table {
AF Masc n => numForms solo soli ! n ; ASg Masc AAttr => buen ;
AF Fem n => numForms sola sole ! n ; ASg Masc APred => solo ;
AA => solamente ASg Fem AAttr => gran ;
} ASg Fem APred => sola ;
APl Masc => solos ;
APl Fem => solas ;
AA => solamente
}
} ; } ;
-- Then the regular and invariant patterns. -- Then the regular and invariant patterns.
@@ -71,26 +75,36 @@ oper
let let
sol = Predef.tk 1 solo sol = Predef.tk 1 solo
in in
mkAdj solo (sol + "a") (sol + "os") (sol + "as") (sol + "amente") ; mkAdj solo solo (sol + "a") (sol + "a")
(sol + "os") (sol + "as") (sol + "amente") ;
-- masculine and feminine are identical: -- masculine and feminine are identical:
-- adjectives ending with -e, -a and many but not all that end in a consonant -- adjectives ending with -e, -a and many but not all that end in a consonant
adjUtil : Str -> Str -> Adj = \util,utiles -> adjUtil : Str -> Str -> Adj = \util,utiles ->
mkAdj util util utiles utiles (util + "mente") ; mkAdj util util util util
utiles utiles (util + "mente") ;
-- adjectives that end in consonant but have different masc and fem forms -- adjectives that end in consonant but have different masc and fem forms
-- español, hablador ... -- español, hablador ...
adjEspanol : Str -> Str -> Adj = \espanol,espanola -> adjEspanol : Str -> Str -> Adj = \espanol,espanola ->
mkAdj espanol espanola (espanol + "es") (espanol + "as") (espanola + "mente") ; mkAdj espanol espanol espanola espanola
(espanol + "es") (espanol + "as") (espanola + "mente") ;
adjBlu : Str -> Adj = \blu -> adjBueno : Str -> Adj = \bueno ->
mkAdj blu blu blu blu blu ; --- let buen = init bueno in
mkAdj buen bueno (buen + "a") (buen + "a")
(buen + "os") (buen + "as") (buen + "amente") ;
adjGrande : Str -> Str -> Adj = \gran,grande ->
mkAdj gran grande gran grande
(grande + "s") (grande + "s") (grande + "mente") ;
-- francés francesa franceses francesas -- francés francesa franceses francesas
adjEs : Str -> Adj = \francEs -> adjEs : Str -> Adj = \francEs ->
let franc : Str = Predef.tk 2 francEs ; let franc : Str = Predef.tk 2 francEs ;
frances : Str = franc + "es" ; frances : Str = franc + "es" ;
in mkAdj francEs (frances + "a") (frances + "es") (frances + "as") (frances + "amente") ; in mkAdj francEs francEs (frances + "a") (frances + "a")
(frances + "es") (frances + "as") (frances + "amente") ;
-- alemán alemana alemanes alemanas -- alemán alemana alemanes alemanas
@@ -106,11 +120,13 @@ oper
"ú" => "u" "ú" => "u"
} ; } ;
alemVn : Str = alem + V + "n" ; alemVn : Str = alem + V + "n" ;
in mkAdj alemAn (alemVn + "a") (alemVn + "es") in mkAdj alemAn alemAn (alemVn + "a") (alemVn + "a")
(alemVn + "as") (alemVn + "amente") ; (alemVn + "es") (alemVn + "as") (alemVn + "amente") ;
mkAdjReg : Str -> Adj = \solo -> mkAdjReg : Str -> Adj = \solo ->
case solo of { case solo of {
"grande" => adjGrande "gran" "grande" ;
"bueno" => adjBueno solo ;
_ + "o" => adjSolo solo ; _ + "o" => adjSolo solo ;
_ + ("e" | "a") => adjUtil solo (solo + "s") ; _ + ("e" | "a") => adjUtil solo (solo + "s") ;
_ + "és" => adjEs solo ; _ + "és" => adjEs solo ;
@@ -153,11 +169,11 @@ oper
-- Determiners, traditionally called indefinite pronouns, are inflected -- Determiners, traditionally called indefinite pronouns, are inflected
-- in gender and number, like adjectives. -- in gender and number, like adjectives.
pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! AF g n ; pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! genNum2Aform g n ;
mkOrdinal : A -> Ord = \adj-> mkOrdinal : A -> Ord = \adj->
lin Ord { lin Ord {
s = \\ag => adj.s ! Posit ! AF ag.g ag.n ; s = \\ag => adj.s ! Posit ! genNum2Aform ag.g ag.n ;
} ; } ;
mkQuantifier : (ese,esa,esos,esas : Str) -> Quant = \ese,esa,esos,esas-> mkQuantifier : (ese,esa,esos,esas : Str) -> Quant = \ese,esa,esos,esas->

View File

@@ -156,7 +156,9 @@ oper
-- One-place adjectives compared with "mas" need five forms in the worst -- One-place adjectives compared with "mas" need five forms in the worst
-- case (masc and fem singular, masc plural, adverbial). -- case (masc and fem singular, masc plural, adverbial).
mkA : (solo,sola,solos,solas,solamente : Str) -> A ; -- worst-case mkA : (solo,sola,solos,solas,solamente : Str) -> A ; -- almost worst-case, except for buen/bueno gran/grande
mkA : (gran,grande,gran,grande,grandes,grandes,solamente : Str) -> A ; -- worst-case
-- In the worst case, two separate adjectives are given: -- In the worst case, two separate adjectives are given:
-- the positive ("bueno"), and the comparative ("mejor"). -- the positive ("bueno"), and the comparative ("mejor").
@@ -354,11 +356,12 @@ oper
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False} ** {lock_NP = <>} ; makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False} ** {lock_NP = <>} ;
mk5A a b c d e = mk7A a b c d e f g =
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ; compADeg {s = \\_ => (mkAdj a b c d e f g).s ; isPre = False ; lock_A = <>} ;
mk2A a b = mk5A a b c d e = mk7A a a b b c d e ;
compADeg {s = \\_ => (adjEspanol a b).s ; isPre = False ; lock_A = <>} ;
mk2A a b = compADeg {s = \\_ => (adjEspanol a b).s ; isPre = False ; lock_A = <>} ;
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ; regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ;
prefA a = {s = a.s ; isPre = True ; lock_A = <>} ; prefA a = {s = a.s ; isPre = True ; lock_A = <>} ;
@@ -407,7 +410,7 @@ oper
special_ppV ve pa = { special_ppV ve pa = {
s = table { s = table {
VPart g n => (adjSolo pa).s ! AF g n ; VPart g n => (adjSolo pa).s ! genNum2Aform g n ;
p => ve.s ! p p => ve.s ! p
} ; } ;
lock_V = <> ; lock_V = <> ;
@@ -508,11 +511,13 @@ oper
mkA : (util : Str) -> A = regA ; mkA : (util : Str) -> A = regA ;
mkA : (espanol,espanola : Str) -> A = mk2A ; mkA : (espanol,espanola : Str) -> A = mk2A ;
mkA : (solo,sola,solos,solas,solamente : Str) -> A = mk5A ; mkA : (solo,sola,solos,solas,solamente : Str) -> A = mk5A ;
mkA : (_,_,_,_,_,_,_ : Str) -> A = mk7A ;
mkA : (bueno : A) -> (mejor : A) -> A = mkADeg ; mkA : (bueno : A) -> (mejor : A) -> A = mkADeg ;
mkA : (blanco : A) -> (hueso : Str) -> A = \blanco,hueso -> blanco ** mkA : (blanco : A) -> (hueso : Str) -> A = \blanco,hueso -> blanco **
{ s = \\x,y => blanco.s ! x ! y ++ hueso } ; { s = \\x,y => blanco.s ! x ! y ++ hueso } ;
} ; } ;
mk7A : (_,_,_,_,_,_,_ : Str) -> A ;
mk5A : (solo,sola,solos,solas,solamente : Str) -> A ; mk5A : (solo,sola,solos,solas,solamente : Str) -> A ;
mk2A : (espanol,espanola : Str) -> A ; mk2A : (espanol,espanola : Str) -> A ;
regA : Str -> A ; regA : Str -> A ;

View File

@@ -89,7 +89,8 @@ lin
PastPartAP v = { PastPartAP v = {
s = table { s = table {
AF g n => v.s ! VPart g n ; ASg g _ => v.s ! VPart g Sg ;
APl g _ => v.s ! VPart g Pl ;
_ => v.s ! VPart Masc Sg ---- the adverb form _ => v.s ! VPart Masc Sg ---- the adverb form
} ; } ;
isPre = True isPre = True