From 376ed50c2e89203364fb21dbdb73a88dcaf0494a Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 6 Dec 2013 08:32:53 +0000 Subject: [PATCH] PassAgentVPSlash for Eng, Swe, Fin, Fre --- lib/src/abstract/Extra.gf | 5 +++++ lib/src/english/ExtraEng.gf | 9 +++++++-- lib/src/finnish/ExtraFin.gf | 30 ++++++++++++++++++++++++++++- lib/src/finnish/ExtraFinAbs.gf | 1 + lib/src/finnish/stemmed/ParseFin.gf | 17 +--------------- lib/src/french/ExtraFre.gf | 4 ++++ lib/src/french/ExtraFreAbs.gf | 1 + lib/src/french/ParseFre.gf | 2 +- lib/src/romance/ExtraRomance.gf | 28 ++++++++++++++++----------- lib/src/romance/ExtraRomanceAbs.gf | 3 ++- lib/src/swedish/ExtraSwe.gf | 5 ++++- lib/src/swedish/LexiconSwe.gf | 2 +- 12 files changed, 73 insertions(+), 34 deletions(-) diff --git a/lib/src/abstract/Extra.gf b/lib/src/abstract/Extra.gf index a7378a5da..4bb826cf9 100644 --- a/lib/src/abstract/Extra.gf +++ b/lib/src/abstract/Extra.gf @@ -74,6 +74,11 @@ abstract Extra = Cat ** { PassVPSlash : VPSlash -> VP ; -- be forced to sleep +-- the form with an agent may result in a different linearization +-- from an adverbial modification by an agent phrase. + + PassAgentVPSlash : VPSlash -> NP -> VP ; -- be begged by her to go + -- publishing of the document NominalizeVPSlashNP : VPSlash -> NP -> NP ; diff --git a/lib/src/english/ExtraEng.gf b/lib/src/english/ExtraEng.gf index 1ee9c8430..e326a76c0 100644 --- a/lib/src/english/ExtraEng.gf +++ b/lib/src/english/ExtraEng.gf @@ -149,7 +149,8 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** lin UncNeg = {s = [] ; p = CNeg False} ; - PassVPSlash vps = + oper passVPSlash : VPSlash -> Str -> ResEng.VP = + \vps,ag -> let be = predAux auxBe ; ppt = vps.ptp @@ -160,10 +161,14 @@ lin ptp = be.ptp ; inf = be.inf ; ad = \\_ => [] ; - s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ vps.c2 ; ---- order + s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ ag ++ vps.s2 ! a ++ vps.c2 ; ---- place of agent ext = vps.ext } ; + lin + PassVPSlash vps = passVPSlash vps [] ; + PassAgentVPSlash vps np = passVPSlash vps ("by" ++ np.s ! NPAcc) ; + --- AR 7/3/2013 ComplSlashPartLast vps np = case vps.gapInMiddle of { _ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps --- diff --git a/lib/src/finnish/ExtraFin.gf b/lib/src/finnish/ExtraFin.gf index 01804e67c..2b15e3656 100644 --- a/lib/src/finnish/ExtraFin.gf +++ b/lib/src/finnish/ExtraFin.gf @@ -2,7 +2,7 @@ --# -coding=latin1 concrete ExtraFin of ExtraFinAbs = CatFin ** - open ResFin, MorphoFin, Coordination, Prelude, NounFin, StructuralFin, StemFin, (R = ParamX) in { + open ResFin, MorphoFin, Coordination, Prelude, NounFin, VerbFin, StructuralFin, StemFin, (R = ParamX) in { lin GenNP np = { @@ -231,4 +231,32 @@ concrete ExtraFin of ExtraFinAbs = CatFin ** kohan_Part = mkPart "kohan" "köhän" ; pahan_Part = mkPart "pahan" "pähän" ; + PassVPSlash vp = { + s = \\vif,ant,pol,agr => case vif of { + VIFin t => vp.s ! VIPass t ! ant ! pol ! agr ; + _ => vp.s ! vif ! ant ! pol ! agr + } ; + s2 = vp.s2 ; + adv = vp.adv ; + ext = vp.ext ; + h = vp.h ; + isNeg = vp.isNeg ; + sc = case vp.c2.c of {NPCase Nom => NPAcc ; c => c} + } ; + +---- uses inversion of active: Guernican maalasi Picasso. TODO: use the agent participle +---- TODO maybe squeeze s2 between the fin and inf (but this is subtle) +---- sinua olen rakastanut minä -> sinua olen minä rakastanus + + PassAgentVPSlash vp np = { + s = \\vif,ant,pol,agr => vp.s ! vif ! ant ! pol ! np.a ; -- only agr changes + s2 = \\b,p,a => np.s ! NPCase Nom ++ vp.s2 ! b ! p ! a ; + adv = vp.adv ; + ext = vp.ext ; + h = vp.h ; + isNeg = vp.isNeg ; + sc = vp.c2.c -- advantage: works for all V2 verbs, need not be transitive + } ; + + } diff --git a/lib/src/finnish/ExtraFinAbs.gf b/lib/src/finnish/ExtraFinAbs.gf index 2432e06d6..a6f8b0c98 100644 --- a/lib/src/finnish/ExtraFinAbs.gf +++ b/lib/src/finnish/ExtraFinAbs.gf @@ -1,6 +1,7 @@ --# -coding=latin1 abstract ExtraFinAbs = Extra [ GenNP,GenIP,GenRP, + PassVPSlash, PassAgentVPSlash, VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI, VPS,ListVPS,BaseVPS,ConsVPS,ConjVPS,MkVPS,PredVPS,ConjVPS,Tense,Temp,Pol,S, VV,VP,Conj,NP,Quant,IAdv,IComp,ICompAP,IAdvAdv,Adv,AP, Pron, RP, ProDrop] ** { diff --git a/lib/src/finnish/stemmed/ParseFin.gf b/lib/src/finnish/stemmed/ParseFin.gf index 94603ee70..2a7426c63 100644 --- a/lib/src/finnish/stemmed/ParseFin.gf +++ b/lib/src/finnish/stemmed/ParseFin.gf @@ -15,7 +15,7 @@ concrete ParseFin of ParseEngAbs = QuestionFin, RelativeFin, IdiomFin [NP, VP, Tense, Cl, ProgrVP, ExistNP, SelfAdvVP, SelfAdVVP, SelfNP] - , ExtraFin [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, Voc, RP, GenRP, + , ExtraFin [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, Voc, RP, GenRP, PassVPSlash, PassAgentVPSlash, Temp, Tense, Pol, Conj, VPS, ListVPS, S, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV] , DictEngFin @@ -55,21 +55,6 @@ lin h = cn.h } ; - PassVPSlash = passVPSlash ; - -oper - passVPSlash : VPSlash -> ResFin.VP = \vp -> lin VP { - s = \\vif,ant,pol,agr => case vif of { - VIFin t => vp.s ! VIPass t ! ant ! pol ! agr ; - _ => vp.s ! vif ! ant ! pol ! agr - } ; - s2 = vp.s2 ; - adv = vp.adv ; - ext = vp.ext ; - h = vp.h ; - isNeg = vp.isNeg ; - sc = case vp.c2.c of {NPCase Nom => NPAcc ; c => c} - } ; lin DashCN noun1 noun2 = { diff --git a/lib/src/french/ExtraFre.gf b/lib/src/french/ExtraFre.gf index acf648a13..686031ce8 100644 --- a/lib/src/french/ExtraFre.gf +++ b/lib/src/french/ExtraFre.gf @@ -77,4 +77,8 @@ concrete ExtraFre of ExtraFreAbs = ExtraRomanceFre ** ExistsNP np = mkClause "il" True False np.a (insertComplement (\\_ => (np.s ! Nom).ton) (predV (regV "exister"))) ; + + PassAgentVPSlash vps np = passVPSlash + vps ("par" ++ (np.s ! Acc).ton) ; + } diff --git a/lib/src/french/ExtraFreAbs.gf b/lib/src/french/ExtraFreAbs.gf index 0a7a3f767..ab66dcdd2 100644 --- a/lib/src/french/ExtraFreAbs.gf +++ b/lib/src/french/ExtraFreAbs.gf @@ -46,4 +46,5 @@ abstract ExtraFreAbs = ExtraRomanceAbs - [ProDrop] ** { PNegNe : Pol ; + } diff --git a/lib/src/french/ParseFre.gf b/lib/src/french/ParseFre.gf index 057cba685..e84a3956d 100644 --- a/lib/src/french/ParseFre.gf +++ b/lib/src/french/ParseFre.gf @@ -14,7 +14,7 @@ concrete ParseFre of ParseEngAbs = QuestionFre, RelativeFre, IdiomFre [NP, VP, Tense, Cl, ProgrVP, ExistNP], - ExtraFre [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, + ExtraFre [NP, Quant, VPSlash, VP, Tense, GenNP, PassVPSlash, PassAgentVPSlash, Temp, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP, VPI, VPIForm, VPIInf, VPIPresPart, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, ClSlash, RCl, EmptyRelSlash], diff --git a/lib/src/romance/ExtraRomance.gf b/lib/src/romance/ExtraRomance.gf index 575e433b6..7bb904b4f 100644 --- a/lib/src/romance/ExtraRomance.gf +++ b/lib/src/romance/ExtraRomance.gf @@ -3,6 +3,7 @@ incomplete concrete ExtraRomance of ExtraRomanceAbs = CatRomance ** CommonRomance, Coordination, ResRomance, + (G = Grammar), Prelude in { lin TPasseSimple = {s = []} ** {t = RPasse} ; --# notpresent @@ -75,19 +76,24 @@ incomplete concrete ExtraRomance of ExtraRomanceAbs = CatRomance ** hasClit = False } ; - PassVPSlash vps = + PassVPSlash vps = passVPSlash vps [] ; +---- PassAgentVPSlash vps np = passVPSlash +---- vps (let by = in by.s ++ (np.s ! by.c).ton) ; + +oper + passVPSlash : VPSlash -> Str -> ResRomance.VP = \vps, ag -> let auxvp = predV auxPassive in - insertComplement (\\a => let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) { - s = auxvp.s ; - agr = auxvp.agr ; - neg = vps.neg ; - clit1 = vps.clit1 ; - clit2 = vps.clit2 ; - clit3 = vps.clit3 ; - isNeg = vps.isNeg ; - comp = vps.comp ; - ext = vps.ext + insertComplement (\\a => let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) { + s = auxvp.s ; + agr = auxvp.agr ; + neg = vps.neg ; + clit1 = vps.clit1 ; + clit2 = vps.clit2 ; + clit3 = vps.clit3 ; + isNeg = vps.isNeg ; + comp = \\a => vps.comp ! a ++ ag ; + ext = vps.ext } ; } diff --git a/lib/src/romance/ExtraRomanceAbs.gf b/lib/src/romance/ExtraRomanceAbs.gf index 008248ce3..115f31dca 100644 --- a/lib/src/romance/ExtraRomanceAbs.gf +++ b/lib/src/romance/ExtraRomanceAbs.gf @@ -1,7 +1,8 @@ abstract ExtraRomanceAbs = Cat, Extra[ VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI, VPS,ListVPS,BaseVPS,ConsVPS,ConjVPS,MkVPS,PredVPS, - PassVPSlash,ExistsNP, + PassVPSlash, PassAgentVPSlash, ---- how to get type of by8agent_Prep; lin moved to indiv. languages + ExistsNP, Temp,Pol,S,NP,VPSlash,Cl, VV,VP,Conj,Pron,ProDrop,CompIQuant,IQuant,IComp,PrepCN,CN,Prep,Adv] ** { diff --git a/lib/src/swedish/ExtraSwe.gf b/lib/src/swedish/ExtraSwe.gf index 907ce4042..36c68a569 100644 --- a/lib/src/swedish/ExtraSwe.gf +++ b/lib/src/swedish/ExtraSwe.gf @@ -3,7 +3,7 @@ concrete ExtraSwe of ExtraSweAbs = ExtraScandSwe - [FocAdv] , ParadigmsSwe - [nominative] ** open CommonScand, ResSwe, ParamX, VerbSwe, Prelude, DiffSwe, StructuralSwe, MorphoSwe, - NounSwe, Coordination, AdjectiveSwe, SentenceSwe, RelativeSwe in { + NounSwe, Coordination, AdjectiveSwe, SentenceSwe, AdverbSwe, RelativeSwe in { lincat ReflNP = NP ; @@ -30,8 +30,11 @@ lin lin --TODO: fix this; just wrote something that it compiles and doesn't give [PassVPSlash] when parsing text + --looks OK now AR 5/12/2013 PassVPSlash vps = insertObj (\\a => vps.c2.s ++ vps.n3 ! a) (passiveVP vps) ; + PassAgentVPSlash vps np = + insertObjPost (\\a => vps.c2.s ++ vps.n3 ! a) (insertObj (\\_ => (PrepNP by8agent_Prep np).s) (passiveVP vps)) ; RelVS s rvs = {s = \\o => s.s ! o ++ comma ++ rvs.s ! agrP3 Neutr Sg ! RPrep True} ; diff --git a/lib/src/swedish/LexiconSwe.gf b/lib/src/swedish/LexiconSwe.gf index 1d06a5478..edef8e2db 100644 --- a/lib/src/swedish/LexiconSwe.gf +++ b/lib/src/swedish/LexiconSwe.gf @@ -20,7 +20,7 @@ lin beautiful_A = mk3A "vacker" "vackert" "vackra" ; become_VA = mkVA (mkV "bli" "blir""bli" "blev" "blivit" "bliven" "blivande") ; beer_N = regGenN "öl" neutrum ; - beg_V2V = mkV2V (mkV "be" "ber""be" "bad" "bett" "bedd") noPrep (mkPrep "att") ; + beg_V2V = mkV2V (mkV "be" "ber""be" "bad" "bett" "bedd") ; big_A = irregA "stor" "större" "störst"; bike_N = mk2N "cykel" "cyklar" ; bird_N = mk2N "fågel" "fåglar" ;