From ebb393d4b10ced9aaba73c3c5a9ccf54599858ba Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 29 May 2010 09:43:42 +0000 Subject: [PATCH] heavy/light NP distinction in Ger to control the place of negation --- lib/src/german/CatGer.gf | 2 +- lib/src/german/ConjunctionGer.gf | 4 ++-- lib/src/german/MorphoGer.gf | 2 +- lib/src/german/NounGer.gf | 11 ++++++----- lib/src/german/ResGer.gf | 26 ++++++++++++++++++++------ lib/src/german/VerbGer.gf | 2 +- 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/lib/src/german/CatGer.gf b/lib/src/german/CatGer.gf index 853f924e3..e3ef2afb1 100644 --- a/lib/src/german/CatGer.gf +++ b/lib/src/german/CatGer.gf @@ -48,7 +48,7 @@ concrete CatGer of Cat = -- Noun CN = {s : Adjf => Number => Case => Str ; g : Gender} ; - NP = {s : PCase => Str ; a : Agr} ; + NP = {s : PCase => Str ; a : Agr ; isPron : Bool} ; Pron = {s : NPForm => Str ; a : Agr} ; Det = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf} ; Quant = { diff --git a/lib/src/german/ConjunctionGer.gf b/lib/src/german/ConjunctionGer.gf index dd97c7cca..bb73396e9 100644 --- a/lib/src/german/ConjunctionGer.gf +++ b/lib/src/german/ConjunctionGer.gf @@ -9,9 +9,9 @@ concrete ConjunctionGer of Conjunction = ConjAdv conj ss = conjunctDistrSS conj ss ; - ConjNP conj ss = conjunctDistrTable PCase conj ss ** { + ConjNP conj ss = heavyNP (conjunctDistrTable PCase conj ss ** { a = Ag Fem (conjNumber conj.n (numberAgr ss.a)) (personAgr ss.a) - } ; + }) ; ConjAP conj ss = conjunctDistrTable AForm conj ss ** { isPre = ss.isPre diff --git a/lib/src/german/MorphoGer.gf b/lib/src/german/MorphoGer.gf index bd159d482..a7c3a6e1b 100644 --- a/lib/src/german/MorphoGer.gf +++ b/lib/src/german/MorphoGer.gf @@ -19,7 +19,7 @@ oper mkPrep : Str -> PCase -> Preposition = \s,c -> {s = s ; c = c} ; - nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr} = \name -> { + nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ; isPron : Bool} = \name -> heavyNP { s = \\c => usePrepC c (\k -> name.s ! k) ; a = agrP3 Sg } ; diff --git a/lib/src/german/NounGer.gf b/lib/src/german/NounGer.gf index 52e819f0d..4415069bc 100644 --- a/lib/src/german/NounGer.gf +++ b/lib/src/german/NounGer.gf @@ -16,30 +16,31 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { isPron = False } ; - UsePN pn = { + UsePN pn = heavyNP { s = \\c => usePrepC c (\k -> pn.s ! k) ; a = agrP3 Sg } ; UsePron pron = { s = \\c => usePrepC c (\k -> pron.s ! NPCase k) ; - a = pron.a + a = pron.a ; + isPron = True } ; PredetNP pred np = - let ag = case pred.a of {PAg n => agrP3 n ; _ => np.a} in { + let ag = case pred.a of {PAg n => agrP3 n ; _ => np.a} in heavyNP { s = \\c0 => let c = case pred.c.k of {NoCase => c0 ; PredCase k => k} in pred.s ! numberAgr ag ! genderAgr np.a ! c0 ++ pred.c.p ++ np.s ! c ; a = ag } ; - PPartNP np v2 = { + PPartNP np v2 = heavyNP { s = \\c => np.s ! c ++ v2.s ! VPastPart APred ; --- invar part a = np.a } ; - AdvNP np adv = { + AdvNP np adv = heavyNP { s = \\c => np.s ! c ++ adv.s ; a = np.a } ; diff --git a/lib/src/german/ResGer.gf b/lib/src/german/ResGer.gf index 0662ab519..3aaf44340 100644 --- a/lib/src/german/ResGer.gf +++ b/lib/src/german/ResGer.gf @@ -436,7 +436,8 @@ resource ResGer = ParamX ** open Prelude in { VP : Type = { s : Verb ; a1 : Polarity => Str ; -- nicht - n2 : Agr => Str ; -- dich + n0 : Agr => Str ; -- dich + n2 : Agr => Str ; -- deine Frau a2 : Str ; -- heute isAux : Bool ; -- is a double infinitive inf : Str ; -- sagen @@ -509,10 +510,11 @@ resource ResGer = ParamX ** open Prelude in { } ; a1 : Polarity => Str = negation ; - n2 : Agr => Str = case verb.vtype of { + n0 : Agr => Str = case verb.vtype of { VAct => \\_ => [] ; VRefl c => \\a => reflPron ! a ! c } ; + n2 : Agr => Str = \\_ => [] ; a2 : Str = [] ; isAux = isAux ; ---- inf,ext : Str = [] @@ -576,10 +578,13 @@ resource ResGer = ParamX ** open Prelude in { -- Extending a verb phrase with new constituents. - insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { + insertObj : (Agr => Str) -> VP -> VP = insertObjNP False ; + + insertObjNP : Bool -> (Agr => Str) -> VP -> VP = \isPron, obj,vp -> { s = vp.s ; a1 = vp.a1 ; - n2 = \\a => obj ! a ++ vp.n2 ! a ; + n0 = \\a => case isPron of {True => obj ! a ; _ => []} ++ vp.n0 ! a ; + n2 = \\a => case isPron of {False => obj ! a ; _ => []} ++ vp.n2 ! a ; a2 = vp.a2 ; isAux = vp.isAux ; inf = vp.inf ; @@ -589,6 +594,7 @@ resource ResGer = ParamX ** open Prelude in { insertAdV : Str -> VP -> VP = \adv,vp -> { s = vp.s ; a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht + n0 = vp.n0 ; n2 = vp.n2 ; a2 = vp.a2 ; isAux = vp.isAux ; @@ -599,6 +605,7 @@ resource ResGer = ParamX ** open Prelude in { insertAdv : Str -> VP -> VP = \adv,vp -> { s = vp.s ; a1 = vp.a1 ; + n0 = vp.n0 ; n2 = vp.n2 ; a2 = vp.a2 ++ adv ; isAux = vp.isAux ; @@ -609,6 +616,7 @@ resource ResGer = ParamX ** open Prelude in { insertExtrapos : Str -> VP -> VP = \ext,vp -> { s = vp.s ; a1 = vp.a1 ; + n0 = vp.n0 ; n2 = vp.n2 ; a2 = vp.a2 ; isAux = vp.isAux ; @@ -619,6 +627,7 @@ resource ResGer = ParamX ** open Prelude in { insertInf : Str -> VP -> VP = \inf,vp -> { s = vp.s ; a1 = vp.a1 ; + n0 = vp.n0 ; n2 = vp.n2 ; a2 = vp.a2 ; isAux = vp.isAux ; ---- @@ -641,8 +650,9 @@ resource ResGer = ParamX ** open Prelude in { } ; verb = vps.s ! ord ! agr ! VPFinite m t a ; neg = vp.a1 ! b ; + obj0 = vp.n0 ! agr ; obj = vp.n2 ! agr ; - compl = obj ++ neg ++ vp.a2 ; + compl = obj0 ++ neg ++ obj ++ vp.a2 ; inf = vp.inf ++ verb.inf ; extra = vp.ext ; inffin = @@ -661,7 +671,7 @@ resource ResGer = ParamX ** open Prelude in { infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp -> let vps = useVP vp in < - \\agr => vp.n2 ! agr ++ vp.a2, + \\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2, vp.a1 ! Pos ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, vp.inf ++ vp.ext > ; @@ -694,4 +704,8 @@ resource ResGer = ParamX ** open Prelude in { infPart : Bool -> Str = \b -> if_then_Str b [] "zu" ; + heavyNP : + {s : PCase => Str ; a : Agr} -> {s : PCase => Str ; a : Agr ; isPron : Bool} = \np -> + np ** {isPron = False} ; + } diff --git a/lib/src/german/VerbGer.gf b/lib/src/german/VerbGer.gf index 0542e7cd6..42995c82a 100644 --- a/lib/src/german/VerbGer.gf +++ b/lib/src/german/VerbGer.gf @@ -42,7 +42,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in { SlashV2A v ap = insertObj (\\_ => ap.s ! APred) (predV v) ** {c2 = v.c2} ; - ComplSlash vp np = insertObj (\\_ => appPrep vp.c2 np.s) vp ; + ComplSlash vp np = insertObjNP np.isPron (\\_ => appPrep vp.c2 np.s) vp ; SlashVV v vp = let