1. updated types in ../abstract/*'.gf to replace NP,Det,Quant,Predep,Prep,DAP by

their primed versions
2. implemented all linearizations to use the primed categories

This allows linearization with prep+defart's, but parsing gives metavariables
in parses (DetQuant ? NumSg) and (DetQuantOrd ? NumSg ord) for prep+defart.

Todo: make Quant.s and NP. depend on PronType = isCat | isPron | isPronDefArt.

Without SlashV2VNP', compiles in 84 sec and gives 3,6M VerbGer.gfo, 2,3M SentenceGer.gfo.

Uses |Prep'|=12 instead of |Prep|=18, |NP'|=72 instead of |NP|=54
This commit is contained in:
Hans Leiss
2022-07-22 11:49:19 +02:00
parent 8eee3df739
commit ec41af609d
20 changed files with 283 additions and 257 deletions

View File

@@ -9,12 +9,12 @@ abstract Adjective' = Cat' ** {
-- elliptic-relational.
PositA : A -> AP ; -- warm
ComparA : A -> NP -> AP ; -- warmer than I
ComparA : A -> NP' -> AP ; -- warmer than I
ComplA2 : A2 -> NP' -> AP ; -- married to her
ReflA2 : A2 -> AP ; -- married to itself
UseA2 : A2 -> AP ; -- married
UseComparA : A -> AP ; -- warmer
CAdvAP : CAdv -> AP -> NP -> AP ; -- as cool as John
CAdvAP : CAdv -> AP -> NP' -> AP ; -- as cool as John
-- The superlative use is covered in $Ord$.

View File

@@ -13,7 +13,7 @@ abstract Adverb' = Cat' ** {
-- Comparative adverbs have a noun phrase or a sentence as object of
-- comparison.
ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more warmly than John
ComparAdvAdj : CAdv -> A -> NP' -> Adv ; -- more warmly than John
ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
-- Adverbs can be modified by 'adadjectives', just like adjectives.

View File

@@ -1 +1 @@
abstract Cat' = Cat ** {cat NP'; Det'; Quant'; Predet'; Prep'; }
abstract Cat' = Cat ** {cat NP'; Det'; Quant'; Predet'; Prep'; DAP' ;}

View File

@@ -10,7 +10,7 @@ abstract Lang' =
Lexicon
-- ,Construction --- could be compiled here, but not in concretes, as they call Syntax and Grammar
-- ,Documentation --# notpresent
,Markup - [stringMark]
,Markup' - [stringMark]
** {
flags startcat=Phr ;
} ;

View File

@@ -12,28 +12,27 @@ abstract Noun' = Cat' ** {
--
--
fun
DetCN : Det -> CN -> NP ; -- the man
DetCN' : Det' -> CN -> NP' ; -- the man
UsePN : PN -> NP ; -- John
UsePron : Pron -> NP ; -- he
DetCN : Det' -> CN -> NP' ; -- the man
UsePN : PN -> NP' ; -- John
UsePron : Pron -> NP' ; -- he
-- Pronouns are defined in the module [``Structural`` Structural.html].
-- A noun phrase already formed can be modified by a $Predet$erminer.
PredetNP : Predet -> NP -> NP ; -- only the man
PredetNP : Predet' -> NP' -> NP' ; -- only the man
-- A noun phrase can also be postmodified by the past participle of a
-- verb, by an adverb, or by a relative clause
PPartNP : NP -> V2 -> NP ; -- the man seen
AdvNP : NP -> Adv -> NP ; -- Paris today
ExtAdvNP: NP -> Adv -> NP ; -- boys, such as ..
RelNP : NP -> RS -> NP ; -- Paris, which is here
PPartNP : NP' -> V2 -> NP' ; -- the man seen
AdvNP : NP' -> Adv -> NP' ; -- Paris today
ExtAdvNP: NP' -> Adv -> NP' ; -- boys, such as ..
RelNP : NP' -> RS -> NP' ; -- Paris, which is here
-- Determiners can form noun phrases directly.
DetNP : Det -> NP ; -- these five
DetNP : Det' -> NP' ; -- these five
--2 Determiners
@@ -41,9 +40,8 @@ abstract Noun' = Cat' ** {
-- The determiner has a fine-grained structure, in which a 'nucleus'
-- quantifier and an optional numeral can be discerned.
DetQuant : Quant -> Num -> Det ; -- these five
DetQuant' : Quant' -> Num -> Det'; -- these five
DetQuantOrd : Quant -> Num -> Ord -> Det ; -- these five best
DetQuant : Quant' -> Num -> Det' ; -- these five
DetQuantOrd : Quant' -> Num -> Ord -> Det' ; -- these five best
-- Whether the resulting determiner is singular or plural depends on the
-- cardinal.
@@ -84,21 +82,20 @@ abstract Noun' = Cat' ** {
-- neatly distinct words (Spanish "un, unos ; el, los") but also without
-- any particular word (Finnish; Swedish definites).
IndefArt : Quant ; -- a/an
DefArt : Quant ; -- the
DefArt' : Quant'; -- the
DefArt : Quant'; -- the
IndefArt : Quant' ; -- a/an
-- Nouns can be used without an article as mass nouns. The resource does
-- not distinguish mass nouns from other common nouns, which can result
-- in semantically odd expressions.
MassNP : CN -> NP ; -- (beer)
MassNP : CN -> NP' ; -- (beer)
-- Pronouns have possessive forms. Genitives of other kinds
-- of noun phrases are not given here, since they are not possible
-- in e.g. Romance languages. They can be found in $Extra$ modules.
PossPron : Pron -> Quant ; -- my (house)
PossPron : Pron -> Quant' ; -- my (house)
-- Other determiners are defined in [Structural Structural.html].
@@ -140,14 +137,14 @@ abstract Noun' = Cat' ** {
-- This is certainly overgenerating.
ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y)
ApposCN : CN -> NP' -> CN ; -- city Paris (, numbers x and y)
--2 Possessive and partitive constructs
-- (New 13/3/2013 AR; Structural.possess_Prep and part_Prep should be deprecated in favour of these.)
PossNP : CN -> NP -> CN ; -- house of Paris, house of mine
PartNP : CN -> NP -> CN ; -- glass of wine
PossNP : CN -> NP' -> CN ; -- house of Paris, house of mine
PartNP : CN -> NP' -> CN ; -- glass of wine
-- This is different from the partitive, as shown by many languages.
@@ -156,6 +153,6 @@ abstract Noun' = Cat' ** {
--3 Conjoinable determiners and ones with adjectives
AdjDAP : DAP -> AP -> DAP ; -- the large (one)
DetDAP : Det -> DAP ; -- this (or that)
DetDAP : Det' -> DAP' ; -- this (or that)
}

View File

@@ -14,8 +14,7 @@ abstract Structural' = Cat' ** {
above_Prep : Prep' ;
after_Prep : Prep' ;
all_Predet : Predet ;
all_Predet' : Predet' ;
all_Predet : Predet' ;
almost_AdA : AdA ;
almost_AdN : AdN ;
although_Subj : Subj ;
@@ -35,12 +34,12 @@ abstract Structural' = Cat' ** {
during_Prep : Prep' ;
either7or_DConj : Conj ; -- either...or
---b either7or_DConj : DConj ;
every_Det : Det ;
everybody_NP : NP ; -- everybody
everything_NP : NP ;
every_Det : Det' ;
everybody_NP : NP' ; -- everybody
everything_NP : NP' ;
everywhere_Adv : Adv ;
--- first_Ord : Ord ; DEPRECATED
few_Det : Det ;
few_Det : Det' ;
for_Prep : Prep' ;
from_Prep : Prep' ;
he_Pron : Pron ;
@@ -56,17 +55,16 @@ abstract Structural' = Cat' ** {
in_Prep : Prep' ;
it_Pron : Pron ;
less_CAdv : CAdv ;
many_Det : Det ;
many_Det : Det' ;
more_CAdv : CAdv ;
most_Predet : Predet ;
most_Predet' : Predet' ;
much_Det : Det ;
most_Predet : Predet' ;
much_Det : Det' ;
must_VV : VV ;
---b no_Phr : Phr ;
no_Utt : Utt ;
on_Prep : Prep' ;
--- one_Quant : QuantSg ; DEPRECATED
only_Predet : Predet ;
only_Predet : Predet' ;
or_Conj : Conj ;
otherwise_PConj : PConj ;
part_Prep : Prep' ;
@@ -75,19 +73,19 @@ abstract Structural' = Cat' ** {
quite_Adv : AdA ;
she_Pron : Pron ;
so_AdA : AdA ;
someSg_Det : Det ;
somePl_Det : Det ;
somebody_NP : NP ;
something_NP : NP ;
someSg_Det : Det' ;
somePl_Det : Det' ;
somebody_NP : NP' ;
something_NP : NP' ;
somewhere_Adv : Adv ;
that_Quant : Quant ;
that_Quant : Quant' ;
that_Subj : Subj ;
there_Adv : Adv ;
there7to_Adv : Adv ; -- to there
there7from_Adv : Adv ; -- from there
therefore_PConj : PConj ;
they_Pron : Pron ;
this_Quant : Quant ;
this_Quant : Quant' ;
through_Prep : Prep' ;
to_Prep : Prep' ;
too_AdA : AdA ;
@@ -112,13 +110,13 @@ abstract Structural' = Cat' ** {
youPl_Pron : Pron ; -- you (plural)
youPol_Pron : Pron ; -- you (polite)
no_Quant : Quant ;
not_Predet : Predet ;
no_Quant : Quant' ;
not_Predet : Predet' ;
if_then_Conj : Conj ;
at_least_AdN : AdN ;
at_most_AdN : AdN ;
nobody_NP : NP ;
nothing_NP : NP ;
nobody_NP : NP' ;
nothing_NP : NP' ;
except_Prep : Prep' ;
as_CAdv : CAdv ;

View File

@@ -75,7 +75,7 @@ abstract Verb' = Cat' ** {
-- Adjectival phrases, noun phrases, and adverbs can be used.
CompAP : AP -> Comp ; -- (be) small
CompNP : NP -> Comp ; -- (be) the man
CompNP : NP' -> Comp ; -- (be) the man
CompAdv : Adv -> Comp ; -- (be) here
CompCN : CN -> Comp ; -- (be) a man/men

View File

@@ -10,14 +10,18 @@ concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in {
c = <[],[]> ;
ext = []
} ;
ComparA a np = {
s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! NPC Nom ++ bigNP np ;
ComparA a np =
let nps = (np.s ! Nom).p1 ++ (np.s ! Nom).p2 ++ bigNP' np
in {
s = \\af => a.s ! Compar ! af ++ conjThan ++ nps ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;
CAdvAP ad ap np = ap ** {
s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ np.s ! NPC Nom ++ bigNP np ;
CAdvAP ad ap np =
let nps = (np.s ! Nom).p1 ++ (np.s ! Nom).p2 ++ bigNP' np in
ap ** {
s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ nps ;
isPre = False
} ;
UseComparA a = {
@@ -37,33 +41,31 @@ concrete AdjectiveGer of Adjective' = CatGer ** open ResGer, Prelude in {
-- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 a np =
let CExt = case a.c2.isPrep of {
isCase => <appPrepNP' a.c2 np, []> ;
_ => <[], appPrepNP' a.c2 np> } -- HL: check 7/22
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
let CExt = case a.c2.isPrep of {
isCase => <appPrepNP' a.c2 np, []> ;
_ => <[], appPrepNP' a.c2 np> } -- HL: check 7/22
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
} ;
ReflA2 a =
let
-- 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
{isCase => <compl, []> ;
_ => <[], compl> } -- HL Check isPrepDefArt
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
let
compl = appPrep' a.c2 (reflPron ! agrP3 Sg) ;
CExt = case a.c2.isPrep of
{isCase => <compl, []> ; _ => <[], compl> }
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
} ;
SentAP ap sc = ap ** {
isPre = False ;
ext = ap.ext ++ sc.s
ext = ap.ext ++ sc.s
} ;
AdAP ada ap = ap ** {s = \\a => ada.s ++ ap.s ! a} ;

View File

@@ -3,8 +3,10 @@ concrete AdverbGer of Adverb' = CatGer ** open ResGer, Prelude in {
lin
PositAdvAdj a = {s = a.s ! Posit ! APred} ;
ComparAdvAdj cadv a np = {
s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ np.s ! NPC Nom
ComparAdvAdj cadv a np =
let nps = (np.s ! Nom).p1 ++ (np.s ! Nom).p2 ++ bigNP' np in
{
s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ nps
} ;
ComparAdvAdjS cadv a s = {
s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub

View File

@@ -75,7 +75,8 @@ concrete CatGer of Cat' =
-- HL: To reduce PCase to Case:
NP' = ResGer.NP' ;
Det' = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
Det' = {s,sp : Gender => Case => {quant,num:Str}; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
DAP' = {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 ;
@@ -85,11 +86,10 @@ concrete CatGer of Cat' =
} ;
Predet' = {
s : Number => Gender => Case => Str ;
c : {p : Str ; k : PredetCase} ;
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} ;
@@ -129,7 +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
NP' = \np -> (np.s!Nom).p1 ++ (np.s!Nom).p2 ++ np.ext ++ np.rc ; -- HL 7/2022
CN = \cn -> cn.s ! Strong ! Pl ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Pl ;
SSlash = \ss -> ss.s ! Main ++ ss.c2.s ;
@@ -149,4 +149,8 @@ concrete CatGer of Cat' =
V2V = \v -> useInfVP v.isAux (predVGen v.isAux v) ++ v.c2.s ;
Conj = \c -> c.s1 ++ c.s2 ;
Det' = \det -> (det.s ! Masc ! Nom).quant ++ (det.s ! Masc ! Nom).num ;
Prep' = \prep -> case prep.isPrep of {PrepDefArf => prep.sg ! Masc ;
_ => prep.s ++ prep.s2 } ;
}

View File

@@ -2,7 +2,7 @@
concrete GrammarGer of Grammar' =
NounGer,
VerbGer, -- to save compile time during development HL 7/22
VerbGer,
AdjectiveGer,
AdverbGer,
NumeralGer,

View File

@@ -13,6 +13,7 @@ flags
lin
add_V3 = dirV3 (prefixV "hinzu" (regV "fügen")) zu_Prep ;
airplane_N = mkN "Flugzeug" "Flugzeuge" neuter ;
alas_Interj = {s = "ach" } ;
already_Adv = mkAdv "schon" ;
answer_V2S = mkV2S (regV "antworten") datPrep ;
apartment_N = mkN "Wohnung" ;
@@ -212,7 +213,8 @@ lin
dirV2 (irregV "verstehen" "versteht" "verstand" "verstände" "verstanden") ;
university_N = reg2N "Universität" "Universitäten" feminine ;
village_N = reg2N "Dorf" "Dörfer" neuter ;
wait_V2 = prepV2 (regV "warten") (mkPrep "auf" accusative) ;
-- wait_V2 = prepV2 (regV "warten") (mkPrep "auf" accusative) ;
wait_V2 = prepV2 (regV "warten") (mkPrep "auf" "auf den" "auf die" "aufs" accusative) ;
walk_V = seinV Irreg.gehen_V ;
warm_A = mk3A "warm" "wärmer" "wärmste" ;
war_N = mkN "Krieg" ;

View File

@@ -1,10 +1,11 @@
--# -path=.:../abstract:../common
concrete MarkupGer of Markup = CatGer, MarkHTMLX ** {
concrete MarkupGer of Markup' = CatGer, MarkHTMLX ** {
lin
MarkupCN m cn = cn ** {s = \\a,n,c => appMark m (cn.s ! a ! n ! c)} ; --- other fields e.g ext intact
MarkupNP m np = np ** {s = \\c => appMark m (np.s ! c)} ;
MarkupNP' m np = np ** {s = \\c => appMark2 m (np.s ! c)} ;
MarkupAP m ap = ap ** {s = \\a => appMark m (ap.s ! a)} ;
MarkupAdv m adv = {s = appMark m adv.s} ;
MarkupS m s = {s = \\o => appMark m (s.s ! o)} ;
@@ -12,5 +13,8 @@ lin
MarkupPhr m phr = {s = appMark m phr.s} ;
MarkupText m txt = {s = appMark m txt.s} ;
oper
appMark2 : {begin,end : Str} -> Str * Str -> Str * Str
= \m,s -> <m.begin ++ s.p1, s.p2 ++ m.end> ;
}

View File

@@ -27,6 +27,16 @@ oper
s = \\c => usePrepC c (\k -> name.s ! k) ;
a = agrP3 Sg
} ;
nameNounPhrase' : Gender -> {s : Case => Str} -> {s : Case => Str * Str;
a : Agr ;
w : Weight' ;
ext,rc : Str} =
\g,name -> {
s = \\c => <[],name.s ! c> ;
a = agrgP3 g Sg ;
ext,rc = [] ;
w = WHeavy' -- ok?
} ;
detLikeAdj : Bool -> Number -> Str ->
{s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} = \isDef,n,dies ->

View File

@@ -7,142 +7,116 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in {
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 ++ cn.adv) ;
a = agrgP3 cn.g det.n ;
s = \\c => <(det.s ! cn.g ! c).quant,
(det.s ! cn.g ! c).num ++ 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 } ;
rc = cn.rc ! det.n ;
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' } ;
-- 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 ;
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
DetNP det = { -- more genders in ExtraGer -- HL: der+er,den+en ; der drei,den drei+en
s = \\c => <(det.sp ! Neutr ! c).quant, (det.sp ! Neutr ! c).num> ;
a = agrP3 det.n ;
-- 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 } ;
w = case det.isDef of { True => WLight' ; _ => WHeavy' } ;
rc, ext = []
} ;
UsePN pn = {
s = \\c => usePrepC c (\k -> pn.s ! k) ;
s = \\c => <[], pn.s ! c> ;
a = agrgP3 pn.g Sg ;
-- 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 = []
w = WLight' ; -- means: this is not a heavy NP, but comes before negation
rc, ext = [] -- Pron => Light HL 6/2019: to regulate Pron/NonPronNP order
} ;
UsePron pron = {
s = \\c => usePrepC c (\k -> pron.s ! NPCase k) ;
s = \\c => <[], pron.s ! NPCase c> ;
a = pron.a ;
-- isLight = True ;
-- isPron = True ;
w = WPron ;
w = WPron' ;
rc, ext = []
} ;
PredetNP pred np =
let ag = case pred.a of {PAg n => agrP3 n ; _ => np.a} in np ** {
s = \\c0 =>
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 ;
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).p1, (np.s ! c).p2> ;
a = ag ;
-- isLight = False ;
-- isPron = False
w = WHeavy
w = WHeavy'
} ;
PPartNP np v2 = np ** {
s = \\c => np.s ! c ++ embedInCommas (v2.s ! VPastPart APred) ; --- invar part
-- isPron = False
w = WHeavy
s = incr2 np.s (embedInCommas (v2.s ! VPastPart APred)) ; --- invar part
w = WHeavy'
} ;
{- "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 ** {
s = \\c => np.s ! c ++ adv.s ;
-- isLight = False ;
-- isPron = False
w = WHeavy
s = incr2 np.s adv.s ;
w = WHeavy'
} ;
ExtAdvNP np adv = np ** {
s = \\c => np.s ! c ++ embedInCommas adv.s ;
-- isLight = False ;
-- isPron = False
w = WHeavy
s = incr2 np.s (embedInCommas adv.s) ;
w = WHeavy'
} ;
DetQuantOrd quant num ord =
let
n = num.n ;
a = quant.a
in {
s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++ (let k = (prepC c).c in
num.s!g!k ++ ord.s ! agrAdj g (adjfCase a k) n k) ;
sp = \\g,c => quant.sp ! num.isNum ! n ! g ! c ++ (let k = (prepC c).c in
num.s!g!k ++ ord.s ! agrAdj g (adjfCase quant.aPl k) n k) ;
n = n ;
a = case n of {Sg => a ; Pl => quant.aPl} ;
isDef = case <quant.a, quant.aPl> of {<Strong,Strong> => False ; _ => True} ;
} ;
-- HL 21.7.2022: the dropping of DefArt in Prep+DefArt via hasDefArt works by splitting the
-- np.s into det':Str and cn:Str and (det.s ! g ! n) into {quant:Str; num:Str}, so that in
-- PrepNP in_Prep np we can replace "in" + "das" by "im" to get
-- PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (warme Meer)) => im warmen Meer
-- But parsing "im warmen Meer" results in a
-- PrepNP in_Prep (DetCN (DetQuant ? NumSg) (AdjCN ... ))
-- because (DetQuant.s!g!c).quant is ignored, but the .num is part of (np.s!c).p2.
-- To avoid the metavariable ?, we have to make Det.s and NP.s depend on t:PrepType = isPrep.
DetQuant quant num =
let
n = num.n ;
DetQuantOrd quant num ord =
let -- does not work, since here DefArt is combined with ord
n = num.n ; --
a = quant.a
in {
s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++ (let k = (prepC c).c in
num.s!g!k) ;
sp = \\g,c => quant.sp ! num.isNum ! n ! g ! c ++ (let k = (prepC c).c in
num.s!g!k) ; -- 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} ;
} ;
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
s = \\g,c => {quant = quant.s ! num.isNum ! n ! g ! c;
num = num.s!g!c ++ ord.s ! agrAdj g (adjfCase a c) n c} ;
sp = \\g,c => {quant = quant.sp ! num.isNum ! n ! g ! c;
num = num.s!g!c ++ ord.s ! agrAdj g (adjfCase quant.aPl c) n c} ;
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 ;
} ;
DetQuant quant num =
let
n = num.n ;
a = quant.a
in {
s = \\g,c => {quant = quant.s ! num.isNum ! n ! g ! c ; num = num.s!g!c} ;
sp = \\g,c => {quant = quant.sp ! num.isNum ! n ! g ! c ; num = 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 = {
s = \\_,n,g,c => usePrepC c (\k -> p.s ! NPPoss (gennum g n) k) ;
sp = \\_,n,g,c => usePrepC c (\k -> p.s ! NPPoss (gennum g n) k) ;
s = \\_,n,g,c => p.s ! NPPoss (gennum g n) c ;
sp = \\_,n,g,c => p.s ! NPPoss (gennum g n) c ;
a = Strong ;
aPl = Weak ;
hasDefArt = False ;
} ;
NumCard n = n ** {isNum = True} ;
@@ -163,39 +137,6 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in {
OrdNumeralSuperl n a = {s = \\af => n.s ! NOrd APred ++ Predef.BIND ++ a.s ! Superl ! af} ; -- drittbeste
DefArt = {
s = \\_,n,g,c => artDefContr (gennum g n) c ;
-- sp = \\_,n,g,c => artDefContr (gennum g n) c ; ---- deren, denen ...
sp = \\_,n,g,c => case <n,c> of {
<Sg,NPP p> => let sp = prepC c ; gn = gennum g n
in sp.s ++ artDef ! gn ! sp.c ;
<Pl,NPP CInAcc> => let sp = prepC c in sp.s ++ "die" ;
<Pl,NPP p> => let sp = prepC c ; gn = gennum g n
in sp.s ++ (artDef ! gn ! sp.c + "en") ;
<Pl,NPC Dat> => "denen" ; -- HL 6/2019
<Pl,NPC Gen> => "derer" ; -- HL 6/2019
_ => artDefContr (gennum g n) c } ; -- von den+en
a, aPl = Weak
} ;
IndefArt = {
s = table {
True => \\_,_,c => usePrepC c (\k -> []) ;
False => table {
Sg => \\g,c => usePrepC c (\k -> "ein" + pronEnding ! GSg g ! k) ;
Pl => \\_,c => usePrepC c (\k -> [])
}
} ;
sp = table {
True => \\_,_,c => usePrepC c (\k -> []) ;
False => table {
Sg => \\g,c => usePrepC c (\k -> (detUnlikeAdj False Sg "ein").s ! g ! NPC k) ;
Pl => \\_,c => usePrepC c (\k -> caselist "einige" "einige" "einigen" "einiger" ! k)
}
} ;
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
@@ -204,15 +145,34 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in {
a, aPl = Weak ;
hasDefArt = True
} ;
IndefArt = {
s = table {
True => \\_,_,c => [] ;
False => table {
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
Pl => \\_,c => []
}
} ;
sp = table {
True => \\_,_,c => [] ;
False => table {
Sg => \\g,c => (detUnlikeAdj' False Sg "ein").s ! g ! c ;
Pl => \\_,c => caselist "einige" "einige" "einigen" "einiger" ! c
}
} ;
a, aPl = Strong ;
hasDefArt = False
} ;
MassNP cn = {
s = \\c => usePrepC c (\k -> cn.s ! Strong ! Sg ! k) ++ cn.adv ;
s = \\c => <[], cn.s ! Strong ! Sg ! c ++ cn.adv> ;
a = agrgP3 cn.g Sg ;
-- isLight = True ; -- ich trinke Bier nicht vs. ich trinke kein Bier
-- isPron = False ;
w = WLight ;
w = WLight' ;
rc = cn.rc ! Sg ;
ext = cn.ext
ext = cn.ext ;
hasDefArt = False
} ;
UseN, UseN2 = \n -> {
@@ -262,9 +222,8 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in {
---- another layer of embedInCommas needed if there is a non-empty rc
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 }
rc = np.rc ++ embedInCommas (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ;
w = case isPron' np of { True => WLight' ; _ => np.w }
} ;
SentCN cn s = cn ** {ext = cn.ext ++ embedInCommas s.s} ;
@@ -272,11 +231,33 @@ concrete NounGer of Noun' = CatGer ** open ResGer, MorphoGer, Prelude in {
AdvCN cn a = cn ** {adv = cn.adv ++ a.s} ;
ApposCN cn np = let g = cn.g in cn ** {
s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPC c ++ bigNP np } ;
s = \\a,n,c => cn.s ! a ! n ! c ++ (np.s ! c).p1 ++ (np.s ! c).p2 ++ bigNP' np } ;
-- PossNP cn np = cn ** {
-- s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat ++ bigNP np } ;
PossNP cn np = cn ** {
s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat ++ bigNP np } ;
s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep2' vonDat' np.s ++ bigNP' np } ; -- HL, ad hoc
DetDAP det = det ;
-- PartNP cn np = todo -- glass of wine
CountNP det np = -- drei der Kinder | drei von den Kindern -- HL 7/22, ad-hoc
-- det or numeral? np or rather (DefArt +) cn? drei (einiger Kinder) ?
let g = genderAgr np.a
in {
s = \\c => det.s ! g ! c ++ np.s ! NPP CVonDat ++ bigNP np ;
a = agrgP3 g det.n ;
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
rc = np.rc ;
ext = np.ext
} ;
-- AdjDAP dap adj = ?? TODO -- the large (one)
DetDAP det = {s = \\g,c => (det.s ! g ! c).quant ++ (det.s ! g ! c).num ; -- HL 7/22
sp = \\g,c => (det.sp ! g ! c).quant ++ (det.sp ! g ! c).num ;
n = det.n ; a = det.a ; isDef = det.isDef ; hasDefArt = det.hasDefArt} ;
oper
incr2 : (Case => Str * Str) -> Str -> (Case => Str * Str) = \tab,str ->
\\c => <(tab ! c).p1, (tab ! c).p2 ++ str> ;
}

View File

@@ -137,10 +137,10 @@ mkN : overload {
} ;
-- To extract the number of a noun phrase
-- To extract the number of a noun phrase --never used in RGL
ifPluralNP : NP -> Bool
= \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
-- ifPluralNP : NP -> Bool
-- = \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
--2 Adjectives
@@ -185,6 +185,9 @@ mkN : overload {
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' ;
} ;
-- Often just a case with the empty string is enough.
@@ -195,11 +198,11 @@ mkN : overload {
-- A couple of common prepositions (the first two always with the dative).
von_Prep : Prep' ; -- von + 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 ins
inAcc_Prep : Prep' ; -- in + accusative, with contraction im
inDat_Prep : Prep' ; -- in + dative, with contraction im
inAcc_Prep : Prep' ; -- in + accusative, with contraction ins
--2 Verbs
@@ -503,7 +506,10 @@ mkV2 : overload {
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' = <>}
c = c ; isPrep = isPrep ; lock_Prep' = <>} ;
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep' = \s,masc,fem,neutr, c ->
{s = s ; s2 = [] ; sg = table{Masc => masc ; Fem => fem ; Neutr => neutr} ;
c = c ; isPrep = isPrepDefArt ; lock_Prep' = <>} ;
} ;
accPrep = {s,s2 = [] ; sg = \\_ => [] ; c = accusative ; isPrep = isCase ; lock_Prep' = <>} ;
datPrep = {s,s2 = [] ; sg = \\_ => [] ; c = dative ; isPrep = isCase ; lock_Prep' = <>} ;

View File

@@ -82,6 +82,12 @@ resource ResGer = ParamX ** open Prelude in {
oper
noCase : {p : Str ; k : PredetCase} = {p = [] ; k = NoCase} ;
param
PredetCase' = NoCase' | PredCase' Case ;
-- PredetAgr = PAg Number | PAgNone ;
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
@@ -95,11 +101,11 @@ resource ResGer = ParamX ** open Prelude in {
-- 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} ;
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$
@@ -512,6 +518,8 @@ resource ResGer = ParamX ** open Prelude in {
Dat' : Preposition' = {s=""; s2=""; sg = \\c => []; c=Dat; isPrep=isCase} ;
mit' : Preposition' = {s="zusammen mit"; s2=""; sg = \\_ => []; c=Dat; isPrep=isPrep} ;
vonDat' : Preposition' = {s="von"; s2=""; sg = table{Fem => "von der"; _ => "vom"}; 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} ;
@@ -848,9 +856,8 @@ resource ResGer = ParamX ** open Prelude in {
insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron
let prep = vp.c2 ;
c = prep.c ; -- HL 7/22 reduced to c:Case
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ++ prep.s2 ;
let prep = vp.c2 ; -- HL 7/22 reduced to c:Case
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! prep.c ++ prep.s2 ;
in vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in

View File

@@ -32,7 +32,7 @@ concrete SentenceGer of Sentence' = CatGer ** open ResGer, Prelude 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 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
} ;
-- to save (67299 - 27432 = 39863 msec) compile time: HL 7/22, comment out:
SlashVP np vp =
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

View File

@@ -10,8 +10,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} ;
all_Predet = {s = appAdj' (regA "all") ; c = noCase' ; a = PAgNone} ;
almost_AdA, almost_AdN = ss "fast" ;
although_Subj = ss "obwohl" ;
always_AdV = ss "immer" ;
@@ -32,11 +31,14 @@ concrete StructuralGer of Structural' = CatGer **
VHaben) ;
during_Prep = mkPrep "während" P.genitive ; --- no variants in the rgl | P.mkPrep P.accusative "über" ;
either7or_DConj = sd2 "entweder" "oder" ** {n = Sg} ;
everybody_NP = nameNounPhrase {s = caselist "jeder" "jeden" "jedem" "jedes"} ;
every_Det = detUnlikeAdj False Sg "jed" ;
everything_NP = nameNounPhrase {s = caselist "alles" "alles" "allem" "alles"} ;
everybody_NP = nameNounPhrase' Masc {s = caselist "jeder" "jeden" "jedem" "jedes"} ;
-- every_Det = detUnlikeAdj False Sg "jed" ;
every_Det = let tab = (detUnlikeAdj' False Sg "jed").s
in {s,sp = asQuant tab ; n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ;
everything_NP = nameNounPhrase' Neutr {s = caselist "alles" "alles" "allem" "alles"} ;
everywhere_Adv = ss "überall" ;
few_Det = detLikeAdj False Pl "wenig" ;
few_Det = let tab = (detLikeAdj' False Pl "wenig").s
in {s,sp = asQuant tab ; n = Pl ; a = Weak ; isDef = False ; hasDefArt = False} ;
---- first_Ord = {s = (regA "erst").s ! Posit} ;
for_Prep = mkPrep "für" P.accusative ;
from_Prep = mkPrep "aus" P.dative ;
@@ -54,11 +56,13 @@ concrete StructuralGer of Structural' = CatGer **
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" ;
many_Det = let tab = (detLikeAdj' False Pl "viel").s
in {s,sp = asQuant tab ; n = Pl ; a = Weak ; isDef = False ; hasDefArt = False} ;
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} ;
most_Predet = {s = appAdj' (regA "meist") ; c = noCase' ; a = PAgNone} ;
-- much_Det = {s = \\_,_ => "viel" ; sp = \\_,_ => "vieles" ; n = Sg ; a = Weak ; isDef = False} ;
much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ;
n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ;
must_VV = auxVV
(mkV
"müssen" "muss" "musst" "muss" "müsst" "müss"
@@ -66,10 +70,11 @@ concrete StructuralGer of Structural' = CatGer **
"müsste" "gemusst" []
VHaben) ;
--- one_Quant = DEPREC
only_Predet = {s = \\_,_,_ => "nur" ; c = noCase ; a = PAgNone} ;
only_Predet = {s = \\_,_,_ => "nur" ; c = noCase' ; a = PAgNone} ;
no_Utt = ss "nein" ;
---b no_Phr = ss "nein" ;
on_Prep = mkPrep "auf" P.dative ;
-- on_Prep = mkPrep "auf" P.dative ;
on_Prep = P.mkPrep "auf" "auf den" "auf die" "aufs" P.accusative ; -- test HL 7/2022
or_Conj = {s1 = [] ; s2 = "oder" ; n = Sg} ;
otherwise_PConj = ss "sonst" ;
part_Prep = P.von_Prep ; -- mkPrep "von" P.dative ;
@@ -78,21 +83,21 @@ concrete StructuralGer of Structural' = CatGer **
quite_Adv = ss "ziemlich" ;
she_Pron = mkPronPers "sie" "sie" "ihr" "ihrer" "ihr" Fem Sg P3 ;
so_AdA = ss "so" ;
somebody_NP = nameNounPhrase {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ;
somePl_Det = detLikeAdj True Pl "einig" ;
somebody_NP = nameNounPhrase' Masc {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ;
somePl_Det = let tab = (detLikeAdj' True Pl "einig").s
in {s,sp = asQuant tab ; isDef = True ; n = Pl ; a = Weak ; hasDefArt = False} ;
someSg_Det = {
s,sp = \\g,c =>
usePrepC c (\k -> "ein" + pronEnding ! GSg g ! k) ; ---- einer,eines
s,sp = asQuant (\\g,c => "ein" + pronEnding ! GSg g ! c) ; ---- einer,eines
n = Sg ;
a = Strong ;
hasNum = True ;
isDef = False ;
isDef = False ; hasDefArt = False
} ;
something_NP = nameNounPhrase {s = \\_ => "etwas"} ;
something_NP = nameNounPhrase' Neutr {s = \\_ => "etwas"} ;
somewhere_Adv = ss "irgendwo" ;
that_Quant = let
jener : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "jen").s in
{s,sp = \\_ => jener ; a,aPl = Weak} ;
jener : Number => Gender => Case => Str = \\n => (detUnlikeAdj' True n "jen").s in
{s,sp = \\_ => jener ; a,aPl = Weak ; hasDefArt = False} ;
---b that_NP = nameNounPhrase {s = caselist "das" "das" "denem" "dessen"} ; ----
there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ;
there7to_Adv = ss "dahin" ;
@@ -101,8 +106,8 @@ concrete StructuralGer of Structural' = CatGer **
---b these_NP = {s = caselist "diese" "diese" "diesen" "dieser" ; a = agrP3 Pl} ;
they_Pron = mkPronPers "sie" "sie" "ihnen" "ihrer" "ihr" Fem Pl P3 ;
this_Quant = let
dieser : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "dies").s in
{s,sp = \\_ => dieser ; a,aPl = Weak} ;
dieser : Number => Gender => Case => Str = \\n => (detUnlikeAdj' True n "dies").s in
{s,sp = \\_ => dieser ; a,aPl = Weak ; hasDefArt = False} ;
---b this_NP = nameNounPhrase {s = caselist "dies" "dies" "diesem" "dieses"} ; ----
---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ;
through_Prep = mkPrep "durch" P.accusative ;
@@ -124,7 +129,7 @@ concrete StructuralGer of Structural' = CatGer **
when_IAdv = ss "wann" ;
when_Subj = ss "wenn" ;
where_IAdv = ss "wo" ;
which_IQuant = {s = \\n,g,c => (detUnlikeAdj True n "welch").s ! g ! NPC c} ;
which_IQuant = {s = \\n,g,c => (detUnlikeAdj' True n "welch").s ! g ! c} ;
whoSg_IP = {s = caselist "wer" "wen" "wem" "wessen" ; n = Sg} ;
whoPl_IP = {s = caselist "wer" "wen" "wem" "wessen" ; n = Sg} ; -- HL 6/2016
@@ -136,19 +141,19 @@ concrete StructuralGer of Structural' = CatGer **
youPol_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Fem Pl P3 ;
yes_Utt = ss "ja" ;
not_Predet = {s = \\_,_,_ => "nicht" ; c = noCase ; a = PAgNone} ;
not_Predet = {s = \\_,_,_ => "nicht" ; c = noCase' ; a = PAgNone} ;
no_Quant = let
keiner : Number => Gender => PCase => Str = table {
Sg => \\g,c => usePrepC c (\k -> "kein" + pronEnding ! GSg g ! k) ;
Pl => (detUnlikeAdj False Pl "kein").s
keiner : Number => Gender => Case => Str = table {
Sg => \\g,c => "kein" + pronEnding ! GSg g ! c ;
Pl => (detUnlikeAdj' False Pl "kein").s
}
in
{s,sp = \\_ => keiner ; a = Strong ; aPl = Weak} ; ---- sp
{s,sp = \\_ => keiner ; a = Strong ; aPl = Weak ; hasDefArt = False} ; ---- sp
if_then_Conj = {s1 = "wenn" ; s2 = "dann" ; n = Sg ; lock_Conj = <>} ;
nobody_NP =
nameNounPhrase {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ;
nameNounPhrase' Masc {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ;
nothing_NP =
nameNounPhrase {s = \\_ => "nichts"} ; --maybe add: nameNounPhrase {s = \\_ => "garnichts"}
nameNounPhrase' Neutr {s = \\_ => "nichts"} ; --maybe add: nameNounPhrase {s = \\_ => "garnichts"}
at_least_AdN = ss "wenigstens" ;
at_most_AdN = ss "höchstens" ;
except_Prep = mkPrep "außer" P.dative ;
@@ -159,4 +164,11 @@ concrete StructuralGer of Structural' = CatGer **
lin language_title_Utt = ss "Deutsch" ;
oper
asQuant : (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) =
\tab -> \\g,c => {quant = tab ! g ! c; num = []} ;
asNum : (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) =
\tab -> \\g,c => {quant = []; num = tab ! g ! c} ;
pairTable : (Gender => Case => Str) -> (Gender => Case => Str) -> (Gender => Case => {quant,num:Str})
= \qt,nt -> \\g,c => {quant = qt ! g ! c; num = nt ! g ! c} ;
}

View File

@@ -40,7 +40,7 @@ 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:
-- to save (83669 - 67299 = 16370 msec) 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
@@ -94,10 +94,11 @@ concrete VerbGer of Verb' = CatGer ** open Prelude, ResGer, Coordination in {
-- 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:
{-
-- to save (571098 = 83669 = 487429 msec) compile time (in 58% memory), 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
-- adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs?
@@ -106,7 +107,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.rc ; ext = np.ext} ;
CompNP np = {s = \\_ => (np.s ! Nom).p1 ++ (np.s ! Nom).p2 ++ np.rc ; ext = np.ext} ;
CompAdv a = {s = \\_ => a.s ; ext = []} ;
CompCN cn = {s = \\a => case numberAgr a of {