- add missing linearizations for DetDAP and AdjDAP

- indentation
This commit is contained in:
odanoburu
2018-03-28 15:56:57 -03:00
parent 23f27a9dab
commit ccefcc7f16
2 changed files with 42 additions and 31 deletions

View File

@@ -16,7 +16,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : Mood => Agr => Str ; c : Case} ; RS = {s : Mood => Agr => Str ; c : Case} ;
SSlash = { SSlash = {
s : AAgr => Mood => Str ; s : AAgr => Mood => Str ;
c2 : Compl c2 : Compl
} ; } ;
@@ -26,7 +26,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
Cl = {s : Direct => RTense => Anteriority => RPolarity => Mood => Str} ; Cl = {s : Direct => RTense => Anteriority => RPolarity => Mood => Str} ;
ClSlash = { ClSlash = {
s : AAgr => Direct => RTense => Anteriority => RPolarity => Mood => Str ; s : AAgr => Direct => RTense => Anteriority => RPolarity => Mood => Str ;
c2 : Compl c2 : Compl
} ; } ;
Imp = {s : RPolarity => ImpForm => Gender => Str} ; Imp = {s : RPolarity => ImpForm => Gender => Str} ;
@@ -35,14 +35,14 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
QCl = {s : RTense => Anteriority => RPolarity => QForm => Str} ; QCl = {s : RTense => Anteriority => RPolarity => QForm => Str} ;
IP = {s : Case => Str ; a : AAgr} ; IP = {s : Case => Str ; a : AAgr} ;
IComp = {s : AAgr => Str ; cop : CopulaType} ; IComp = {s : AAgr => Str ; cop : CopulaType} ;
IDet = {s : Gender => Case => Str ; n : Number} ; IDet = {s : Gender => Case => Str ; n : Number} ;
IQuant = {s : Number => Gender => Case => Str} ; IQuant = {s : Number => Gender => Case => Str} ;
-- Relative -- Relative
RCl = { RCl = {
s : Agr => RTense => Anteriority => RPolarity => Mood => Str ; s : Agr => RTense => Anteriority => RPolarity => Mood => Str ;
c : Case c : Case
} ; } ;
RP = {s : Bool => AAgr => Case => Str ; a : AAgr ; hasAgr : Bool} ; RP = {s : Bool => AAgr => Case => Str ; a : AAgr ; hasAgr : Bool} ;
@@ -51,11 +51,11 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
VP = ResRomance.VP ; VP = ResRomance.VP ;
VPSlash = ResRomance.VP ** {c2 : Compl} ; VPSlash = ResRomance.VP ** {c2 : Compl} ;
Comp = {s : Agr => Str ; cop : CopulaType} ; Comp = {s : Agr => Str ; cop : CopulaType} ;
-- Adjective -- Adjective
AP = {s : AForm => Str ; isPre : Bool} ; AP = {s : AForm => Str ; isPre : Bool} ;
-- Noun -- Noun
@@ -63,20 +63,21 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
Pron = Pronoun ; Pron = Pronoun ;
NP = NounPhrase ; NP = NounPhrase ;
Det = { Det = {
s : Gender => Case => Str ; s : Gender => Case => Str ;
n : Number ; n : Number ;
s2 : Str ; -- -ci s2 : Str ; -- -ci
sp : Gender => Case => Str ; -- substantival: mien, mienne sp : Gender => Case => Str ; -- substantival: mien, mienne
isNeg : Bool -- negative element, e.g. aucun isNeg : Bool -- negative element, e.g. aucun
} ; } ;
Quant = { Quant = {
s : Bool => Number => Gender => Case => Str ; s : Bool => Number => Gender => Case => Str ;
s2 : Str ; s2 : Str ;
sp : Number => Gender => Case => Str ; sp : Number => Gender => Case => Str ;
isNeg : Bool -- negative element, e.g. aucun isNeg : Bool -- negative element, e.g. aucun
} ; } ;
DAP = {s : Gender => Str ; n : Number} ;
Predet = { Predet = {
s : AAgr => Case => Str ; s : AAgr => Case => Str ;
c : Case ; -- c : la plupart de c : Case ; -- c : la plupart de
a : PAgr -- if an agr is forced, e.g. chacun de nous a : PAgr -- if an agr is forced, e.g. chacun de nous
} ; } ;
@@ -107,7 +108,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
A = {s : Degree => AForm => Str ; isPre : Bool} ; A = {s : Degree => AForm => Str ; isPre : Bool} ;
A2 = {s : Degree => AForm => Str ; c2 : Compl} ; A2 = {s : Degree => AForm => Str ; c2 : Compl} ;
N = Noun ; N = Noun ;
N2 = Noun ** {c2 : Compl} ; N2 = Noun ** {c2 : Compl} ;
N3 = Noun ** {c2,c3 : Compl} ; N3 = Noun ** {c2,c3 : Compl} ;
PN = {s : Str ; g : Gender} ; PN = {s : Str ; g : Gender} ;

View File

