From c8ac4a9551f24b644a5aafa5b115f954ae3d45ae Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 23 Sep 2012 07:46:43 +0000 Subject: [PATCH] refactoring German VP --- examples/computer/Computer.gf | 2 +- lib/doc/synopsis.html | 4 +-- lib/src/german/CatGer.gf | 2 +- lib/src/german/ExtraGer.gf | 4 +-- lib/src/german/ResGer.gf | 49 +++++++++++++++++------------------ lib/src/german/SentenceGer.gf | 2 +- src/www/gfmorpho/README | 2 +- 7 files changed, 32 insertions(+), 33 deletions(-) diff --git a/examples/computer/Computer.gf b/examples/computer/Computer.gf index 5138b09b7..1460d47e9 100644 --- a/examples/computer/Computer.gf +++ b/examples/computer/Computer.gf @@ -123,7 +123,7 @@ flags startcat = Text ; fun TextS : S -> Text ; -- with . TextQS : QS -> Text ; -- with ? - TextImp : VP -> Text ; -- with ! +-- TextImp : VP -> Text ; -- with ! ComplV2 : V2 -> NP -> VP ; ModCN : AP -> CN -> CN ; diff --git a/lib/doc/synopsis.html b/lib/doc/synopsis.html index da954b648..1a8de2748 100644 --- a/lib/doc/synopsis.html +++ b/lib/doc/synopsis.html @@ -3774,7 +3774,7 @@ source N -de muis-muisen, with some predictable exceptions +de muis, muisen, with some predictable exceptions mkN @@ -5326,7 +5326,7 @@ source N -de muis-muisen, with some predictable exceptions +de muis-muizen, with some predictable exceptions mkN diff --git a/lib/src/german/CatGer.gf b/lib/src/german/CatGer.gf index cbbd84825..7dd5f7ce4 100644 --- a/lib/src/german/CatGer.gf +++ b/lib/src/german/CatGer.gf @@ -38,7 +38,7 @@ concrete CatGer of Cat = -- Verb VP = ResGer.VP ; - VPSlash = ResGer.VP ** {c2 : Preposition} ; + VPSlash = ResGer.VPSlash ; Comp = {s : Agr => Str} ; -- Adjective diff --git a/lib/src/german/ExtraGer.gf b/lib/src/german/ExtraGer.gf index bf30f15e6..f49f27e80 100644 --- a/lib/src/german/ExtraGer.gf +++ b/lib/src/german/ExtraGer.gf @@ -84,8 +84,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** subj = [] ; verb = vps.s ! ord ! agr ! VPFinite m t a ; neg = vp.a1 ! b ; - obj0 = vp.n0 ! agr ; - obj = vp.n2 ! agr ; + obj0 = (vp.nn ! agr).p1 ; + obj = (vp.nn ! agr).p2 ; compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5 inf = vp.inf ++ verb.inf ; extra = vp.ext ; diff --git a/lib/src/german/ResGer.gf b/lib/src/german/ResGer.gf index 423179239..9fc9ec722 100644 --- a/lib/src/german/ResGer.gf +++ b/lib/src/german/ResGer.gf @@ -438,12 +438,11 @@ resource ResGer = ParamX ** open Prelude in { VP : Type = { s : Verb ; - a1 : Polarity => Str ; -- nicht - n0 : Agr => Str ; -- dich - n2 : Agr => Str ; -- deine Frau - a2 : Str ; -- heute - isAux : Bool ; -- is a double infinitive - inf : Str ; -- sagen + a1 : Polarity => Str ; -- nicht + nn : Agr => Str * Str ; -- dich/deine Frau + a2 : Str ; -- heute + isAux : Bool ; -- is a double infinitive + inf : Str ; -- sagen ext : Str ; -- dass sie kommt infExt : Str } ; @@ -514,11 +513,10 @@ resource ResGer = ParamX ** open Prelude in { } ; a1 : Polarity => Str = negation ; - n0 : Agr => Str = case verb.vtype of { - VAct => \\_ => [] ; - VRefl c => \\a => reflPron ! a ! c + nn : Agr => Str * Str = case verb.vtype of { + VAct => \\_ => <[],[]> ; + VRefl c => \\a => } ; - n2 : Agr => Str = \\_ => [] ; a2 : Str = [] ; isAux = isAux ; ---- inf,ext,infExt : Str = [] @@ -580,6 +578,8 @@ resource ResGer = ParamX ** open Prelude in { Neg => "nicht" } ; + VPSlash = VP ** {c2 : Preposition} ; + -- Extending a verb phrase with new constituents. insertObj : (Agr => Str) -> VP -> VP = insertObjNP False ; @@ -587,8 +587,12 @@ resource ResGer = ParamX ** open Prelude in { insertObjNP : Bool -> (Agr => Str) -> VP -> VP = \isPron, obj,vp -> { s = vp.s ; a1 = vp.a1 ; - n0 = \\a => case isPron of {True => obj ! a ; _ => []} ++ vp.n0 ! a ; - n2 = \\a => case isPron of {False => obj ! a ; _ => []} ++ vp.n2 ! a ; + nn = \\a => + let vpnn = vp.nn ! a in + case isPron of { + True => ; + False => < vpnn.p1, obj ! a ++ vpnn.p2> + } ; a2 = vp.a2 ; isAux = vp.isAux ; inf = vp.inf ; @@ -599,8 +603,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 ; + nn = vp.nn ; a2 = vp.a2 ; isAux = vp.isAux ; inf = vp.inf ; @@ -611,8 +614,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 ; + nn = vp.nn ; a2 = vp.a2 ++ adv ; isAux = vp.isAux ; inf = vp.inf ; @@ -623,8 +625,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 ; + nn = vp.nn ; a2 = vp.a2 ; isAux = vp.isAux ; inf = vp.inf ; @@ -635,8 +636,7 @@ resource ResGer = ParamX ** open Prelude in { insertInfExt : Str -> VP -> VP = \infExt,vp -> { s = vp.s ; a1 = vp.a1 ; - n0 = vp.n0 ; - n2 = vp.n2 ; + nn = vp.nn ; a2 = vp.a2 ; isAux = vp.isAux ; inf = vp.inf ; @@ -647,8 +647,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 ; + nn = vp.nn ; a2 = vp.a2 ; isAux = vp.isAux ; ---- inf = inf ++ vp.inf ; @@ -672,8 +671,8 @@ 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 ; + obj0 = (vp.nn ! agr).p1 ; + obj = (vp.nn ! agr).p2 ; compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5 inf = vp.inf ++ verb.inf ; extra = vp.ext ; @@ -712,7 +711,7 @@ resource ResGer = ParamX ** open Prelude in { infVP : Bool -> VP -> ((Agr => Str) * Str * Str * Str) = \isAux, vp -> let vps = useVP vp in < - \\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2, + \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ vp.a2, vp.a1 ! Pos ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, vp.inf, vp.ext diff --git a/lib/src/german/SentenceGer.gf b/lib/src/german/SentenceGer.gf index 5d9517162..1268bb672 100644 --- a/lib/src/german/SentenceGer.gf +++ b/lib/src/german/SentenceGer.gf @@ -20,7 +20,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { inf = vp.inf ++ verb.inf ; in verb.fin ++ ps.p2 ++ - vp.n0 ! agr ++ vp.a1 ! pol ++ vp.n2 ! agr ++ vp.a2 ++ inf ++ vp.ext + (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ (vp.nn ! agr).p2 ++ vp.a2 ++ inf ++ vp.ext } ; SlashVP np vp = diff --git a/src/www/gfmorpho/README b/src/www/gfmorpho/README index 2090bb5d3..cb120040e 100644 --- a/src/www/gfmorpho/README +++ b/src/www/gfmorpho/README @@ -14,7 +14,7 @@ The resulting output is converted into an HTML table. The file gfmorpho.html gives some more information. Open issues in addition to those mentioned there are: - GFMorpho.hs creates the temporary files _gfcommand.tmp and _gfmorpho.tmp which need to be world-writable; they should be created more properly and removed after use -- gfmorpho.cgi defines the variable GF_LIB_PATH to reside in /Users/aarne, and must be edited for other environments +- gfmorpho.cgi defines the variable GF_LIB_PATH to reside in /home/aarne, and must be edited for other environments - to work for all languages mentioned, one has to compile some incomplete GF grammars not standardly compiled: GF/lib/src$ runghc Make alltenses lang langs=Amh,Ara,Lat,Mlt,Tur