1
0
forked from GitHub/gf-core

German conjunctive

This commit is contained in:
aarne
2007-03-20 15:30:02 +00:00
parent 0eac3f6b58
commit 6f2bf05b0f
12 changed files with 140 additions and 81 deletions

View File

@@ -1,4 +1,6 @@
concrete CatGer of Cat = CommonX ** open ResGer, Prelude in { concrete CatGer of Cat =
CommonX - [Tense,TPres,TPast,TFut,TCond] **
open ResGer, Prelude in {
flags optimize=all_subs ; flags optimize=all_subs ;
@@ -12,21 +14,21 @@ concrete CatGer of Cat = CommonX ** open ResGer, Prelude in {
-- Sentence -- Sentence
Cl = {s : Tense => Anteriority => Polarity => Order => Str} ; Cl = {s : Mood => Tense => Anteriority => Polarity => Order => Str} ;
Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** Slash = {s : Mood => Tense => Anteriority => Polarity => Order => Str} **
{c2 : Preposition} ; {c2 : Preposition} ;
Imp = {s : Polarity => ImpForm => Str} ; Imp = {s : Polarity => ImpForm => Str} ;
-- Question -- Question
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; QCl = {s : Mood => Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Case => Str ; n : Number} ; IP = {s : Case => Str ; n : Number} ;
IComp = {s : Agr => Str} ; IComp = {s : Agr => Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ; IDet = {s : Gender => Case => Str ; n : Number} ;
-- Relative -- Relative
RCl = {s : Tense => Anteriority => Polarity => GenNum => Str ; c : Case} ; RCl = {s : Mood => Tense => Anteriority => Polarity => GenNum => Str ; c : Case} ;
RP = {s : GenNum => Case => Str ; a : RAgr} ; RP = {s : GenNum => Case => Str ; a : RAgr} ;
-- Verb -- Verb
@@ -76,4 +78,13 @@ concrete CatGer of Cat = CommonX ** open ResGer, Prelude in {
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ; N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ;
PN = {s : Case => Str} ; PN = {s : Case => Str} ;
-- tense with possibility to choose conjunctive forms
Tense = {s : Str ; t : Tense ; m : Mood} ;
lin
TPres = {s = [] ; t = Pres ; m = MIndic} ;
TPast = {s = [] ; t = Past ; m = MIndic} ; --# notpresent
TFut = {s = [] ; t = Fut ; m = MIndic} ; --# notpresent
TCond = {s = [] ; t = Cond ; m = MIndic} ; --# notpresent
} }

View File

@@ -1,5 +1,5 @@
concrete ExtraGer of ExtraGerAbs = CatGer ** concrete ExtraGer of ExtraGerAbs = CatGer **
open ResGer, Coordination, Prelude in { open ResGer, Coordination, Prelude, IrregGer in {
lincat lincat
VPI = {s : Bool => Str} ; VPI = {s : Bool => Str} ;
@@ -21,4 +21,14 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
predVGen v.isAux v))) ; predVGen v.isAux v))) ;
-} -}
PPzuAdv cn = {s = case cn.g of {
Masc | Neutr => "zum" ;
Fem => "zur"
} ++ cn.s ! adjfCase Weak Dat ! Sg ! Dat
} ;
TImpfSubj = {s = [] ; t = Past ; m = MConjunct} ; --# notpresent
moegen_VV = auxVV mögen_V ;
} }

View File

@@ -1,4 +1,11 @@
abstract ExtraGerAbs = Extra [ abstract ExtraGerAbs = Extra [
VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI
] ** { ] ** {
fun
PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche
TImpfSubj : Tense ; -- ich möchte... --# notpresent
moegen_VV : VV ; -- ich mag/möchte singen
} }

View File

