The glueing of preposition with definite article is now implemented using

NP.s : Bool => Case => Str  and   NP.w = WDefArt

np.s ! False : Case => Str is the ordinary paradigm; if the np has a
definite article, np.w = WDefArt, and np.s ! True : Case => Str is the
paradigm with definite article omitted, if np.a = Ag g Sg p.

Prepositions now have type

  Prep = {s : GenNum => Str ; s2 :Str ; c : Case ; isPrep : PrepType},

and |Prep| = |Case|*|isPrep| = 4 * 3 = 12, independent of |PCase| >= 18.

A preposition p with p.isPrep = isPrepDefArt has in p.s ! (GSg g) : Str
the preposition glued with definite article of a following np in singular.

The modified linearization categories for Prep, NP, Det, DAP, Quant,
Predet are no longer Prep', NP' etc., but Prep, NP etc. in CatGer.
They are now also used in gf-rgl/tests/german/TestLangGer.gf.
The previous auxiliary files abstract/Adjective'.gf etc. are removed.

BUT: for complexitiy reasons,
- the glueing is omitted in SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash,
- SlashVP : NP -> SlashVP -> ClSlash (in SentenceGer and TestLanGer)
  are commented out.
SlashVP causes grammar compilation to crash due to memory limits, probably
because mkClause and its modification mkClSlash are too detailed.
This commit is contained in:
Hans Leiss
2022-08-23 15:32:17 +02:00
parent 787f9d10e8
commit 1cad178ec8
42 changed files with 238 additions and 1202 deletions
+45 -45
View File
@@ -102,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
@@ -111,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
--
@@ -168,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
@@ -182,28 +182,28 @@ 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
-- for preposition glued with DefArt in singular:
-- e.g. "auf" "auf den" "auf die" "aufs" + accusative
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep' ;
mkPrep : Case -> Prep' ; -- convert case to preposition
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep ;
mkPrep : Case -> Prep ; -- convert case to preposition
} ;
-- 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, with contraction vom
zu_Prep : Prep' ; -- zu + dative, with contractions zum, zur
anDat_Prep : Prep' ; -- an + dative, with contraction am
inDat_Prep : Prep' ; -- in + dative, with contraction im
inAcc_Prep : Prep' ; -- in + accusative, with contraction ins
von_Prep : Prep ; -- von + dative, with contraction vom
zu_Prep : Prep ; -- zu + dative, with contractions zum, zur
anDat_Prep : Prep ; -- an + dative, with contraction am
inDat_Prep : Prep ; -- in + dative, with contraction im
inAcc_Prep : Prep ; -- in + accusative, with contraction ins
--2 Verbs
@@ -273,7 +273,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.
@@ -287,11 +287,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
@@ -314,15 +314,15 @@ mkV2 : overload {
mkV2A : overload {
mkV2A : V -> V2A ;
mkV2A : V -> Prep' -> 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 ;
} ;
@@ -338,9 +338,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
@@ -447,11 +447,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 = <>} ;
@@ -502,17 +502,17 @@ mkV2 : overload {
mkAdv s = {s = s ; lock_Adv = <>} ;
mkPrep = overload {
mkPrep : Str -> Case -> Prep' = \s,c ->
{s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep ; lock_Prep' = <>} ;
mkPrep : Case -> Str -> Prep' = \c,s ->
{s = \\_ => [] ; s2 = s ; c = c ; isPrep = isPrep ; lock_Prep' = <>} ;
mkPrep : Str -> Case -> Str -> Prep' = \s,c,t ->
{s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep' = <>} ;
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep' = \s,masc,fem,neutr, c ->
mkPrep : Str -> Case -> Prep = \s,c ->
{s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep ; lock_Prep = <>} ;
mkPrep : Case -> Str -> Prep = \c,s ->
{s = \\_ => [] ; s2 = s ; c = c ; isPrep = isPrep ; lock_Prep = <>} ;
mkPrep : Str -> Case -> Str -> Prep = \s,c,t ->
{s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep = <>} ;
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep = \s,masc,fem,neutr, c ->
{s = table{GPl => s ; GSg Masc => masc ; GSg Fem => fem ; GSg Neutr => neutr} ;
s2 = [] ; c = c ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
mkPrep : Case -> Prep' = \c ->
{s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep' = <>} ;
s2 = [] ; c = c ; isPrep = isPrepDefArt ; lock_Prep = <>} ;
mkPrep : Case -> Prep = \c ->
{s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>} ;
} ;
accPrep = mkPrep accusative ;
@@ -590,7 +590,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}) ;
} ;
@@ -611,38 +611,38 @@ mkV2 : overload {
mkV2V = overload { -- default: object-control
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
= \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 -> 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
= \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 = <>} ;
@@ -713,7 +713,7 @@ mkV2 : overload {
};
prepV2 : V -> Prep' -> V2 ;
prepV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -722,7 +722,7 @@ mkV2 : overload {
mkV2 = overload {
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
mkV2 : V -> V2 = dirV2 ;
mkV2 : V -> Prep' -> V2 = prepV2;
mkV2 : V -> Prep -> V2 = prepV2;
mkV2 : V -> Case -> V2 = \v,c -> prepV2 v (mkPrep c) ;
} ;