1
0
forked from GitHub/gf-core

refactoring German VP

This commit is contained in:
aarne
2012-09-23 07:46:43 +00:00
parent 539856de26
commit c8ac4a9551
7 changed files with 32 additions and 33 deletions

View File

@@ -123,7 +123,7 @@ flags startcat = Text ;
fun fun
TextS : S -> Text ; -- with . TextS : S -> Text ; -- with .
TextQS : QS -> Text ; -- with ? TextQS : QS -> Text ; -- with ?
TextImp : VP -> Text ; -- with ! -- TextImp : VP -> Text ; -- with !
ComplV2 : V2 -> NP -> VP ; ComplV2 : V2 -> NP -> VP ;
ModCN : AP -> CN -> CN ; ModCN : AP -> CN -> CN ;

View File

@@ -3774,7 +3774,7 @@ source <A HREF="http://www.grammaticalframework.org/lib/src/afrikaans/ParadigmsA
<TR> <TR>
<TD><CODE>mkN</CODE></TD> <TD><CODE>mkN</CODE></TD>
<TD><CODE>(muis</CODE> <CODE>:</CODE> <CODE>Str)</CODE> <CODE>-&gt;</CODE> <A HREF="#N" TITLE="N - common noun">N</A></TD> <TD><CODE>(muis</CODE> <CODE>:</CODE> <CODE>Str)</CODE> <CODE>-&gt;</CODE> <A HREF="#N" TITLE="N - common noun">N</A></TD>
<TD><I>de muis-muisen, with some predictable exceptions</I></TD> <TD><I>de muis, muisen, with some predictable exceptions</I></TD>
</TR> </TR>
<TR> <TR>
<TD><CODE>mkN</CODE></TD> <TD><CODE>mkN</CODE></TD>
@@ -5326,7 +5326,7 @@ source <A HREF="http://www.grammaticalframework.org/lib/src/dutch/ParadigmsDut.g
<TR> <TR>
<TD><CODE>mkN</CODE></TD> <TD><CODE>mkN</CODE></TD>
<TD><CODE>(muis</CODE> <CODE>:</CODE> <CODE>Str)</CODE> <CODE>-&gt;</CODE> <A HREF="#N" TITLE="N - common noun">N</A></TD> <TD><CODE>(muis</CODE> <CODE>:</CODE> <CODE>Str)</CODE> <CODE>-&gt;</CODE> <A HREF="#N" TITLE="N - common noun">N</A></TD>
<TD><I>de muis-muisen, with some predictable exceptions</I></TD> <TD><I>de muis-muizen, with some predictable exceptions</I></TD>
</TR> </TR>
<TR> <TR>
<TD><CODE>mkN</CODE></TD> <TD><CODE>mkN</CODE></TD>

View File

@@ -38,7 +38,7 @@ concrete CatGer of Cat =
-- Verb -- Verb
VP = ResGer.VP ; VP = ResGer.VP ;
VPSlash = ResGer.VP ** {c2 : Preposition} ; VPSlash = ResGer.VPSlash ;
Comp = {s : Agr => Str} ; Comp = {s : Agr => Str} ;
-- Adjective -- Adjective

View File

@@ -84,8 +84,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
subj = [] ; subj = [] ;
verb = vps.s ! ord ! agr ! VPFinite m t a ; verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ; neg = vp.a1 ! b ;
obj0 = vp.n0 ! agr ; obj0 = (vp.nn ! agr).p1 ;
obj = vp.n2 ! agr ; obj = (vp.nn ! agr).p2 ;
compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5 compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
inf = vp.inf ++ verb.inf ; inf = vp.inf ++ verb.inf ;
extra = vp.ext ; extra = vp.ext ;

View File