@@ -4,8 +4,8 @@ incomplete concrete NounRomance of Noun =
flags optimize=all_subs ; coding = utf8 ; flags optimize=all_subs ; coding = utf8 ;
lin lin
DetCN det cn = DetCN det cn =
let let
g = cn.g ; g = cn.g ;
n = det.n n = det.n
in heavyNPpol det.isNeg { in heavyNPpol det.isNeg {
@@ -18,7 +18,7 @@ incomplete concrete NounRomance of Noun =
UsePron p = p ** {isNeg = False} ; UsePron p = p ** {isNeg = False} ;
PredetNP pred np = PredetNP pred np =
let agr = complAgr np.a in let agr = complAgr np.a in
heavyNPpol np.isNeg { heavyNPpol np.isNeg {
s = \\c => pred.s ! agr ! c ++ (np.s ! pred.c).ton ; s = \\c => pred.s ! agr ! c ++ (np.s ! pred.c).ton ;
@@ -26,7 +26,7 @@ incomplete concrete NounRomance of Noun =
hasClit = False hasClit = False
} ; } ;
PPartNP np v2 = PPartNP np v2 =
let agr = complAgr np.a in let agr = complAgr np.a in
heavyNPpol np.isNeg { heavyNPpol np.isNeg {
s = \\c => (np.s ! c).ton ++ v2.s ! VPart agr.g agr.n ; s = \\c => (np.s ! c).ton ++ v2.s ! VPart agr.g agr.n ;
@@ -53,7 +53,7 @@ incomplete concrete NounRomance of Noun =
} ; } ;
DetQuantOrd quant num ord = { DetQuantOrd quant num ord = {
s,sp = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++ s,sp = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
ord.s ! aagr g num.n ; ord.s ! aagr g num.n ;
s2 = quant.s2 ; s2 = quant.s2 ;
n = num.n ; n = num.n ;
@@ -61,18 +61,18 @@ incomplete concrete NounRomance of Noun =
} ; } ;
DetQuant quant num = { DetQuant quant num = {
s = \\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 ;
sp = \\g,c => case num.isNum of { sp = \\g,c => case num.isNum of {
True => quant.s ! True ! num.n ! g ! c ++ num.s ! g ; True => quant.s ! True ! num.n ! g ! c ++ num.s ! g ;
False => quant.sp ! num.n ! g ! c ++ num.s ! g False => quant.sp ! num.n ! g ! c ++ num.s ! g
} ; } ;
s2 = quant.s2 ; s2 = quant.s2 ;
n = num.n ; n = num.n ;
isNeg = quant.isNeg isNeg = quant.isNeg
} ; } ;
DetNP det = DetNP det =
let let
g = Masc ; ---- Fem in Extra g = Masc ; ---- Fem in Extra
n = det.n n = det.n
in heavyNPpol det.isNeg { in heavyNPpol det.isNeg {
@@ -103,24 +103,24 @@ incomplete concrete NounRomance of Noun =
OrdSuperl adj = {s = \\a => adj.s ! Superl ! AF a.g a.n} ; OrdSuperl adj = {s = \\a => adj.s ! Superl ! AF 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 ! AF 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 = {
s = \\_,n,g,c => artDef False g n c ; s = \\_,n,g,c => artDef False g n c ;
sp = \\n,g,c => artDef True g n c ; sp = \\n,g,c => artDef True g n c ;
s2 = [] ; s2 = [] ;
isNeg = False isNeg = False
} ; } ;
IndefArt = { IndefArt = {
s = \\b,n,g,c => if_then_Str b (prepCase c) (artIndef False g n c) ; s = \\b,n,g,c => if_then_Str b (prepCase c) (artIndef False g n c) ;
sp = \\n,g,c => artIndef True g n c ; sp = \\n,g,c => artIndef True g n c ;
s2 = [] ; s2 = [] ;
isNeg = False isNeg = False
} ; } ;
MassNP cn = let MassNP cn = let
g = cn.g ; g = cn.g ;
n = Sg n = Sg
in heavyNP { in heavyNP {
@@ -149,9 +149,9 @@ incomplete concrete NounRomance of Noun =
c2 = f.c3 c2 = f.c3
} ; } ;
AdjCN ap cn = AdjCN ap cn =
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 ! (AF g n)) (cn.s ! n) ;
g = g ; g = g ;
@@ -179,4 +179,14 @@ incomplete concrete NounRomance of Noun =
s = \\n => cn.s ! n ++ appCompl {s = [] ; c = genitive ; isDir = False} np ; s = \\n => cn.s ! n ++ appCompl {s = [] ; c = genitive ; isDir = False} np ;
g = cn.g ; g = cn.g ;
} ; } ;
-- PartNP and CounNP missing: how to define 'of' in the functor?
AdjDAP det ap = {
s = \\g => det.s ! g ++ ap.s ! AF g det.n ;
n = det.n ;
} ;
DetDAP det = {s = \\g => det.s ! g ! Nom ; n = det.n } ;
} }