From 8696b27bee9319b6f24e19e58de48f99873e7e6b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 3 Mar 2021 14:16:38 +0800 Subject: [PATCH 1/6] Add constructions for N2 and A2 to VPSlash To generalise transitive predicates, along with V2 -> VPSlash. --- src/abstract/Extend.gf | 7 ++++++- src/common/ExtendFunctor.gf | 2 ++ src/english/ExtendEng.gf | 15 ++++++++++++++- src/swedish/ExtendSwe.gf | 26 ++++++++++++++++++++++---- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/abstract/Extend.gf b/src/abstract/Extend.gf index a3b49a63..15e07143 100644 --- a/src/abstract/Extend.gf +++ b/src/abstract/Extend.gf @@ -116,6 +116,11 @@ abstract Extend = Cat ** { ProgrVPSlash : VPSlash -> VPSlash; +-- construct VPSlash from A2 and N2 + + A2VPSlash : A2 -> VPSlash ; -- is married to (that person) + N2VPSlash : N2 -> VPSlash ; -- is a mother of (that person) + -- existential for mathematics ExistsNP : NP -> Cl ; -- there exists a number / there exist numbers @@ -126,7 +131,7 @@ abstract Extend = Cat ** { ExistMassCN : CN -> Cl ; -- there is beer / there is no beer ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees --- generalisation of existential, with adverb as a parameter +-- generalisation of existential, with adverb as an argument AdvIsNP : Adv -> NP -> Cl ; -- here is the tree / here are the trees AdvIsNPAP : Adv -> NP -> AP -> Cl ; -- here are the instructions documented diff --git a/src/common/ExtendFunctor.gf b/src/common/ExtendFunctor.gf index a8018891..296eeaae 100644 --- a/src/common/ExtendFunctor.gf +++ b/src/common/ExtendFunctor.gf @@ -51,6 +51,8 @@ lin PastPartAgentAP = variants {} ; -- VPSlash -> NP -> AP ; -- (opportunity) lost by the company NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ; ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ; + A2VPSlash = variants {} ; -- A2 -> VPSlash ; + N2VPSlash = variants {} ; -- N2 -> VPSlash ; ExistsNP = ExistNP ; -- NP -> Cl ; -- there exists a number / there exist numbers ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ; ExistMassCN cn = ExistNP (MassNP cn) ; diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index 872e2772..c46b7eed 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -16,7 +16,7 @@ concrete ExtendEng of Extend = GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP, PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, - UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2 + UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2, A2VPSlash, N2VPSlash ] with (Grammar = GrammarEng) ** @@ -225,6 +225,19 @@ concrete ExtendEng of Extend = ProgrVPSlash vp = insertObjc (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) (predAux auxBe ** {c2 = vp.c2; gapInMiddle = vp.gapInMiddle; missingAdv = vp.missingAdv}); + N2VPSlash n2 = + let prep : Prep = mkPrep n2.c2 ; + dummyVPS : VPSlash = SlashV2a (mkV2 (mkV "dummy") prep); + in dummyVPS ** -- has necessary fields for VPSlash, and c2 from the N2 + UseComp (CompCN (UseN2 n2)) ; -- has all the right fields except for c2 + + A2VPSlash a2 = + let prep : Prep = mkPrep a2.c2 ; + dummyVPS : VPSlash = SlashV2a (mkV2 (mkV "dummy") prep) ; + in dummyVPS ** -- has necessary fields for VPSlash, and c2 from the A2 + UseComp (CompAP (UseA2 a2)) ; -- has all the right fields except for c2 + + --- AR 7/3/2013 ComplSlashPartLast vps np = case vps.gapInMiddle of { _ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps --- diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf index 813468fb..727b95b2 100644 --- a/src/swedish/ExtendSwe.gf +++ b/src/swedish/ExtendSwe.gf @@ -14,7 +14,8 @@ concrete ExtendSwe of Extend = CatSwe ** RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ReflPossPron, CompoundN, CompoundAP, AdvIsNP, - UttAccNP + UttAccNP, + A2VPSlash, N2VPSlash ] with (Grammar = GrammarSwe) ** @@ -70,6 +71,23 @@ in { PassAgentVPSlash vps np = insertObjPost (\\a => vps.c2.s ++ vps.n3 ! a) (insertObj (\\_ => (PrepNP by8agent_Prep np).s) (passiveVP vps)) ; + + N2VPSlash n2 = + let vp : CatSwe.VP = UseComp (CompCN (UseN2 n2)) ; + dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ; + in dummyVPS ** -- has necessary fields for VPSlash + vp ** -- has all the right fields except for c2 + {c2 = n2.c2} ; -- has the right c2 + + + + A2VPSlash a2 = + let vp : CatSwe.VP = UseComp (CompAP (UseA2 a2)) ; + dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ; + in dummyVPS ** -- has necessary fields for VPSlash + vp ** -- has all the right fields except for c2 + {c2 = a2.c2} ; -- has the right c2 + lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ; lincat @@ -147,11 +165,11 @@ in { } ; c2 = vp.c2 } ; - + ComplVPS2 vps2 np = { s = \\o,a => vps2.s !o ! a ++ vps2.c2.s ++ np.s ! NPAcc } ; - + ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ; lincat @@ -210,7 +228,7 @@ in { Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ; ReflPossPron = M.mkQuant "sin" "sitt" "sina" ; - + lin ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ; From 891bd2f3b17eb668eb1e17d763495436ccd018c7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 3 Mar 2021 15:05:57 +0800 Subject: [PATCH 2/6] (Extend) Add ReflVPS2 function --- src/abstract/Extend.gf | 1 + src/common/ExtendFunctor.gf | 1 + src/english/ExtendEng.gf | 6 ++++-- src/swedish/ExtendSwe.gf | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/abstract/Extend.gf b/src/abstract/Extend.gf index 15e07143..5b792981 100644 --- a/src/abstract/Extend.gf +++ b/src/abstract/Extend.gf @@ -69,6 +69,7 @@ abstract Extend = Cat ** { MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates ComplVPS2 : VPS2 -> NP -> VPS ; -- has loved and now hates that person + ReflVPS2 : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car MkVPI2 : VPSlash -> VPI2 ; -- to love ConjVPI2 : Conj -> [VPI2] -> VPI2 ; -- to love and hate diff --git a/src/common/ExtendFunctor.gf b/src/common/ExtendFunctor.gf index 296eeaae..d70ebe31 100644 --- a/src/common/ExtendFunctor.gf +++ b/src/common/ExtendFunctor.gf @@ -32,6 +32,7 @@ lin MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person + ReflVPS2 = variants {} ; -- : VPS2 -> RNP -> VPS ; -- have loved and now hate myself and my car MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index c46b7eed..5018459a 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -7,7 +7,7 @@ concrete ExtendEng of Extend = AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP, BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2, MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV, - MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2, + MkVPS2, ConjVPS2, ComplVPS2, ReflVPS2, MkVPI2, ConjVPI2, ComplVPI2, Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN, CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP, CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash, @@ -120,7 +120,9 @@ concrete ExtendEng of Extend = ComplVPI2 vpi2 np = { s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc } ; - + ReflVPS2 vps2 rnp = { + s = \\a => vps2.s ! a ++ vps2.c2 ++ rnp.s ! a + } ; oper mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS { s = \\a => diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf index 727b95b2..48d7d1f5 100644 --- a/src/swedish/ExtendSwe.gf +++ b/src/swedish/ExtendSwe.gf @@ -8,7 +8,7 @@ concrete ExtendSwe of Extend = CatSwe ** PassVPSlash, PassAgentVPSlash, UttVPShort, ByVP, InOrderToVP, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, - MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2, + MkVPS2, ConjVPS2, ComplVPS2, ReflVPS2, MkVPI2, ConjVPI2, ComplVPI2, ICompAP,ProDrop,EmbedSSlash, AdAdV, PositAdVAdj, GerundCN, GerundNP, GerundAdv, PresPartAP, PastPartAP, PastPartAgentAP, RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, @@ -169,6 +169,9 @@ in { ComplVPS2 vps2 np = { s = \\o,a => vps2.s !o ! a ++ vps2.c2.s ++ np.s ! NPAcc } ; + ReflVPS2 vps2 rnp = { + s = \\o,a => vps2.s ! o ! a ++ vps2.c2.s ++ rnp.s ! a + } ; ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ; From f55f5b2d3c357a3380531b2c29f666dbfa10f4d4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 4 Mar 2021 15:44:22 +0800 Subject: [PATCH 3/6] (Eng) Reorder, remove dupls and exclude new funs from ExtendFunctor --- src/english/ExtendEng.gf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index 5018459a..6f7aebe9 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -5,18 +5,19 @@ concrete ExtendEng of Extend = [ VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList, AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP, - BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2, - MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV, - MkVPS2, ConjVPS2, ComplVPS2, ReflVPS2, MkVPI2, ConjVPI2, ComplVPI2, + MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, QuestVPS, SQuestVPS, + MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, + MkVPS2, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, ReflVPS2, + MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2, Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN, CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP, - CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash, + CompoundN, ConjRNP, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash, ExistsNP, ExistCN, ExistMassCN, ExistPluralCN, FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP, - GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP, - PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, + GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, NominalizeVPSlashNP, + PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPSVV, PredetRNP, PrepCN, EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, - UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2, A2VPSlash, N2VPSlash + UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, A2VPSlash, N2VPSlash ] with (Grammar = GrammarEng) ** From fe45b7ed5c2060c140d1acd0c368008bc6b282a6 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 4 Mar 2021 15:53:22 +0800 Subject: [PATCH 4/6] (Eng) Add lin for QuestVPS and SQuestVPS + new lincats for VPS* Now VPS and VPS2 need to potentially become QS, so we keep them discontinuous. Works great with lists too, e.g. {fin="wouldn't" ; inf="have seen and waited for (obj)"} NB. copula disappears, if it's a part of a diverse list of questions: Statements: you sleep or are small -- ok you are small or sleep -- ok Questions: ?are you small or sleep -- for "are you small or do you sleep", need to implement [QS] *do you sleep or small -- infinitive "be small" not retrievable from VPS currently In a list of only predicates, this addition is rather redundant. You can already say "are you big or small" with AP coordination. But no other RGL construction allows "do you sleep or drink beer". --- src/english/ExtendEng.gf | 84 +++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index 6f7aebe9..f263cac4 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -70,21 +70,63 @@ concrete ExtendEng of Extend = } ; lincat - VPS = {s : Agr => Str} ; - [VPS] = {s1,s2 : Agr => Str} ; + VPS = {s : Order => Agr => {fin, inf : Str}} ; + [VPS] = {s1,s2 : Order => Agr => Str ; fin : Order => Agr => Str} ; VPI = {s : VVType => Agr => Str} ; [VPI] = {s1,s2 : VVType => Agr => Str} ; lin - BaseVPS = twoTable Agr ; - ConsVPS = consrTable Agr comma ; + BaseVPS x y = + let baseX : OneFinVPS = baseVPS x ; + baseY : OneFinVPS = baseVPS y ; + in twoTable2 Order Agr baseX baseY ** {fin = baseX.fin} ; + ConsVPS x xs = + let baseX : OneFinVPS = baseVPS x ; + in consrTable2 Order Agr comma baseX xs ** {fin = baseX.fin} ; -- keep only the first fin + oper + {- IL 03/2021 for VPS conjunction: separate the first finite verb for questions + [do]:fin (you) [eat bread and sleep?]:inf + (you) [ ]:fin [eat bread and sleep]:inf + The fin field becomes empty for ODir, but no problem: order is just subj++fin++inf. + Weird results for CompNP/AP/…, but coordination of those already covered in RGL. -} + OneFinVPS : Type = {s : Order => Agr => Str ; fin : Order => Agr => Str} ; + baseVPS : VPS -> OneFinVPS = \vps -> { + s = \\o,a => let vp = vps.s ! o ! a in + case o of { + OQuest => vp.inf ; + ODir _ => vp.fin ++ vp.inf + } ; + fin = \\o,a => let vp = vps.s ! o ! a in + case o of { + OQuest => vp.fin ; + ODir _ => [] + } + } ; + + lin BaseVPI = twoTable2 VVType Agr ; ConsVPI = consrTable2 VVType Agr comma ; MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ; - ConjVPS c xs = conjunctDistrTable Agr c xs ; - PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ; + ConjVPS c xs = { + s = \\o,a => { + fin = xs.fin ! o ! a ; + inf = c.s1 ++ xs.s1 ! o ! a ++ c.s2 ++ xs.s2 ! o ! a} + } ; + PredVPS np vps = let vp = vps.s ! oDir ! np.a in { + s = np.s ! npNom ++ vp.fin ++ vp.inf + } ; + SQuestVPS np vps = let + vp = vps.s ! OQuest ! np.a ; + vpindir = vps.s ! oDir ! np.a in { + s = table { + QDir => vp.fin ++ np.s ! npNom ++ vp.inf ; + QIndir => "if" ++ np.s ! npNom ++ vpindir.fin ++ vpindir.inf} + } ; + QuestVPS ip vps = let vp = vps.s ! oDir ! toAgr ip.n P3 Neutr in { + s = \\q => ip.s ! npNom ++ vp.fin ++ vp.inf + } ; MkVPI vp = mkVPI (lin VP vp) ; @@ -95,8 +137,11 @@ concrete ExtendEng of Extend = -------- two-place verb conjunction lincat - VPS2 = {s : Agr => Str ; c2 : Str} ; - [VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ; + VPS2 = {s : Order => Agr => {fin,inf : Str} ; c2 : Str} ; + [VPS2] = { + fin : Order => Agr => Str ; -- Q: do ; DIR: + s1,s2 : Order => Agr => Str ; -- Q: eat, drink ; DIR: eat, drink + c2 : Str} ; VPI2 = {s : VVType => Agr => Str ; c2 : Str} ; [VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ; @@ -104,33 +149,36 @@ concrete ExtendEng of Extend = MkVPS2 t p vpsl = mkVPS (lin Temp t) (lin Pol p) (lin VP vpsl) ** {c2 = vpsl.c2} ; MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ; - BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb - ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ; + BaseVPS2 x y = BaseVPS x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb + ConsVPS2 x xs = ConsVPS x xs ** {c2 = xs.c2} ; BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ; - ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2} ; + ConjVPS2 c xs = ConjVPS c xs ** {c2 = xs.c2} ; ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2} ; ComplVPS2 vps2 np = { - s = \\a => vps2.s ! a ++ vps2.c2 ++ np.s ! NPAcc + s = \\o,a => let vps2s = vps2.s ! o ! a in + vps2s ** {inf = vps2s.inf ++ vps2.c2 ++ np.s ! NPAcc} -- keep fin, add object to inf } ; ComplVPI2 vpi2 np = { s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc } ; ReflVPS2 vps2 rnp = { - s = \\a => vps2.s ! a ++ vps2.c2 ++ rnp.s ! a + s = \\o,a => let vps2s = vps2.s ! o ! a in + vps2s ** {inf = vps2s.inf ++ vps2.c2 ++ rnp.s ! a} } ; oper mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS { - s = \\a => - let - verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ; - verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ; - in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext + s = \\o,a => + let + verb = vp.s ! t.t ! t.a ! p.p ! o ! a ; -- choice of Order determines aux or not + compl = vp.s2 ! a ++ vp.ext + in {fin = verb.aux ; + inf = verb.adv ++ vp.ad ! a ++ verb.fin ++ verb.inf ++ vp.p ++ compl} ; } ; mkVPI : VP -> VPI = \vp -> lin VPI { From 868ea0fc0cf7b6c978bae87037e8d2895bb44740 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 3 Mar 2021 14:16:38 +0800 Subject: [PATCH 5/6] Add constructions for N2 and A2 to VPSlash To generalise transitive predicates, along with V2 -> VPSlash. --- src/abstract/Extend.gf | 7 ++++++- src/common/ExtendFunctor.gf | 2 ++ src/english/ExtendEng.gf | 15 ++++++++++++++- src/swedish/ExtendSwe.gf | 26 ++++++++++++++++++++++---- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/abstract/Extend.gf b/src/abstract/Extend.gf index ce53a597..36e327a4 100644 --- a/src/abstract/Extend.gf +++ b/src/abstract/Extend.gf @@ -124,6 +124,11 @@ abstract Extend = Cat ** { ProgrVPSlash : VPSlash -> VPSlash; +-- construct VPSlash from A2 and N2 + + A2VPSlash : A2 -> VPSlash ; -- is married to (that person) + N2VPSlash : N2 -> VPSlash ; -- is a mother of (that person) + -- existential for mathematics ExistsNP : NP -> Cl ; -- there exists a number / there exist numbers @@ -134,7 +139,7 @@ abstract Extend = Cat ** { ExistMassCN : CN -> Cl ; -- there is beer / there is no beer ExistPluralCN : CN -> Cl ; -- there are trees / there are no trees --- generalisation of existential, with adverb as a parameter +-- generalisation of existential, with adverb as an argument AdvIsNP : Adv -> NP -> Cl ; -- here is the tree / here are the trees AdvIsNPAP : Adv -> NP -> AP -> Cl ; -- here are the instructions documented diff --git a/src/common/ExtendFunctor.gf b/src/common/ExtendFunctor.gf index a8018891..296eeaae 100644 --- a/src/common/ExtendFunctor.gf +++ b/src/common/ExtendFunctor.gf @@ -51,6 +51,8 @@ lin PastPartAgentAP = variants {} ; -- VPSlash -> NP -> AP ; -- (opportunity) lost by the company NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ; ProgrVPSlash = variants {} ; -- VPSlash -> VPSlash ; + A2VPSlash = variants {} ; -- A2 -> VPSlash ; + N2VPSlash = variants {} ; -- N2 -> VPSlash ; ExistsNP = ExistNP ; -- NP -> Cl ; -- there exists a number / there exist numbers ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ; ExistMassCN cn = ExistNP (MassNP cn) ; diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index 9862202e..ae5dc22c 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -16,7 +16,7 @@ concrete ExtendEng of Extend = GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP, PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, - UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2 + UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2, A2VPSlash, N2VPSlash ] with (Grammar = GrammarEng) ** @@ -239,6 +239,19 @@ lin BaseImp = twoTable2 CPolarity ImpForm ; ProgrVPSlash vp = insertObjc (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) (predAux auxBe ** {c2 = vp.c2; gapInMiddle = vp.gapInMiddle; missingAdv = vp.missingAdv}); + N2VPSlash n2 = + let prep : Prep = mkPrep n2.c2 ; + dummyVPS : VPSlash = SlashV2a (mkV2 (mkV "dummy") prep); + in dummyVPS ** -- has necessary fields for VPSlash, and c2 from the N2 + UseComp (CompCN (UseN2 n2)) ; -- has all the right fields except for c2 + + A2VPSlash a2 = + let prep : Prep = mkPrep a2.c2 ; + dummyVPS : VPSlash = SlashV2a (mkV2 (mkV "dummy") prep) ; + in dummyVPS ** -- has necessary fields for VPSlash, and c2 from the A2 + UseComp (CompAP (UseA2 a2)) ; -- has all the right fields except for c2 + + --- AR 7/3/2013 ComplSlashPartLast vps np = case vps.gapInMiddle of { _ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps --- diff --git a/src/swedish/ExtendSwe.gf b/src/swedish/ExtendSwe.gf index f2f8669c..22af2c50 100644 --- a/src/swedish/ExtendSwe.gf +++ b/src/swedish/ExtendSwe.gf @@ -14,7 +14,8 @@ concrete ExtendSwe of Extend = CatSwe ** RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ReflPossPron, CompoundN, CompoundAP, AdvIsNP, - UttAccNP + UttAccNP, + A2VPSlash, N2VPSlash ] with (Grammar = GrammarSwe) ** @@ -75,6 +76,23 @@ in { c2 = vp.c2 } ; + + N2VPSlash n2 = + let vp : CatSwe.VP = UseComp (CompCN (UseN2 n2)) ; + dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ; + in dummyVPS ** -- has necessary fields for VPSlash + vp ** -- has all the right fields except for c2 + {c2 = n2.c2} ; -- has the right c2 + + + + A2VPSlash a2 = + let vp : CatSwe.VP = UseComp (CompAP (UseA2 a2)) ; + dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ; + in dummyVPS ** -- has necessary fields for VPSlash + vp ** -- has all the right fields except for c2 + {c2 = a2.c2} ; -- has the right c2 + lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ; lincat @@ -152,11 +170,11 @@ in { } ; c2 = vp.c2 } ; - + ComplVPS2 vps2 np = { s = \\o,a => vps2.s !o ! a ++ vps2.c2.s ++ np.s ! NPAcc } ; - + ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ; lincat @@ -248,7 +266,7 @@ lin BaseImp = twoTable2 Polarity Number ; Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ; ReflPossPron = M.mkQuant "sin" "sitt" "sina" ; - + lin ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ; From cb8cc63528e815ae3fb6f2dac442edde8b54138a Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 23 Apr 2021 14:54:53 +0800 Subject: [PATCH 6/6] Add linref to VPS and VPS2 --- src/english/ExtendEng.gf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index 898245e4..539c15af 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -181,6 +181,8 @@ concrete ExtendEng of Extend = inf = verb.adv ++ vp.ad ! a ++ verb.fin ++ verb.inf ++ vp.p ++ compl} ; } ; + linVPS : Agr -> {s : Order => Agr => {fin,inf : Str}} -> Str = \agr,vps -> let vpss = vps.s ! ODir True ! agr in vpss.fin ++ vpss.inf ; + mkVPI : VP -> VPI = \vp -> lin VPI { s = table { VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ; @@ -189,6 +191,10 @@ concrete ExtendEng of Extend = } } ; +linref + VPS = linVPS (agrP3 Sg) ; + VPS2 = \vps -> linVPS (agrP3 Sg) vps ++ vps.c2 ; + -- Conjunction of copula complements lincat [Comp] = {s1,s2 : Agr => Str} ; @@ -441,7 +447,4 @@ lin BaseImp = twoTable2 CPolarity ImpForm ; UncontractedNeg = {s = [] ; p = CNeg False} ; UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ; - - - }