fix the word order for superlatives

This commit is contained in:
Krasimir Angelov
2023-11-04 15:04:15 +01:00
parent 14825b5617
commit e97205e04d
23 changed files with 91 additions and 51 deletions

View File

@@ -65,7 +65,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol,MU]
Det,DAP = {
s : Gender => Case => Str ;
n : Number ;
s2 : Str ; -- -ci
s2 : Gender => Str ; -- -ci
sp : Gender => Case => Str ; -- substantival: mien, mienne
spn: Case => Str ;
isNeg : Bool -- negative element, e.g. aucun
@@ -84,7 +84,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol,MU]
} ;
Num = {s : Gender => Str ; isNum : Bool ; n : Number} ;
Card = {s : Gender => Str ; n : Number} ;
Ord = {s : AAgr => Str} ;
Ord = {s, s2 : AAgr => Str} ;
-- Numeral
@@ -146,6 +146,9 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol,MU]
A = \a -> a.s ! genNum2Aform Masc Sg ;
A2 = \a -> a.s ! genNum2Aform Masc Sg ++ a.c2.s ;
Det = \d -> d.s ! Masc ! Nom ++ d.s2 ! Masc ;
Ord = \o -> o.s ! aagr Masc Sg ++ o.s2 ! aagr Masc Sg ;
N = \n -> n.s ! Sg ;
N2 = \n -> n.s ! Sg ++ n.c2.s ;
N3 = \n -> n.s ! Sg ++ n.c2.s ++ n.c3.s ;

View File

@@ -64,7 +64,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
-- e.g. un bon amic (Cat), una gran parte (Spa) vs. predicative bo/bona, grande
oper AForm : PType ;
oper Adj : Type = {s : AForm => Str} ;
oper mkOrd : Adj -> {s : AAgr => Str} = \x -> {s = \\ag => x.s ! aagr2aform ag} ;
oper mkOrd : Adj -> {s,s2 : AAgr => Str} = \x -> {s = \\ag => x.s ! aagr2aform ag; s2 = \\_ => []} ;
oper aform2aagr : AForm -> AAgr ;
oper aform2gender : AForm -> Gender = \af -> (aform2aagr af).g ;
@@ -221,5 +221,8 @@ oper
stare_V = essere_V ;
param HasArt ;
oper
superlCanBePost : Bool ;
} ;

View File

@@ -9,7 +9,7 @@ incomplete concrete NounRomance of Noun =
g = cn.g ;
n = det.n
in heavyNPpol det.isNeg {
s = \\c => det.s ! g ! c ++ cn.s ! n ++ det.s2 ;
s = \\c => det.s ! g ! c ++ cn.s ! n ++ det.s2 ! g ;
a = agrP3 g n ;
hasClit = False
} ;
@@ -53,11 +53,13 @@ incomplete concrete NounRomance of Noun =
} ;
DetQuantOrd quant num ord = {
s,sp = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
s = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
ord.s ! aagr g num.n ;
spn = \\c => quant.s ! num.isNum ! num.n ! Masc ! c ++ num.s ! Masc ++
ord.s ! aagr Masc num.n ;
s2 = quant.s2 ;
s2 = \\g => quant.s2 ++ ord.s2 ! aagr g num.n ;
sp = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
ord.s ! aagr g num.n ++ ord.s2 ! aagr g num.n ;
spn = \\c => quant.s ! num.isNum ! num.n ! Masc ! c ++ num.s ! Masc ++
ord.s ! aagr Masc num.n ++ ord.s2 ! aagr Masc num.n ;
n = num.n ;
isNeg = quant.isNeg
} ;
@@ -72,7 +74,7 @@ incomplete concrete NounRomance of Noun =
True => quant.s ! True ! num.n ! Masc ! c ++ num.s ! Masc ;
False => quant.spn ! c ++ num.s ! Masc
} ;
s2 = quant.s2 ;
s2 = \\_ => quant.s2 ;
n = num.n ;
isNeg = quant.isNeg
} ;
@@ -101,25 +103,40 @@ incomplete concrete NounRomance of Noun =
NumCard n = n ** {isNum = True} ;
NumDigits nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdDigits nu = {s = \\a => nu.s ! NOrd a.g a.n} ;
OrdDigits nu = {s = \\a => nu.s ! NOrd a.g a.n ; s2 = \\_ => []} ;
NumDecimal nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
NumNumeral nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdNumeral nu = {s = \\a => nu.s ! NOrd a.g a.n} ;
OrdNumeral nu = {s = \\a => nu.s ! NOrd a.g a.n ; s2 = \\_ => []} ;
AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum ; n = num.n} ;
OrdSuperl adj = {
s = \\a => case adj.isDeg of {
True => adj.compar ! aagr2compar a ;
False => piuComp ++ adj.s ! genNum2Aform a.g a.n }
OrdSuperl adj =
case <adj.isDeg, superlCanBePost> of {
<True, _> => { s = \\a => adj.compar ! aagr2compar a ;
s2 = \\_ => []
} ;
<False, True> => { s = \\_ => [] ;
s2 = \\a => piuComp ++ adj.s ! genNum2Aform a.g a.n
} ;
<False, False> => { s = \\a => piuComp ++ adj.s ! genNum2Aform a.g a.n ;
s2 = \\_ => []
}
} ;
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
case <adj.isDeg, superlCanBePost> of {
<True, _> => { s = \\a => num.s ! NOrd a.g a.n ++ adj.compar ! aagr2compar a ;
s2 = \\_ => []
} ;
<False, True> => { s = \\a => num.s ! NOrd a.g a.n ;
s2 = \\a => piuComp ++ adj.s ! genNum2Aform a.g a.n
} ;
<False, False> => { s = \\a => num.s ! NOrd a.g a.n ++ piuComp ++ adj.s ! genNum2Aform a.g a.n ;
s2 = \\_ => []
}
} ;
DefArt = {
s = \\_,n,g,c => artDef False g n c ;

View File

@@ -25,7 +25,7 @@ lin
SymbS sy = {s = \\_ => sy.s} ;
SymbNum n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
SymbOrd n = {s = \\_ => n.s ++ BIND ++ "º"} ; -- feminine variant ª, also variants 1.º and 1.ª
SymbOrd n = {s = \\_ => n.s ++ BIND ++ "º"; s2 = \\_ => []} ; -- feminine variant ª, also variants 1.º and 1.ª
lincat