1
0
forked from GitHub/gf-rgl

Modifications of Prep\', Predet\', Quant\', Det\', NP\' to remove PCase and use NP.s : Agr => Str * Str instead

This commit is contained in:
Hans Leiss
2022-07-19 18:27:56 +02:00
parent d3de861e86
commit 8eee3df739
34 changed files with 1331 additions and 187 deletions

View File

@@ -1,4 +1,4 @@
concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in {
flags optimize=all_subs ;
@@ -38,8 +38,8 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
ComplA2 a np =
let CExt = case a.c2.isPrep of {
False => <appPrepNP a.c2 np, []> ;
True => <[], appPrepNP a.c2 np> }
isCase => <appPrepNP' a.c2 np, []> ;
_ => <[], appPrepNP' a.c2 np> } -- HL: check 7/22
in {
s = a.s ! Posit ;
isPre = True ;
@@ -49,10 +49,11 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
ReflA2 a =
let
compl = appPrep a.c2 (\\k => usePrepC k (\c -> reflPron ! agrP3 Sg ! c)) ;
-- compl = appPrep a.c2 (\\k => usePrepC k (\c -> reflPron ! agrP3 Sg ! c)) ;
compl = appPrep' a.c2 (reflPron ! agrP3 Sg) ;
CExt = case a.c2.isPrep of
{False => <compl, []> ;
True => <[], compl> }
{isCase => <compl, []> ;
_ => <[], compl> } -- HL Check isPrepDefArt
in {
s = a.s ! Posit ;
isPre = True ;

View File

@@ -1,4 +1,4 @@
concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in {
concrete AdverbGer of Adverb' = CatGer ** open ResGer, Prelude in {
lin
PositAdvAdj a = {s = a.s ! Posit ! APred} ;
@@ -10,7 +10,7 @@ concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in {
s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub
} ;
PrepNP prep np = {s = appPrepNP prep np} ;
PrepNP prep np = {s = appPrepNP' prep np} ;
AdAdv = cc2 ;

View File

@@ -1,4 +1,5 @@
concrete CatGer of Cat =
--# -path=.:../abstract:../common:../prelude
concrete CatGer of Cat' =
CommonX - [Tense,Temp] **
open ResGer, Prelude in {
@@ -11,14 +12,14 @@ concrete CatGer of Cat =
S = {s : Order => Str} ;
QS = {s : QForm => Str} ;
RS = {s : RelGenNum => Str ; c : Case} ;
SSlash = {s : Order => Str} ** {c2 : Preposition} ;
SSlash = {s : Order => Str} ** {c2 : Preposition'} ;
-- Sentence
Cl = {s : Mood => ResGer.Tense => Anteriority => Polarity => Order => Str} ;
ClSlash = {
s : Mood => ResGer.Tense => Anteriority => Polarity => Order => Str ;
c2 : Preposition
c2 : Preposition'
} ;
Imp = {s : Polarity => ImpForm => Str} ;
@@ -71,6 +72,24 @@ concrete CatGer of Cat =
c : {p : Str ; k : PredetCase} ;
a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ...
} ;
-- HL: To reduce PCase to Case:
NP' = ResGer.NP' ;
Det' = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
Quant' = {
s : Bool => Number => Gender => Case => Str ; -- Bool is True if a cardinal number is present
sp : Bool => Number => Gender => Case => Str ;
a : Adjf ;
aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde"
hasDefArt : Bool
} ;
Predet' = {
s : Number => Gender => Case => Str ;
c : {p : Str ; k : PredetCase} ;
a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ...
} ;
Num = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ;
Card = {s : Gender => Case => Str ; n : Number} ;
Ord = {s : AForm => Str} ;
@@ -85,21 +104,22 @@ concrete CatGer of Cat =
Conj = {s1,s2 : Str ; n : Number} ;
Subj = {s : Str} ;
Prep = Preposition ;
Prep' = Preposition' ;
-- Open lexical classes, e.g. Lexicon
V, VA, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
VV = Verb ** {isAux : Bool} ;
V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; objCtrl : Bool} ;
V3 = Verb ** {c2, c3 : Preposition} ;
V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition'} ;
V2V = Verb ** {c2 : Preposition' ; isAux : Bool ; objCtrl : Bool} ;
V3 = Verb ** {c2, c3 : Preposition'} ;
A = {s : Degree => AForm => Str} ;
A2 = {s : Degree => AForm => Str ; c2 : Preposition} ;
A2 = {s : Degree => AForm => Str ; c2 : Preposition'} ;
N = ResGer.Noun ;
N2 = ResGer.Noun ** {c2 : Preposition} ;
N3 = ResGer.Noun ** {c2,c3 : Preposition} ;
N2 = ResGer.Noun ** {c2 : Preposition'} ;
N3 = ResGer.Noun ** {c2,c3 : Preposition'} ;
PN = {s : Case => Str; g : Gender} ;
-- tense with possibility to choose conjunctive forms
@@ -109,6 +129,7 @@ concrete CatGer of Cat =
linref
NP = \np -> np.s!(NPC Nom) ++ np.ext ++ np.rc ; -- HL 6/2019
NP' = \np -> (np.s!Nom).p1 ++ (np.s!Nom).p2 ++ 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

@@ -1,4 +1,4 @@
concrete ConjunctionGer of Conjunction =
concrete ConjunctionGer of Conjunction' =
CatGer ** open ResGer, Coordination, Prelude in {
flags optimize=all_subs ;
@@ -9,7 +9,7 @@ concrete ConjunctionGer of Conjunction =
ConjAdv conj ss = conjunctDistrSS conj ss ;
ConjNP conj ss = heavyNP (conjunctDistrTable PCase conj ss ** {
ConjNP conj ss = heavyNP' (conjunctDistrTable Case conj ss ** {
a = Ag Fem (conjNumber conj.n (numberAgr ss.a)) (personAgr ss.a) ;
}) ;
@@ -39,11 +39,11 @@ concrete ConjunctionGer of Conjunction =
BaseAdv = twoSS ;
ConsAdv = consrSS comma ;
BaseNP x y = {
s1 = \\c => x.s ! c ++ bigNP x ;
s1 = \\c => (x.s ! c).p1 ++ (x.s ! c).p2 ++ bigNP x ;
s2 = \\c => y.s ! c ++ bigNP y ;
a = conjAgr x.a y.a } ;
ConsNP xs x = {
s1 = \\c => xs.s ! c ++ bigNP xs ++ comma ++ x.s1 ! c ;
s1 = \\c => (x.s ! c).p1 ++ (x.s ! c).p2 ++ bigNP xs ++ comma ++ x.s1 ! c ;
s2 = x.s2 ;
a = conjAgr xs.a x.a } ;
BaseAP x y = {

View File

@@ -1,8 +1,8 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarGer of Grammar =
concrete GrammarGer of Grammar' =
NounGer,
VerbGer,
VerbGer, -- to save compile time during development HL 7/22
AdjectiveGer,
AdverbGer,
NumeralGer,

View File

@@ -1,4 +1,4 @@
concrete IdiomGer of Idiom = CatGer **
concrete IdiomGer of Idiom' = CatGer **
open MorphoGer, ParadigmsGer, Prelude in {
flags optimize=all_subs ;
@@ -10,7 +10,8 @@ concrete IdiomGer of Idiom = CatGer **
CleftNP np rs = mkClause "es" (agrP3 Sg)
(insertExtrapos (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ----
(insertObj (\\_ => np.s ! NPC rs.c ++ bigNP np) (predV MorphoGer.sein_V))) ;
-- (insertObj (\\_ => np.s ! NPC rs.c ++ bigNP np) (predV MorphoGer.sein_V))) ;
(insertObj (\\_ => (np.s ! rs.c).p1 ++ (np.s ! rs.c).p2 ++ bigNP' np) (predV MorphoGer.sein_V))) ; --HL
CleftAdv ad s = mkClause "es" (agrP3 Sg)
(insertExtrapos (conjThat ++ s.s ! Sub)
@@ -19,7 +20,7 @@ concrete IdiomGer of Idiom = CatGer **
ExistNP np =
mkClause "es" (agrP3 Sg)
(insertObj (\\_ => appPrep geben.c2 np.s ++ bigNP np)
(insertObj (\\_ => appPrep2' geben.c2 np.s ++ bigNP' np)
(predV geben)) ;
ExistIP ip = {
@@ -36,7 +37,8 @@ concrete IdiomGer of Idiom = CatGer **
ExistNPAdv np adv=
mkClause "es" (agrP3 Sg)
(insertAdv adv.s (insertObj (\\_ => appPrep geben.c2 np.s ++ bigNP np)
-- (insertAdv adv.s (insertObj (\\_ => appPrep geben.c2 np.s ++ bigNP np)
(insertAdv adv.s (insertObj (\\_ => appPrep2' geben.c2 np.s ++ bigNP' np)
(predV geben))) ;
ExistIPAdv ip adv = {
@@ -59,14 +61,14 @@ concrete IdiomGer of Idiom = CatGer **
} ;
ImpP3 np vp = {
s = (mkClause ((mkSubj np vp.c1).p1) np.a vp).s !
s = (mkClause ((mkSubj' np vp.c1).p1) np.a vp).s !
MConjunct ! Pres ! Simul ! Pos ! Inv
} ;
SelfAdvVP vp = insertAdv "selbst" vp ;
SelfAdVVP vp = insertAdv "selbst" vp ;
SelfNP np = np ** {
s = \\c => np.s ! c ++ "selbst" ++ bigNP np ;
s = \\c => <(np.s ! c).p1, (np.s ! c).p2 ++ "selbst" ++ bigNP' np> ;
isPron = False ;
} ;

View File

@@ -1,10 +1,10 @@
--# -path=.:../abstract:../common:../api:../prelude
concrete LangGer of Lang =
concrete LangGer of Lang' =
GrammarGer,
LexiconGer
,ConstructionGer
,DocumentationGer --# notpresent
-- ,ConstructionGer
-- ,DocumentationGer --# notpresent
,MarkupGer - [stringMark]
** {

View File

@@ -185,7 +185,8 @@ lin
sock_N = reg2N "Strumpf" "Strümpfe" masculine ;
song_N = reg2N "Lied" "Lieder" neuter ;
speak_V2 = dirV2 Irreg.sprechen_V ;
star_N = mkN "Sterne" ;
-- star_N = mkN "Sterne" ;
star_N = mkN "Stern" ; -- HL 7/22
steel_N = mkN "Stahl" ;
stone_N = mkN "Stein" ;
stop_V = seinV Irreg.halten_V ;

View File

@@ -17,15 +17,15 @@ oper
-- For $StructuralGer$.
mkPrep : Str -> PCase -> Preposition = \s,c ->
{s = s ; s2 = [] ; c = c ; isPrep = True} ;
mkPrep : Str -> Case -> Preposition' = \s,c ->
{s = s ; s2 = [] ; c = c ; sg = \\_ => [] ; isPrep = isPrep} ;
nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ;
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
a = agrP3 Sg
} ;
detLikeAdj : Bool -> Number -> Str ->
@@ -36,6 +36,14 @@ oper
{s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->
{s,sp = appAdj (regDetA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ;
-- HL: to reduce PCase to Case:
detLikeAdj' : Bool -> Number -> Str ->
{s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->
{s,sp = appAdj' (regA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ;
detUnlikeAdj' : Bool -> Number -> Str ->
{s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->
{s,sp = appAdj' (regDetA dies) ! n ; n = n ; a = Weak ; isDef = isDef} ;
mkOrd : {s : Degree => AForm => Str} -> {s : AForm => Str} = \a ->
{s = a.s ! Posit} ;

View File

@@ -1,4 +1,5 @@
concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
--# -path=.:../abstract:../common:
concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in {
flags optimize=all_subs ;
@@ -17,6 +18,24 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
ext = cn.ext
} ;
-- HL:
DetCN' det' cn = {
s = \\c => <det'.s ! cn.g ! c, cn.s ! (adjfCase det'.a c) ! det'.n ! c ++ cn.adv> ;
a = agrgP3 cn.g det'.n ;
-- 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' } ;
-- Would be clearer with w:Weight and hasDefArt:Bool with |NP|=|Agr|*3*2 = 108
-- instead of the more efficient w:Weigth' with |NP|=|Agr|*4 = 18*4 = 54
w = case det'.isDef of { True => case det'.hasDefArt of { True => WDefArt ;
_ => 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 ;
@@ -105,6 +124,18 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
a = case n of {Sg => a ; Pl => quant.aPl} ;
isDef = case <quant.a, quant.aPl> of {<Strong,Strong> => False ; _ => True} ;
} ;
DetQuant' quant num =
let
n = num.n ;
a = quant.a
in {
s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++ num.s!g!c ;
sp = \\g,c => quant.sp ! num.isNum ! n ! g ! c ++ num.s!g!c ; -- HL: der+er,den+en ; der drei,den drei+en
n = n ;
a = case n of {Sg => a ; Pl => quant.aPl} ;
isDef = case <quant.a, quant.aPl> of {<Strong,Strong> => False ; _ => True} ;
hasDefArt = quant.hasDefArt ;
} ;
PossPron p = {
@@ -163,6 +194,16 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ;
a, aPl = Strong
} ;
-- HL
DefArt' = {
s = \\_,n,g,c => artDef ! (gennum g n) ! c ;
sp = \\_,n,g,c => case <n,c> of {
<Pl,Dat> => "denen" ; -- HL 6/2019
<Pl,Gen> => "derer" ; -- HL 6/2019
_ => artDef ! (gennum g n) ! c } ;
a, aPl = Weak ;
hasDefArt = True
} ;
MassNP cn = {
s = \\c => usePrepC c (\k -> cn.s ! Strong ! Sg ! k) ++ cn.adv ;
@@ -182,20 +223,20 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ;
ComplN2 f x = {
s = \\_,n,c => f.s ! n ! c ++ appPrepNP f.c2 x ;
s = \\_,n,c => f.s ! n ! c ++ appPrepNP' f.c2 x ;
g = f.g ;
rc = \\_ => [] ;
ext,adv = []
ext,adv = []
} ;
ComplN3 f x = {
s = \\n,c => f.s ! n ! c ++ appPrepNP f.c2 x ;
co = f.co ++ appPrepNP f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2
s = \\n,c => f.s ! n ! c ++ appPrepNP' f.c2 x ;
co = f.co ++ appPrepNP' f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2
uncap = {
s = \\n,c => f.uncap.s ! n ! c ++ appPrepNP f.c2 x ;
co = f.uncap.co ++ appPrepNP f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2
s = \\n,c => f.uncap.s ! n ! c ++ appPrepNP' f.c2 x ;
co = f.uncap.co ++ appPrepNP' f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2
} ;
g = f.g ;
g = f.g ;
c2 = f.c3 ;
} ;
@@ -205,11 +246,11 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
c2 = f.c3;
} ;
AdjCN ap cn =
AdjCN ap cn =
let
g = cn.g
g = cn.g
in cn ** {
s = \\a,n,c =>
s = \\a,n,c =>
preOrPost ap.isPre
(ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj g a n c ++ ap.ext)
(cn.s ! a ! n ! c) ;
@@ -222,8 +263,8 @@ 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
w = case isPron np of { True => WLight ; _ => np.w }
-- isPron = False
w = case isPron np of { True => WLight ; _ => np.w }
} ;
SentCN cn s = cn ** {ext = cn.ext ++ embedInCommas s.s} ;

View File

@@ -48,12 +48,6 @@ oper
dative : Case ;
genitive : Case ;
anDat_Case : Case ; -- preposition "an" accusative with contraction "am" --%
inAcc_Case : Case ; -- preposition "in" accusative with contraction "ins" --%
inDat_Case : Case ; -- preposition "in" dative with contraction "im" --%
zuDat_Case : Case ; -- preposition "zu" dative with contractions "zum", "zur" --%
vonDat_Case : Case ;
-- To abstract over number names, we define the following.
Number : Type ;
@@ -108,7 +102,7 @@ mkN : overload {
mkN2 : overload {
mkN2 : Str -> N2 ; --%
mkN2 : N -> N2 ; -- noun + von
mkN2 : N -> Prep -> N2 -- noun + other preposition
mkN2 : N -> Prep' -> N2 -- noun + other preposition
} ;
-- Use the function $mkPrep$ or see the section on prepositions below to
@@ -117,7 +111,7 @@ mkN : overload {
--
-- Three-place relational nouns ("die Verbindung von x nach y") need two prepositions.
mkN3 : N -> Prep -> Prep -> N3 ; -- noun + two prepositions
mkN3 : N -> Prep' -> Prep' -> N3 ; -- noun + two prepositions
--3 Proper names and noun phrases
--
@@ -174,7 +168,7 @@ mkN : overload {
-- Two-place adjectives are formed by adding a preposition to an adjective.
mkA2 : A -> Prep -> A2 ; -- e.g. teilbar + durch
mkA2 : A -> Prep' -> A2 ; -- e.g. teilbar + durch
--2 Adverbs
@@ -188,24 +182,24 @@ mkN : overload {
-- A preposition is formed from a string and a case.
mkPrep : overload {
mkPrep : Str -> Case -> Prep ; -- e.g. "durch" + accusative
mkPrep : Case -> Str -> Prep ; -- postposition
mkPrep : Str -> Case -> Str -> Prep ; -- both sides
mkPrep : Str -> Case -> Prep' ; -- e.g. "durch" + accusative
mkPrep : Case -> Str -> Prep' ; -- postposition
mkPrep : Str -> Case -> Str -> Prep' ; -- both sides
} ;
-- Often just a case with the empty string is enough.
accPrep : Prep ; -- no string, just accusative case
datPrep : Prep ; -- no string, just dative case
genPrep : Prep ; -- no string, just genitive case
accPrep : Prep' ; -- no string, just accusative case
datPrep : Prep' ; -- no string, just dative case
genPrep : Prep' ; -- no string, just genitive case
-- A couple of common prepositions (the first two always with the dative).
von_Prep : Prep ; -- von + dative
zu_Prep : Prep ; -- zu + dative, with contractions zum, zur
anDat_Prep : Prep ; -- an + dative, with contraction am
inDat_Prep : Prep ; -- in + dative, with contraction ins
inAcc_Prep : Prep ; -- in + accusative, with contraction im
von_Prep : Prep' ; -- von + dative
zu_Prep : Prep' ; -- zu + dative, with contractions zum, zur
anDat_Prep : Prep' ; -- an + dative, with contraction am
inDat_Prep : Prep' ; -- in + dative, with contraction ins
inAcc_Prep : Prep' ; -- in + accusative, with contraction im
--2 Verbs
@@ -275,7 +269,7 @@ mkV2 : overload {
-- Two-place verbs with a preposition.
mkV2 : V -> Prep -> V2 ; -- preposition for complement
mkV2 : V -> Prep' -> V2 ; -- preposition for complement
-- Two-place verbs with object in the given case.
@@ -289,11 +283,11 @@ mkV2 : overload {
-- the first one or both can be absent.
accdatV3 : V -> V3 ; -- geben + dat(c2) + acc(c3) (Eng: no prepositions)
dirV3 : V -> Prep -> V3 ; -- senden + acc + nach (preposition on second arg)
dirV3 : V -> Prep' -> V3 ; -- senden + acc + nach (preposition on second arg)
mkV3 : overload {
mkV3 : V -> V3 ; -- geben + dat(c3) + acc(c2) (Eng: give sth to-sb)
mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen + mit + über
mkV3 : V -> Prep' -> Prep' -> V3 ; -- sprechen + mit + über
} ;
--3 Other complement patterns
@@ -315,16 +309,16 @@ mkV2 : overload {
subjV2V : V2V -> V2V ; -- force subject-control
mkV2A : overload {
mkV2A : V -> V2A ;
mkV2A : V -> Prep -> V2A ;
mkV2A : V -> V2A ;
mkV2A : V -> Prep' -> V2A ;
} ;
mkV2S : overload {
mkV2S : V -> V2S ;
mkV2S : V -> Prep -> V2S ;
mkV2S : V -> Prep' -> V2S ;
} ;
mkV2Q : overload {
mkV2Q : V -> V2Q ;
mkV2Q : V -> Prep -> V2Q ;
mkV2Q : V -> Prep' -> V2Q ;
} ;
@@ -340,9 +334,9 @@ mkV2 : overload {
mkAS : A -> AS ; --%
mkA2S : A -> Prep -> A2S ; --%
mkA2S : A -> Prep' -> A2S ; --%
mkAV : A -> AV ; --%
mkA2V : A -> Prep -> A2V ; --%
mkA2V : A -> Prep' -> A2V ; --%
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
-- and the second argument is given as an adverb. Likewise
@@ -364,20 +358,15 @@ mkV2 : overload {
Gender = MorphoGer.Gender ;
Case = MorphoGer.PCase ;
Case = MorphoGer.Case ;
Number = MorphoGer.Number ;
masculine = Masc ;
feminine = Fem ;
neuter = Neutr ;
nominative = NPC Nom ;
accusative = NPC Acc ;
dative = NPC Dat ;
genitive = NPC Gen ;
anDat_Case = NPP CAnDat ;
inAcc_Case = NPP CInAcc ;
inDat_Case = NPP CInDat ;
zuDat_Case = NPP CZuDat ;
vonDat_Case = NPP CVonDat ;
nominative = Nom ;
accusative = Acc ;
dative = Dat ;
genitive = Gen ;
singular = Sg ;
plural = Pl ;
@@ -454,11 +443,11 @@ mkV2 : overload {
mkN2 = overload {
mkN2 : Str -> N2 = \s -> vonN2 (regN s) ;
mkN2 : N -> N2 = vonN2 ;
mkN2 : N -> Prep -> N2 = mmkN2
mkN2 : N -> Prep' -> N2 = mmkN2
} ;
mmkN2 : N -> Prep -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ;
mmkN2 : N -> Prep' -> N2 = \n,p -> n ** {c2 = p ; lock_N2 = <>} ;
vonN2 : N -> N2 = \n -> n ** {c2 = von_Prep ; lock_N2 = <>} ;
mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ;
@@ -509,20 +498,28 @@ mkV2 : overload {
mkAdv s = {s = s ; lock_Adv = <>} ;
mkPrep = overload {
mkPrep : Str -> PCase -> Prep = \s,c -> {s = s ; s2 = [] ; c = c ; isPrep = True ; lock_Prep = <>} ;
mkPrep : PCase -> Str -> Prep = \c,s -> {s = [] ; s2 = s ; c = c ; isPrep = True ; lock_Prep = <>} ;
mkPrep : Str -> PCase -> Str -> Prep = \s,c,t -> {s = s ; s2 = t ; c = c ; isPrep = True ; lock_Prep = <>}
mkPrep : Str -> Case -> Prep' = \s,c -> {s = s ; s2 = [] ; sg = \\_ => [] ;
c = c ; isPrep = isPrep ; lock_Prep' = <>} ;
mkPrep : Case -> Str -> Prep' = \c,s -> {s = [] ; s2 = s ; sg = \\_ => [] ;
c = c ; isPrep = isPrep ; lock_Prep' = <>} ;
mkPrep : Str -> Case -> Str -> Prep' = \s,c,t -> {s = s ; s2 = t ; sg = \\_ => [] ;
c = c ; isPrep = isPrep ; lock_Prep' = <>}
} ;
accPrep = {s,s2 = [] ; c = accusative ; isPrep = False ; lock_Prep = <>} ;
datPrep = {s,s2 = [] ; c = dative ; isPrep = False ; lock_Prep = <>} ;
genPrep = {s,s2 = [] ; c = genitive ; isPrep = False ; lock_Prep = <>} ;
--von_Prep = mkPrep "von" dative ;
von_Prep = mkPrep [] vonDat_Case ;
zu_Prep = mkPrep [] zuDat_Case ;
anDat_Prep = mkPrep [] anDat_Case ;
inDat_Prep = mkPrep [] inDat_Case ;
inAcc_Prep = mkPrep [] inAcc_Case ;
accPrep = {s,s2 = [] ; sg = \\_ => [] ; c = accusative ; isPrep = isCase ; lock_Prep' = <>} ;
datPrep = {s,s2 = [] ; sg = \\_ => [] ; c = dative ; isPrep = isCase ; lock_Prep' = <>} ;
genPrep = {s,s2 = [] ; sg = \\_ => [] ; c = genitive ; isPrep = isCase ; lock_Prep' = <>} ;
--von_Prep = mkPrep "von" dative ;
von_Prep = {s = "von"; s2=[]; sg = table{ Masc|Neutr => "vom" ; Fem => "von der" } ;
c = dative ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
zu_Prep = {s = "zu"; s2=[]; sg = table{ Masc|Neutr => "zum" ; Fem => "zur" } ;
c = dative ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
anDat_Prep = {s = "an"; s2=[]; sg = table{ Masc|Neutr => "am" ; Fem => "an der" } ;
c = dative ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
inDat_Prep = {s = "in"; s2=[]; sg = table{ Masc|Neutr => "im" ; Fem => "in der" } ;
c = dative ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
inAcc_Prep = {s = "in"; s2=[]; sg = table{ Masc => "in den" ; Fem => "in die" ; Neutr => "ins" } ;
c = dative ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
mk6V geben gibt gib gab gaebe gegeben =
let
@@ -562,7 +559,7 @@ mkV2 : overload {
habenV v = v ** {aux = VHaben} ;
seinV v = v ** {aux = VSein} ;
reflV v c = v ** {aux = VHaben ; vtype = VRefl (prepC c).c} ;
reflV v c = v ** {aux = VHaben ; vtype = VRefl c} ;
no_geV v = let vs = v.s in v ** {
s = table {
@@ -587,7 +584,7 @@ mkV2 : overload {
mkV3 = overload {
mkV3 : V -> V3
= \v -> lin V3 (v ** {c2 = accPrep ; c3 = datPrep}) ;
mkV3 : V -> Prep -> Prep -> V3
mkV3 : V -> Prep' -> Prep' -> V3
= \v,c,d -> lin V3 (v ** {c2 = c ; c3 = d}) ;
} ;
@@ -606,41 +603,40 @@ mkV2 : overload {
mkV0 v = v ** {lock_V = <>} ;
mkV2V = overload { -- default: object-control
mkV2V : V -> V2V
mkV2V : V -> V2V
= \v -> dirV2 v ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ; -- ermahne jmdn, sich zu waschen
mkV2V : V -> Prep -> V2V
mkV2V : V -> Prep' -> V2V
= \v,p -> prepV2 v p ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ;
} ;
auxV2V = overload {
auxV2V : V -> V2V
auxV2V : V -> V2V
= \v -> dirV2 v ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ; -- lasse jmdn sich waschen
auxV2V : V -> Prep -> V2V
auxV2V : V -> Prep' -> V2V
= \v,p -> prepV2 v p ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ;
} ;
subjV2V v = v ** {objCtrl = False} ;
mkV2A = overload {
mkV2A : V -> V2A
= \v -> dirV2 v ** {isAux = False ; lock_V2A = <>} ;
mkV2A : V -> Prep -> V2A
mkV2A : V -> V2A = \v -> dirV2 v ** {isAux = False ; lock_V2A = <>} ;
mkV2A : V -> Prep' -> V2A
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2A = <>} ;
} ;
mkV2S = overload {
mkV2S : V -> V2S
= \v -> dirV2 v ** {isAux = False ; lock_V2S = <>} ;
mkV2S : V -> Prep -> V2S
mkV2S : V -> Prep' -> V2S
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2S = <>} ;
} ;
mkV2Q = overload {
mkV2Q : V -> V2Q
mkV2Q : V -> V2Q
= \v -> dirV2 v ** {isAux = False ; lock_V2Q = <>} ;
mkV2Q : V -> Prep -> V2Q
mkV2Q : V -> Prep' -> V2Q
= \v,p -> prepV2 v p ** {isAux = False ; lock_V2Q = <>} ;
} ;
mkVA = overload {
mkVA : V -> VA = \v -> lin VA (dirV2 v) ;
mkVA : V -> Prep -> VA = \v,p -> lin VA (v ** {c2 = p}) ;
mkVA : V -> Prep' -> VA = \v,p -> lin VA (v ** {c2 = p}) ;
} ;
mkAS v = v ** {lock_A = <>} ;
@@ -711,7 +707,7 @@ mkV2 : overload {
};
prepV2 : V -> Prep -> V2 ;
prepV2 : V -> Prep' -> V2 ;
dirV2 : V -> V2 ;
@@ -720,8 +716,9 @@ mkV2 : overload {
mkV2 = overload {
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Prep -> V2 = prepV2;
mkV2 : V -> Case -> V2 = \v,c -> prepV2 v (lin Prep {s,s2 = [] ; c = c ; isPrep = False}) ;
mkV2 : V -> Prep' -> V2 = prepV2;
mkV2 : V -> Case -> V2 = \v,c ->
prepV2 v (lin Prep' {s,s2 = [] ; sg = \\_ => [] ; c = c ; isPrep = isCase}) ;
} ;
}

View File

@@ -1,4 +1,5 @@
concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in {
--# -path=.:../abstract:../common:prelude -- HL
concrete PhraseGer of Phrase' = CatGer ** open Prelude, ResGer in {
flags optimize=all_subs ;
@@ -13,7 +14,7 @@ concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in {
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
UttIAdv iadv = iadv ;
UttNP np = {s = np.s ! NPC Nom ++ bigNP np} ;
UttNP np = {s = (np.s ! Nom).p1 ++ (np.s ! Nom).p2 ++ bigNP' np} ;
UttVP vp = {s = useInfVP True vp} ; -- without zu
UttAdv adv = adv ;
UttCN n = {s = n.s ! Strong ! Sg ! Nom ++ n.adv ++ n.ext ++ n.rc ! Sg} ;
@@ -25,6 +26,6 @@ concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in {
PConjConj conj = ss (conj.s2) ;
NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! NPC Nom ++ bigNP np} ;
VocNP np = {s = "," ++ (np.s ! Nom).p1 ++ (np.s ! Nom).p2 ++ bigNP' np} ;
}

View File

@@ -1,4 +1,4 @@
concrete QuestionGer of Question = CatGer ** open ResGer in {
concrete QuestionGer of Question' = CatGer ** open ResGer in {
flags optimize=all_subs ;
@@ -28,7 +28,8 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
s = \\m,t,a,p =>
let
cls = slash.s ! m ! t ! a ! p ;
who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ;
-- who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ;
who = appPrep' slash.c2 ip.s ;
in table {
QDir => who ++ cls ! Inv ;
QIndir => who ++ cls ! Sub
@@ -50,7 +51,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
s = \\m,t,a,p =>
let
vp = predV sein_V ** {ext = icomp.ext};
subj = mkSubj np vp.c1 ;
subj = mkSubj' np vp.c1 ;
cls = (mkClause subj.p1 subj.p2 vp).s ! m ! t ! a ! p ;
why = icomp.s ! np.a
in table {

View File

@@ -1,4 +1,4 @@
concrete RelativeGer of Relative = CatGer ** open ResGer in {
concrete RelativeGer of Relative' = CatGer ** open ResGer in {
flags optimize=all_subs ;
@@ -28,13 +28,16 @@ concrete RelativeGer of Relative = CatGer ** open ResGer in {
RelSlash rp slash = {
s = \\m,t,a,p,gn =>
appPrep slash.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++
-- appPrep slash.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++
appPrep' slash.c2 (rp.s ! gn) ++
slash.s ! m ! t ! a ! p ! Sub ;
c = (prepC slash.c2.c).c
-- c = (prepC slash.c2.c).c
c = slash.c2.c
} ;
FunRP p np rp = {
s = \\gn,c => np.s ! NPC c ++ appPrep p (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ;
-- s = \\gn,c => np.s ! NPC c ++ appPrep p (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ;
s = \\gn,c => (np.s ! c).p1 ++ (np.s !c).p2 ++ appPrep' p (rp.s ! gn) ;
a = RAg (numberAgr np.a) (personAgr np.a)
} ;

View File

@@ -92,6 +92,15 @@ resource ResGer = ParamX ** open Prelude in {
isLight : {w : Weight} -> Bool = \np ->
case np.w of {WHeavy => False ; _ => True} ;
-- To reduce c:PCase to c:Case in Preposition' and NP.s:PCase => Str to NP'.s:Case => Str*Str:
param
Weight' = WPron' | WLight' | WHeavy' | WDefArt ;
-- 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.
@@ -257,6 +266,13 @@ resource ResGer = ParamX ** open Prelude in {
-- isPron : Bool ; -- needed to put accPron before datPron
w : Weight } ;
NP' : Type = {
s : Case => Str * Str ;
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 ...]
a : Agr ;
w : Weight' } ;
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
\Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> {
s = table {
@@ -436,11 +452,75 @@ resource ResGer = ParamX ** open Prelude in {
-- revised appPrep for discontinuous NPs
bigNP : NP -> Str = \np -> np.ext ++ np.rc ;
bigNP' : NP' -> Str = \np -> np.ext ++ np.rc ;
-- To build a preposition from just a case. -- HL 9/19: no longer used in RGL
noPreposition : Case -> Preposition = \c ->
noPreposition : Case -> Preposition = \c ->
{s,s2 = [] ; c = NPC c ; isPrep = False} ;
noPreposition' : Case -> Preposition' = \c ->
{s,s2 = [] ; c = c ; isPrep = isCase ; sg = \\_ => []} ;
PrepNom' : Preposition' = {s,s2 = "" ; sg = \\_ => []; isPrep = isCase ; c = Nom} ;
-- New version of Prepositions to reduce c:PCase to c:Case.
param PrepType = isCase | isPrep | isPrepDefArt ;
oper
Preposition' : Type = {s : Str ; s2 : Str ; sg : Gender => Str;
c : Case ; isPrep : PrepType} ;
appPrep' : Preposition' -> (Case => Str) -> Str = \prep,arg ->
prep.s ++ arg ! prep.c ++ prep.s2 ; -- todo
appPrep2' : Preposition' -> (Case => Str * Str) -> Str = \prep,arg ->
let det : Str = (arg ! prep.c).p1 ;
cn : Str = (arg ! prep.c).p2 ;
in prep.s ++ det ++ cn ++ prep.s2 ;
appPrepNP' : Preposition' -> NP' -> Str = \prep,np ->
let n = numberAgr np.a ;
g = genderAgr np.a ;
w = np.w ;
det = (np.s ! prep.c).p1 ;
cn = (np.s ! prep.c).p2 ;
in
case prep.isPrep of {
isCase => det ++ cn ++ np.ext ++ np.rc;
isPrep => prep.s ++ det ++ cn ++ prep.s2 ++ np.ext ++ np.rc;
isPrepDefArt => case <n,w> of {
<Sg,WDefArt> => -- e.g. "zum Hof|zur Tür|zum Fenster herein"
prep.sg!g ++ cn ++ prep.s2 ++ np.ext ++ np.rc ;
_ =>
prep.s ++ det ++ cn ++ prep.s2 ++ np.ext ++ np.rc
} } ;
npM' : NP' = {s = table Case {Nom => <"der","Hund">; Acc => <"den","Hund">;
Dat => <"dem","Hund">; Gen => <"des","Hundes">};
rc = []; ext=[]; a = (Ag Masc Sg P3); w = WDefArt};
npN' : NP' = {s = table Case {Nom => <"das","Haus">; Acc => <"das","Haus">;
Dat => <"dem","Haus">; Gen => <"des","Hauses">};
rc = []; ext=[]; a = (Ag Neutr Sg P3); w = WDefArt};
npInDefM' : NP' = {s = table Case {Nom => <"ein","Hund">; Acc => <"einen","Hund">;
Dat => <"einem","Hund">; Gen => <"eines","Hundes">};
rc = []; ext=[]; a = (Ag Masc Sg P3); w = WLight'};
npInDefN' : NP' = {s = table Case {Nom => <"ein","Haus">; Acc => <"ein","Haus">;
Dat => <"einem","Haus">; Gen => <"eines","Hauses">};
rc = []; ext=[]; a = (Ag Neutr Sg P3); w = WLight'}; -- WHeavy' ?
npF' : NP' = {s = table Case {Nom => <"die","Frau">; Acc => <"die","Frau">;
Dat => <"der","Frau">; Gen => <"der","Frau">};
rc = []; ext=[]; a = (Ag Fem Sg P3); w = WDefArt};
Dat' : Preposition' = {s=""; s2=""; sg = \\c => []; c=Dat; isPrep=isCase} ;
mit' : Preposition' = {s="zusammen mit"; s2=""; sg = \\_ => []; c=Dat; isPrep=isPrep} ;
zuDat' : Preposition' = {s="zu"; s2="herein"; sg = \\_ => ""; c=Dat; isPrep=isPrep} ;
zum' : Preposition' = {s="zu"; s2="herein"; sg = table{Masc=>"zum"; Fem=>"zur"; Neutr=>"zum"};
c=Dat; isPrep=isPrepDefArt} ;
inDat' : Preposition' = {s="in"; s2="drin"; sg = \\_ => ""; c=Dat; isPrep=isPrep} ;
im' : Preposition' = {s="in"; s2="drin"; sg = table{Masc=>"im"; Fem=>"in der"; Neutr=>"im"};
c=Dat; isPrep=isPrepDefArt} ;
inAcc' : Preposition' = {s="in"; s2="hinein"; sg = \\_ => ""; c=Acc; isPrep=isPrep} ;
ins' : Preposition' = {s="in"; s2="hinein"; sg = table{Masc=>"in den"; Fem=>"in die"; Neutr=>"ins"};
c=Acc; isPrep=isPrepDefArt} ;
-- Pronouns and articles
-- Here we define personal and relative pronouns.
@@ -504,6 +584,15 @@ resource ResGer = ParamX ** open Prelude in {
_ => ad GPl k
}) ;
-- HL: To reduce PCase to Case: todo: check if we can omit the prep-string of a PCase
-- perhaps needed for "am besten"? But the adj is used in Posit only
appAdj' : Adjective -> Number => Gender => Case => Str = \adj ->
let
ad : GenNum -> Case -> Str = \gn,c ->
adj.s ! Posit ! AMod gn c
in
\\n,g,c => case n of {Sg => ad (GSg g) c ;_ => ad GPl c} ;
-- This auxiliary gives the forms in each degree of adjectives.
adjForms : (x1,x2 : Str) -> AForm => Str = \teuer,teur ->
@@ -551,10 +640,9 @@ resource ResGer = ParamX ** open Prelude in {
ext : Str ; -- sentential complement of V(2)S, V(2)Q, e.g. dass|ob sie kommt
inf : {inpl: (Agr => Str)*Str ; -- infinitival complement of V(2)V HL 3/2022
extr: (Agr => Str)} ; -- e.g. ihn [] versuchen (lasse) [, ihr zu helfen]
c1 : Preposition -- case of subject
c1 : Preposition' -- case of subject
} ;
VPSlash = VP ** {c2 : Preposition ; objCtrl : Bool} ; -- HL 3/2019 objCtr added
VPSlash = VP ** {c2 : Preposition' ; objCtrl : Bool} ; -- HL 3/2019 objCtr added
-- objCtrl distinguishes object-control from subject-control verb v:V2V in VP.s:
-- if True, reflexives in vp.inf and vp.nn have to agree with c2-object (added
@@ -616,7 +704,7 @@ resource ResGer = ParamX ** open Prelude in {
predV : Verb -> VP = predVGen False ;
predVc : Verb ** {c2 : Preposition} -> VPSlash = \v ->
predVc : Verb ** {c2 : Preposition'} -> VPSlash = \v ->
predV v ** {c2 = v.c2 ; objCtrl = False} ;
predVGen : Bool -> Verb -> VP = \isAux, verb -> {
@@ -630,7 +718,7 @@ resource ResGer = ParamX ** open Prelude in {
-- default infinitival complement:
inf = {inpl = <\\_ => [], []>; extr = \\_ => []} ;
ext,adj : Str = [] ;
c1 = PrepNom
c1 = PrepNom'
} ;
auxPerfect : Verb -> VForm => Str = \verb ->
@@ -731,16 +819,44 @@ resource ResGer = ParamX ** open Prelude in {
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> }
} ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4)
insertObjNP' : NP' -> Preposition' -> VPSlash -> VPSlash = \np,prep,vp ->
let c = prep.c ;
obj = appPrepNP' prep np ;
isPrep : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ;
in vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in
-- HL 11/6/19: rough object NP order (expensive):
-- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp
case <isPrep, np.w, c> of { -- 2 * 3 * 4 = 24 cases
<True, _,_> => -- <prons, light, heavy++pp, compl>
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> ;
<False,WPron', Acc> => -- <ihn ++ sich, light, heavy, comp>
<obj ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
<False,WPron', _ > => -- <sich ++ ihm|seiner, light, heavy, comp>
<vpnn.p1 ++ obj, vpnn.p2, vpnn.p3, vpnn.p4> ;
<False,WLight',Dat> => -- (assuming v.c2=acc) nonPron: dat < acc|gen
-- <prons, dat ++ np, heavy, comp>
<vpnn.p1, obj ++ vpnn.p2, vpnn.p3, vpnn.p4> ;
<False,WHeavy'|WDefArt,Dat> => -- <prons, light, dat ++ np, comp>
<vpnn.p1, vpnn.p2, obj ++ vpnn.p3, vpnn.p4> ;
<False,WLight',_ > => -- <prons, np ++ gen|acc, heavy, comp>
<vpnn.p1, vpnn.p2 ++ obj, vpnn.p3, vpnn.p4> ;
<False,WHeavy'|WDefArt,_ > => -- <prons, light, dat ++ np, comp>
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> }
} ; -- 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 ;
c = case prep.c of { NPC cc => cc ; _ => Acc } ;
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ; -- HL: to test ReflVP: reflPronSelf
c = prep.c ; -- HL 7/22 reduced to c:Case
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ++ prep.s2 ;
in vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in
case prep.isPrep of {
False => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
True => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4> }
isCase => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
_ => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4> }
} ;
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { -- not used in Ger, so VP.a1 can be skipped
@@ -979,6 +1095,9 @@ resource ResGer = ParamX ** open Prelude in {
heavyNP :
{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
heavyNP' :
{s : Case => Str ; a : Agr} -> {s : Case => 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 {
@@ -999,5 +1118,10 @@ resource ResGer = ParamX ** open Prelude in {
agr = case prep.c of { NPC Nom => np.a ; _ => Ag Masc Sg P3 } ;
subj = appPrepNP prep np
in <subj , agr> ;
mkSubj' : NP' -> Preposition' -> Str * Agr = \np, prep ->
let
agr = case prep.c of { Nom => np.a ; _ => Ag Masc Sg P3 } ;
subj = appPrepNP' prep np
in <subj , agr> ;
}

View File

@@ -1,11 +1,11 @@
concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
concrete SentenceGer of Sentence' = CatGer ** open ResGer, Prelude in {
flags optimize=all_subs ;
lin
PredVP np vp =
let subj = mkSubj np vp.c1
let subj = mkSubj' np vp.c1
in mkClause subj.p1 subj.p2 vp ;
{- applies verb's subject case to subject ;
@@ -34,7 +34,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
} ;
SlashVP np vp =
let subj = mkSubj np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
let subj = mkSubj' np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
in mkClause subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
AdvSlash slash adv = {
@@ -45,7 +45,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
SlashPrep cl prep = cl ** {c2 = prep} ;
SlashVS np vs slash =
let subj = mkSubj np PrepNom
let subj = mkSubj' np PrepNom'
in mkClause subj.p1 subj.p2
(insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) **
{c2 = slash.c2} ;

View File

@@ -1,4 +1,4 @@
concrete StructuralGer of Structural = CatGer **
concrete StructuralGer of Structural' = CatGer **
open MorphoGer, MakeStructuralGer, (X = ConstructX),
(P = ParadigmsGer), IrregGer, Prelude in {
@@ -11,6 +11,7 @@ concrete StructuralGer of Structural = CatGer **
above_Prep = mkPrep "über" P.dative ;
after_Prep = mkPrep "nach" P.dative ;
all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAgNone} ;
all_Predet' = {s = appAdj' (regA "all") ; c = noCase ; a = PAgNone} ;
almost_AdA, almost_AdN = ss "fast" ;
although_Subj = ss "obwohl" ;
always_AdV = ss "immer" ;
@@ -49,12 +50,14 @@ concrete StructuralGer of Structural = CatGer **
if_Subj = ss "wenn" ; --- no variants in the RGL! | ss "falls" ;
in8front_Prep = mkPrep "vor" P.dative ;
i_Pron = mkPronPers "ich" "mich" "mir" "meiner" "mein" Masc Sg P1 ;
in_Prep = mkPrep [] (NPP CInDat) ;
-- in_Prep = mkPrep [] (NPP CInDat) ;
in_Prep = P.inDat_Prep ; -- HL 7/2022
it_Pron = mkPronPers "es" "es" "ihm" "seiner" "sein" Neutr Sg P3 ;
less_CAdv = X.mkCAdv "weniger" "als" ;
many_Det = detLikeAdj False Pl "viel" ;
more_CAdv = X.mkCAdv "mehr" "als" ;
most_Predet = {s = appAdj (regA "meist") ; c = noCase ; a = PAgNone} ;
most_Predet' = {s = appAdj' (regA "meist") ; c = noCase ; a = PAgNone} ;
much_Det = {s = \\_,_ => "viel" ; sp = \\_,_ => "vieles" ; n = Sg ; a = Weak ; isDef = False} ;
must_VV = auxVV
(mkV

View File

@@ -1,20 +1,9 @@
concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
concrete VerbGer of Verb' = CatGer ** open Prelude, ResGer, Coordination in {
flags optimize=all_subs ;
lin
UseV = predV ;
{-
ComplVV v vp =
let
vpi = infVP v.isAux vp ;
vps = predVGen v.isAux v ;
in
insertExtrapos vpi.p4 (
insertInfExt vpi.p3 (
insertInf vpi.p2 (
insertObjc vpi.p1 vps))) ;
-}
ComplVV v vp = -- HL 3/22: leave inf-complement in-place, extract infzu-complement
let
@@ -32,25 +21,14 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
SlashV2a v = (predVc v) ;
Slash2V3 v np = insertObjNP np v.c2 (predVc v) ** {c2 = v.c3} ;
Slash3V3 v np = insertObjNP np v.c3 (predVc v) ;
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 (comma ++ conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2; objCtrl = False} ;
SlashV2Q v q =
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ** {c2 = v.c2; objCtrl = False} ;
{-
SlashV2V v vp =
let
vpi = infVP v.isAux vp ;
vps = predVGen v.isAux v ** {c2 = v.c2} ;
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, sich zu waschen | sich waschen lassen HL 7/19
let
vps = predVGen v.isAux v ; -- e.g. verspricht|bittet.isAux=False | läßt.isAux=True
@@ -62,23 +40,14 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
SlashV2A v ap =
insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ;
-- to save compile time, comment out:
ComplSlash vps np =
-- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np.
-- HL 3/22 better before inserting np, using objCtrl
let vp = case vps.objCtrl of { True => objAgr np vps ; _ => vps }
** { c2 = vps.c2 ; objCtrl = vps.objCtrl } ;
in insertObjNP np vps.c2 vp ;
{-
SlashVV v vp =
let
vpi = infVP v.isAux vp ;
vps = predVGen v.isAux v ** {c2 = vp.c2 } ;
in vps **
insertExtrapos vpi.p3 (
insertInf vpi.p2 (
insertObj vpi.p1 vps)) ;
-}
in insertObjNP' np vps.c2 vp ;
-- compiler: + ComplSlash' 414720 (199680,352)
-- SlashVV v vps is like ComplVV v vp, but infinite vps should not be extracted
SlashVV v vp = -- HL 3/2022
@@ -123,9 +92,11 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
-- expensive: + SlashV2VNP 503.884.800 (2880,540), reaches memory limit with SlashVV
-- does not work for nested uses: the nn-levels are confused HL 3/22
SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22
insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ;
-- SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22
-- insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ;
-- to save compile time, comment out:
SlashV2VNP' v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22
insertObjNP' np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ;
UseComp comp =
insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used
@@ -159,7 +130,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
PassV2 v = -- acc object -> nom subject; all others: same PCase
let c = case <v.c2.c, v.c2.isPrep> of {
<NPC Acc, False> => NPC Nom ; _ => v.c2.c}
<Acc, isCase> => Nom ; _ => v.c2.c}
in insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } ;
{- HL: The construction VPSlashPrep : VP -> Prep -> VPSlash does not exist