From adb1cffb75ec5df5bc10aeac68ee2a56423a4977 Mon Sep 17 00:00:00 2001 From: krangelov Date: Tue, 27 Apr 2021 13:18:27 +0200 Subject: [PATCH] generalize infVP to support negative VP in Romance --- src/french/IdiomFre.gf | 2 +- src/portuguese/IdiomPor.gf | 2 +- src/romance/CatRomance.gf | 14 +++++++------- src/romance/ExtendRomanceFunctor.gf | 18 ++++++++---------- src/romance/ExtraRomance.gf | 2 +- src/romance/PhraseRomance.gf | 2 +- src/romance/ResRomance.gf | 10 +++++----- src/romance/SentenceRomance.gf | 2 +- src/romance/VerbRomance.gf | 10 +++++----- src/spanish/ExtendSpa.gf | 2 +- 10 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/french/IdiomFre.gf b/src/french/IdiomFre.gf index 1b5df02b..ccf88dc6 100644 --- a/src/french/IdiomFre.gf +++ b/src/french/IdiomFre.gf @@ -31,7 +31,7 @@ concrete IdiomFre of Idiom = CatFre ** ProgrVP vp = insertComplement - (\\a => "en" ++ "train" ++ elisDe ++ infVP vp a) + (\\a => "en" ++ "train" ++ elisDe ++ infVP vp RPos a) (predV copula) ; ImpPl1 vp = { diff --git a/src/portuguese/IdiomPor.gf b/src/portuguese/IdiomPor.gf index 448ce1d7..37e207c1 100644 --- a/src/portuguese/IdiomPor.gf +++ b/src/portuguese/IdiomPor.gf @@ -53,7 +53,7 @@ concrete IdiomPor of Idiom = CatPor ** } ; ImpP3 np vp = { - s = "deixe" ++ (np.s ! Nom).ton ++ infVP vp np.a ; + s = "deixe" ++ (np.s ! Nom).ton ++ infVP vp RPos np.a ; } ; SelfAdvVP vp = variants {} ; diff --git a/src/romance/CatRomance.gf b/src/romance/CatRomance.gf index cb4dcee7..76a87fd9 100644 --- a/src/romance/CatRomance.gf +++ b/src/romance/CatRomance.gf @@ -122,14 +122,14 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol] SSlash = \ss -> ss.s ! aagr Masc Sg ! Indic ++ ss.c2.s ; ClSlash = \cls -> cls.s ! aagr Masc Sg ! DDir ! RPres ! Simul ! RPos ! Indic ++ cls.c2.s ; - VP = \vp -> infVP vp (agrP3 Masc Sg) ; - VPSlash = \vps -> infVP vps (agrP3 Masc Sg) ++ vps.c2.s ; + VP = \vp -> infVP vp RPos (agrP3 Masc Sg) ; + VPSlash = \vps -> infVP vps RPos (agrP3 Masc Sg) ++ vps.c2.s ; - V, VS, VQ, VA = \v -> infVP (predV v) (agrP3 Masc Sg); - V2, V2A, V2Q, V2S = \v -> infVP (predV v) (agrP3 Masc Sg) ++ v.c2.s ; - V3 = \v -> infVP (predV v) (agrP3 Masc Sg) ++ v.c2.s ++ v.c3.s ; - VV = \v -> infVP (predV v) (agrP3 Masc Sg) ; - V2V = \v -> infVP (predV v) (agrP3 Masc Sg) ; + V, VS, VQ, VA = \v -> infVP (predV v) RPos (agrP3 Masc Sg); + V2, V2A, V2Q, V2S = \v -> infVP (predV v) RPos (agrP3 Masc Sg) ++ v.c2.s ; + V3 = \v -> infVP (predV v) RPos (agrP3 Masc Sg) ++ v.c2.s ++ v.c3.s ; + VV = \v -> infVP (predV v) RPos (agrP3 Masc Sg) ; + V2V = \v -> infVP (predV v) RPos (agrP3 Masc Sg) ; NP = \np -> (np.s ! Nom).comp ; Conj = \c -> c.s2 ; diff --git a/src/romance/ExtendRomanceFunctor.gf b/src/romance/ExtendRomanceFunctor.gf index 4e084d21..c0e3eb1b 100644 --- a/src/romance/ExtendRomanceFunctor.gf +++ b/src/romance/ExtendRomanceFunctor.gf @@ -104,7 +104,7 @@ incomplete concrete ExtendRomanceFunctor of Extend = EmbedPresPart = variants {} ; -- VP -> SC ; -- looking at Mary (is fun) PresPartAP vp = { - s = \\af => gerVP vp (aform2aagr af ** {p = P3}) ; + s = \\af => gerVP vp RPos (aform2aagr af ** {p = P3}) ; isPre = False ; copTyp = serCopula } ; @@ -172,12 +172,12 @@ incomplete concrete ExtendRomanceFunctor of Extend = GerundNP vp = let neutrAgr = Ag Masc Sg P3 in heavyNP { - s = \\_ => gerVP vp neutrAgr ; + s = \\_ => gerVP vp RPos neutrAgr ; a = neutrAgr } ; GerundCN vp = { - s = \\n => gerVP vp {g = Masc ; n = n ; p = P3} ; + s = \\n => gerVP vp RPos {g = Masc ; n = n ; p = P3} ; g = Masc } ; @@ -187,7 +187,7 @@ incomplete concrete ExtendRomanceFunctor of Extend = lin PurposeVP vp = { - s = infVP vp (Ag Masc Sg P3) + s = infVP vp RPos (Ag Masc Sg P3) } ; WithoutVP = variants {} ; -- VP -> Adv ; -- without publishing the document @@ -222,10 +222,8 @@ incomplete concrete ExtendRomanceFunctor of Extend = CompQS = variants {} ; -- QS -> Comp ; -- (the question is) who sleeps --TODO: actually use ant - CompVP ant p vp = let - neg = negation ! p.p - in { - s = \\agr => ant.s ++ p.s ++ "de" ++ neg.p1 ++ infVP vp agr ; + CompVP ant p vp = { + s = \\agr => ant.s ++ p.s ++ "de" ++ neg.p1 ++ infVP vp p.p agr ; cop = serCopula } ; @@ -265,10 +263,10 @@ incomplete concrete ExtendRomanceFunctor of Extend = oper gerundStr : VP -> Str ; - gerundStr vp = gerVP vp (Ag Masc Sg P3) ; + gerundStr vp = gerVP vp RPos (Ag Masc Sg P3) ; infStr : VP -> Str ; - infStr vp = infVP vp (Ag Masc Sg P3) ; + infStr vp = infVP vp RPos (Ag Masc Sg P3) ; pastPartAP : VPSlash -> Str -> AP ; pastPartAP vps agent = lin AP { diff --git a/src/romance/ExtraRomance.gf b/src/romance/ExtraRomance.gf index c238a8f2..a5d9ffe6 100644 --- a/src/romance/ExtraRomance.gf +++ b/src/romance/ExtraRomance.gf @@ -17,7 +17,7 @@ incomplete concrete ExtraRomance of ExtraRomanceAbs = CatRomance ** BaseVPI = twoSS ; ConsVPI = consrSS comma ; - MkVPI vp = {s = infVP vp (agrP3 Masc Sg)} ; + MkVPI vp = {s = infVP vp RPos (agrP3 Masc Sg)} ; ConjVPI = conjunctDistrSS ; ComplVPIVV v vpi = insertComplement (\\a => prepCase v.c2.c ++ vpi.s) (predV v) ; diff --git a/src/romance/PhraseRomance.gf b/src/romance/PhraseRomance.gf index 933e3ec9..5dab8209 100644 --- a/src/romance/PhraseRomance.gf +++ b/src/romance/PhraseRomance.gf @@ -15,7 +15,7 @@ incomplete concrete PhraseRomance of Phrase = UttIP ip = {s = ip.s ! Nom} ; --- Acc also UttIAdv iadv = iadv ; UttNP np = {s = (np.s ! Nom).ton} ; - UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr + UttVP vp = {s = infVP vp RPos (agrP3 Fem Sg)} ; --- Agr UttAdv adv = adv ; UttCN n = {s = n.s ! Sg} ; UttAP ap = {s = ap.s ! genNum2Aform Masc Sg} ; diff --git a/src/romance/ResRomance.gf b/src/romance/ResRomance.gf index a53575de..993ae95e 100644 --- a/src/romance/ResRomance.gf +++ b/src/romance/ResRomance.gf @@ -248,17 +248,17 @@ oper -- have a "-" with possibly a special verb form with "t": -- "comment fera-t-il" vs. "comment fera Pierre" - infVP : VP -> Agr -> Str = nominalVP VInfin ; + infVP : VP -> RPolarity -> Agr -> Str = nominalVP VInfin ; - gerVP : VP -> Agr -> Str = nominalVP (\_ -> VGer) ; + gerVP : VP -> RPolarity -> Agr -> Str = nominalVP (\_ -> VGer) ; - nominalVP : (Bool -> VF) -> VP -> Agr -> Str = \vf,vp,agr -> + nominalVP : (Bool -> VF) -> VP -> RPolarity -> Agr -> Str = \vf,vp,pol,agr -> let ----iform = orB vp.clit3.hasClit (isVRefl vp.s.vtyp) ; iform = contractInf vp.clit3.hasClit (isVRefl vp.s.vtyp) ; inf = vp.s.s ! vf iform ; - neg = vp.neg ! RPos ; --- Neg not in API - obj = vp.s.p ++ vp.comp ! agr ++ vp.ext ! RPos ; ---- pol + neg = vp.neg ! pol ; + obj = vp.s.p ++ vp.comp ! agr ++ vp.ext ! pol ; ---- pol refl = case isVRefl vp.s.vtyp of { True => reflPron agr.n agr.p Acc ; ---- case ? _ => [] diff --git a/src/romance/SentenceRomance.gf b/src/romance/SentenceRomance.gf index fe9c72da..9d3fa8a9 100644 --- a/src/romance/SentenceRomance.gf +++ b/src/romance/SentenceRomance.gf @@ -156,7 +156,7 @@ incomplete concrete SentenceRomance of Sentence = EmbedS s = {s = \\_ => conjThat ++ s.s ! Indic} ; --- mood EmbedQS qs = {s = \\_ => qs.s ! QIndir} ; - EmbedVP vp = {s = \\c => prepCase c ++ infVP vp (agrP3 Masc Sg)} ; --- agr ---- compl + EmbedVP vp = {s = \\c => prepCase c ++ infVP vp RPos (agrP3 Masc Sg)} ; --- agr ---- compl UseCl t p cl = { s = \\o => t.s ++ p.s ++ cl.s ! DDir ! t.t ! t.a ! p.p ! o diff --git a/src/romance/VerbRomance.gf b/src/romance/VerbRomance.gf index 1332336f..8d147d0b 100644 --- a/src/romance/VerbRomance.gf +++ b/src/romance/VerbRomance.gf @@ -7,7 +7,7 @@ incomplete concrete VerbRomance of Verb = UseV = predV ; ComplVV v vp = - insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v) ; + insertComplement (\\a => prepCase v.c2.c ++ infVP vp RPos a) (predV v) ; ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ; ComplVQ v q = insertExtrapos (\\_ => q.s ! QIndir) (predV v) ; ComplVA v ap = @@ -21,7 +21,7 @@ incomplete concrete VerbRomance of Verb = SlashV2V v vp = mkVPSlash v.c2 (insertComplement - (\\a => v.c3.s ++ prepCase v.c3.c ++ infVP vp a) + (\\a => v.c3.s ++ prepCase v.c3.c ++ infVP vp RPos a) (predV v)) ; SlashV2S v s = @@ -63,7 +63,7 @@ incomplete concrete VerbRomance of Verb = SlashVV v vp = mkVPSlash vp.c2 - (insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v)) ; + (insertComplement (\\a => prepCase v.c2.c ++ infVP vp RPos a) (predV v)) ; SlashV2VNP v np vps = let obj = np.s ! v.c2.c in { s = v ; @@ -73,7 +73,7 @@ incomplete concrete VerbRomance of Verb = clit3 = {s,imp = [] ; hasClit = False} ; ---- shortcut from insertObject, to check AR 20/11/2013 isNeg = False ; neg = negation ; - comp = \\a => v.c2.s ++ obj.comp ++ prepCase v.c3.c ++ infVP vps a ; + comp = \\a => v.c2.s ++ obj.comp ++ prepCase v.c3.c ++ infVP vps RPos a ; ext = \\p => [] ; c2 = vps.c2 } ; @@ -82,7 +82,7 @@ incomplete concrete VerbRomance of Verb = SlashV2VNP v np vp = mkVPSlash vp.c2 (insertComplement - (\\a => prepCase v.c3.c ++ infVP vp a) + (\\a => prepCase v.c3.c ++ infVP vp RPos a) (insertObject v.c2 np (predV v))) ; -} diff --git a/src/spanish/ExtendSpa.gf b/src/spanish/ExtendSpa.gf index d6f2528e..03a350c2 100644 --- a/src/spanish/ExtendSpa.gf +++ b/src/spanish/ExtendSpa.gf @@ -96,7 +96,7 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor - CompVP ant p vp = let neg = negation ! p.p in { - s = \\agr => ant.s ++ p.s ++ "de" ++ neg.p1 ++ infVP vp agr ; + s = \\agr => ant.s ++ p.s ++ "de" ++ neg.p1 ++ infVP vp RPos agr ; cop = serCopula } ;