@@ -11,7 +11,7 @@ concrete GrammarGer of Grammar =
RelativeGer, RelativeGer,
ConjunctionGer, ConjunctionGer,
PhraseGer, PhraseGer,
TextX, TextX - [Tense,TPres,TPast,TFut,TCond],
IdiomGer, IdiomGer,
StructuralGer StructuralGer
** { ** {

View File

@@ -22,9 +22,10 @@ concrete IdiomGer of Idiom = CatGer **
(predV geben)) ; (predV geben)) ;
ExistIP ip = { ExistIP ip = {
s = \\t,a,p => s = \\m,t,a,p =>
let let
cls = (mkClause "es" (agrP3 Sg) (predV geben)).s ! t ! a ! p ; cls =
(mkClause "es" (agrP3 Sg) (predV geben)).s ! m ! t ! a ! p ;
who = ip.s ! Acc who = ip.s ! Acc
in table { in table {
QDir => who ++ cls ! Inv ; QDir => who ++ cls ! Inv ;
@@ -35,7 +36,8 @@ concrete IdiomGer of Idiom = CatGer **
ProgrVP = insertAdv "eben" ; ---- ProgrVP = insertAdv "eben" ; ----
ImpPl1 vp = {s = ImpPl1 vp = {s =
(mkClause "wir" {g = Fem ; n = Pl ; p = P1} vp).s ! Pres ! Simul ! Pos ! Inv (mkClause "wir" {g = Fem ; n = Pl ; p = P1} vp).s !
MConjunct ! Pres ! Simul ! Pos ! Inv
} ; } ;
oper oper

View File

@@ -94,7 +94,12 @@ in {
lin melken_V = irregV "melken" (variants {"melkt" ; "milkt"}) (variants {"melkte" ; "molk"}) "gemolken" "gemelkt" ; lin melken_V = irregV "melken" (variants {"melkt" ; "milkt"}) (variants {"melkte" ; "molk"}) "gemolken" "gemelkt" ;
lin messen_V = irregV "messen" "mißt" "maß" "mäße" "gemessen" ; lin messen_V = irregV "messen" "mißt" "maß" "mäße" "gemessen" ;
lin mißlingen_V = irregV "mißlingen" "mißlingt" "mißlang" "mißlungen" "mißlänge" ; lin mißlingen_V = irregV "mißlingen" "mißlingt" "mißlang" "mißlungen" "mißlänge" ;
lin mögen_V = irregV "mögen" "mag" "mochte" "möchte" "gemocht" ; lin mögen_V = M.mkV
"mögen" "mag" "magst" "mag" "mögt" "mög"
"mochte" "mochtest" "mochten" "mochtet"
"möchte" "gemocht" []
M.VHaben ** {lock_V = <>} ;
lin müssen_V = irregV "müssen" "muß" "mußte" "müßte" "gemußt" ; lin müssen_V = irregV "müssen" "muß" "mußte" "müßte" "gemußt" ;
lin nehmen_V = mkV "nehmen" "nimmt" "nimm" "nahm" "nähme" "genommen" ; lin nehmen_V = mkV "nehmen" "nimmt" "nimm" "nahm" "nähme" "genommen" ;
lin nennen_V = irregV "nennen" "nennt" "nannte" "nennte" "genannt" ; lin nennen_V = irregV "nennen" "nennt" "nannte" "nennte" "genannt" ;

View File

@@ -354,31 +354,8 @@ oper
in in
mkV singen singt sing sang saenge gesungen ; mkV singen singt sing sang saenge gesungen ;
prefixV p v = prefixV p v = MorphoGer.prefixV p v ** {lock_V = v.lock_V} ;
let
vs = v.s ;
v1 = MorphoGer.mkV
(vs ! (VInf False))
(vs ! (VFin False (VPresInd Sg P1)))
(vs ! (VFin False (VPresInd Sg P2)))
(vs ! (VFin False (VPresInd Sg P3)))
(vs ! (VFin False (VPresInd Pl P2)))
(vs ! VImper Sg)
(vs ! (VFin False (VImpfInd Sg P1)))
(vs ! (VFin False (VImpfInd Sg P2)))
(vs ! (VFin False (VImpfInd Pl P1)))
(vs ! (VFin False (VImpfInd Pl P2)))
(vs ! (VFin False (VImpfSubj Sg P2)))
(vs ! VPastPart APred)
p
v.aux
in {
s = v1.s ;
prefix = p ;
lock_V = v.lock_V ;
aux = v.aux ;
vtype = v.vtype
} ;
habenV v = habenV v =
{s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = v.vtype} ; {s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = v.vtype} ;
seinV v = seinV v =

View File

@@ -5,8 +5,8 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
lin lin
QuestCl cl = { QuestCl cl = {
s = \\t,a,p => s = \\m,t,a,p =>
let cls = cl.s ! t ! a ! p let cls = cl.s ! m ! t ! a ! p
in table { in table {
QDir => cls ! Inv ; QDir => cls ! Inv ;
QIndir => "ob" ++ cls ! Sub QIndir => "ob" ++ cls ! Sub
@@ -14,9 +14,9 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
} ; } ;
QuestVP qp vp = { QuestVP qp vp = {
s = \\t,a,b,q => s = \\m,t,a,b,q =>
let let
cl = (mkClause (qp.s ! Nom) (agrP3 qp.n) vp).s ! t ! a ! b cl = (mkClause (qp.s ! Nom) (agrP3 qp.n) vp).s ! m ! t ! a ! b
in in
case q of { case q of {
QIndir => cl ! Sub ; QIndir => cl ! Sub ;
@@ -25,9 +25,9 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
} ; } ;
QuestSlash ip slash = { QuestSlash ip slash = {
s = \\t,a,p => s = \\m,t,a,p =>
let let
cls = slash.s ! t ! a ! p ; cls = slash.s ! m ! t ! a ! p ;
who = appPrep slash.c2 ip.s who = appPrep slash.c2 ip.s
in table { in table {
QDir => who ++ cls ! Inv ; QDir => who ++ cls ! Inv ;
@@ -36,9 +36,9 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
} ; } ;
QuestIAdv iadv cl = { QuestIAdv iadv cl = {
s = \\t,a,p => s = \\m,t,a,p =>
let let
cls = cl.s ! t ! a ! p ; cls = cl.s ! m ! t ! a ! p ;
why = iadv.s why = iadv.s
in table { in table {
QDir => why ++ cls ! Inv ; QDir => why ++ cls ! Inv ;
@@ -47,10 +47,10 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
} ; } ;
QuestIComp icomp np = { QuestIComp icomp np = {
s = \\t,a,p => s = \\m,t,a,p =>
let let
vp = predV sein_V ; vp = predV sein_V ;
cls = (mkClause (np.s ! Nom) np.a vp).s ! t ! a ! p ; cls = (mkClause (np.s ! Nom) np.a vp).s ! m ! t ! a ! p ;
why = icomp.s ! np.a why = icomp.s ! np.a
in table { in table {
QDir => why ++ cls ! Inv ; QDir => why ++ cls ! Inv ;

View File

@@ -5,12 +5,12 @@ concrete RelativeGer of Relative = CatGer ** open ResGer in {
lin lin
RelCl cl = { RelCl cl = {
s = \\t,a,b,_ => "derart" ++ conjThat ++ cl.s ! t ! a ! b ! Sub ; s = \\m,t,a,b,_ => "derart" ++ conjThat ++ cl.s ! m ! t ! a ! b ! Sub ;
c = Nom c = Nom
} ; } ;
RelVP rp vp = { RelVP rp vp = {
s = \\t,ant,b,gn => s = \\m,t,ant,b,gn =>
let let
agr = case rp.a of { agr = case rp.a of {
RNoAg => agrP3 (numGenNum gn) ; RNoAg => agrP3 (numGenNum gn) ;
@@ -18,13 +18,13 @@ concrete RelativeGer of Relative = CatGer ** open ResGer in {
} ; } ;
cl = mkClause (rp.s ! gn ! Nom) agr vp cl = mkClause (rp.s ! gn ! Nom) agr vp
in in
cl.s ! t ! ant ! b ! Sub ; cl.s ! m ! t ! ant ! b ! Sub ;
c = Nom c = Nom
} ; } ;
RelSlash rp slash = { RelSlash rp slash = {
s = \\t,a,p,gn => s = \\m,t,a,p,gn =>
appPrep slash.c2 (rp.s ! gn) ++ slash.s ! t ! a ! p ! Sub ; appPrep slash.c2 (rp.s ! gn) ++ slash.s ! m ! t ! a ! p ! Sub ;
c = slash.c2.c c = slash.c2.c
} ; } ;

View File

@@ -62,7 +62,7 @@ resource ResGer = ParamX ** open Prelude in {
; ;
param VPForm = param VPForm =
VPFinite Tense Anteriority VPFinite Mood Tense Anteriority
| VPImperat Bool | VPImperat Bool
| VPInfinit Anteriority ; | VPInfinit Anteriority ;
@@ -76,6 +76,10 @@ resource ResGer = ParamX ** open Prelude in {
param param
Order = Main | Inv | Sub ; Order = Main | Inv | Sub ;
-- Main clause mood: "es sei, es wäre, es werde sein".
-- Not relevant for $Fut$. ---
Mood = MIndic | MConjunct ;
--2 For $Relative$ --2 For $Relative$
@@ -133,10 +137,12 @@ resource ResGer = ParamX ** open Prelude in {
_ => Weak _ => Weak
} ; } ;
vFin : Bool -> Tense -> Agr -> VForm = \b,t,a -> vFin : Bool -> Mood -> Tense -> Agr -> VForm = \b,m,t,a ->
case t of { case <t,m> of {
Pres => VFin b (VPresInd a.n a.p) ; <Pres,MIndic> => VFin b (VPresInd a.n a.p) ;
Past => VFin b (VImpfInd a.n a.p) ; --# notpresent <Pres,MConjunct> => VFin b (VPresSubj a.n a.p) ;
<Past,MIndic> => VFin b (VImpfInd a.n a.p) ; --# notpresent
<Past,MConjunct> => VFin b (VImpfSubj a.n a.p) ; --# notpresent
_ => VInf False --- never used _ => VInf False --- never used
} ; } ;
@@ -203,8 +209,9 @@ resource ResGer = ParamX ** open Prelude in {
} ; } ;
mkV : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Str -> VAux -> Verb = mkV : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Str -> VAux -> Verb =
\geben,gebe,gibst,gibt,gebt,gib,gab,gabst,gaben, \geben,gebe,gibst,gibt,gebt,gib,
gabt,gaebe,gegeben,ein,aux -> gab,gabst,gaben,gabt,
gaebe,gegeben,ein,aux ->
let let
einb : Bool -> Str -> Str = \b,geb -> einb : Bool -> Str -> Str = \b,geb ->
if_then_Str b (ein + geb) geb ; if_then_Str b (ein + geb) geb ;
@@ -242,6 +249,30 @@ resource ResGer = ParamX ** open Prelude in {
vtype = VAct vtype = VAct
} ; } ;
-- To add a prefix (like "ein") to an already existing verb.
prefixV : Str -> Verb -> Verb = \ein,verb ->
let
vs = verb.s ;
geben = vs ! VInf False ;
einb : Bool -> Str -> Str = \b,geb ->
if_then_Str b (ein + geb) geb ;
in
{s = table {
VInf False => ein + geben ;
VInf True =>
if_then_Str (isNil ein) ("zu" ++ geben) (ein + "zu" + geben) ;
VFin b vf => einb b (vs ! VFin b vf) ;
VImper n => vs ! VImper n ;
VPresPart a => ein + (regA (geben + "d")).s ! Posit ! a ;
VPastPart a => ein + vs ! VPastPart a
} ;
prefix = ein ;
aux = verb.aux ;
vtype = verb.vtype
} ;
-- These functions cover many regular cases; full coverage inflectional patterns are -- These functions cover many regular cases; full coverage inflectional patterns are
-- defined in $MorphoGer$. -- defined in $MorphoGer$.
@@ -353,16 +384,20 @@ resource ResGer = ParamX ** open Prelude in {
predVGen : Bool -> Verb -> VP = \isAux, verb -> predVGen : Bool -> Verb -> VP = \isAux, verb ->
let let
vfin : Bool -> Tense -> Agr -> Str = \b,t,a -> verb.s ! vFin b t a ; vfin : Bool -> Mood -> Tense -> Agr -> Str = \b,m,t,a ->
verb.s ! vFin b m t a ;
vinf = verb.s ! VInf False ; vinf = verb.s ! VInf False ;
vpart = if_then_Str isAux vinf (verb.s ! VPastPart APred) ; vpart = if_then_Str isAux vinf (verb.s ! VPastPart APred) ;
vHaben = auxPerfect verb ; vHaben = auxPerfect verb ;
hat : Tense -> Agr -> Str = \t,a -> vHaben ! vFin False t a ; hat : Mood -> Tense -> Agr -> Str = \m,t,a ->
vHaben ! vFin False m t a ;
haben : Str = vHaben ! VInf False ; haben : Str = vHaben ! VInf False ;
wird : Agr -> Str = \a -> wird : Mood -> Agr -> Str = \m,a -> case m of {
werden_V.s ! VFin False (VPresInd a.n a.p) ; MIndic => werden_V.s ! VFin False (VPresInd a.n a.p) ;
MConjunct => werden_V.s ! VFin False (VPresSubj a.n a.p)
} ;
wuerde : Agr -> Str = \a -> --# notpresent wuerde : Agr -> Str = \a -> --# notpresent
werden_V.s ! VFin False (VImpfSubj a.n a.p) ; --# notpresent werden_V.s ! VFin False (VImpfSubj a.n a.p) ; --# notpresent
@@ -375,16 +410,16 @@ resource ResGer = ParamX ** open Prelude in {
in { in {
s = \\b,a => table { s = \\b,a => table {
VPFinite t Simul => case t of { VPFinite m t Simul => case t of {
-- Pres | Past => vf (vfin t a) [] ; -- the general rule -- Pres | Past => vf (vfin m t a) [] ; -- the general rule
Past => vf b (vfin b t a) [] ; --# notpresent Past => vf b (vfin b m t a) [] ; --# notpresent
Fut => vf True (wird a) vinf ; --# notpresent Fut => vf True (wird m a) vinf ; --# notpresent
Cond => vf True (wuerde a) vinf ; --# notpresent Cond => vf True (wuerde a) vinf ; --# notpresent
Pres => vf b (vfin b t a) [] Pres => vf b (vfin b m t a) []
} ; } ;
VPFinite t Anter => case t of { --# notpresent VPFinite m t Anter => case t of { --# notpresent
Pres | Past => vf True (hat t a) vpart ; --# notpresent Pres | Past => vf True (hat m t a) vpart ; --# notpresent
Fut => vf True (wird a) (vpart ++ haben) ; --# notpresent Fut => vf True (wird m a) (vpart ++ haben) ; --# notpresent
Cond => vf True (wuerde a) (vpart ++ haben) --# notpresent Cond => vf True (wuerde a) (vpart ++ haben) --# notpresent
} ; --# notpresent } ; --# notpresent
VPImperat False => vf False (verb.s ! VImper a.n) [] ; VPImperat False => vf False (verb.s ! VImper a.n) [] ;
@@ -513,28 +548,28 @@ resource ResGer = ParamX ** open Prelude in {
-- For $Sentence$. -- For $Sentence$.
Clause : Type = { Clause : Type = {
s : Tense => Anteriority => Polarity => Order => Str s : Mood => Tense => Anteriority => Polarity => Order => Str
} ; } ;
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> {
s = \\t,a,b,o => s = \\m,t,a,b,o =>
let let
ord = case o of { ord = case o of {
Sub => True ; -- glue prefix to verb Sub => True ; -- glue prefix to verb
_ => False _ => False
} ; } ;
verb = vp.s ! ord ! agr ! VPFinite t a ; verb = vp.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ; neg = vp.a1 ! b ;
obj = vp.n2 ! agr ; obj = vp.n2 ! agr ;
compl = obj ++ neg ++ vp.a2 ; compl = obj ++ neg ++ vp.a2 ;
inf = vp.inf ++ verb.inf ; inf = vp.inf ++ verb.inf ;
extra = vp.ext ; extra = vp.ext ;
inffin = inffin =
case <a,vp.isAux> of { --# notpresent case <a,vp.isAux> of { --# notpresent
<Anter,True> => verb.fin ++ inf ; -- double infinitive --# notpresent <Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
_ => --# notpresent _ => --# notpresent
inf ++ verb.fin --- or just auxiliary vp inf ++ verb.fin --- or just auxiliary vp
} --# notpresent } --# notpresent
in in
case o of { case o of {
Main => subj ++ verb.fin ++ compl ++ inf ++ extra ; Main => subj ++ verb.fin ++ compl ++ inf ++ extra ;

View File

@@ -33,7 +33,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
{c2 = v2.c2} ; {c2 = v2.c2} ;
AdvSlash slash adv = { AdvSlash slash adv = {
s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
c2 = slash.c2 c2 = slash.c2
} ; } ;
@@ -43,10 +43,14 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
EmbedQS qs = {s = qs.s ! QIndir} ; EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = useInfVP False vp} ; EmbedVP vp = {s = useInfVP False vp} ;
UseCl t a p cl = {s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o} ; UseCl t a p cl = {
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ; s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! o
} ;
UseQCl t a p cl = {
s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! q
} ;
UseRCl t a p cl = { UseRCl t a p cl = {
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ; s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.m ! t.t ! a.a ! p.p ! r ;
c = cl.c c = cl.c
} ; } ;

View File

@@ -287,3 +287,11 @@ in the resource grammar version 1.0.
When adding polite imperatives, have to change the lincat of Imp: ImpForm instead When adding polite imperatives, have to change the lincat of Imp: ImpForm instead
of Number. But the required inflections exist already. of Number. But the required inflections exist already.
--------------
20/3/2007
Spent half a day adding prefix gluing to the morphology and also
making conjunctive forms accessible as top-level tenses. These facilities
were requested by Nadine Perera writing a paper with me.