1
0
forked from GitHub/gf-rgl

Ger: improved infinitives (and passives); tests with more verbs in testing/german

- NP: added field isLight in order to push negation behind light nps;
  this had been done in gf-3.9 using field isPron, but isPron is now
  used to put accusative pronoun before dative pronoun. Removed field
  adv: adverbial extensions cannot be extracted (todo: also for CN).
  Reduced isLight*isPron to w:Weight with 3 values: WPron, WLight, WHeavy.

- added param Control and field ctrl:Control to classify V2V-verbs into
  subject- and object-contol verbs, use ctrl to make reflexives agree
  with subject resp. object in VPSlash, and refine ComplSlash.

- Verb: new versions of ComplVV, SlashV2V and SlashVV to give better
  (nested) infinitives (extracting infzu and correcting object order).
  a) nested SlashVV doesn't work properly;
  b) SlashV2VNP may have to be commented out to prevent a stack overflow
     when compiling.
  Intended change of SlashV2VNP in tests/german/TestLangGer could not
  be tested due to size problems with the compiler.

- VP: changed field a1 : Polarity => Str to a1:Str to collect the adverbs
  coming before negation, using (negation : Polarity => Str) in mkClause.
  Use objCtrl:Bool instead of missingAdv to let reflexives agree with object.

- ResGer: insertObjNP reorganized, infzuVP added

- DictVerbsGer: some corrections (helft -> hilft, *sprecht -> *spricht)

- Some potential passive rules in tests/german/TestLangGer|Eng

- ExtraGer needs to be cleaned up with repect to the modified mkClause.
This commit is contained in:
Hans Leiss
2019-09-18 15:16:42 +02:00
parent ef0549053e
commit 8fb8ddd808
31 changed files with 1580 additions and 264 deletions

View File

@@ -89,7 +89,7 @@ concrete CatGer of Cat =
V, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
VV = Verb ** {isAux : Bool} ;
V2, VA, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
V2V = Verb ** {c2 : Preposition ; isAux : Bool} ;
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; ctrl : Control} ;
V3 = Verb ** {c2, c3 : Preposition} ;
A = {s : Degree => AForm => Str} ;
@@ -106,7 +106,7 @@ concrete CatGer of Cat =
Tense = {s : Str ; t : ResGer.Tense ; m : Mood} ;
linref
NP = \np -> np.s!(NPC Nom) ++ np.adv ++ np.ext ++ np.rc ; -- HL 6/2019
NP = \np -> np.s!(NPC Nom) ++ np.ext ++ np.rc ; -- HL 6/2019
CN = \cn -> cn.s ! Strong ! Pl ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Pl ;
SSlash = \ss -> ss.s ! Main ++ ss.c2.s ;

View File

@@ -16980,7 +16980,7 @@ lin
heldin_N = mkN "Heldin" "Heldinnen" feminine ;
heldisch_A = mk3A "heldisch" "heldischer" "heldischste" ;
helena_N = mkN "Helena" "Helenas" feminine ;
helfen_V = irregV "helfen" "helft" "half" "hälfe" "geholfen" ;
helfen_V = irregV "helfen" "hilft" "half" "hälfe" "geholfen" ;
helfensteiner_N = mkN "Helfensteiner" "Helfensteiner" masculine ;
helfer_N = mkN "Helfer" "Helfer" masculine ;
helferlein_N = mkN "Helferlein" "Helferlein" neuter ;
@@ -26112,7 +26112,7 @@ lin
nachgruebeln_V = prefixV "nach" (regV "grübeln") ;
nachhaken_5_V = prefixV "nach" (regV "haken") ;
nachhaltig_A = mk3A "nachhaltig" "nachhaltiger" "nachhaltigste" ;
nachhelfen_6_V = prefixV "nach" (irregV "helfen" "helft" "half" "hälfe" "geholfen") ;
nachhelfen_6_V = prefixV "nach" (irregV "helfen" "hilft" "half" "hälfe" "geholfen") ;
nachher_Adv = mkAdv "nachher" ;
nachhilfe_N = mkN "Nachhilfe" "Nachhilfen" feminine ;
nachhut_N = mkN "Nachhut" "Nachhuten" feminine ;

View File

