1
0
forked from GitHub/gf-rgl

Merge master into prepDefArt

This commit is contained in:
Hans Leiss
2023-08-05 18:17:08 +02:00
441 changed files with 148095 additions and 97116 deletions

View File

@@ -109,7 +109,9 @@ concrete CatGer of Cat =
N = ResGer.Noun ;
N2 = ResGer.Noun ** {c2 : Preposition} ;
N3 = ResGer.Noun ** {c2,c3 : Preposition} ;
PN = {s : Case => Str; g : Gender} ;
GN = {s : Case => Str; g : Sex} ;
SN = {s : Sex => Case => Str} ;
LN, PN = {s : Case => Str; g : Gender; n : Number} ;
-- tense with possibility to choose conjunctive forms

View File

@@ -15315,6 +15315,7 @@ lin
glans_N = mkN "Glans" "Glandes" feminine ;
glanzleistung_N = mkN "Glanzleistung" ;
glaren_V = regV "glaren" ;
glas_N = mkN "Glas" "Gläser" neuter ;
glasampulle_N = mkN "Glasampulle" "Glasampullen" feminine ;
glasauge_N = mkN "Glasauge" "Glasaugen" neuter ;
glasbaustein_N = mkN "Glasbaustein" "Glasbausteine" masculine ;

View File

@@ -15313,6 +15313,7 @@ fun
glans_N : N ;
glanzleistung_N : N ;
glaren_V : V ;
glas_N : N ;
glasampulle_N : N ;
glasauge_N : N ;
glasbaustein_N : N ;

View File

@@ -163,7 +163,7 @@ oper
let
vfin : VForm -> Str = \f ->
verb.s ! f ++ verb.prefix ;
gforms : Number -> Person -> Str = \n,p ->
gforms : ParadigmsGer.Number -> Person -> Str = \n,p ->
td (vfin (VFin False (VPresInd n p))) ++
td (vfin (VFin False (VPresSubj n p)))
++ td (vfin (VFin False (VImpfInd n p))) --# notpresent

View File

@@ -8,7 +8,8 @@ concrete ExtendGer of Extend =
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
GenModNP,
CardCNCard
CardCNCard, CompoundN,
PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP
]
with
(Grammar = GrammarGer) **
@@ -141,4 +142,49 @@ concrete ExtendGer of Extend =
n = Pl
} ;
lin PassVPSlash vp =
insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
{ c1 = subjPrep vp.c2 } ;
-- this also gives "mit dir wird gerechnet" ;
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
lin PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
lin PastPartAP vp =
let a = agrP3 Sg in {
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
ext = vp.ext
} ;
lin PastPartAgentAP vp np =
let a = agrP3 Sg ;
agent = appPrepNP von_Prep np
in {
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3
++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2
++ vp.c2.s -- junk if not TV
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;
lin CompoundN a x =
let s = a.co in
lin N {
s = \\n,c => s ++ Predef.BIND ++ x.uncap.s ! n ! c ;
co = s ++ Predef.BIND ++ x.uncap.co ;
uncap = {
s = \\n,c => a.uncap.co ++ Predef.BIND ++ x.uncap.s ! n ! c ;
co = a.uncap.co ++ Predef.BIND ++ x.uncap.co ;
} ;
g = x.g
} ;
>>>>>>> master
}

View File

