mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 01:52:50 -06:00
German extraposition
This commit is contained in:
@@ -19,7 +19,8 @@ concrete CatGer of Cat = open ResGer, Prelude in {
|
|||||||
|
|
||||||
VP = ResGer.VP ;
|
VP = ResGer.VP ;
|
||||||
V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ;
|
V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ;
|
||||||
V2, VV, V2A = Verb ** {c2 : Preposition} ;
|
VV = Verb ** {part : Str} ;
|
||||||
|
V2, V2A = Verb ** {c2 : Preposition} ;
|
||||||
V3 = Verb ** {c2, c3 : Preposition} ;
|
V3 = Verb ** {c2, c3 : Preposition} ;
|
||||||
|
|
||||||
AP = {s : AForm => Str ; isPre : Bool} ;
|
AP = {s : AForm => Str ; isPre : Bool} ;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ concrete LexGer of Lex = CatGer ** open ResGer, Prelude in {
|
|||||||
{c2 = {s = [] ; c = Dat}} ;
|
{c2 = {s = [] ; c = Dat}} ;
|
||||||
show_V3 = regV "zeigen" **
|
show_V3 = regV "zeigen" **
|
||||||
{c2 = {s = [] ; c = Acc} ; c3 = {s = [] ; c = Dat}} ;
|
{c2 = {s = [] ; c = Acc} ; c3 = {s = [] ; c = Dat}} ;
|
||||||
-- want_VV = regV "want" ** {c2 = "to"} ;
|
want_VV = auxVV wollen_V ;
|
||||||
claim_VS = no_geV (regV "behaupten") ;
|
claim_VS = no_geV (regV "behaupten") ;
|
||||||
ask_VQ = regV "fragen" ;
|
ask_VQ = regV "fragen" ;
|
||||||
|
|
||||||
|
|||||||
@@ -365,11 +365,25 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
aux = VSein
|
aux = VSein
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
wollen_V : Verb =
|
||||||
|
let
|
||||||
|
wollen = mkV "wollen" "will" "woll" "wollte" "wollte" "gewollen" VHaben
|
||||||
|
in
|
||||||
|
{s = table {
|
||||||
|
VPresInd Sg P1 => "will" ;
|
||||||
|
VPresInd Sg P2 => "willst" ;
|
||||||
|
v => wollen.s ! v
|
||||||
|
} ;
|
||||||
|
aux = VHaben
|
||||||
|
} ;
|
||||||
|
|
||||||
negation : Polarity => Str = table {
|
negation : Polarity => Str = table {
|
||||||
Pos => [] ;
|
Pos => [] ;
|
||||||
Neg => "nicht"
|
Neg => "nicht"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
auxVV : Verb -> Verb ** {part : Str} = \v -> v ** {part = []} ;
|
||||||
|
|
||||||
-- Extending a verb phrase with new constituents.
|
-- Extending a verb phrase with new constituents.
|
||||||
|
|
||||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||||
@@ -388,6 +402,32 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
ext = vp.ext
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
insertExtrapos : Str -> VP -> VP = \ext,vp -> {
|
||||||
|
s = vp.s ;
|
||||||
|
a1 = vp.a1 ;
|
||||||
|
n2 = vp.n2 ;
|
||||||
|
a2 = vp.a2 ;
|
||||||
|
ext = vp.ext ++ ext
|
||||||
|
} ;
|
||||||
|
|
||||||
|
s = \\a => table {
|
||||||
|
VPFinite t Anter => case t of {
|
||||||
|
Pres | Past => vf (hat t a) vpart ;
|
||||||
|
Fut => vf (wird a) (vpart ++ haben) ;
|
||||||
|
Cond => vf (wuerde a) (vpart ++ haben)
|
||||||
|
} ;
|
||||||
|
VPImperat => vf (verb.s ! VImper a.n) [] ;
|
||||||
|
VPInfinit Simul => vf [] vinf ;
|
||||||
|
VPInfinit Anter => vf [] (vpart ++ haben)
|
||||||
|
} ;
|
||||||
|
a1 : Polarity => Str = negation ;
|
||||||
|
n2 : Agr => Str = \\_ => [] ;
|
||||||
|
a2 : Str = [] ;
|
||||||
|
ext : Str = []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- For $Sentence$.
|
-- For $Sentence$.
|
||||||
|
|
||||||
Clause : Type = {
|
Clause : Type = {
|
||||||
@@ -399,166 +439,29 @@ resource ResGer = ParamGer ** open Prelude in {
|
|||||||
let
|
let
|
||||||
verb = vp.s ! agr ! VPFinite t a ;
|
verb = vp.s ! agr ! VPFinite t a ;
|
||||||
neg = vp.a1 ! b ;
|
neg = vp.a1 ! b ;
|
||||||
obj = vp.n2 ! agr ++ vp.a2 ++ vp.ext ;
|
obj = vp.n2 ! agr ++ vp.a2 ;
|
||||||
compl = neg ++ obj ++ verb.inf ;
|
compl = neg ++ obj ++ verb.inf ;
|
||||||
|
extra = vp.ext ;
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ verb.fin ++ compl ;
|
Main => subj ++ verb.fin ++ compl ++ extra ;
|
||||||
Inv => verb.fin ++ subj ++ compl ;
|
Inv => verb.fin ++ subj ++ compl ++ extra ;
|
||||||
Sub => subj ++ compl ++ verb.fin
|
Sub => subj ++ compl ++ verb.fin ++ extra
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
conjThat : Str = "daß" ;
|
||||||
|
|
||||||
|
reflPron : Agr => Str = table {
|
||||||
|
{n = Sg ; p = P1} => "mich" ;
|
||||||
|
{n = Sg ; p = P2} => "dich" ;
|
||||||
|
{n = Sg ; p = P3} => "sich" ; --
|
||||||
|
{n = Pl ; p = P1} => "uns" ;
|
||||||
|
{n = Pl ; p = P2} => "euch" ;
|
||||||
|
{n = Pl ; p = P3} => "sich"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- VerbForms : Type =
|
|
||||||
-- Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ;
|
|
||||||
--
|
|
||||||
-- VP : Type = {
|
|
||||||
-- s : VerbForms ;
|
|
||||||
-- s2 : Agr => Str
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- predV : Verb -> VP = \verb -> {
|
|
||||||
-- s = \\t,ant,b,ord,agr =>
|
|
||||||
-- let
|
|
||||||
-- inf = verb.s ! VInf ;
|
|
||||||
-- fin = presVerb verb agr ;
|
|
||||||
-- past = verb.s ! VPast ;
|
|
||||||
-- part = verb.s ! VPPart ;
|
|
||||||
-- vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
|
||||||
-- {fin = x ; inf = y} ;
|
|
||||||
-- in
|
|
||||||
-- case <t,ant,b,ord> of {
|
|
||||||
-- <Pres,Simul,Pos,ODir> => vf fin [] ;
|
|
||||||
-- <Pres,Simul,Pos,OQuest> => vf (does agr) inf ;
|
|
||||||
-- <Pres,Simul,Neg,_> => vf (doesnt agr) inf ;
|
|
||||||
-- <Pres,Anter,Pos,_> => vf (have agr) part ;
|
|
||||||
-- <Pres,Anter,Neg,_> => vf (havent agr) part ;
|
|
||||||
-- <Past,Simul,Pos,ODir> => vf past [] ;
|
|
||||||
-- <Past,Simul,Pos,OQuest> => vf "did" inf ;
|
|
||||||
-- <Past,Simul,Neg,_> => vf "didn't" inf ;
|
|
||||||
-- <Past,Anter,Pos,_> => vf "had" part ;
|
|
||||||
-- <Past,Anter,Neg,_> => vf "hadn't" part ;
|
|
||||||
-- <Fut, Simul,Pos,_> => vf "will" inf ;
|
|
||||||
-- <Fut, Simul,Neg,_> => vf "won't" inf ;
|
|
||||||
-- <Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ;
|
|
||||||
-- <Fut, Anter,Neg,_> => vf "won't" ("have" ++ part) ;
|
|
||||||
-- <Cond,Simul,Pos,_> => vf "would" inf ;
|
|
||||||
-- <Cond,Simul,Neg,_> => vf "wouldn't" inf ;
|
|
||||||
-- <Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
|
|
||||||
-- <Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
|
|
||||||
-- } ;
|
|
||||||
-- s2 = \\_ => []
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- predAux : Aux -> VP = \verb -> {
|
|
||||||
-- s = \\t,ant,b,ord,agr =>
|
|
||||||
-- let
|
|
||||||
-- inf = verb.inf ;
|
|
||||||
-- fin = verb.pres ! b ! agr ;
|
|
||||||
-- past = verb.past ! b ! agr ;
|
|
||||||
-- part = verb.ppart ;
|
|
||||||
-- vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
|
||||||
-- {fin = x ; inf = y} ;
|
|
||||||
-- in
|
|
||||||
-- case <t,ant,b,ord> of {
|
|
||||||
-- <Pres,Simul,_, _> => vf fin [] ;
|
|
||||||
-- <Pres,Anter,Pos,_> => vf (have agr) part ;
|
|
||||||
-- <Pres,Anter,Neg,_> => vf (havent agr) part ;
|
|
||||||
-- <Past,Simul,_, _> => vf past [] ;
|
|
||||||
-- <Past,Anter,Pos,_> => vf "had" part ;
|
|
||||||
-- <Past,Anter,Neg,_> => vf "hadn't" part ;
|
|
||||||
-- <Fut, Simul,Pos,_> => vf "will" inf ;
|
|
||||||
-- <Fut, Simul,Neg,_> => vf "won't" inf ;
|
|
||||||
-- <Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ;
|
|
||||||
-- <Fut, Anter,Neg,_> => vf "won't" ("have" ++ part) ;
|
|
||||||
-- <Cond,Simul,Pos,_> => vf "would" inf ;
|
|
||||||
-- <Cond,Simul,Neg,_> => vf "wouldn't" inf ;
|
|
||||||
-- <Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
|
|
||||||
-- <Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
|
|
||||||
-- } ;
|
|
||||||
-- s2 = \\_ => []
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
|
||||||
-- s = vp.s ;
|
|
||||||
-- s2 = \\a => vp.s2 ! a ++ obj ! a
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
--- This is not functional.
|
|
||||||
--
|
|
||||||
-- insertAdV : Str -> VP -> VP = \adv,vp -> {
|
|
||||||
-- s = vp.s ;
|
|
||||||
-- s2 = vp.s2
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
|
||||||
-- agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
|
||||||
--
|
|
||||||
-- infVP : VP -> Agr -> Str = \vp,a ->
|
|
||||||
-- (vp.s ! Fut ! Simul ! Neg ! ODir ! a).inf ++ vp.s2 ! a ;
|
|
||||||
--
|
|
||||||
-- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
|
||||||
-- case agr of {
|
|
||||||
-- {n = Sg ; p = P3} => has ;
|
|
||||||
-- _ => have
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- have = agrVerb "has" "have" ;
|
|
||||||
-- havent = agrVerb "hasn't" "haven't" ;
|
|
||||||
-- does = agrVerb "does" "do" ;
|
|
||||||
-- doesnt = agrVerb "doesn't" "don't" ;
|
|
||||||
--
|
|
||||||
-- Aux = {pres,past : Polarity => Agr => Str ; inf,ppart : Str} ;
|
|
||||||
--
|
|
||||||
-- auxBe : Aux = {
|
|
||||||
-- pres = \\b,a => case <b,a> of {
|
|
||||||
-- <Pos,{n = Sg ; p = P1}> => "am" ;
|
|
||||||
-- <Neg,{n = Sg ; p = P1}> => ["am not"] ; --- am not I
|
|
||||||
-- _ => agrVerb (posneg b "is") (posneg b "are") a
|
|
||||||
-- } ;
|
|
||||||
-- past = \\b,a => agrVerb (posneg b "was") (posneg b "were") a ;
|
|
||||||
-- inf = "be" ;
|
|
||||||
-- ppart = "been"
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- posneg : Polarity -> Str -> Str = \p,s -> case p of {
|
|
||||||
-- Pos => s ;
|
|
||||||
-- Neg => s + "n't"
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- conjThat : Str = "that" ;
|
|
||||||
--
|
|
||||||
-- reflPron : Agr => Str = table {
|
|
||||||
-- {n = Sg ; p = P1} => "myself" ;
|
|
||||||
-- {n = Sg ; p = P2} => "yourself" ;
|
|
||||||
-- {n = Sg ; p = P3} => "itself" ; --
|
|
||||||
-- {n = Pl ; p = P1} => "ourselves" ;
|
|
||||||
-- {n = Pl ; p = P2} => "yourselves" ;
|
|
||||||
-- {n = Pl ; p = P3} => "themselves"
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- For $Sentence$.
|
|
||||||
--
|
|
||||||
-- Clause : Type = {
|
|
||||||
-- s : Tense => Anteriority => Polarity => Order => Str
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- mkClause : Str -> Agr -> VP -> Clause =
|
|
||||||
-- \subj,agr,vp -> {
|
|
||||||
-- s = \\t,a,b,o =>
|
|
||||||
-- let
|
|
||||||
-- verb = vp.s ! t ! a ! b ! o ! agr ;
|
|
||||||
-- compl = vp.s2 ! agr
|
|
||||||
-- in
|
|
||||||
-- case o of {
|
|
||||||
-- ODir => subj ++ verb.fin ++ verb.inf ++ compl ;
|
|
||||||
-- OQuest => verb.fin ++ subj ++ verb.inf ++ compl
|
|
||||||
-- }
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- For $Numeral$.
|
-- For $Numeral$.
|
||||||
--
|
--
|
||||||
-- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
-- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ concrete VerbGer of Verb = CatGer ** open ResGer in {
|
|||||||
ComplV3 v np np2 =
|
ComplV3 v np np2 =
|
||||||
insertObj (\\_ => appPrep v.c2 np.s ++ appPrep v.c3 np2.s) (predV v) ;
|
insertObj (\\_ => appPrep v.c2 np.s ++ appPrep v.c3 np2.s) (predV v) ;
|
||||||
|
|
||||||
-- ComplVV v vp = insertObj (\\a => v.c2 ++ infVP vp a) (predV v) ;
|
ComplVV v vp =
|
||||||
-- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
insertObj (\\a => v.part ++ (vp.s ! a ! VPInfinit Simul).inf) (predV v) ;
|
||||||
|
ComplVS v s =
|
||||||
|
insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ;
|
||||||
|
|
||||||
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
-- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
||||||
--
|
--
|
||||||
-- ComplVA v ap = insertObj (ap.s) (predV v) ;
|
-- ComplVA v ap = insertObj (ap.s) (predV v) ;
|
||||||
|
|||||||
@@ -57,10 +57,20 @@ add flags optimize=all_subs to this module:
|
|||||||
VerbGer: UseComp, Comp*
|
VerbGer: UseComp, Comp*
|
||||||
> p -cat=Cl -mcfg "ich bin ein Hund" | l -table
|
> p -cat=Cl -mcfg "ich bin ein Hund" | l -table
|
||||||
|
|
||||||
|
> vg
|
||||||
vg
|
|
||||||
(see complex figure)
|
(see complex figure)
|
||||||
i english/TestEng.gf
|
> i english/TestEng.gf
|
||||||
vg
|
> vg
|
||||||
(see complex symmetric figure)
|
(see complex symmetric figure)
|
||||||
|
|
||||||
|
ResGer: wollen_V, auxVV, insertExtrapos
|
||||||
|
VerbGer: ComplVS
|
||||||
|
> p -cat=Cl -mcfg "ich behaupte daß wir gehen" | l -table
|
||||||
|
(gets OK with proper extrapos)
|
||||||
|
VerbGer: ComplVV
|
||||||
|
= insertObj (\\a => v.part ++ (vp.s ! a ! VPInfinit Simul).inf) (predV v) ;
|
||||||
|
> p -cat=Cl "ich will gehen" | l -table
|
||||||
|
Pres Anter Pos Main : ich habe gehen gewollen
|
||||||
|
Pres Anter Pos Inv : habe ich gehen gewollen
|
||||||
|
Pres Anter Pos Sub : ich gehen gewollen habe
|
||||||
|
(Thus "double infinitives" don't get right.)
|
||||||
|
|||||||
Reference in New Issue
Block a user