@@ -1032,8 +1032,8 @@ lin
aussortieren_V2 = dirV2 (prefixV "aus" (regV "sortieren")) ;
ausspeichern_V2 = dirV2 (prefixV "aus" (regV "speichern")) ;
ausspionieren_V2 = dirV2 (prefixV "aus" (regV "spionieren")) ;
aussprechen_V2 = dirV2 (prefixV "aus" (irregV "sprechen" "sprecht" "sprach" "spräche" "gesprochen")) ;
aussprechen_VS = mkVS (prefixV "aus" (irregV "sprechen" "sprecht" "sprach" "spräche" "gesprochen")) ;
aussprechen_V2 = dirV2 (prefixV "aus" (irregV "sprechen" "spricht" "sprach" "spräche" "gesprochen")) ;
aussprechen_VS = mkVS (prefixV "aus" (irregV "sprechen" "spricht" "sprach" "spräche" "gesprochen")) ;
ausspucken_vor_V2 = prepV2 (prefixV "aus" (regV "spucken")) (mkPrep "vor" dative) ;
ausspucken_V = prefixV "aus" (regV "spucken") ;
ausstatten_mit_V3 = dirV3 (prefixV "aus" (regV "statten")) mit_Prep ;
@@ -1358,8 +1358,8 @@ lin
besorgen_dat_V3 = accdatV3 (regV "besorgen") ;
besorgen_V2 = dirV2 (regV "besorgen") ;
bespassen_V2 = dirV2 (regV "bespaßen") ;
besprechen_mit_V3 = dirV3 (irregV "besprechen" "besprecht" "besprach" "bespräche" "besprochen") mit_Prep ;
besprechen_plV2 = pldirV2 (irregV "besprechen" "besprecht" "besprach" "bespräche" "besprochen") ;
besprechen_mit_V3 = dirV3 (irregV "besprechen" "bespricht" "besprach" "bespräche" "besprochen") mit_Prep ;
besprechen_plV2 = pldirV2 (irregV "besprechen" "bespricht" "besprach" "bespräche" "besprochen") ;
bespruehen_mit_V3 = dirV3 (regV "besprühen") mit_Prep ;
bespruehen_V2 = dirV2 (regV "besprühen") ;
besseren_rV = reflV (regV "besseren") accusative ;
@@ -2146,8 +2146,8 @@ lin
entsichern_V2 = dirV2 (irregV "entsichern" "entsichert" "entsicherte" "entsicherte" "entsichert") ;
entsorgen_V2 = dirV2 (irregV "entsorgen" "entsorgt" "entsorgte" "entsorgte" "entsorgt") ;
entspannen_rV = reflV (irregV "entspannen" "entspannt" "entspannte" "entspannte" "entspannt") accusative ;
entsprechen_dat_V2 = mkV2 (irregV "entsprechen" "entsprecht" "entsprach" "entspräche" "entsprochen") datPrep ;
entsprechen_rcV = reciV (irregV "entsprechen" "entsprecht" "entsprach" "entspräche" "entsprochen") dative ;
entsprechen_dat_V2 = mkV2 (irregV "entsprechen" "entspricht" "entsprach" "entspräche" "entsprochen") datPrep ;
entsprechen_rcV = reciV (irregV "entsprechen" "entspricht" "entsprach" "entspräche" "entsprochen") dative ;
entspringen_loc_V2 = prepV2 (irregV "entspringen" "entspringt" "entsprang" "entspränge" "entsprungen") loc_Prep ;
entstaatlichen_V2 = dirV2 (irregV "entstaatlichen" "entstaatlicht" "entstaatlichte" "entstaatlichte" "entstaatlicht") ;
entstammen_gen_V2 = mkV2 (irregV "entstammen" "entstammt" "entstammte" "entstammte" "entstammt") genPrep ;
@@ -3019,8 +3019,8 @@ lin
heissen_V3 = dirV3 (irregV "heißen" "heißt" "hieß" "hieße" "geheißen") accPrep ;
heizen_V2 = dirV2 (regV "heizen") ;
heizen_V = regV "heizen" ;
helfen_dat_V2V = mkV2V (irregV "helfen" "hilft" "half" "hälfe" "geholfen") datPrep ;
helfen_dat_bei_V3 = mkV3 (irregV "helfen" "hilft" "half" "hülfe" "geholfen") datPrep bei_Prep ;
-- helfen_V = irregV "helfen" "helft" "half" "hälfe" "geholfen" ;
hellen_es_esV = esV (regV "hellen") ;
hellenisieren_V2 = dirV2 (regV "hellenisieren") ;
hemmen_sV2 = dassV2 (regV "hemmen") accPrep ;
@@ -4142,8 +4142,8 @@ lin
nachgruebeln_ueber_V2 = prepV2 (prefixV "nach" (regV "grübeln")) (mkPrep "über" dative) ;
nachhaken_bei_V2 = prepV2 (prefixV "nach" (regV "haken")) bei_Prep ;
nachhaken_V = prefixV "nach" (regV "haken") ;
nachhelfen_dat_V2 = mkV2 (prefixV "nach" (irregV "helfen" "helft" "half" "hälfe" "geholfen")) datPrep ;
nachhelfen_dat_V2V = mkV2V (prefixV "nach" (irregV "helfen" "helft" "half" "hälfe" "geholfen")) datPrep ;
nachhelfen_dat_V2 = mkV2 (prefixV "nach" (irregV "helfen" "hilft" "half" "hälfe" "geholfen")) datPrep ;
nachhelfen_dat_V2V = mkV2V (prefixV "nach" (irregV "helfen" "hilft" "half" "hälfe" "geholfen")) datPrep ;
nachkarten_V = prefixV "nach" (regV "karten") ;
nachlassen_dat_V3 = accdatV3 (prefixV "nach" (irregV "lassen" "lasst" "ließ" "ließe" "gelassen")) ;
nachlassen_im_V2 = prepV2 (prefixV "nach" (irregV "lassen" "lasst" "ließ" "ließe" "gelassen")) (mkPrep "in" dative) ;
@@ -6492,7 +6492,7 @@ lin
verspielen_rV = reflV (irregV "verspielen" "verspielt" "verspielte" "verspielte" "verspielt") accusative ;
verspielen_V2 = dirV2 (irregV "verspielen" "verspielt" "verspielte" "verspielte" "verspielt") ;
verspotten_V2 = dirV2 (irregV "verspotten" "verspottet" "verspottete" "verspotte" "verspottet") ;
versprechen_dat_V2V = mkV2V (irregV "versprechen" "versprecht" "versprach" "verspräche" "versprochen") datPrep ;
versprechen_dat_V2V = mkV2V (irregV "versprechen" "verspricht" "versprach" "verspräche" "versprochen") datPrep ;
versprengen_V2 = dirV2 (irregV "versprengen" "versprengt" "versprengte" "versprengte" "versprengt") ;
verspueren_V2 = dirV2 (irregV "verspüren" "verspürt" "verspürte" "verspürte" "verspürt") ;
verstaatlichen_V2 = dirV2 (irregV "verstaatlichen" "verstaatlicht" "verstaatlichte" "verstaatlichte" "verstaatlicht") ;

View File

@@ -2882,6 +2882,7 @@ fun
heissen_V3 : V3 ;
heizen_V2 : V2 ;
heizen_V : V ;
helfen_dat_V2V : V2V ;
helfen_dat_bei_V3 : V3 ;
hellen_es_esV : V ;
hellenisieren_V2 : V2 ;

View File

