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 ;
@@ -12,21 +14,21 @@ concrete CatGer of Cat = CommonX ** open ResGer, Prelude in {
-- Sentence
Cl = {s : Tense => Anteriority => Polarity => Order => Str} ;
Slash = {s : Tense => Anteriority => Polarity => Order => Str} **
Cl = {s : Mood => Tense => Anteriority => Polarity => Order => Str} ;
Slash = {s : Mood => Tense => Anteriority => Polarity => Order => Str} **
{c2 : Preposition} ;
Imp = {s : Polarity => ImpForm => Str} ;
-- Question
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
QCl = {s : Mood => Tense => Anteriority => Polarity => QForm => Str} ;
IP = {s : Case => Str ; n : Number} ;
IComp = {s : Agr => Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ;
-- 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} ;
-- Verb
@@ -76,4 +78,13 @@ concrete CatGer of Cat = CommonX ** open ResGer, Prelude in {
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ;
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 **
open ResGer, Coordination, Prelude in {
open ResGer, Coordination, Prelude, IrregGer in {
lincat
VPI = {s : Bool => Str} ;
@@ -21,4 +21,14 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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 [
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,
ConjunctionGer,
PhraseGer,
TextX,
TextX - [Tense,TPres,TPast,TFut,TCond],
IdiomGer,
StructuralGer
** {

View File

@@ -22,9 +22,10 @@ concrete IdiomGer of Idiom = CatGer **
(predV geben)) ;
ExistIP ip = {
s = \\t,a,p =>
s = \\m,t,a,p =>
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
in table {
QDir => who ++ cls ! Inv ;
@@ -35,7 +36,8 @@ concrete IdiomGer of Idiom = CatGer **
ProgrVP = insertAdv "eben" ; ----
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

View File

@@ -94,7 +94,12 @@ in {
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 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 nehmen_V = mkV "nehmen" "nimmt" "nimm" "nahm" "nähme" "genommen" ;
lin nennen_V = irregV "nennen" "nennt" "nannte" "nennte" "genannt" ;

View File

@@ -354,31 +354,8 @@ oper
in
mkV singen singt sing sang saenge gesungen ;
prefixV p 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
} ;
prefixV p v = MorphoGer.prefixV p v ** {lock_V = v.lock_V} ;
habenV v =
{s = v.s ; prefix = v.prefix ; lock_V = v.lock_V ; aux = VHaben ; vtype = v.vtype} ;
seinV v =

View File

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

View File

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

View File

@@ -62,7 +62,7 @@ resource ResGer = ParamX ** open Prelude in {
;
param VPForm =
VPFinite Tense Anteriority
VPFinite Mood Tense Anteriority
| VPImperat Bool
| VPInfinit Anteriority ;
@@ -76,6 +76,10 @@ resource ResGer = ParamX ** open Prelude in {
param
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$
@@ -133,10 +137,12 @@ resource ResGer = ParamX ** open Prelude in {
_ => Weak
} ;
vFin : Bool -> Tense -> Agr -> VForm = \b,t,a ->
case t of {
Pres => VFin b (VPresInd a.n a.p) ;
Past => VFin b (VImpfInd a.n a.p) ; --# notpresent
vFin : Bool -> Mood -> Tense -> Agr -> VForm = \b,m,t,a ->
case <t,m> of {
<Pres,MIndic> => VFin b (VPresInd a.n a.p) ;
<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
} ;
@@ -203,8 +209,9 @@ resource ResGer = ParamX ** open Prelude in {
} ;
mkV : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> Str -> VAux -> Verb =
\geben,gebe,gibst,gibt,gebt,gib,gab,gabst,gaben,
gabt,gaebe,gegeben,ein,aux ->
\geben,gebe,gibst,gibt,gebt,gib,
gab,gabst,gaben,gabt,
gaebe,gegeben,ein,aux ->
let
einb : Bool -> Str -> Str = \b,geb ->
if_then_Str b (ein + geb) geb ;
@@ -242,6 +249,30 @@ resource ResGer = ParamX ** open Prelude in {
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
-- defined in $MorphoGer$.
@@ -353,16 +384,20 @@ resource ResGer = ParamX ** open Prelude in {
predVGen : Bool -> Verb -> VP = \isAux, verb ->
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 ;
vpart = if_then_Str isAux vinf (verb.s ! VPastPart APred) ;
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 ;
wird : Agr -> Str = \a ->
werden_V.s ! VFin False (VPresInd a.n a.p) ;
wird : Mood -> Agr -> Str = \m,a -> case m of {
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
werden_V.s ! VFin False (VImpfSubj a.n a.p) ; --# notpresent
@@ -375,16 +410,16 @@ resource ResGer = ParamX ** open Prelude in {
in {
s = \\b,a => table {
VPFinite t Simul => case t of {
-- Pres | Past => vf (vfin t a) [] ; -- the general rule
Past => vf b (vfin b t a) [] ; --# notpresent
Fut => vf True (wird a) vinf ; --# notpresent
VPFinite m t Simul => case t of {
-- Pres | Past => vf (vfin m t a) [] ; -- the general rule
Past => vf b (vfin b m t a) [] ; --# notpresent
Fut => vf True (wird m 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
Pres | Past => vf True (hat t a) vpart ; --# notpresent
Fut => vf True (wird a) (vpart ++ haben) ; --# notpresent
VPFinite m t Anter => case t of { --# notpresent
Pres | Past => vf True (hat m t a) vpart ; --# notpresent
Fut => vf True (wird m a) (vpart ++ haben) ; --# notpresent
Cond => vf True (wuerde a) (vpart ++ haben) --# notpresent
} ; --# notpresent
VPImperat False => vf False (verb.s ! VImper a.n) [] ;
@@ -513,28 +548,28 @@ resource ResGer = ParamX ** open Prelude in {
-- For $Sentence$.
Clause : Type = {
s : Tense => Anteriority => Polarity => Order => Str
s : Mood => Tense => Anteriority => Polarity => Order => Str
} ;
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> {
s = \\t,a,b,o =>
s = \\m,t,a,b,o =>
let
ord = case o of {
Sub => True ; -- glue prefix to verb
_ => False
} ;
verb = vp.s ! ord ! agr ! VPFinite t a ;
verb = vp.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ;
obj = vp.n2 ! agr ;
compl = obj ++ neg ++ vp.a2 ;
inf = vp.inf ++ verb.inf ;
extra = vp.ext ;
inffin =
case <a,vp.isAux> of { --# notpresent
<Anter,True> => verb.fin ++ inf ; -- double infinitive --# notpresent
_ => --# notpresent
case <a,vp.isAux> of { --# notpresent
<Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
_ => --# notpresent
inf ++ verb.fin --- or just auxiliary vp
} --# notpresent
} --# notpresent
in
case o of {
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} ;
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
} ;
@@ -43,10 +43,14 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
EmbedQS qs = {s = qs.s ! QIndir} ;
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} ;
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ;
UseCl t a p cl = {
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 = {
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
} ;

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
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.