@@ -1,5 +1,6 @@
concrete ExtraGer of ExtraGerAbs = CatGer **
open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer) in {
concrete ExtraGer of ExtraGerAbs = CatGer **
open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer), (N = NounGer) in {
flags coding=utf8 ;
lincat
@@ -56,7 +57,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
PassVPSlash vp =
let c = case <vp.c2.c,vp.c2.isPrep> of {<Acc,isCase> => Nom ; _ => vp.c2.c}
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
{ c1 = vp.c2 ** {c = c}} ;
{ c1 = vp.c2 ** {c = c} } ;
-- regulates passivised object: accusative objects -> nom; all others: same case
-- this also gives "mit dir wird gerechnet" ;
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
@@ -65,13 +66,13 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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) **
let bekommen : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen")
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommen) **
{ c1 = PrepNom ; c2 = v.c2 ; objCtrl = False } ;
PastPartAP vp =
let a = agrP3 Sg in {
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
@@ -83,7 +84,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
agent = appPrepNP P.von_Prep np
in {
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3
++ vp.a2 ++ agent ++ vp.inf.inpl.p2
++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2
++ vp.c2.s ! GPl -- junk if not TV
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
isPre = True ;
@@ -125,7 +126,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
a = tm.a ;
t = tm.t ;
m = tm.m ;
subj = [] ;
subj = [] ++ tm.s ++ p.s ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
haben = verb.inf2 ;
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
@@ -171,23 +172,93 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
ConjVPS = conjunctDistrTable2 Order Agr ;
-- Reflexive noun phrases -- (HL 5/2022: improved and completed, RNPList added)
lincat
RNP = {s : Agr => Case => Str} ;
RNP = {s : Agr => Case => Str ; rc,ext : Str ; isPron : Bool} ;
RNPList = {s1,s2 : Agr => Case => Str} ;
linref
RNP = \rnp -> rnp.s ! (Ag Masc Sg P3) ! Acc ++ rnp.ext ++ rnp.rc ;
lin
ReflRNP vps rnp =
insertObj (\\a => appPrep vps.c2 (rnp.s ! a)) vps ;
ReflPoss num cn = {s = \\a,c => num.s ! cn.g ! c ++ possPron a num.n cn.g c ++ cn.s ! adjfCase Strong c ! num.n ! c} ;
ReflPron = { -- personal pronoun, with "sich" in P3 Sg
s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ;
ReflPron = { s = ResGer.reflPron } ; -- reflexively used personal pronoun, with special forms in P3 Sg
-- In P1,P2 we might use "selbst" to define a (stronger) reflexive pronoun instead: -- HL 3/2022
-- We might define ReflPron by the stronger reflPronSelf below, using "selbst"
-- to distinguish personal pronoun from reflexive pronoun:
-- du kennst mich vs. ich kenne mich selbst
-- er kennt ihn vs. er kennt sich (selbst)
-- sie kennen sich (selbst) =/= sie kennen einander
-- Likewise, instead of ReflPoss we might define a reflexive possessive pronoun:
ReflPoss num cn =
{s = \\a,c => let adjf = case num.n of {Sg => Strong ; Pl => Weak} -- Duden 477, HL 5/2022
in possPron a num.n cn.g c ++ num.s ! cn.g ! c -- HL 5/2022: meine wenigstens 3 cn,
++ cn.s ! adjfCase adjf c ! num.n ! c -- not: wenigstens 3 meine cn
++ cn.adv ;
ext = cn.ext ; rc = cn.rc ! num.n ;
isPron = False} ;
-- We might define ReflPoss by the stronger reflPossPron below, using "eigen(er)"
-- to distinguish possessive pronoun from reflexive possessive pronoun:
-- du kennst meine Fehler vs. ich kenne meine eigenen Fehler
-- er|sie|es kennt seine|ihre Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler
PredetRNP pred rnp = rnp ** { -- HL 5/2022
s = \\a,c => let n = case pred.a of {PAg n => n ; _ => numberAgr a} ;
g = genderAgr a ;
d = case pred.c.k of {NoCase => c ; PredCase k => k} ;
in case rnp.isPron of {
True => pred.s ! Pl ! Masc ! c ++ "von" ++ rnp.s ! a ! Dat ;
_ => pred.s ! n ! genderAgr a ! c ++ pred.c.p ++ rnp.s ! a ! d} ;
ext = rnp.ext ; rc = rnp.rc ;
isPron = False} ;
-- ok: alle von uns; die meisten von uns ; wrong: *nur von uns =/= nur wir
AdvRNP np prep rnp = {s = \\a,c => np.s ! False ! c
++ appPrep prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ;
ext = np.ext ; rc = np.rc ; isPron = False} ;
AdvRAP ap prep rnp =
let -- ? adv ++ ap.s ! af
adv = appPrep prep (rnp.s ! agrP3 Sg) ; -- bug: fixed agreement
in ap ** { s = \\af => ap.s ! af ++ adv } ; -- e.g. unknown in one's youth
ReflA2RNP adj rnp = -- would need AP.c : Agr => Str*Str, not AP.c : Str*Str
let -- as we have no reflexive AP,
compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
in {
s = adj.s ! Posit ;
isPre = True ;
c = case adj.c2.isPrep of {isCase => <compl, []> ; _ => <[], compl>} ;
ext = rnp.ext ++ rnp.rc
} ;
PossPronRNP pron num cn rnp =
N.DetCN (N.DetQuant (N.PossPron pron) num)
(N.PossNP cn (lin NP {s = \\_,c => rnp.s ! pron.a ! c ;
a = pron.a ;
w = WLight ;
ext = rnp.ext ;
rc = rnp.rc})) ;
-- AdvRVP : VP -> Prep -> RNP -> VP not implemented, as the reflexive adverb (Prep + RNP): Agr => Str
-- could only be added to vp.a2:Str with fixed agreement, but can depend on nominal subject or object,
-- e.g. "er spricht mit ihr über sein Kind" vs. "er spricht mit ihr über ihr Kind".
ConjRNP conj rnps = conjunctDistrTable2 Agr Case conj rnps
** {isPron = False ; ext,rc = []} ;
Base_rr_RNP x y = twoTable2 Agr Case x y ;
Base_nr_RNP x y = twoTable2 Agr Case {s = \\_,c => x.s ! False ! c ++ x.ext ++ x.rc} y ;
Base_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! False ! c ++ y.ext ++ y.rc} ;
Cons_rr_RNP x xs = consrTable2 Agr Case comma x xs ;
Cons_nr_RNP x xs = consrTable2 Agr Case comma {s = \\_,c => x.s ! False ! c ++ x.ext ++ x.rc} xs ;
oper
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ;
@@ -195,7 +266,22 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
let eigen = adjForms "eigen" "eigen" in
\a,n,g,c -> possPron a n g c ++ (eigen ! (AMod (gennum g n) c)) ;
-- implementation of some of the relevant Foc rules from Extra
insertObjReflNP : ResGer.VPSlash -> RNP -> ResGer.VP = -- HL 5/2022
\vp,rnp -> -- generalize ResGer.insertObjRefl
let prep = vp.c2 ;
c = case prep.isPrep of { isCase => prep.c ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ?
obj : Agr => Str = \\a => prep.s ! GPl ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc
in vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in
case <prep.isPrep, rnp.isPron, c> of { -- consider non-pron rnp as light, add to vpnn.p2
<isCase,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
<isCase,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
<isCase,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
<_,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
} ;
-- SS: implementation of some of the relevant Foc rules from Extra
lincat
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;

View File

@@ -4,7 +4,9 @@ abstract ExtraGerAbs = Extra [
VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP,
Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP,
Foc,FocObj,FocAdv,FocAP,UseFoc,
RNP,ReflRNP,ReflPoss,ReflPron
RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP
,RNPList,ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP
,DetNPMAsc,DetNPFem
] ** {
flags coding=utf8;
@@ -25,6 +27,16 @@ 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
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
-- further constructions usin RNP, declared in abstract/Extra.gf:
AdvRNP : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
AdvRVP : VP -> Prep -> RNP -> VP ; -- lectured about her travels
AdvRAP : AP -> Prep -> RNP -> AP ; -- adamant in his refusal
ReflA2RNP : A2 -> RNP -> AP ; -- indifferent to their surroundings
-- NOTE: generalizes ReflA2
PossPronRNP : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
}

View File

@@ -14,7 +14,8 @@ concrete GrammarGer of Grammar =
TextX - [Tense,Temp],
IdiomGer,
StructuralGer - [part_Prep,possess_Prep], -- use PartNP, PossNP instead
TenseGer
TenseGer,
NamesGer
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

38
src/german/NamesGer.gf Normal file
View File

@@ -0,0 +1,38 @@
concrete NamesGer of Names = CatGer ** open ResGer in {
lin GivenName gn = {
s = \\_,c => gn.s ! c ;
a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ;
rc, ext = []
} ;
lin MaleSurname sn = {
s = \\_,c => sn.s ! Male ! c ;
a = agrgP3 Masc Sg ;
w = WLight ;
rc, ext = []
} ;
lin FemaleSurname sn = {
s = \\_,c => sn.s ! Female ! c ;
a = agrgP3 Fem Sg ;
w = WLight ;
rc, ext = []
} ;
lin PlSurname sn = {
s = \\_,c => sn.s ! Male ! c ;
a = agrgP3 Masc Pl ;
w = WLight ;
rc, ext = []
} ;
lin FullName gn sn = {
s = \\_,c => gn.s ! Nom ++ sn.s ! gn.g ! c ;
a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ;
rc, ext = []
} ;
}

View File

@@ -117,6 +117,8 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
NumDigits numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
NumFloat dig1 dig2 = {s = \\g,c => dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! NCard g c ; n = Pl } ;
NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
@@ -252,4 +254,20 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
n = det.n ; a = det.a ; isDef = det.isDef ; hasDefArt = det.hasDefArt} ;
QuantityNP dig m = {
s = \\_,c => preOrPost m.isPre m.s (dig.s ! invNum) ;
a = agrP3 Pl ;
w = WLight ;
rc = "" ;
ext = "" ;
} ;
QuantityFloatNP dig1 dig2 m = {
s = \\_,c => preOrPost m.isPre m.s (dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! invNum) ;
a = agrP3 Pl ;
w = WLight ;
rc = "" ;
ext = "" ;
} ;
}

View File

@@ -6,7 +6,7 @@ flags optimize = all_subs ;
lincat
Digit = {s : DForm => CardOrd => Str} ;
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
Sub100, Sub1000, Sub1000000 =
Sub100, Sub1000, Sub1000000, Sub1000000000, Sub1000000000000 =
{s : CardOrd => Str ; n : Number} ;
lin
@@ -29,23 +29,35 @@ lin
n = Sg
} ;
pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ;
pot0as1 n = {s = n.s ! DUnit; n = n.n } ;
pot110 = {s = cardReg "zehn"; n = Pl} ;
pot111 = {s = cardReg "elf"; n = Pl} ;
pot1to19 d = {s = d.s ! DTeen; n = Pl} ;
pot0as1 n = {s = n.s ! DUnit; n = n.n } ;
pot1 d = {s = d.s ! DTen; n = Pl} ;
pot1plus d e = {s = \\g =>
e.s ! DUnit ! invNum ++ BIND ++ "und" ++ BIND ++ d.s ! DTen ! g; n = Pl} ;
pot1as2 n = n ;
pot2 d = {s = \\g =>
multiple (d.s ! DUnit) d.n ++ cardOrd "hundert" "hunderte" ! g ; n = Pl} ;
pot2plus d e = {s = \\g =>
multiple (d.s ! DUnit) d.n ++ "hundert" ++ BIND ++ e.s ! g ; n = Pl} ;
pot2as3 n = n ;
pot3 n = {s = \\g =>
multiple n.s n.n ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ----
pot3plus n m = {s = \\g =>
multiple n.s n.n ++ "tausend" ++ m.s ! g ; n = Pl} ;
pot3as4 n = n ;
pot3float f = {s = \\g =>
f.s ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ----
pot4as5 n = n ;
pot4float f = {s = \\g =>
f.s ++ cardOrd "Millionen" "Millionte" ! g ; n = Pl} ; ----
pot51 = {s = \\g => "einer Milliarde"; n = Pl} ; -- KA: case inflection missing
oper
multiple : (CardOrd => Str) -> Number -> Str = \d,n ->

View File

@@ -39,6 +39,9 @@ oper
feminine : Gender ;
neuter : Gender ;
male : Sex ;
female : Sex ;
-- To abstract over case names, we define the following.
Case : Type ;
@@ -121,6 +124,7 @@ mkN : overload {
mkPN : overload {
mkPN : Str -> PN ; -- regular name with genitive in "s", masculine
mkPN : Str -> Number -> PN ; -- regular name with genitive in "s", masculine
mkPN : Str -> Gender -> PN ; -- regular name with genitive in "s"
-- If only the genitive differs, two strings are needed.
@@ -137,7 +141,26 @@ mkN : overload {
} ;
-- To extract the number of a noun phrase --never used in RGL
mkGN : overload {
mkGN : Str -> Sex -> GN ; -- regular name with genitive in "s"
mkGN : (nom,gen : Str) -> Sex -> GN ; -- name with other genitive
mkGN : (nom,acc,dat,gen : Str) -> Sex -> GN ; -- name with all case forms
} ;
mkSN : overload {
mkSN : Str -> GN ; -- regular name with genitive in "s", masculine
-- If only the genitive differs, two strings are needed.
mkSN : (nom,gen : Str) -> GN ; -- name with other genitive
-- In the worst case, all four forms are needed.
mkSN : (nom,acc,dat,gen : Str) -> GN ; -- name with all case forms
} ;
-- To extract the number of a noun phrase
-- ifPluralNP : NP -> Bool
-- = \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
@@ -361,18 +384,20 @@ mkV2 : overload {
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
Gender = MorphoGer.Gender ;
Case = MorphoGer.Case ;
Number = MorphoGer.Number ;
masculine = Masc ;
feminine = Fem ;
neuter = Neutr ;
neuter = Neutr ;
male = Male ;
female = Female ;
nominative = Nom ;
accusative = Acc ;
dative = Dat ;
genitive = Gen ;
dative = Dat ;
genitive = Gen ;
singular = Sg ;
plural = Pl ;
@@ -459,24 +484,46 @@ mkV2 : overload {
mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ;
mk2PN = \karolus, karoli, g ->
{s = table {Gen => karoli ; _ => karolus} ; g = g ; lock_PN = <>} ;
{s = table {Gen => karoli ; _ => karolus} ; g = g ; n = Sg ; lock_PN = <>} ;
regPN = \horst, g ->
mk2PN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) g ;
mkPN = overload {
mkPN : Str -> PN = \s -> regPN s Masc ;
mkPN : Str -> Number -> PN = \s,n -> regPN s Masc ** {n=n} ;
mkPN : Str -> Gender -> PN = regPN ;
mkPN : N -> PN = \n -> lin PN {s = n.s ! Sg; g = n.g} ;
mkPN : N -> PN = \n -> lin PN {s = n.s ! Sg; g = n.g; n = Sg} ;
mkPN : (nom,gen : Str) -> Gender -> PN = mk2PN ;
mkPN : (nom,acc,dat,gen : Str) -> Gender -> PN = \nom,acc,dat,gen,g ->
{s = table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ;
g = g ; lock_PN = <>}
g = g ; n = Sg ; lock_PN = <>}
} ;
mk2PN : (karolus, karoli : Str) -> Gender -> PN ; -- karolus, karoli
regPN : (Johann : Str) -> Gender -> PN ;
-- Johann, Johanns ; Johannes, Johannes
mkGN = overload {
mkGN : Str -> Sex -> GN = \nom,g -> lin GN {s = (regPN nom (sex2gender g)).s; g = g} ; -- regular name with genitive in "s"
mkGN : (nom,gen : Str) -> Sex -> GN = \nom,gen,g -> lin GN {s = (mk2PN nom gen (sex2gender g)).s; g = g} ; -- name with other genitive
mkGN : (nom,acc,dat,gen : Str) -> Sex -> GN = \nom,acc,dat,gen,g ->
{s = table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ;
g = g ; lock_GN = <>}
} ;
mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_ => (regPN s Masc).s} ; -- regular name with genitive in "s", masculine
-- If only the genitive differs, two strings are needed.
mkSN : (nom,gen : Str) -> SN = \nom,gen -> lin SN {s = \\_ => (mk2PN nom gen Masc).s} ; -- name with other genitive
-- In the worst case, all four forms are needed.
mkSN : (nom,acc,dat,gen : Str) -> SN = \nom,acc,dat,gen ->
{s = \\_ => table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ;
lock_SN = <>}
} ;
mk3A : (gut,besser,beste : Str) -> A = \a,b,c ->
let aa : Str = case a of {
@@ -540,11 +587,12 @@ mkV2 : overload {
gabst = verbST gab ;
gaben = pluralN gab ;
gabt = verbT gab
in
MorphoGer.mkV
in case geben of {
_ + "n" => MorphoGer.mkV
geben gebe gibst gibt gebt gib gab gabst gaben gabt gaebe gegeben
[] VHaben ** {lock_V = <>} ;
_ => Predef.error (geben + ": invalid infinitive form, should end with 'n'")
} ;
regV fragen =
let
frag = stemVerb fragen ;
@@ -730,4 +778,6 @@ mkV2 : overload {
mkV2 : V -> Case -> V2 = \v,c -> prepV2 v (mkPrep c) ;
} ;
mkMU : Str -> MU = \s -> lin MU {s=s; isPre=False} ;
}

View File

@@ -26,7 +26,7 @@ open MorphoGer, ResGer, ParadigmsGer, SyntaxGer, Prelude, HTML in {
flags literal=Symb ; coding = utf8 ;
lin
ComplVV v ant p vp =
{- ComplVV v ant p vp =
let
vpi = infVP v.isAux vp
in
@@ -35,6 +35,14 @@ lin
insertInf vpi.p2 (
insertObj vpi.p1 (
predVGen v.isAux v)))) ;
-}
ComplVV v ant pol vp = -- HL 4/22
let
vps = predVGen v.isAux v ;
inf = mkInf v.isAux ant pol vp
in
insertExtrapos vp.ext (
insertInf inf vps) ;
PastPartRS ant pol sl = { -- guessed by KA, some fields in sl are ignored!!
s = \\gn => let agr = agrgP3 Masc (numGenNum gn)

View File

@@ -25,6 +25,7 @@ resource ResGer = ParamX ** open Prelude in {
param
Case = Nom | Acc | Dat | Gen ;
Gender = Masc | Fem | Neutr ;
Sex = Male | Female ;
-- Complex $CN$s, like adjectives, have strong and weak forms.
@@ -461,6 +462,14 @@ resource ResGer = ParamX ** open Prelude in {
ins' : Preposition = {s=table{GPl => "in"; GSg Masc=>"in den"; GSg Fem=>"in die"; GSg Neutr=>"ins"};
s2="hinein"; c=Acc; isPrep=isPrepDefArt} ;
-- To build passive: accusative object -> nom subject; others -> same case or prep
subjPrep : Preposition -> Preposition = \prep ->
case <prep.c,prep.isPrep> of {
<Acc,isCase> => prep ** {c = Nom} ;
_ => prep
} ;
-- Pronouns and articles
-- Here we define personal and relative pronouns.
-- All personal pronouns, except "ihr", conform to the simple pattern $mkPronPers$.
@@ -1010,7 +1019,7 @@ resource ResGer = ParamX ** open Prelude in {
<GPl,Gen> => "deren" ;
_ => artDef ! gn ! c
} ;
RSentence => "was"
RSentence => (caselist "was" "was" "was" "wessen") ! c -- wessen HL 4/2022
} ;
-- Function that allows the construction of non-nominative subjects.
@@ -1021,19 +1030,10 @@ resource ResGer = ParamX ** open Prelude in {
agr = case prep.c of { Nom => np.a ; _ => Ag Masc Sg P3 }
in {s = subj ; a = agr} ;
-- Function to construct a glued Prep+RelPron or a IAdv from a preposition. HL 7/23
woStr : Str -> Case -> Str = \prep,c -> case prep of {
"in" => case c of {Acc => "wohin" ; _ => "worin" } ; -- wohin, worin
("a"|"u") + _ => "wor" + prep ; -- e.g. woran, worauf, woraus, worum
_ => case c of {Gen => "wes"+ prep; -- e.g. weshalb(er), weswegen
_ => "wo" + prep } -- e.g. wodurch, wofür, womit, wozu
sex2gender : Sex -> Gender = \g ->
case g of {
Male => Masc ;
Female => Fem
} ;
mkIAdv : Preposition -> {s:Str} = \prep -> case isaPrep prep of {
False => { s = "Bug mkIAdv" } ;
_ => { s = woStr (prep.s ! GPl) prep.c }
};
-- Todo: construct relative clauses like (das Haus) [worin ich wohne | woran ich denke]
}

View File

@@ -37,8 +37,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
s = \\pol,impform => adv.s ++ imp.s ! pol ! impform
} ;
-- to save (67299 - 27432 = 39863 msec) compile time: HL 7/22, comment out:
-- resp. 167061 msec without, 159037 msec with this SlashVP, 53 % memory
-- to save compile time: HL 7/22, comment SlashVP out:
-- + SlashV2VNP 199065600 (46080,240)
-- + SlashVP 414720 (28224,204)
@@ -83,7 +82,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
SSubjS a s b = {s = \\o => a.s ! o ++ "," ++ s.s ++ b.s ! Sub} ;
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was"
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was"
}

View File

@@ -1,7 +1,7 @@
concrete StructuralGer of Structural = CatGer **
open MorphoGer, MakeStructuralGer, (X = ConstructX),
(P = ParadigmsGer), IrregGer, Prelude in {
(P = ParadigmsGer), IrregGer, Prelude, (R = ResGer) in {
flags optimize=all ;
coding=utf8 ;
@@ -10,7 +10,8 @@ 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 = PAg Pl} ; -- HL 5/2022
almost_AdA, almost_AdN = ss "fast" ;
although_Subj = ss "obwohl" ;
always_AdV = ss "immer" ;
@@ -32,7 +33,6 @@ concrete StructuralGer of Structural = CatGer **
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 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"} ;
@@ -59,8 +59,13 @@ concrete StructuralGer of Structural = CatGer **
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} ;
-- much_Det = {s = \\_,_ => "viel" ; sp = \\_,_ => "vieles" ; n = Sg ; a = Weak ; isDef = False} ;
most_Predet = { -- HL 5/2022
s = \\n,g,c => let gn = R.gennum g n ;
adj = (P.mkA "viel" "mehr" "meiste").s ! Superl
in
R.artDef ! gn ! c ++ adj ! (agrAdj g Weak n c) ;
c = {p = [] ; k = PredCase Gen} ;
a = PAg Pl} ;
much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ;
n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ;
must_VV = auxVV
@@ -97,7 +102,7 @@ concrete StructuralGer of Structural = CatGer **
that_Quant = let
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"} ; ----
---b that_NP = nameNounPhrase Neutr {s = caselist "das" "das" "dem" "dessen"} ; ----
there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ;
there7to_Adv = ss "dahin" ;
there7from_Adv = ss ["daher"] ;
@@ -107,7 +112,7 @@ concrete StructuralGer of Structural = CatGer **
this_Quant = let
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 this_NP = nameNounPhrase Neutr {s = caselist "dies" "dies" "diesem" "dieses"} ; ----
---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ;
through_Prep = mkPrep "durch" P.accusative ;
too_AdA = ss "zu" ;
@@ -170,4 +175,8 @@ concrete StructuralGer of Structural = CatGer **
\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} ;
appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str =
\adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ;
}

View File

@@ -3,10 +3,10 @@
concrete SymbolGer of Symbol = CatGer ** open Prelude, ResGer in {
lin
SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c
IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c
FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c
NumPN i = {s = i.s ! Neutr ; g = Neutr} ; --- c
SymbPN i = {s = \\c => i.s ; g = Neutr ; n = Sg} ; --- c
IntPN i = {s = \\c => i.s ; g = Neutr ; n = Sg} ; --- c
FloatPN i = {s = \\c => i.s ; g = Neutr ; n = Sg} ; --- c
NumPN i = {s = i.s ! Neutr ; g = Neutr ; n = Sg} ; --- c
CNIntNP cn i = {
s = \\b,c => cn.s ! Weak ! Sg ! Nom ++ i.s ;

View File

@@ -106,8 +106,8 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
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?
-- "ich bin nicht alt" "ich bin nicht Doris"
-- SS: adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs?
-- "ich bin nicht alt" "ich bin nicht Doris"
UseCopula = predV sein_V ;