@@ -13,7 +13,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
ConjVPI = conjunctDistrTable Bool ;
ComplVPIVV v vpi =
insertInf (vpi.s ! v.isAux) (
-- insertInf (vpi.s ! v.isAux) (
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
predVGen v.isAux v) ; ----
{-
insertExtrapos vpi.p3 (
@@ -42,15 +43,19 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
DetNPMasc det = {
s = \\c => det.sp ! Masc ! c ; ---- genders
a = agrP3 det.n ;
isPron = False ;
ext, adv, rc = []
-- isPron = False ;
-- isLight = True ;
w = WLight ;
ext, rc = []
} ;
DetNPFem det = {
s = \\c => det.sp ! Fem ! c ; ---- genders
a = agrP3 det.n ;
isPron = False ;
ext, adv, rc = []
-- isPron = False ;
-- isLight = True ;
w = WLight ;
ext, rc = []
} ;
EmptyRelSlash slash = {
@@ -63,7 +68,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
PassVPSlash vp =
let c = case <vp.c2.c,vp.c2.isPrep> of {
<NPC Acc,False> => NPC Nom ;
_ => vp.c2.c}
_ => vp.c2.c}
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
{subjc = vp.c2 ** {c= c}} ;
-- regulates passivised object: accusative objects -> nom; all others: same case
@@ -73,8 +78,12 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
Pass3V3 v = -- HL 7/19
let bekommenPass : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen")
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) ** { subjc = PrepNom ; c2 = v.c2 } ;
PastPartAP vp = {
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ vp.inf ++
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ vp.inf.s ++
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
@@ -85,7 +94,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
let agent = appPrepNP P.von_Prep np
in {
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ agent ++
vp.inf ++
vp.inf.s ++
vp.c2.s ++ --- junk if not TV
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
isPre = True ;
@@ -129,7 +138,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
m = tm.m ;
subj = [] ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = tm.s ++ p.s ++ vp.a1 ! b ;
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
-- obj1 = (vp.nn ! agr).p1 ;
-- obj = (vp.nn ! agr).p2 ;
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
@@ -137,19 +146,19 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
inf = vp.inf ++ verb.inf ++ verb.inf2 ;
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
extra = vp.ext ;
infE : Str = -- HL 30/6/2019
case <t,a,vp.isAux> of {
<Fut|Cond,Simul,True> => inf ; --# notpresent
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
=> verb.inf2 ++ vp.inf ++ verb.inf ; --# notpresent
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
<_,Anter,True> => inf ; --# notpresent
_ => verb.inf ++ verb.inf2 ++ vp.inf } ;
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
inffin : Str =
case <t,a,vp.isAux> of {
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
=> verb.fin ++ verb.inf2 ++ vp.inf ++ verb.inf ; --# notpresent
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
<_,Anter,True> --# notpresent
=> verb.fin ++ inf ; -- double inf --# notpresent
_ => inf ++ verb.fin --- or just auxiliary vp
@@ -204,8 +213,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
lin
EsVV vv vp = predV vv ** {
nn = \\a => let n = vp.nn ! a in <"es" ++ n.p1 , n.p2 , n.p3, n.p4> ;
inf = vp.s.s ! (VInf True) ++ vp.inf ; -- ich genieße es zu versuchen zu gehen; alternative word order could be produced by vp.inf ++ vp.s.s... (zu gehen zu versuchen)
nn = \\a => let n = vp.nn ! a in <"es" ++ n.p1, n.p2, n.p3, n.p4, n.p5, n.p6> ;
inf = vp.inf ** {s = vp.s.s ! (VInf True) ++ vp.inf.s} ; -- ich genieße es zu versuchen zu gehen; alternative word order could be produced by vp.inf ++ vp.s.s... (zu gehen zu versuchen)
a1 = vp.a1 ;
a2 = vp.a2 ;
ext = vp.ext ;
@@ -213,7 +222,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
adj = vp.adj } ;
EsV2A v2a ap s = predV v2a ** {
nn = \\_ => <"es",[],[],[]> ;
nn = \\_ => <"es",[],[],[],[],[]> ;
adj = ap.s ! APred ;
ext = "," ++ "dass" ++ s.s ! Sub} ;
@@ -228,7 +237,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
let vp = predV werdenPass ;
in vp ** {
subj = esSubj ;
inf = v.s ! VPastPart APred } ; -- construct the formal clause
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
@@ -244,9 +253,12 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
esSubj : NP = lin NP {
s = \\_ => "es" ;
rc, ext, adv = [] ;
rc, ext = [] ;
a = Ag Neutr Sg P3 ;
isPron = True} ;
-- isLight = True ;
-- isPron = True
w = WPron
} ;
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
let vps = useVP vp in {
@@ -257,11 +269,11 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
_ => False
} ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ;
neg = vp.a1 ++ negation ! b ; -- HL 8/19 vp.a1 ! b ;
obj1 = (vp.nn ! agr).p1 ;
obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ;
compl = obj1 ++ neg ++ vp.adj ++ obj2 ++ vp.a2 ; -- adj added
inf = vp.inf ++ verb.inf ; -- not used for linearisation of Main/Inv
inf = vp.inf.s ++ verb.inf ; -- not used for linearisation of Main/Inv
extra = vp.ext ;
inffin : Str =
case <a,vp.isAux> of {
@@ -270,8 +282,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
}
in
case o of {
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf ;
Inv => verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf ;
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
Inv => verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
Sub => compl ++ vp.infExt ++ inffin ++ extra }
} ;

View File

@@ -26,4 +26,5 @@ abstract ExtraGerAbs = Extra [
AdvFor : Adv -> FClause -> FClause ; -- es wird heute gelacht - addition of adverbs
FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc.
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
}

View File

@@ -20,10 +20,12 @@ oper
mkPrep : Str -> PCase -> Preposition = \s,c ->
{s = s ; s2 = [] ; c = c ; isPrep = True} ;
nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ; isPron : Bool ; ext,adv,rc : Str} = \name -> heavyNP {
nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ;
-- isLight, isPron : Bool ;
w : Weight ;
ext,rc : Str} = \name -> heavyNP {
s = \\c => usePrepC c (\k -> name.s ! k) ;
a = agrP3 Sg ;
ext, adv, rc = [] -- added
a = agrP3 Sg
} ;
detLikeAdj : Bool -> Number -> Str ->

View File

@@ -2,39 +2,46 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
flags optimize=all_subs ;
-- Remark: np.isLight makes ResGer.insertObjNP expensive, for ComplSlash, SlashVP
lin
DetCN det cn = {
s = \\c => det.s ! cn.g ! c ++
(let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k) ;
(let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k ++ cn.adv) ;
a = agrgP3 cn.g det.n ;
-- isPron = det.isDef ; -- ich sehe den Mann nicht vs. ich sehe nicht einen Mann
isPron = False ; -- HL 6/2019 (but:) sehe (die|einige) Männer nicht
rc = cn.rc ! det.n ; -- don't see a|no man = sehe keinen Mann
adv = cn.adv ;
-- isLight = det.isDef ; -- ich sehe den Mann nicht vs. ich sehe nicht einen Mann
-- isPron = False ; -- HL 6/2019 (but:) sehe (die|einige) Männer nicht
-- don't see a|no man = sehe keinen Mann
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
rc = cn.rc ! det.n ;
ext = cn.ext
} ;
DetNP det = {
s = \\c => det.sp ! Neutr ! c ; -- more genders in ExtraGer -- HL: der+er,den+en ; der drei,den drei+en
a = agrP3 det.n ;
-- isPron = det.isDef ;
isPron = False ; -- HL 6/2019: don't apply pronoun switch: ich gebe ihr das vs. ich gebe es ihr
rc, adv, ext = []
-- isLight = det.isDef ;
-- isPron = False ; -- HL 6/2019: don't apply pronoun switch: ich gebe ihr das vs. ich gebe es ihr
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
rc, ext = []
} ;
UsePN pn = {
s = \\c => usePrepC c (\k -> pn.s ! k) ;
a = agrgP3 pn.g Sg ;
-- isPron = True ; --- means: this is not a heavy NP, but comes before negation
isPron = False ; -- HL 6/2019: to regulate Pron/NonPronNP order
rc, adv, ext = []
-- isLight = True ; -- means: this is not a heavy NP, but comes before negation
-- isPron = False ; -- HL 6/2019: to regulate Pron/NonPronNP order
w = WLight ;
rc, ext = []
} ;
UsePron pron = {
s = \\c => usePrepC c (\k -> pron.s ! NPCase k) ;
a = pron.a ;
isPron = True ;
rc, adv, ext = []
-- isLight = True ;
-- isPron = True ;
w = WPron ;
rc, ext = []
} ;
PredetNP pred np =
@@ -43,25 +50,32 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
let c = case pred.c.k of {NoCase => c0 ; PredCase k => k} in
pred.s ! numberAgr ag ! genderAgr np.a ! c0 ++ pred.c.p ++ np.s ! c ;
a = ag ;
isPron = False
-- isLight = False ;
-- isPron = False
w = WHeavy
} ;
PPartNP np v2 = np ** {
s = \\c => np.s ! c ++ v2.s ! VPastPart APred ; --- invar part
isPron = False
s = \\c => np.s ! c ++ embedInCommas (v2.s ! VPastPart APred) ; --- invar part
-- isPron = False
w = WHeavy
} ;
{- possibly structures such as
"sie ist eine erfolgreiche Frau geliebt von vielen"
but only with v2 not possible in German? -}
{- "eine erfolgreiche Frau, geliebt von vielen," but only with v2 not possible in German?
HL: PPartNP np vps|vp: "der Autor, heute vergessen" , "der Mond, gerade aufgegangen,"
-}
AdvNP np adv = np ** {
adv = np.adv ++ adv.s ;
isPron = False
s = \\c => np.s ! c ++ adv.s ;
-- isLight = False ;
-- isPron = False
w = WHeavy
} ;
ExtAdvNP np adv = np ** {
adv = np.adv ++ embedInCommas adv.s ;
isPron = False
s = \\c => np.s ! c ++ embedInCommas adv.s ;
-- isLight = False ;
-- isPron = False
w = WHeavy
} ;
DetQuantOrd quant num ord =
@@ -151,19 +165,20 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ;
MassNP cn = {
s = \\c => usePrepC c (\k -> cn.s ! Strong ! Sg ! k) ;
s = \\c => usePrepC c (\k -> cn.s ! Strong ! Sg ! k) ++ cn.adv ;
a = agrgP3 cn.g Sg ;
isPron = False ;
rc = cn.rc ! Sg ;
adv = cn.adv ;
ext = cn.ext
-- isLight = True ; -- ich trinke Bier nicht vs. ich trinke kein Bier
-- isPron = False ;
w = WLight ;
rc = cn.rc ! Sg ;
ext = cn.ext
} ;
UseN, UseN2 = \n -> {
s = \\_ => n.s ;
g = n.g ;
rc = \\_ => [] ;
ext,adv = []
rc = \\_ => [] ;
ext,adv = []
} ;
ComplN2 f x = {
@@ -182,8 +197,6 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ;
g = f.g ;
c2 = f.c3 ;
rc = \\_ => [] ;
ext,adv = []
} ;
Use2N3 f = f ;
@@ -209,7 +222,9 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
RelNP np rs = np ** {
rc = (np.rc ++ embedInCommas (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a)))) ;
isPron = False } ;
-- isPron = False
w = case isPron np of { True => WLight ; _ => np.w }
} ;
SentCN cn s = cn ** {ext = cn.ext ++ embedInCommas s.s} ;