@@ -439,8 +439,7 @@ resource ResGer = ParamX ** open Prelude in {
VP : Type = { VP : Type = {
s : Verb ; s : Verb ;
a1 : Polarity => Str ; -- nicht a1 : Polarity => Str ; -- nicht
n0 : Agr => Str ; -- dich nn : Agr => Str * Str ; -- dich/deine Frau
n2 : Agr => Str ; -- deine Frau
a2 : Str ; -- heute a2 : Str ; -- heute
isAux : Bool ; -- is a double infinitive isAux : Bool ; -- is a double infinitive
inf : Str ; -- sagen inf : Str ; -- sagen
@@ -514,11 +513,10 @@ resource ResGer = ParamX ** open Prelude in {
} ; } ;
a1 : Polarity => Str = negation ; a1 : Polarity => Str = negation ;
n0 : Agr => Str = case verb.vtype of { nn : Agr => Str * Str = case verb.vtype of {
VAct => \\_ => [] ; VAct => \\_ => <[],[]> ;
VRefl c => \\a => reflPron ! a ! c VRefl c => \\a => <reflPron ! a ! c,[]>
} ; } ;
n2 : Agr => Str = \\_ => [] ;
a2 : Str = [] ; a2 : Str = [] ;
isAux = isAux ; ---- isAux = isAux ; ----
inf,ext,infExt : Str = [] inf,ext,infExt : Str = []
@@ -580,6 +578,8 @@ resource ResGer = ParamX ** open Prelude in {
Neg => "nicht" Neg => "nicht"
} ; } ;
VPSlash = VP ** {c2 : Preposition} ;
-- Extending a verb phrase with new constituents. -- Extending a verb phrase with new constituents.
insertObj : (Agr => Str) -> VP -> VP = insertObjNP False ; 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 -> { insertObjNP : Bool -> (Agr => Str) -> VP -> VP = \isPron, obj,vp -> {
s = vp.s ; s = vp.s ;
a1 = vp.a1 ; a1 = vp.a1 ;
n0 = \\a => case isPron of {True => obj ! a ; _ => []} ++ vp.n0 ! a ; nn = \\a =>
n2 = \\a => case isPron of {False => obj ! a ; _ => []} ++ vp.n2 ! a ; let vpnn = vp.nn ! a in
case isPron of {
True => <obj ! a ++ vpnn.p1, vpnn.p2> ;
False => < vpnn.p1, obj ! a ++ vpnn.p2>
} ;
a2 = vp.a2 ; a2 = vp.a2 ;
isAux = vp.isAux ; isAux = vp.isAux ;
inf = vp.inf ; inf = vp.inf ;
@@ -599,8 +603,7 @@ resource ResGer = ParamX ** open Prelude in {
insertAdV : Str -> VP -> VP = \adv,vp -> { insertAdV : Str -> VP -> VP = \adv,vp -> {
s = vp.s ; s = vp.s ;
a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht
n0 = vp.n0 ; nn = vp.nn ;
n2 = vp.n2 ;
a2 = vp.a2 ; a2 = vp.a2 ;
isAux = vp.isAux ; isAux = vp.isAux ;
inf = vp.inf ; inf = vp.inf ;
@@ -611,8 +614,7 @@ resource ResGer = ParamX ** open Prelude in {
insertAdv : Str -> VP -> VP = \adv,vp -> { insertAdv : Str -> VP -> VP = \adv,vp -> {
s = vp.s ; s = vp.s ;
a1 = vp.a1 ; a1 = vp.a1 ;
n0 = vp.n0 ; nn = vp.nn ;
n2 = vp.n2 ;
a2 = vp.a2 ++ adv ; a2 = vp.a2 ++ adv ;
isAux = vp.isAux ; isAux = vp.isAux ;
inf = vp.inf ; inf = vp.inf ;
@@ -623,8 +625,7 @@ resource ResGer = ParamX ** open Prelude in {
insertExtrapos : Str -> VP -> VP = \ext,vp -> { insertExtrapos : Str -> VP -> VP = \ext,vp -> {
s = vp.s ; s = vp.s ;
a1 = vp.a1 ; a1 = vp.a1 ;
n0 = vp.n0 ; nn = vp.nn ;
n2 = vp.n2 ;
a2 = vp.a2 ; a2 = vp.a2 ;
isAux = vp.isAux ; isAux = vp.isAux ;
inf = vp.inf ; inf = vp.inf ;
@@ -635,8 +636,7 @@ resource ResGer = ParamX ** open Prelude in {
insertInfExt : Str -> VP -> VP = \infExt,vp -> { insertInfExt : Str -> VP -> VP = \infExt,vp -> {
s = vp.s ; s = vp.s ;
a1 = vp.a1 ; a1 = vp.a1 ;
n0 = vp.n0 ; nn = vp.nn ;
n2 = vp.n2 ;
a2 = vp.a2 ; a2 = vp.a2 ;
isAux = vp.isAux ; isAux = vp.isAux ;
inf = vp.inf ; inf = vp.inf ;
@@ -647,8 +647,7 @@ resource ResGer = ParamX ** open Prelude in {
insertInf : Str -> VP -> VP = \inf,vp -> { insertInf : Str -> VP -> VP = \inf,vp -> {
s = vp.s ; s = vp.s ;
a1 = vp.a1 ; a1 = vp.a1 ;
n0 = vp.n0 ; nn = vp.nn ;
n2 = vp.n2 ;
a2 = vp.a2 ; a2 = vp.a2 ;
isAux = vp.isAux ; ---- isAux = vp.isAux ; ----
inf = inf ++ vp.inf ; inf = inf ++ vp.inf ;
@@ -672,8 +671,8 @@ resource ResGer = ParamX ** open Prelude in {
} ; } ;
verb = vps.s ! ord ! agr ! VPFinite m t a ; verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ; neg = vp.a1 ! b ;
obj0 = vp.n0 ! agr ; obj0 = (vp.nn ! agr).p1 ;
obj = vp.n2 ! agr ; obj = (vp.nn ! agr).p2 ;
compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5 compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
inf = vp.inf ++ verb.inf ; inf = vp.inf ++ verb.inf ;
extra = vp.ext ; 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 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.a1 ! Pos ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf,
vp.inf, vp.inf,
vp.ext vp.ext

View File

@@ -20,7 +20,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
inf = vp.inf ++ verb.inf ; inf = vp.inf ++ verb.inf ;
in in
verb.fin ++ ps.p2 ++ 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 = SlashVP np vp =

View File

@@ -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: 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.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: - 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 GF/lib/src$ runghc Make alltenses lang langs=Amh,Ara,Lat,Mlt,Tur