From 6084aef91b99fff0c94bca0ab66c35c7f688df7a Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Mon, 22 Jul 2024 23:47:03 +0200 Subject: [PATCH] trying to fix word order in ExtendGer.PredVPS ; not yet correct for Sub --- src/german/ExtendGer.gf | 60 +++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/src/german/ExtendGer.gf b/src/german/ExtendGer.gf index ee99afec8..707f8fe09 100644 --- a/src/german/ExtendGer.gf +++ b/src/german/ExtendGer.gf @@ -53,15 +53,50 @@ concrete ExtendGer of Extend = lincat VPI = {s : Bool => Str} ; [VPI] = {s1,s2 : Bool => Str} ; - VPS = {s : Order => Agr => Str} ; - [VPS] = {s1,s2 : Order => Agr => Str} ; + VPS = {s : Order => Agr => {verb, compl : Str}} ; + [VPS] = {s : Order => Agr => {s1, s2, s3 : Str}} ; -- liebe, (ich) dich, (und) bin glücklich lin BaseVPI = twoTable Bool ; ConsVPI = consrTable Bool comma ; - BaseVPS = twoTable2 Order Agr ; - ConsVPS = consrTable2 Order Agr comma ; + BaseVPS v w = { + s = \\ord, agr => + let + vs = v.s ! ord ! agr ; + ws = w.s ! ord ! agr ; + in { + s1 = vs.verb ; + s2 = vs.compl ; + s3 = case ord of { + Sub => ws.compl ++ ws.verb ; + _ => ws.verb ++ ws.compl + } + } + } ; + + ConsVPS v vv = { + s = \\ord, agr => + let + vs = v.s ! ord ! agr ; + vvs = vv.s ! ord ! agr ; + in { + s1 = vs.verb ; + s2 = vs.compl ++ comma ++ vvs.s1 ++ vvs.s2 ; + s3 = vvs.s3 + } + } ; + + ConjVPS conj vv = { + s = \\ord, agr => + let + vvs = vv.s ! ord ! agr + in { + verb = vvs.s1 ; + compl = conj.s1 ++ vvs.s2 ++ conj.s2 ++ vvs.s3 + } + } ; + MkVPS tm p vp = let vps = useVP vp in { @@ -112,26 +147,29 @@ concrete ExtendGer of Extend = } ; extra = vp.inf.extr!agr ++ vp.ext ; in + --- AR 22/7/2024 as the subject comes to a wrong place in PredVPS Inv + {verb = verb.fin ; compl = compl ++ infCompl ++ pred.inf ++ extra} + {- case o of { - Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ; + Main => verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ; Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ; Subj => subj ++ compl ++ pred.infComplfin ++ extra } + -} } ; - ConjVPS = conjunctDistrTable2 Order Agr ; - PredVPS np vpi = + PredVPS np vps = let subj = np.s ! False ! Nom ++ bigNP np ; agr = np.a ; in { s = \\o => - let verb = vpi.s ! o ! agr + let verb = vps.s ! o ! agr in case o of { - Main => subj ++ verb ; - Inv => verb ++ subj ; ---- älskar henne och sover jag - Sub => subj ++ verb + Main => subj ++ verb.verb ++ verb.compl ; + Inv => verb.verb ++ subj ++ verb.compl ; -- älskar jag henne och sover + Sub => subj ++ verb.verb ++ verb.compl --- not quite correct in ConjVPS } } ;