View File

@@ -302,7 +302,7 @@ mkV2 : overload {
mkV0 : V -> V0 ; --%
mkVS : V -> VS ;
mkV2V : overload { -- with zu
mkV2V : overload { -- with zu; object-control
mkV2V : V -> V2V ;
mkV2V : V -> Prep -> V2V ;
} ;
@@ -310,6 +310,8 @@ mkV2 : overload {
auxV2V : V -> V2V ;
auxV2V : V -> Prep -> V2V ;
} ;
subjV2V : V2V -> V2V ; -- force subject-control
mkV2A : overload {
mkV2A : V -> V2A ;
mkV2A : V -> Prep -> V2A ;
@@ -596,24 +598,25 @@ mkV2 : overload {
auxVV v = v ** {isAux = True ; lock_VV = <>} ;
V0 : Type = V ;
-- V2S, V2V, V2Q : Type = V2 ;
AS, A2S, AV : Type = A ;
A2V : Type = A2 ;
mkV0 v = v ** {lock_V = <>} ;
mkV2V = overload {
mkV2V = overload { -- default: object-control
mkV2V : V -> V2V
= \v -> dirV2 v ** {isAux = False ; lock_V2V = <>} ;
= \v -> dirV2 v ** {isAux = False ; ctrl = ObjC ; lock_V2V = <>} ;
mkV2V : V -> Prep -> V2V
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2V = <>} ;
= \v,p -> prepV2 v p ** {isAux = False ; ctrl = ObjC ; lock_V2V = <>} ;
} ;
auxV2V = overload {
auxV2V : V -> V2V
= \v -> dirV2 v ** {isAux = True ; lock_V2V = <>} ;
= \v -> dirV2 v ** {isAux = True ; ctrl = ObjC ; lock_V2V = <>} ;
auxV2V : V -> Prep -> V2V
= \v,p -> prepV2 v p ** {isAux = True ; lock_V2V = <>} ;
= \v,p -> prepV2 v p ** {isAux = True ; ctrl = ObjC ; lock_V2V = <>} ;
} ;
subjV2V v = v ** {ctrl = SubjC} ;
mkV2A = overload {
mkV2A : V -> V2A
= \v -> dirV2 v ** {isAux = False ; lock_V2A = <>} ;

View File

@@ -1,4 +1,4 @@
--# -path=.:../abstract:../common:prelude
--# -path=.:../abstract:../common:../prelude:
--1 German auxiliary operations.
--
@@ -74,7 +74,7 @@ resource ResGer = ParamX ** open Prelude in {
-- Predeterminers sometimes require a case ("ausser mir"), sometimes not ("nur ich").
-- A number is sometimes inherited ("alle Menschen"),
-- sometimes forced ("jeder von Mwnschen").
-- sometimes forced ("jeder von den Menschen").
param
PredetCase = NoCase | PredCase PCase ;
@@ -82,6 +82,16 @@ resource ResGer = ParamX ** open Prelude in {
oper
noCase : {p : Str ; k : PredetCase} = {p = [] ; k = NoCase} ;
-- Pronominal nps are ordered differently, and light nps come before negation in clauses.
-- (To save space, reduce isPron * isLight = 4 values to the following three.) HL 9/19
param
Weight = WPron | WLight | WHeavy ;
oper
isPron : {w : Weight} -> Bool = \np ->
case np.w of {WPron => True ; _ => False} ;
isLight : {w : Weight} -> Bool = \np ->
case np.w of {WHeavy => False ; _ => True} ;
--2 For $Adjective$
-- The predicative form of adjectives is not inflected further.
@@ -114,7 +124,11 @@ resource ResGer = ParamX ** open Prelude in {
param VType = VAct | VRefl Case ;
-- The order of sentence is depends on whether it is used as a main
-- Implicit subject of embedded vp equals subject resp. object of matrix verb v:V2V:
param Control = SubjC | ObjC | NoC ; -- NoC : verb without infinite vp-complement
-- The order of a sentence depends on whether it is used as a main
-- clause, inverted, or subordinate.
param
@@ -239,11 +253,13 @@ resource ResGer = ParamX ** open Prelude in {
NP : Type = {
s : PCase => Str ;
rc : Str ; -- die Frage , [rc die ich gestellt habe]
ext : Str ; -- die Frage , [sc wo sie schläft])
adv : Str ; -- die Frage [a von Max]
a : Agr ;
isPron : Bool } ;
rc : Str ; -- die Frage , [rc die ich gestellt habe]
ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...]
-- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted
a : Agr ;
-- isLight : Bool ; -- light NPs come before negation in simple clauses (expensive)
-- isPron : Bool } ; -- needed to put accPron before datPron
w : Weight } ;
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
\Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> {
@@ -398,7 +414,10 @@ resource ResGer = ParamX ** open Prelude in {
-- Prepositions for complements indicate the complement case.
Preposition : Type = {s : Str ; s2 : Str ; c : PCase ; isPrep : Bool} ; -- s2 is postposition
Preposition : Type = {s : Str ; s2 : Str ; c : PCase ; isPrep : Bool} ;
-- HL 7/19: German has very few circumpositions: um (Gen) Willen, von (Adv) an|ab|aus
-- ? bis (Adv) hin|her. So maybe we should skip s2 (and save readings with empty preps).
-- To apply a preposition to a complement.
@@ -409,10 +428,9 @@ resource ResGer = ParamX ** open Prelude in {
prep.s ++ np.s ! prep.c ++ bigNP np ++ prep.s2 ;
-- revised appPrep for discontinuous NPs
bigNP : NP -> Str = \np ->
np.adv ++ np.ext ++ np.rc ;
bigNP : NP -> Str = \np -> np.ext ++ np.rc ;
-- To build a preposition from just a case.
-- To build a preposition from just a case. -- HL 9/19: no longer used in RGL
noPreposition : Case -> Preposition = \c ->
{s,s2 = [] ; c = NPC c ; isPrep = False} ;
@@ -503,27 +521,27 @@ resource ResGer = ParamX ** open Prelude in {
VPC : Type = {
s : Bool => Agr => VPForm => { -- True = prefix glued to verb
fin : Str ; -- wird
inf:Str;inf2 : Str -- lesen,[] | gelesen,haben | können,haben (= gekonnt,haben)
inf, inf2 : Str -- lesen,[] | gelesen,haben | können,haben (= gekonnt,haben)
} -- HL 11/6/2019 Fut Anter: lesen gekonnt haben => haben lesen können
} ;
VP : Type = {
s : Verb ; -- HL 6/2019: <refl|pron,NP,PP,AP|CN|Adv>
nn : Agr => Str * Str * Str * Str ; -- <sich|ihr,deine Frau,an sie,gut>
a1 : Polarity => Str ; -- nicht = adV
s : Verb ; -- HL 6/2019: <refl|pron,NP,PP,AP|CN|Adv,ObjInf,EmbedInfs>
nn : Agr => Str * Str * Str * Str -- <sich|ihr,deine Frau,an sie,gut,
* Str * Str ; -- splitInfExt: (rate) dir, dich zu bemühen mir zu helfen>
a1 : Str ; -- adv before negation, adV
a2 : Str ; -- heute = adv
adj : Str ; -- space for adjectival complements ("ich finde dich schön")
adj : Str ; -- adjectival complement ("ich finde dich schön")
isAux : Bool ; -- is a double infinitive
inf : Str ; -- sagen
inf : {s:Str ; isAux:Bool ; ctrl:Control} ; -- infinitival complement of VV or V2V
ext : Str ; -- dass sie kommt
infExt : Str ; -- infinitival complements of inf e.g. ich hoffe [zu gehen] zu versuchen
subjc : Preposition -- determines case of "subj"
} ;
infExt : Str ; -- infinitival complements of inf
-- e.g. ich hoffe [ihr zu helfen] zu versuchen
subjc : Preposition -- case of subject
} ;
predV : Verb -> VPSlash = predVGen False ;
predVc : Verb ** {c2 : Preposition} -> VPSlash = \v ->
predV v ** {c2 = v.c2} ;
VPSlash = VP ** {c2 : Preposition ;
objCtrl : Bool } ; -- True = embedded reflexives agree with object
useVP : VP -> VPC = \vp ->
let
@@ -578,6 +596,11 @@ resource ResGer = ParamX ** open Prelude in {
}
} ;
predV : Verb -> VPSlash = predVGen False ;
predVc : Verb ** {c2 : Preposition} -> VPSlash = \v ->
predV v ** {c2 = v.c2 ; objCtrl = False} ;
predVGen : Bool -> Verb -> VPSlash = \isAux, verb -> {
s = {
s = verb.s ;
@@ -586,19 +609,18 @@ resource ResGer = ParamX ** open Prelude in {
aux = verb.aux ;
vtype = verb.vtype
} ;
a1 : Polarity => Str = negation ;
a2 : Str = [] ;
nn : Agr => Str * Str * Str * Str = case verb.vtype of {
VAct => \\_ => <[],[],[],[]> ;
VRefl c => \\a => <reflPron ! a ! c,[],[],[]>
a1,a2 : Str = [] ;
nn : Agr => Str * Str * Str * Str * Str * Str = case verb.vtype of {
VAct => \\_ => <[],[],[],[],[],[]> ;
VRefl c => \\a => <reflPron ! a ! c,[],[],[],[],[]>
} ;
isAux = isAux ; ----
inf,ext,infExt,adj : Str = [] ;
inf = {s=[]; isAux=True; ctrl=NoC} ; -- default infinitive complement
ext,infExt,adj : Str = [] ; -- (isAux=True => no endcomma)
subjc = PrepNom ;
-- Dummy values for subtyping.
c2 = noPreposition Nom ;
missingAdv = False
c2 = PrepNom ;
objCtrl = False
} ;
auxPerfect : Verb -> VForm => Str = \verb ->
@@ -658,34 +680,59 @@ resource ResGer = ParamX ** open Prelude in {
Neg => "nicht"
} ;
VPSlash = VP ** {c2 : Preposition ; missingAdv : Bool } ;
-- IL 24/04/2018 Fixing the scope of reflexives
objAgr : { a : Agr } -> VP -> VP = \obj,vp -> vp ** {
nn = \\a => vp.nn ! obj.a } ;
nn = \\a => vp.nn ! obj.a } ;
-- HL: if reflexive only: <vp.nn.p1 ! np.a, vp.nn.p1 ! a, ..>
-- Extending a verb phrase with new constituents.
insertObj : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp -> -- obj:Comp A|Adv|CN
vp ** { nn = \\a => let vpnn = vp.nn ! a in <vpnn.p1, vpnn.p2, vpnn.p3, obj ! a ++ vpnn.p4> } ;
vp ** { nn = \\a => let vpnn = vp.nn ! a
in <vpnn.p1, vpnn.p2, vpnn.p3, obj ! a ++ vpnn.p4, vpnn.p5, vpnn.p6> } ;
insertObjc : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp ->
insertObj obj vp ** {c2 = vp.c2 ; missingAdv = vp.missingAdv } ;
insertObj obj vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl } ;
insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp ->
let c = case prep.c of { NPC cc => cc ; _ => Nom } ;
obj : Agr => Str = \\_ => appPrepNP prep np ;
in vp ** {
nn = \\a => -- HL 11/6/19: rough objNP order:
nn = \\a => -- HL 11/6/19: rough objNP order: (p5,p6 = splitInfExt)
let vpnn = vp.nn ! a in -- vfin < accPron < refl < (gen|dat)Pron < nonPronNP < neg < prepNP < vinf|comp
case <np.isPron,prep.isPrep,c> of { -- (assuming v.c2=acc) nonPron: dat < acc|gen (acc < gen not enforced)
<True, False,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- <es|ihn sich, np, pp, comp>
<True, False,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- <sich ihm, np, pp, comp>
<False,False,Dat> => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4> ; -- <prons, dat ++ np, pp, comp>
<False,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- <prons, np ++ gen|acc, pp, comp>
<_, True, _> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> -- <prons, np, mit ihr|np, compl>
{- less expensive if isLight is removed from NPs:
case <np.isPron,prep.isPrep,c> of {
-- (assuming v.c2=acc) nonPron: dat < acc|gen (acc < gen not enforced)
<True, False,Acc> => -- <es|ihn sich, np, pp, comp, _,_>
<obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<True, False,_ > => -- <sich ihm, np, pp, comp>
<vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,False,Dat> => -- <prons, dat ++ np, pp, comp>
<vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,False,_ > => -- <prons, np ++ gen|acc, pp, comp>
<vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<_, True,_ > => -- <prons, np, pp++pp, compl>
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6>
}
} ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4)
-}
-- expensive: -- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp
case <prep.isPrep, np.w, c> of {
<True, _,_> => -- <prons, light, heavy++pp, compl,_,_>
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,WPron, Acc> => -- <ihn ++ sich, light, heavy, comp, _,_>
<obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,WPron, _ > => -- <sich ++ ihm|seiner, light, heavy, comp>
<vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,WLight,Dat> => -- (assuming v.c2=acc) nonPron: dat < acc|gen
-- <prons, dat ++ np, heavy, comp>
<vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,WHeavy,Dat> => -- <prons, light, dat ++ np, comp>
<vpnn.p1, vpnn.p2, obj ! a ++ vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,WLight,_ > => -- <prons, np ++ gen|acc, heavy, comp>
<vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
<False,WHeavy,_ > => -- <prons, light, dat ++ np, comp>
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6> }
} ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4)
insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron
let prep = vp.c2 ;
@@ -696,12 +743,12 @@ resource ResGer = ParamX ** open Prelude in {
nn = \\a =>
let vpnn = vp.nn ! a in
case b of {
True => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
False => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4> }
True => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
False => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> }
} ;
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** {
a1 = \\a => adv ++ vp.a1 ! a } ; -- immer nicht
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { -- not used in RGL, so VP.a1 can be skipped
a1 = adv ++ vp.a1 } ; -- cf. AdvVP(Slash),AdVVP(Slash)
insertAdv : Str -> VP -> VP = \adv,vp -> vp ** {
a2 = vp.a2 ++ adv } ;
@@ -712,13 +759,24 @@ resource ResGer = ParamX ** open Prelude in {
insertInfExt : Str -> VPSlash -> VPSlash = \infExt,vp -> vp ** {
infExt = vp.infExt ++ infExt } ;
insertInf : Str -> VPSlash -> VPSlash = \inf,vp -> vp ** {
inf = inf ++ vp.inf } ;
-- HL: to handle infExt in ComplVV and SlashVV, SlashV2V
insertInfExtraObj : (Agr => Str) -> VPSlash -> VPSlash = \objs,vp -> vp ** {
nn = \\a => let vpnn = vp.nn ! a in
<vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, objs ! a ++ vpnn.p5, vpnn.p6>
} ;
insertInfExtraInf : (Agr => Str) -> VPSlash -> VPSlash = \inf,vp -> vp ** {
nn = \\a => let vpnn = vp.nn ! a in
<vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6 ++ inf ! a>
} ;
insertInf : {s:Str;isAux:Bool;ctrl:Control} -> VPSlash -> VPSlash = \inf,vp -> vp ** {
inf = {s = inf.s ++ vp.inf.s ; isAux = inf.isAux ; ctrl=inf.ctrl} } ;
insertAdj : Str -> Str * Str -> Str -> VPSlash -> VPSlash = \adj,c,ext,vp -> vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in <vpnn.p1, vpnn.p2 ++ c.p1, vpnn.p3, vpnn.p4> ; -- ihr? | der Frau treu
adj = vp.adj ++ adj ++ c.p2 ; -- neugierig auf das Buch
let vpnn = vp.nn ! a in <vpnn.p1, vpnn.p2 ++ c.p1, -- der Frau treu
vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
adj = vp.adj ++ adj ++ c.p2 ; -- neugierig auf das Buch
ext = vp.ext ++ ext} ;
--------------------------------------------
@@ -739,34 +797,56 @@ resource ResGer = ParamX ** open Prelude in {
_ => False
} ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
neg = vp.a1 ! b ;
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
neg = negation ! b ;
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
inf = vp.inf ++ verb.inf ++ verb.inf2 ; -- zu kommen gebeten haben
extra = vp.ext ; -- * kommen (gewollt|wollen) haben
infE : Str = -- HL 30/6/2019
-- leave inf-complement of +auxV(2)V in place,
-- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V)
infExt : Str * Str = case vp.inf.isAux of
{ True => <(vp.nn!agr).p6,[]> ; _ => <[],(vp.nn!agr).p6> } ;
extra = infExt.p2 ++ vp.ext ;
infCompls = -- () tun | ihn (es tun) lassen | ihm [es zu tun] versprechen
(vp.nn ! agr).p5 ++ infExt.p1 ++ vp.inf.s ;
comma = case orB vp.isAux (case vp.inf.ctrl of { NoC => True ; _ => False }) of {
True => [] ; _ => bindComma} ;
inf : Str =
case <t,a,vp.isAux> of {
<Fut|Cond,Simul,True> => inf ; --# notpresent
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
=> verb.inf2 ++ vp.inf ++ verb.inf ; --# notpresent
<_,Anter,True> => inf ; --# notpresent
_ => verb.inf ++ verb.inf2 ++ vp.inf } ;
<Fut|Cond,Anter,True> => --# notpresent
-- haben () tun wollen |
-- ihn haben (es tun) lassen wollen () |
-- ihm haben () versprechen wollen (, es zu tun)
(vp.nn ! agr).p5 ++ verb.inf2 ++ infExt.p1 ++ vp.inf.s ++ verb.inf ; --# notpresent
<_, Anter,True> => --# notpresent
-- tun wollen [] | ihn (es tun) lassen wollen [] |
-- ihm () versprechen wollen [] (, es zu tun)
infCompls ++ verb.inf ++ verb.inf2 ; --# notpresent
<Fut|Cond,Simul,True> => --# notpresent
infCompls ++ verb.inf ++ verb.inf2 ; --# notpresent
<Fut|Cond,Anter,False> => --# notpresent
-- gebeten haben , es zu tun () | gebeten haben , ihn (es tun) zu lassen
verb.inf ++ verb.inf2 ++ comma ++ infCompls ; --# notpresent
_ => verb.inf2 ++ verb.inf ++ comma ++ infCompls } ;
inffin : Str =
case <t,a,vp.isAux> of {
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
=> verb.fin ++ verb.inf2 ++ vp.inf ++ verb.inf ; --# notpresent
<_,Anter,True> --# notpresent
=> verb.fin ++ inf ; -- double inf --# notpresent
_ => inf ++ verb.fin --- or just auxiliary vp
=> (vp.nn ! agr).p5 ++ verb.fin --# notpresent
++ verb.inf2 ++ infExt.p1 ++ vp.inf.s ++ verb.inf ; --# notpresent
<Pres|Past,Anter,True> --# notpresent
=> (vp.nn ! agr).p5 ++ infExt.p1 ++ verb.fin --# notpresent
++ vp.inf.s ++ verb.inf ++ verb.inf2 ; -- double inf --# notpresent
<_, _ ,True>
=> infCompls ++ verb.inf ++ verb.inf2 ++ verb.fin ; -- or just auxiliary vp
<_, _ ,False>
=> verb.inf ++ verb.inf2 ++ verb.fin ++ comma ++ infCompls
} ;
in
case o of {
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
}
Main => subj ++ verb.fin ++ compl ++ inf ++ extra ;
Inv => verb.fin ++ subj ++ compl ++ inf ++ extra ;
Sub => subj ++ compl ++ inffin ++ extra
}
} ;
{-
@@ -786,11 +866,12 @@ resource ResGer = ParamX ** open Prelude in {
es wird nicht besser
-}
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.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.a2,
vp.a1 ! Pos ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf,
vp.inf,
vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos
vp.inf.s,
vp.infExt ++ vp.ext
> ;
@@ -798,6 +879,17 @@ resource ResGer = ParamX ** open Prelude in {
let vpi = infVP isAux vp in
vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ;
infzuVP : Bool -> Control -> Anteriority -> Polarity -> VP -- HL
-> { objs:(Agr => Str) ; pred:{s:Str;isAux:Bool;ctrl:Control} ; inf:Str ; ext:Str } =
\isAux, ctrl, ant, pol, vp -> let vps = useVP vp in
{ objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
pred = { s = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
isAux = vp.isAux ; ctrl = ctrl } ;
inf = vp.inf.s ;
ext = vp.ext
} ;
-- The nominative case is not used as reflexive, but defined here
-- so that we can reuse this in personal pronouns.
-- The missing Sg "ihrer" shows that a dependence on gender would
@@ -855,8 +947,8 @@ resource ResGer = ParamX ** open Prelude in {
infPart : Bool -> Str = \b -> if_then_Str b [] "zu" ;
heavyNP :
{s : PCase => Str ; a : Agr} -> {s : PCase => Str ; a : Agr ; isPron : Bool ; adv,ext,rc : Str} = \np ->
np ** {isPron = False; adv,ext,rc = []} ; -- this could be wrong
{s : PCase => Str ; a : Agr} -> {s : PCase => Str ; a : Agr ; w : Weight ; ext,rc : Str} = \np ->
np ** {w = WHeavy ; ext,rc = []} ; -- this could be wrong
relPron : RelGenNum => Case => Str = \\rgn,c =>
case rgn of {
@@ -872,14 +964,12 @@ resource ResGer = ParamX ** open Prelude in {
} ;
-- Function that allows the construction of non-nominative subjects.
mkSubj : NP -> Preposition -> Str * Agr = \np, subjc ->
let
sub = subjc ;
agr = case sub.c of {
NPC Nom => np.a ;
_ => Ag Masc Sg P3 } ;
subj = appPrepNP sub np
in <subj , agr> ;
mkSubj : NP -> Preposition -> Str * Agr = \np, subjc ->
let
sub = subjc ;
agr = case sub.c of { NPC Nom => np.a ; _ => Ag Masc Sg P3 } ;
subj = appPrepNP sub np
in <subj , agr> ;
}

View File

@@ -26,10 +26,11 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
} ;
agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
inf = vp.inf ++ verb.inf ; -- HL .nn
inf = vp.inf.s ++ verb.inf ; -- HL .nn
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
in
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
-- verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
} ;
SlashVP np vp =
@@ -49,7 +50,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
(insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) **
{c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s ! Sub} ;
EmbedS s = {s = conjThat ++ s.s ! Sub} ; -- no leading comma, if sentence-initial
EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = useInfVP False vp} ;

