From 38ae2430b57aa4cdd8b242a0fc4453d05378fcc0 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 26 Sep 2014 13:26:01 +0000 Subject: [PATCH] gerund and participle translations for Fre,Ita,Spa and Ger. Some a bit questionable. --- lib/src/catalan/BeschCat.gf | 2 +- lib/src/french/MorphoFre.gf | 2 +- lib/src/italian/BeschIta.gf | 3 +- lib/src/romance/CommonRomance.gf | 1 + lib/src/romance/ResRomance.gf | 16 ++++++--- lib/src/spanish/BeschSpa.gf | 2 +- lib/src/translator/ExtensionsFre.gf | 52 +++++++++++++++++----------- lib/src/translator/ExtensionsGer.gf | 52 ++++++++++++++++++++-------- lib/src/translator/ExtensionsIta.gf | 52 +++++++++++++++++----------- lib/src/translator/ExtensionsSpa.gf | 53 ++++++++++++++++++----------- lib/src/translator/TranslateFre.gf | 6 +++- lib/src/translator/TranslateGer.gf | 7 ++-- lib/src/translator/TranslateIta.gf | 2 +- lib/src/translator/TranslateSpa.gf | 6 +++- 14 files changed, 171 insertions(+), 85 deletions(-) diff --git a/lib/src/catalan/BeschCat.gf b/lib/src/catalan/BeschCat.gf index bd9f9535e..70ff0a396 100644 --- a/lib/src/catalan/BeschCat.gf +++ b/lib/src/catalan/BeschCat.gf @@ -6041,7 +6041,7 @@ VP (Imp Sg P1) => variants {} VImper PlP1 => amar.s ! VP (Imp Pl P1) ; VImper PlP2 => amar.s ! VP (Imp Pl P2) ; VPart g n => amar.s ! VP (Pass n g) ; - VGer => amar.s ! VI Ger + VGer | VPresPart => amar.s ! VI Ger } } ; diff --git a/lib/src/french/MorphoFre.gf b/lib/src/french/MorphoFre.gf index e5d7df779..c6884cf39 100644 --- a/lib/src/french/MorphoFre.gf +++ b/lib/src/french/MorphoFre.gf @@ -244,7 +244,7 @@ oper VFin VCondit n p => aller ! Condi n p ; --# notpresent VImper np => aller ! Imper np ; VPart g n => aller ! Part (PPasse g n) ; - VGer => aller ! Part PPres -- *en* allant + VGer | VPresPart => aller ! Part PPres -- *en* allant } ; Verbe : Type = VForm => Str ; diff --git a/lib/src/italian/BeschIta.gf b/lib/src/italian/BeschIta.gf index af86c8d20..763dfead0 100644 --- a/lib/src/italian/BeschIta.gf +++ b/lib/src/italian/BeschIta.gf @@ -6502,7 +6502,8 @@ oper venire_110 : Str -> Verbo = \venire -> VFin VCondit n p => amare.s ! Cond n p ; --# notpresent VImper np => amare.s ! Imper np ; VPart g n => amare.s ! Part PassP g n ; - VGer => amare.s ! Ger + VGer => amare.s ! Ger ; + VPresPart => Predef.tk 2 (amare.s ! Ger) + "te" } } ; diff --git a/lib/src/romance/CommonRomance.gf b/lib/src/romance/CommonRomance.gf index 6c0f13cba..a00fbe66b 100644 --- a/lib/src/romance/CommonRomance.gf +++ b/lib/src/romance/CommonRomance.gf @@ -87,6 +87,7 @@ param | VImper NumPersI | VPart Gender Number | VGer + | VPresPart --- = VGer except in Italian ; TMood = diff --git a/lib/src/romance/ResRomance.gf b/lib/src/romance/ResRomance.gf index e2d46655d..7c3692014 100644 --- a/lib/src/romance/ResRomance.gf +++ b/lib/src/romance/ResRomance.gf @@ -276,18 +276,26 @@ oper --- have a "-" with possibly a special verb form with "t": --- "comment fera-t-il" vs. "comment fera Pierre" - infVP : VP -> Agr -> Str = \vp,agr -> + infVP : VP -> Agr -> Str = \vp -> let iform = orB vp.clit3.hasClit (isVRefl vp.s.vtyp) ; - inf = vp.s.s ! VInfin iform ; + vf = VInfin iform ; + in + nominalVP vf iform vp ; + + gerVP : VP -> Agr -> Str = nominalVP VGer True ; + + nominalVP : VF -> Bool -> VP -> Agr -> Str = \vf,iform,vp,agr -> + let + inf = vp.s.s ! vf ; neg = vp.neg ! RPos ; --- Neg not in API - obj = neg.p2 ++ vp.s.p ++ vp.comp ! agr ++ vp.ext ! RPos ; ---- pol + obj = vp.s.p ++ vp.comp ! agr ++ vp.ext ! RPos ; ---- pol refl = case isVRefl vp.s.vtyp of { True => reflPron agr.n agr.p Acc ; ---- case ? _ => [] } ; in - neg.p1 ++ clitInf iform (refl ++ vp.clit1 ++ vp.clit2 ++ vp.clit3.s) inf ++ obj ; + neg.p1 ++ neg.p2 ++ clitInf iform (refl ++ vp.clit1 ++ vp.clit2 ++ vp.clit3.s) inf ++ obj ; -- ne pas dormant } diff --git a/lib/src/spanish/BeschSpa.gf b/lib/src/spanish/BeschSpa.gf index 01f7a2c9e..01bcbe6e4 100644 --- a/lib/src/spanish/BeschSpa.gf +++ b/lib/src/spanish/BeschSpa.gf @@ -6471,7 +6471,7 @@ oper llover_89 : Str -> Verbum = \llover -> VImper PlP1 => amar.s ! VPB (Imper Pl P1) ; VImper PlP2 => amar.s ! VPB (Imper Pl P2) ; VPart g n => amar.s ! VPB (Pass n g) ; - VGer => amar.s ! VI Ger + VGer | VPresPart => amar.s ! VI Ger } } ; diff --git a/lib/src/translator/ExtensionsFre.gf b/lib/src/translator/ExtensionsFre.gf index 9968a6389..1cbc91913 100644 --- a/lib/src/translator/ExtensionsFre.gf +++ b/lib/src/translator/ExtensionsFre.gf @@ -59,29 +59,43 @@ lin } ; -{- - GerundN v = { - s = \\n,c => v.s ! VPresPart ; - g = Neutr - } ; - - GerundAP v = { - s = \\agr => v.s ! VPresPart ; - isPre = True - } ; --- } + GerundNP vp = + let a = agrP3 Masc Sg ---- agr + in + heavyNP {s = \\c => prepCase c ++ infVP vp a ; a = a} ; -- parlare tedesco non è facile - PastPartAP v = { + GerundAdv vp = + let a = agrP3 Masc Sg + in + {s = gerVP vp a} | {s = "en" ++ gerVP vp a} ; + + WithoutVP vp = SyntaxFre.mkAdv without_Prep (lin NP (GerundNP (lin VP vp))) ; -- senza dormire + + InOrderToVP vp = SyntaxFre.mkAdv for_Prep (lin NP (GerundNP (lin VP vp))) ; -- per dormire + + ByVP vp = GerundAdv (lin VP vp) ; + + PresPartAP vp = { s = table { - AF g n => v.s ! VPart g n ; - _ => v.s ! VPart Masc Sg ---- the adverb form + AF g n => nominalVP VPresPart True vp (agrP3 g n) ; + _ => nominalVP VPresPart True vp (agrP3 Masc Sg) ---- the adverb form } ; - isPre = True - } ; + isPre = False + } ; - --{- - OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ; --} + PastPartAP vp = { + s = table { + AF g n => nominalVP (VPart g n) True vp (agrP3 g n) ; + _ => nominalVP (VPart Masc Sg) True vp (agrP3 Masc Sg) ---- the adverb form + } ; + isPre = False + } ; + + PastPartAgentAP vp np = + let part = PastPartAP (lin VP vp) + in part ** { + s = \\a => part.s ! a ++ (SyntaxFre.mkAdv (mkPrep "par") (lin NP np)).s + } ; PositAdVAdj a = {s = a.s ! Posit ! AA} ; diff --git a/lib/src/translator/ExtensionsGer.gf b/lib/src/translator/ExtensionsGer.gf index 7b7c31acd..080a2d87c 100644 --- a/lib/src/translator/ExtensionsGer.gf +++ b/lib/src/translator/ExtensionsGer.gf @@ -78,22 +78,46 @@ lin isPre = True } ; - GerundN v = { -- parsing - s = \\n,c => v.s ! VInf False ; --- formalisieren, not formalisierung - g = Neutr - } ; + GerundNP vp = { -- infinitive: Bier zu trinken + s = \\c => (prepC c).s ++ useInfVP False vp ; + a = Ag Neutr Sg P3 ; + isPron = False + } ; + + GerundAdv vp = { -- Bier trinkend + s = (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ vp.inf ++ vp.ext ++ vp.infExt ++ vp.s.s ! VPresPart APred + } ; + + WithoutVP vp = { -- ohne Bier zu trinken + s = "ohne" ++ useInfVP False vp + } ; + + InOrderToVP vp = { -- um Bier zu trinken + s = "um" ++ useInfVP False vp + } ; + + ByVP vp = { ---- durch Bier zu drinken + s = "durch" ++ useInfVP False vp ---- + } ; + + PresPartAP vp = { + s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ vp.inf ++ vp.ext ++ vp.infExt ++ vp.s.s ! VPresPart af ; + isPre = True + } ; + + PastPartAP vp = { + s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ vp.inf ++ vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ; + isPre = True + } ; + + PastPartAgentAP vp np = + let agent = (SyntaxGer.mkAdv von_Prep (lin NP np)).s + in { + s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ agent ++ vp.inf ++ vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ; + isPre = True + } ; {- - GerundAP v = { -- beckoning - s = \\agr => v.s ! VPresPart ; - isPre = True - } ; - - PastPartAP v = { -- broken - s = \\agr => v.s ! VPPart ; - isPre = True - } ; - OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ; -- higher PositAdVAdj a = {s = a.s ! AAdv} ; -- really diff --git a/lib/src/translator/ExtensionsIta.gf b/lib/src/translator/ExtensionsIta.gf index 8c79c86cc..38f5b7057 100644 --- a/lib/src/translator/ExtensionsIta.gf +++ b/lib/src/translator/ExtensionsIta.gf @@ -58,31 +58,43 @@ lin isPre = False } ; --- infVP : VP -> Agr -> Str = \vp,agr -> + GerundNP vp = + let a = agrP3 Masc Sg ---- agr + in + heavyNP {s = \\c => prepCase c ++ infVP vp a ; a = a} ; -- parlare tedesco non è facile -{- - GerundN v = { - s = \\n,c => v.s ! VPresPart ; - g = Neutr - } ; - - GerundAP v = { - s = \\agr => v.s ! VPresPart ; - isPre = True - } ; --- } + GerundAdv vp = + let a = agrP3 Masc Sg + in + {s = gerVP vp a} ; -- dormendo - PastPartAP v = { + WithoutVP vp = SyntaxIta.mkAdv without_Prep (lin NP (GerundNP (lin VP vp))) ; -- senza dormire + + InOrderToVP vp = SyntaxIta.mkAdv for_Prep (lin NP (GerundNP (lin VP vp))) ; -- per dormire + + ByVP vp = GerundAdv (lin VP vp) ; + + PresPartAP vp = { s = table { - AF g n => v.s ! VPart g n ; - _ => v.s ! VPart Masc Sg ---- the adverb form + AF g n => nominalVP VPresPart True vp (agrP3 g n) ; + _ => nominalVP VPresPart True vp (agrP3 Masc Sg) ---- the adverb form } ; - isPre = True - } ; + isPre = False + } ; - --{- - OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ; --} + PastPartAP vp = { + s = table { + AF g n => nominalVP (VPart g n) True vp (agrP3 g n) ; + _ => nominalVP (VPart Masc Sg) True vp (agrP3 Masc Sg) ---- the adverb form + } ; + isPre = False + } ; + + PastPartAgentAP vp np = + let part = PastPartAP (lin VP vp) + in part ** { + s = \\a => part.s ! a ++ (SyntaxIta.mkAdv da_Prep (lin NP np)).s + } ; PositAdVAdj a = {s = a.s ! Posit ! AA} ; diff --git a/lib/src/translator/ExtensionsSpa.gf b/lib/src/translator/ExtensionsSpa.gf index 52d650e98..eccbd87bf 100644 --- a/lib/src/translator/ExtensionsSpa.gf +++ b/lib/src/translator/ExtensionsSpa.gf @@ -58,29 +58,44 @@ lin isPre = False } ; -{- - GerundN v = { - s = \\n,c => v.s ! VPresPart ; - g = Neutr - } ; - - GerundAP v = { - s = \\agr => v.s ! VPresPart ; - isPre = True - } ; --- } - PastPartAP v = { + GerundNP vp = + let a = agrP3 Masc Sg ---- agr + in + heavyNP {s = \\c => prepCase c ++ infVP vp a ; a = a} ; -- parlare tedesco non è facile + + GerundAdv vp = + let a = agrP3 Masc Sg + in + {s = gerVP vp a} ; -- dormendo + + WithoutVP vp = SyntaxSpa.mkAdv without_Prep (lin NP (GerundNP (lin VP vp))) ; -- senza dormire + + InOrderToVP vp = SyntaxSpa.mkAdv for_Prep (lin NP (GerundNP (lin VP vp))) ; -- per dormire + + ByVP vp = GerundAdv (lin VP vp) ; + + PresPartAP vp = { s = table { - AF g n => v.s ! VPart g n ; - _ => v.s ! VPart Masc Sg ---- the adverb form + AF g n => nominalVP VPresPart True vp (agrP3 g n) ; + _ => nominalVP VPresPart True vp (agrP3 Masc Sg) ---- the adverb form } ; - isPre = True - } ; + isPre = False + } ; - --{- - OrdCompar a = {s = \\c => a.s ! AAdj Compar c } ; --} + PastPartAP vp = { + s = table { + AF g n => nominalVP (VPart g n) True vp (agrP3 g n) ; + _ => nominalVP (VPart Masc Sg) True vp (agrP3 Masc Sg) ---- the adverb form + } ; + isPre = False + } ; + + PastPartAgentAP vp np = + let part = PastPartAP (lin VP vp) + in part ** { + s = \\a => part.s ! a ++ (SyntaxSpa.mkAdv (mkPrep "por") (lin NP np)).s + } ; PositAdVAdj a = {s = a.s ! Posit ! AA} ; diff --git a/lib/src/translator/TranslateFre.gf b/lib/src/translator/TranslateFre.gf index c8834c193..5e8c70fb5 100644 --- a/lib/src/translator/TranslateFre.gf +++ b/lib/src/translator/TranslateFre.gf @@ -25,7 +25,11 @@ concrete TranslateFre of Translate = DocumentationFre, ChunkFre, - ExtensionsFre [CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP], + ExtensionsFre [ + CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP + , PastPartAP, PastPartAgentAP, PresPartAP, GerundNP, GerundAdv + , WithoutVP, InOrderToVP, ByVP + ], DictionaryFre ** open PhonoFre, MorphoFre, ResFre, CommonRomance, ParadigmsFre, SyntaxFre, Prelude, (G = GrammarFre) in { diff --git a/lib/src/translator/TranslateGer.gf b/lib/src/translator/TranslateGer.gf index 5d37b2d38..b946c86fc 100644 --- a/lib/src/translator/TranslateGer.gf +++ b/lib/src/translator/TranslateGer.gf @@ -23,8 +23,11 @@ concrete TranslateGer of Translate = DocumentationGer, ChunkGer, - ExtensionsGer [CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP, - DirectComplVS, DirectComplVQ, FocusObjS], + ExtensionsGer [ + CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP + , PastPartAP, PastPartAgentAP, PresPartAP, GerundNP, GerundAdv + , WithoutVP, InOrderToVP, ByVP + ], DictionaryGer ** open MorphoGer, ResGer, ParadigmsGer, SyntaxGer, CommonScand, (E = ExtraGer), Prelude in { diff --git a/lib/src/translator/TranslateIta.gf b/lib/src/translator/TranslateIta.gf index 8e52784dc..9cc255507 100644 --- a/lib/src/translator/TranslateIta.gf +++ b/lib/src/translator/TranslateIta.gf @@ -28,7 +28,7 @@ concrete TranslateIta of Translate = ExtensionsIta [ CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP , PastPartAP, PastPartAgentAP, PresPartAP, GerundNP, GerundAdv ----- , WithoutVP, InOrderToVP, ByVP + , WithoutVP, InOrderToVP, ByVP ], DictionaryIta ** diff --git a/lib/src/translator/TranslateSpa.gf b/lib/src/translator/TranslateSpa.gf index ec05f0ad8..e8dda1a45 100644 --- a/lib/src/translator/TranslateSpa.gf +++ b/lib/src/translator/TranslateSpa.gf @@ -25,7 +25,11 @@ concrete TranslateSpa of Translate = DocumentationSpa, ChunkSpa, - ExtensionsSpa [CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP], + ExtensionsSpa [ + CompoundN,AdAdV,UttAdV,ApposNP,MkVPI, MkVPS, PredVPS, PassVPSlash, PassAgentVPSlash, CompoundAP + , PastPartAP, PastPartAgentAP, PresPartAP, GerundNP, GerundAdv + , WithoutVP, InOrderToVP, ByVP + ], DictionarySpa ** open MorphoSpa, ResSpa, ParadigmsSpa, SyntaxSpa, (E = ExtraSpa), (G = GrammarSpa), Prelude in {