From f2a02c438dd11bebd4aa4a357fe508f1298d8ad0 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 18 Apr 2018 10:13:55 +0200 Subject: [PATCH] (Dut) Fixes in ComplSlash, mkClause, ProgrVP + general cleanup --- src/dutch/ExtraDut.gf | 19 -------------- src/dutch/IdiomDut.gf | 10 +++----- src/dutch/ResDut.gf | 56 +++++++++++++++++++++------------------- src/dutch/VerbDut.gf | 60 ++++++++++++++++++------------------------- 4 files changed, 59 insertions(+), 86 deletions(-) diff --git a/src/dutch/ExtraDut.gf b/src/dutch/ExtraDut.gf index f444daac..15c103ac 100644 --- a/src/dutch/ExtraDut.gf +++ b/src/dutch/ExtraDut.gf @@ -17,25 +17,6 @@ concrete ExtraDut of ExtraDutAbs = CatDut ** ComplVPIVV v vpi = insertInf (vpi.s ! v.isAux) ( predVGen v.isAux BeforeObjs v) ; ---- ---{- --- insertExtrapos vpi.p3 ( --- insertInf vpi.p2 ( --- insertObj vpi.p1 ( --- predVGen v.isAux vpi.negPos v))) ; ----} --- --- PPzuAdv cn = {s = case cn.g of { --- Masc | Neutr => "zum" ; --- Fem => "zur" --- } ++ cn.s ! adjfCase Weak Dat ! Sg ! Dat --- } ; --- --- TImpfSubj = {s = [] ; t = Past ; m = MConjunct} ; --# notpresent --- --- moegen_VV = auxVV mögen_V ; --- ---} - lin ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ; diff --git a/src/dutch/IdiomDut.gf b/src/dutch/IdiomDut.gf index 0e63f3c2..f17bbe28 100644 --- a/src/dutch/IdiomDut.gf +++ b/src/dutch/IdiomDut.gf @@ -32,16 +32,14 @@ concrete IdiomDut of Idiom = CatDut ** } } ; - ProgrVP vp = insertObj (\\agr => "aan" ++ "het" ++ useInfVP True vp ! agr) (predV zijn_V) ; + ProgrVP vp = let vpi = infVP True vp in + insertAdv ("aan het" ++ vpi.inf ++ vpi.ext) + (insertObj vpi.obj (compV zijn_V)) ; ImpPl1 vp = let v = laten_V ; - vpi = infVP True vp ; - vvp = insertExtrapos vpi.p3 ( - insertInf vpi.p2 ( - insertObj vpi.p1 ( - predVGen True vp.negPos v))) ; + vvp = insertInfVP True vp (predVGen True vp.negPos v) ; in {s = (mkClause "we" {g = Utr ; n = Pl ; p = P1} vvp).s ! Pres ! Simul ! Pos ! Inv diff --git a/src/dutch/ResDut.gf b/src/dutch/ResDut.gf index ffcc41e9..ca059d0d 100644 --- a/src/dutch/ResDut.gf +++ b/src/dutch/ResDut.gf @@ -575,10 +575,6 @@ param mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { s = \\t,a,b,o => let - ord = case o of { - Sub => True ; -- glue prefix to verb - _ => False - } ; vform = vForm t agr.g agr.n agr.p o ; auxv = (auxVerb vp.s.aux).s ; vperf = vp.s.s ! VPerf ; @@ -593,12 +589,16 @@ param obj0 = vp.n0 ! agr ; obj = vp.n2 ! agr ; part = vp.s.particle ; + pref = case a of { + Anter => [] ; -- prefix is part of participle: toegevoegd + _ => vp.s.prefix -- prefix not present in verb form + } ; compl = case vp.negPos of { - BeforeObjs => neg ++ obj0 ++ obj ++ part ++ vp.a2 ++ vp.s.prefix ; - AfterObjs => obj0 ++ obj ++ neg ++ part ++ vp.a2 ++ vp.s.prefix ; - BetweenObjs => obj0 ++ neg ++ obj ++ part ++ vp.a2 ++ vp.s.prefix + BeforeObjs => neg ++ obj0 ++ obj ++ part ++ vp.a2 ++ pref ; + AfterObjs => obj0 ++ obj ++ neg ++ part ++ vp.a2 ++ pref ; + BetweenObjs => obj0 ++ neg ++ obj ++ part ++ vp.a2 ++ pref } ; - inf : Str = + inf : Str = case of { => vp.s.s ! VInf ++ vp.inf.p1 ; --# notpresent _ => verb.p2 ++ vp.inf.p1 } ; -- cunger: changed from vp.inf.p1 ++ verb.p2 @@ -608,15 +608,12 @@ param inffin : Str = case of { -- gezien zou/zal hebben - => vperf ++ fin ++ auxv ! VInf ; --# notpresent - => vperf ++ fin ++ auxv ! VInf ; --# notpresent + => vperf ++ fin ++ auxv ! VInf ++ vp.inf.p1 ; --# notpresent -- zou/zal zien - => fin ++ verb.p2 ; - => fin ++ verb.p2 ; + => fin ++ verb.p2 ++ vp.inf.p1 ; + -- wil kunnen zien (first line in inf) - <_,Anter,True> => fin ++ inf ; -- double inf --# notpresent - _ => fin ++ inf - -- no inf ++ fin, this is not German :-P + _ => fin ++ inf -- double inf --# notpresent } in case o of { @@ -631,20 +628,27 @@ param VZijn => zijn_V } ; - infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp -> - < - \\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2, - let vverb = vp.s - in - vp.a1 ! Pos ++ - vverb.particle ++ - if_then_Str isAux (vverb.s ! VInfFull) (vverb.prefix ++ "te" ++ vverb.s ! VInf), - vp.inf.p1 ++ vp.ext - > ; + infVP : Bool -> VP -> {obj : (Agr => Str) ; inf : Str ; ext : Str} = \isAux,vp -> + let vverb = vp.s in { + obj = \\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2 ; + inf = vp.a1 ! Pos ++ -- altijd + vverb.particle ++ -- leuk + if_then_Str isAux + (vverb.s ! VInfFull) -- toevoegen + (vverb.prefix ++ "te" ++ vverb.s ! VInf) ; -- te vinden + ext = vp.inf.p1 ++ vp.ext } ; + + insertInfVP : Bool -> VP -> (VP -> VP) = \isAux,vp -> + let + vpi = infVP isAux vp + in + \vps -> insertExtrapos vpi.ext + (insertInf vpi.inf + (insertObj vpi.obj vps)) ; useInfVP : Bool -> VP -> Agr => Str = \isAux,vp -> let vpi = infVP isAux vp in - \\agr => vpi.p1 ! agr ++ vpi.p2 ++ vpi.p3 ; + \\agr => vpi.obj ! agr ++ vpi.inf ++ vpi.ext ; reflPron : Agr => Str = table { {n = Sg ; p = P1} => "mijzelf" ; diff --git a/src/dutch/VerbDut.gf b/src/dutch/VerbDut.gf index 6f3b3ff0..d38f39fe 100644 --- a/src/dutch/VerbDut.gf +++ b/src/dutch/VerbDut.gf @@ -10,15 +10,8 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in { vpv = predVGen v.isAux vp.negPos (v2v v) ; vpi = infVP v.isAux vp ; in - vpv ** {n2 = vpi.p1 ; inf = ; ext = vpi.p3} ; ---- + vpv ** {n2 = vpi.obj ; inf = ; ext = vpi.ext} ; ---- Why replace and not use insertInfVP? TODO find out -{- - in - insertInf vpi.p3 ( - insertInf vpi.p2 ( - insertObj vpi.p1 ( - predVGen v.isAux vp.negPos (v2v v)))) ; ---- subtyp --} ComplVS v s = insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ; ComplVQ v q = @@ -32,43 +25,40 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in { insertObj (\\_ => appPrep v.c2.p1 np) (predVv v) ** {c2 = v.c3} ; Slash3V3 v np = insertObj (\\_ => appPrep v.c3.p1 np) (predVv v) ** {c2 = v.c2} ; - SlashV2S v s = insertExtrapos (conjThat ++ s.s ! Sub) (predVv v) ** {c2 = v.c2} ; SlashV2Q v q = insertExtrapos (q.s ! QIndir) (predVv v) ** {c2 = v.c2} ; - SlashV2V v vp = - let - vpi = infVP v.isAux vp - in - insertExtrapos vpi.p3 ( - insertInf vpi.p2 ( - insertObj vpi.p1 ((predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ; + SlashV2V v vp = + insertInfVP v.isAux vp (predVGen v.isAux vp.negPos v) ** {c2 = v.c2} ; SlashV2A v ap = insertObj (\\agr => ap.s ! agr ! APred) (predVGen False BetweenObjs (v2v v)) ** {c2 = v.c2} ; - --vp.c2.p2: if the verb has a preposition or not - ComplSlash vp np = insertObjNP np.isPron (case vp.c2.p2 of {True => BeforeObjs; False => vp.negPos}) (\\_ => appPrep vp.c2.p1 np) vp ; + ComplSlash vp np = + let obj : Agr => Str = \\_ => appPrep vp.c2.p1 np ; - SlashVV v vp = - let - vpi = infVP v.isAux vp - in - insertExtrapos vpi.p3 ( - insertInf vpi.p2 ( - insertObj vpi.p1 ( - predVGen v.isAux vp.negPos (v2v v)))) ** {c2 = vp.c2} ; + -- If there is an infinitive, put the old object before it. + -- If not, just keep the old vp. + vp': VP = case vp.inf.p2 of { + True => let emptyObjVP : VP = vp ** {n0, n2 = \\_ => [] } ; + infCompl = vp.n0 ! np.a ++ vp.n2 ! np.a ; + in insertInf infCompl emptyObjVP ; + False => vp } ; - SlashV2VNP v np vp = - let - vpi = infVP v.isAux vp - in - insertExtrapos vpi.p3 ( - insertInf vpi.p2 ( - insertObj vpi.p1 ( - insertObj (\\_ => appPrep v.c2.p1 np) ( - predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ; + negPos = case vp.c2.p2 of { -- if the verb has a preposition or not + True => BeforeObjs ; + False => vp.negPos } ; + in insertObjNP np.isPron negPos obj vp' ; + + SlashVV v vp = + insertInfVP v.isAux vp (predVGen v.isAux vp.negPos v) ** {c2 = vp.c2} ; + + SlashV2VNP v np vp = + insertInfVP v.isAux vp ( + insertObj (\\_ => appPrep v.c2.p1 np) + (predVGen v.isAux vp.negPos v)) + ** {c2 = v.c2} ; UseComp comp = insertObj comp.s (compV zijn_V) ;