View File

@@ -11,21 +11,27 @@ lin
CNIntNP cn i = {
s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ;
a = agrP3 Sg ;
isPron = False ;
ext,rc,adv = [] -- added
-- isPron = False ;
-- isLight = True ;
w = WLight ;
ext,rc = [] -- added
} ;
CNSymbNP det cn xs = let g = cn.g in {
s = \\c => det.s ! g ! c ++
(let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k) ++ xs.s ;
a = agrP3 det.n ;
isPron = False ;
ext,rc,adv = [] -- added
-- isPron = False ;
-- isLight = True ;
w = WLight ;
ext,rc = [] -- added
} ;
CNNumNP cn i = {
s = \\c => artDefContr (GSg cn.g) c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! (prepC c).c ;
a = agrP3 Sg ;
isPron = False ;
ext,rc,adv = [] -- added
-- isPron = False ;
-- isLight = True ;
w = WLight ;
ext,rc = [] -- added
} ;
SymbS sy = {s = \\_ => sy.s} ;

View File

@@ -4,7 +4,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
lin
UseV = predV ;
{-
ComplVV v vp =
let
vpi = infVP v.isAux vp ;
@@ -14,6 +14,32 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
insertInfExt vpi.p3 (
insertInf vpi.p2 (
insertObjc vpi.p1 vps))) ;
-}
-- HL 7/19
ComplVV v vp = -- will|wage (es ([]|zu) tun [] | ihn [es tun] ([]|zu) lassen
let
vps = predVGen v.isAux v ;
vpi = infzuVP v.isAux SubjC Simul Pos vp ;
-- { objs: ihm ; pred: []/zu versprechen, objInf: sich/es zu tun }
-- (ich) vfin:werde (ihm ([]/zu) versprechen) vinf:(wollen/gewagt haben) (, es zu tun)
-- (ich) vfin:werde (ihn (es tun) lassen)/[] vinf:(wollen/gewagt haben) []/(, ihn (es tun) zu lassen)
extInfzu = case <vp.isAux,vp.inf.isAux> of {<True,False> => (vp.nn!(Ag Masc Sg P3)).p6 ; _ => []} ;
comma = case vp.inf.ctrl of { NoC => [] ; _ => bindComma} ; -- es (zu) tun
embeddedInf : Agr => Str =
case <vp.isAux,vp.inf.isAux> of { -- vv + vp + [embeddedInf]
-- will [es lesen] können | will ihn [es lesen] lassen
<True,True> => \\agr => (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ;
-- will ihn [euch (extInfzu) bitten] lassen
<True,False> => \\agr => (vp.nn!agr).p5 ++ vpi.inf ; -- ++ (vp.nn!agr).p6 => extInfzu
-- will es lesen [] | will ihn bitten [, es zu lesen] | will ihn bitten [, sie es lesen zu lassen]
<False,True> => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ;
-- will ihn bitten [, ihr zu helfen, es zu lesen]
<False,False> => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 }
in
insertExtrapos (extInfzu ++ vpi.ext) ( -- vps.ext <- vp's extracted embedded infzu + vp's object-sentence
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
insertInfExtraInf embeddedInf vps))) ;
ComplVS v s =
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ;
@@ -21,52 +47,90 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ;
ComplVA v ap = insertAdj (v.c2.s ++ ap.s ! APred) ap.c ap.ext (predV v) ; -- changed
SlashV2a v = (predVc v) ** {missingAdv = True} ; -- HL 12/6/2019 for reflexive verbs with objects, rV2:V2, rV3:V3
SlashV2a v = (predVc v) ;
Slash2V3 v np = insertObjNP np v.c2 (predV v) ** {c2 = v.c3 ; missingAdv = True} ;
Slash3V3 v np = insertObjNP np v.c3 (predV v) ** {c2 = v.c2 ; missingAdv = True} ;
Slash2V3 v np = insertObjNP np v.c2 (predVc v) ** {c2 = v.c3} ;
Slash3V3 v np = insertObjNP np v.c3 (predVc v) ;
SlashV2S v s =
insertExtrapos (conjThat ++ s.s ! Sub) (predVc v) ;
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predVc v) ;
SlashV2Q v q =
insertExtrapos (q.s ! QIndir) (predVc v) ;
insertExtrapos (comma ++ q.s ! QIndir) (predVc v) ;
{-
SlashV2V v vp =
let
vpi = infVP v.isAux vp ;
vps = predVGen v.isAux v ** {c2 = v.c2} ;
in vps **
insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertObj vpi.p1 vps)) ;
in vps **
insertExtrapos vpi.p4 ( -- inplace vp; better extract it!
insertInfExt vpi.p3 (
insertInf vpi.p2 (
insertObjc vpi.p1 vps))) ;
-}
SlashV2V v vp = -- jmdn bitten, (\agr => sich!agr das Buch zu merken) HL 7/19
let
vps = (predVGen v.isAux v) ** { c2 = v.c2 ; objCtrl = case v.ctrl of {ObjC => True ; _ => False}} ;
vpi = infzuVP v.isAux v.ctrl Simul Pos vp ;
comma : Str = case <vp.isAux,vp.inf.ctrl> of { <True,_> | <_,NoC> => [] ; _ => bindComma} ;
embeddedInf : Agr => Str = case vp.inf.isAux of {
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- ihn es lesen (zu) lassen
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- ihn (zu) bitten , es zu lesen
in
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
insertInfExtraInf embeddedInf vps))) ;
SlashV2A v ap =
SlashV2A v ap =
insertAdj (ap.s ! APred) ap.c ap.ext (predVc v) ;
ComplSlash vps np =
let vp = insertObjNP np vps.c2 vps ;
in case vp.missingAdv of {
True => vp ;
False => objAgr np vp } ; -- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of the object introduced by ComplSlash.
-- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np.
in case vps.objCtrl of { True => objAgr np vp ; _ => vp } ;
{-
SlashVV v vp =
let
let
vpi = infVP v.isAux vp ;
vps = predVGen v.isAux v ** {c2 = vp.c2} ;
vps = predVGen v.isAux v ** {c2 = vp.c2 } ;
in vps **
insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertInf {s=vpi.p2;isAux=vp.isAux;ctrl=SubjC} ( -- insertInf vpi.p2 (
insertObj vpi.p1 vps)) ;
-}
SlashVV v vp = -- will|hoffe ((zu) lesen | ihr (zu) geben | (zu) bitten, es zu lesen)
let
vps = (predVGen v.isAux v) ** { c2 = vp.c2 } ;
vpi = infzuVP v.isAux SubjC Simul Pos vp ; -- (zu) (lesen | ihr geben | bitten, es zu lesen)
comma : Str = case <vp.isAux,vp.inf.ctrl> of { <True,_> | <_,NoC> => [] ; _ => bindComma} ;
embeddedInf : Agr => Str = case vp.inf.isAux of {
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- es lesen (zu) lassen
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- (zu) bitten, es zu lesen
in
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
insertInfExtraInf embeddedInf vps))) ;
-- {- HL 8/19: this slightly modified SlashV2VNP is expensive even with NP.w:Weight
-- order of embedded objects wrong:
-- Lang> p "the woman that you beg me to listen to" | l
-- the woman that you beg me to listen to
-- die Frau , der ihr mich zuzuhören bittet
-- better: die Frau , der zuzuhören ihr mich bittet
SlashV2VNP v np vp =
let
vpi = infVP v.isAux vp ;
vps = predVGen v.isAux v ** {c2 = v.c2} ;
vps = predVGen v.isAux v ** {c2 = vp.c2} ; -- objCtrl = ?
in vps **
insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertInf {s=vpi.p2;isAux=v.isAux;ctrl=v.ctrl} ( -- insertInf vpi.p2
insertObj vpi.p1 (
insertObj (\\_ => appPrepNP v.c2 np) vps))) ;
-- insertObjNP v.c2 np vps))) ;
-- HL: version with infzuVP in tests/german/TestLangGer.gf, too expensive
UseComp comp =
insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used
@@ -76,7 +140,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
UseCopula = predV sein_V ;
CompAP ap = {s = \\_ => ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ; ext = ap.ext} ;
CompNP np = {s = \\_ => np.s ! NPC Nom ++ np.adv ++ np.rc ; ext = np.ext} ;
CompNP np = {s = \\_ => np.s ! NPC Nom ++ np.rc ; ext = np.ext} ;
CompAdv a = {s = \\_ => a.s ; ext = []} ;
CompCN cn = {s = \\a => case numberAgr a of {
@@ -112,14 +176,16 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
from "we live (in the city : Adv) : Cl"
But in German we cannot move the NP part of an Adv, we only have the
In German we cannot move the NP part of an Adv, we only have the
full relative clauses like
die Stadt, in der wir leben,
die Stadt, worin wir leben, --contracted Prep+Rel
but nothing like "die Stadt wir leben in".
But: VPSlashPrep is used to parse "sie ist mit mir verheiratet",
(ist verheiratet:VP mit:Prep):VPSlash,
ComplA2 is used to parse "sie ist verheiratet mit mir"
-}
VPSlashPrep vp prep = vp ** {c2 = prep ; missingAdv = True} ;
VPSlashPrep vp prep = vp ** {c2 = prep ; objCtrl = False} ;
}