From 83a22ab31b7dd8680c7d9115d8904ea58c59624a Mon Sep 17 00:00:00 2001 From: odanoburu Date: Fri, 19 Oct 2018 22:21:22 +0000 Subject: [PATCH 1/3] (Por) Extend: add lins - add PastPartAP, PastPartAgentAP - add PassVPSlash, PassAgentVPSlash lins from ExtraRomance - correct CompoundN --- src/portuguese/ExtendPor.gf | 45 +++++++++++++++++++---------- src/portuguese/MakeStructuralPor.gf | 3 +- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/portuguese/ExtendPor.gf b/src/portuguese/ExtendPor.gf index 6719ca65d..3ee18db8f 100644 --- a/src/portuguese/ExtendPor.gf +++ b/src/portuguese/ExtendPor.gf @@ -18,7 +18,9 @@ concrete ExtendPor of Extend = iFem_Pron, ListVPS, PassVPSlash, - PassVPSlash, + PassAgentVPSlash, + PastPartAP, + PastPartAgentAP, ProDrop, theyFem_Pron, VPS, @@ -94,31 +96,42 @@ concrete ExtendPor of Extend = PrepCN prep cn = {s = prep.s ++ prepCase prep.c ++ cn.s ! Sg} ; lin - PassVPSlash vps = - let auxvp = predV copula - 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 + PastPartAP vps = pastPartAP vps [] ; + + PastPartAgentAP vps np = pastPartAP vps (let by = in by.s ++ (np.s ! by.c).ton) ; + + oper + pastPartAP : VPSlash -> Str -> AP ; + pastPartAP vps agent = lin AP { + s = \\af => vps.comp ! (aform2aagr af ** {p = P3}) ++ vps.s.s ! VPart (aform2gender af) (aform2number af) ++ agent ; + isPre = False } ; + lin + PassVPSlash vps = passVPSlash vps [] ; + + PassAgentVPSlash vps np = passVPSlash vps (let by = in by.s ++ (np.s ! by.c).ton) ; + ExistsNP np = mkClause [] True False np.a (insertComplement (\\_ => (np.s ! Nom).ton) (predV (mkV "existir"))) ; + oper + passVPSlash : VPSlash -> Str -> VP = \vps, agent -> + let auxvp = predV auxPassive + in + vps ** { + s = auxvp.s ; + agr = auxvp.agr ; + comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ; + } ; + lin CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english s = \\n => noun2.s ! n - ++ variants {genNumForms "do" "da" "dos" "das" ! noun.g ! n; "de"} - ++ noun.s ! n ; + ++ variants {"de" ; genForms "do" "da" ! noun.g} + ++ noun.s ! Sg ; g = noun2.g } ; diff --git a/src/portuguese/MakeStructuralPor.gf b/src/portuguese/MakeStructuralPor.gf index d7f714587..87ab6dc31 100644 --- a/src/portuguese/MakeStructuralPor.gf +++ b/src/portuguese/MakeStructuralPor.gf @@ -19,5 +19,4 @@ oper a = if_then_else PAgr p (PAg Sg) PNoAg ---- e,g, "chacun de"; other possibilities? } ; - -} +} ; From 8990ee80a847c6eb8bd7a101d6aad1ec05f74b06 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Mon, 22 Oct 2018 14:18:53 +0000 Subject: [PATCH 2/3] (Eng) change lincat of V2A - update V2A linref - add overloaded mkV2A with backwards-compatible signature - update lexicon V2A example - remove old comment with Verb lincat thanks to @inariksit for guidance! --- src/english/CatEng.gf | 10 +++++----- src/english/LexiconEng.gf | 2 +- src/english/ParadigmsEng.gf | 12 ++++++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/english/CatEng.gf b/src/english/CatEng.gf index d57f7d8f5..3d5b19548 100644 --- a/src/english/CatEng.gf +++ b/src/english/CatEng.gf @@ -92,9 +92,9 @@ concrete CatEng of Cat = CommonX - [Pol,SC,CAdv] ** open ResEng, Prelude in { -- Open lexical classes, e.g. Lexicon - V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; - V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ; - V3 = Verb ** {c2, c3 : Str} ; + V, VS, VQ, VA = Verb ; + V2, V2Q, V2S = Verb ** {c2 : Str} ; + V2A,V3 = Verb ** {c2, c3 : Str} ; VV = {s : VVForm => Str ; p : Str ; typ : VVType} ; V2V = Verb ** {c2,c3 : Str ; typ : VVType} ; @@ -114,8 +114,8 @@ concrete CatEng of Cat = CommonX - [Pol,SC,CAdv] ** open ResEng, Prelude in { VPSlash = \s -> predV {s = \\_ => s; p = ""; isRefl = False} ** {c2 = ""; gapInMiddle = False; missingAdv = False } ; V, VS, VQ, VA = \s -> {s = \\_ => s; p = ""; isRefl = False} ; - V2, V2A, V2Q, V2S = \s -> {s = \\_ => s; p = ""; isRefl = False; c2=""} ; - V3 = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3=""} ; + V2, V2Q, V2S = \s -> {s = \\_ => s; p = ""; isRefl = False; c2=""} ; + V3, V2A = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3=""} ; VV = \s -> {s = \\_ => s; p = ""; isRefl = False; typ = VVInf} ; V2V = \s -> {s = \\_ => s; p = ""; isRefl = False; c2,c3="" ; typ = VVInf} ; diff --git a/src/english/LexiconEng.gf b/src/english/LexiconEng.gf index 7597a7a50..cd9d2a8b8 100644 --- a/src/english/LexiconEng.gf +++ b/src/english/LexiconEng.gf @@ -132,7 +132,7 @@ lin oil_N = regN "oil" ; old_A = regADeg "old" ; open_V2 = dirV2 (mkV "open" "opens" "opened" "opened" "opening") ; - paint_V2A = mkV2A (regV "paint") noPrep ; + paint_V2A = mkV2A (regV "paint") ; paper_N = regN "paper" ; paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ; peace_N = regN "peace" ; diff --git a/src/english/ParadigmsEng.gf b/src/english/ParadigmsEng.gf index d88630e99..1a56707b4 100644 --- a/src/english/ParadigmsEng.gf +++ b/src/english/ParadigmsEng.gf @@ -321,7 +321,11 @@ oper } ; ingV2V : V -> Prep -> Prep -> V2V ; -- e.g. prevent (noPrep NP) (from VP-ing) mkVA : V -> VA ; -- e.g. become (AP) - mkV2A : V -> Prep -> V2A ; -- e.g. paint (NP) (AP) + mkV2A : overload { + mkV2A : V -> V2A ; -- e.g. paint (NP) (AP) + mkV2A : V -> Prep -> V2A ; -- backwards compatibility + mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. strike (NP) as (AP) + } ; mkVQ : V -> VQ ; -- e.g. wonder (QS) mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS) @@ -601,7 +605,11 @@ mkInterj : Str -> Interj ingV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVPresPart}) ; mkVA v = lin VA v ; - mkV2A v p = lin V2A (prepV2 v p) ; + mkV2A = overload { + mkV2A : V -> V2A = \v -> lin V2A (dirdirV3 v) ; + mkV2A : V -> Prep -> V2A = \v,p -> lin V2A (dirV3 v p) ; + mkV2A : V -> Prep -> Prep -> V2A = \v,p1,p2 -> lin V2A (prepPrepV3 v p1 p2) ; + } ; mkV2Q v p = lin V2Q (prepV2 v p) ; mkAS v = v ; From e4d34bff3202ec28d9d23fe803109021bed2f92d Mon Sep 17 00:00:00 2001 From: odanoburu Date: Mon, 22 Oct 2018 18:27:20 +0000 Subject: [PATCH 3/3] (Eng) update SlashV2A with new V2A lincat --- src/english/VerbEng.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/english/VerbEng.gf b/src/english/VerbEng.gf index 20fd1863e..cf397e8c7 100644 --- a/src/english/VerbEng.gf +++ b/src/english/VerbEng.gf @@ -21,7 +21,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng, Prelude in { SlashV2S v s = insertExtrac (conjThat ++ s.s) (predVc v) ; ---- insertExtra? --- SlashV2S v s = insertObjc (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predVc v) ; SlashV2Q v q = insertExtrac (q.s ! QIndir) (predVc v) ; - SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ---- + SlashV2A v ap = insertObjc (\\a => v.c3 ++ ap.s ! a) (predVc v) ; ---- ComplSlash vp np = let vp' = case vp.gapInMiddle of {