make CompoundN more flexible

This commit is contained in:
Krasimir Angelov
2023-10-25 11:19:00 +02:00
parent fa8cef4112
commit 01e5165537
13 changed files with 68 additions and 38 deletions
+3 -3
View File
@@ -110,9 +110,9 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol,MU]
A = {s : AForm => Str ; compar : ComparAgr => Str ; isPre : Bool ; copTyp : CopulaType ; isDeg : Bool} ;
A2 = {s : AForm => Str ; compar : ComparAgr => Str ; c2 : Compl ; copTyp : CopulaType ; isDeg : Bool} ;
N = Noun ;
N2 = Noun ** {c2 : Compl} ;
N3 = Noun ** {c2,c3 : Compl} ;
N = Noun ** {relType : NRelType};
N2 = Noun ** {relType : NRelType; c2 : Compl} ;
N3 = Noun ** {relType : NRelType; c2,c3 : Compl} ;
GN, PN = {s : Str ; g : Gender} ;
SN = {s : Gender => Str ; pl : Str} ;
LN = {s : Str;
+2
View File
@@ -140,6 +140,8 @@ interface DiffRomance = open CommonRomance, Prelude in {
param
Case = Nom | Acc | CPrep Prepos ;
NRelType = NRelPrep Prepos | NRelNoPrep ; -- How do build a compound noun
oper
Verb = {s : VF => Str ; vtyp : VType ; p : Str} ;
+11 -2
View File
@@ -127,7 +127,7 @@ incomplete concrete ExtendRomanceFunctor of Extend =
ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ;
AdvIsNP adv np = mkClause adv.s False False np.a (UseComp_estar (CompNP np)) ;
AdvIsNPAP adv np ap = -- <aquí:Adv> está <documentada:AP> <la examinación:NP>
let emptyN : N = lin N {s = \\_ => [] ; g = np.a.g} ; -- To match the gender of the N
let emptyN : N = lin N {s = \\_ => [] ; relType = NRelNoPrep ; g = np.a.g} ; -- To match the gender of the N
indef : Quant = IndefArt ** {s = \\b,n,g,c => []} ;
det : Det = case np.a.n of {Sg => DetQuant indef NumSg ; Pl => DetQuant indef NumPl} ;
apAsNP : NP = DetCN det (AdjCN ap (UseN emptyN)) ; -- NP where the string comes only from AP
@@ -166,7 +166,16 @@ incomplete concrete ExtendRomanceFunctor of Extend =
ComplGenVV = variants {} ; -- VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept
ComplSlashPartLast = ComplSlash ;
CompoundN a b = lin N {s = \\n => b.s ! n ++ a.s ! Sg ; g = b.g} ; -- connessione internet = internet connection
CompoundN a b = lin N {
s = \\n => b.s ! n ++
case b.relType of {
NRelPrep p => prepCase (CPrep p) ; -- tasa de suicidio
NRelNoPrep => [] -- connessione internet = internet connection
} ++
a.s ! Sg ;
g = b.g ;
relType = b.relType
} ;
CompoundAP = variants {} ; -- N -> A -> AP ; -- language independent / language-independent
lin
+2
View File
@@ -158,11 +158,13 @@ incomplete concrete NounRomance of Noun =
ComplN2 f x = {
s = \\n => f.s ! n ++ appCompl f.c2 x ;
g = f.g ;
relType = f.relType
} ;
ComplN3 f x = {
s = \\n => f.s ! n ++ appCompl f.c2 x ;
g = f.g ;
relType = f.relType ;
c2 = f.c3
} ;