1
0
forked from GitHub/gf-rgl

(Ger) Shrink Agr = Ag Gender Number Person from 3*2*3 = 18 values to 2+3+1+3+1 = 10 by

Agr = AgSgP1 | AgSgP2 | AgSgP3 Gender | AgSgP3Gen | AgPl Person | AgPlPol ;
      with AgSgP3Gen resp. AgPlPol used for reflexive,possessive forms of "man", "Sie".

      Compiles AllGer from src in 162sec with 15M VerbGer.gfo vs. 380sec with 17M VerbGer.gfo
This commit is contained in:
Hans Leiss
2023-09-30 23:28:42 +02:00
parent 67d1e24761
commit 1cf6496883
25 changed files with 623 additions and 668 deletions

View File

@@ -40,27 +40,27 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
-- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 a np =
ComplA2 a np =
let CExt = case a.c2.isPrep of {
isCase => <appPrepNP a.c2 np, []> ;
_ => <[], appPrepNP a.c2 np> } -- HL: check 7/22
isCase => <appPrepNP a.c2 np, []> ;
_ => <[], appPrepNP a.c2 np> }
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
} ;
ReflA2 a =
let
compl = appPrep a.c2 (reflPron ! agrP3 Sg) ;
CExt = case a.c2.isPrep of
{isCase => <compl, []> ; _ => <[], compl> }
{isCase => <compl, []> ; _ => <[], compl> }
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
ext = []
} ;
SentAP ap sc = ap ** {

View File

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

View File

@@ -58,18 +58,15 @@ concrete CatGer of Cat =
adv : Str ; -- Haus [adv auf dem Hügel]
g : Gender
} ;
Pron = {s : NPForm => Str ; a : Agr} ;
-- simplified PCase to Case in NP, Det, DAP, Quant, Predet HL 8/22
NP = ResGer.NP ;
Det = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped HL 8/22
n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ;
Pron = {s : NPForm => Str ; a : Agr} ;
Det = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped, HL 8/22
n : Number ; a : Adjf ; isDef, hasDefArt : Bool} ;
DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef,hasDefArt : Bool} ;
-- HL 7/2022: first Bool = True if used to glue in Sg with preposition
-- second Bool is True if a cardinal number is present
Quant = {
s, sp : Bool => Bool => Number => Gender => Case => Str ;
Quant = {
s, sp : Bool => Bool => Number => Gender => Case => Str ;
a : Adjf ;
aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde"
hasDefArt : Bool
@@ -145,4 +142,5 @@ concrete CatGer of Cat =
Det = \det -> det.s ! False ! Masc ! Nom ;
Prep = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ;
_ => prep.s ! GPl } ;
}

View File

@@ -9,11 +9,15 @@ concrete ConjunctionGer of Conjunction =
ConjAdv conj ss = conjunctDistrSS conj ss ;
-- ConjNP : Conj -> ListNP' -> NP' ; -- she or we
ConjNP conj ss = { s = \\_ => (conjunctDistrTable Case conj { s1 = ss.s1 ; s2 = ss.s2 }).s } ** {
a = Ag Fem (conjNumber conj.n (numberAgr ss.a)) (personAgr ss.a) ;
w = WHeavy ; ext,rc = [] } ;
ConjNP conj ss = heavyNP (
{s = \\_ => (conjunctDistrTable Case conj ss).s ;
a = let n : Number = (conjNumber conj.n (numberAgr ss.a)) ;
p : Person = personAgr ss.a ;
agr : Agr = case <n,p> of {<Pl,q> => AgPl q ;
<Sg,P3> => AgSgP3 Neutr ;
<Sg,P1> => AgSgP1 ;
<Sg,P2> => AgSgP2 }
in (conjAgr agr ss.a) }) ;
ConjAP conj ss = conjunctDistrTable AForm conj ss ** {
isPre = ss.isPre ; c = ss.c ; ext = ss.ext} ;
@@ -48,13 +52,13 @@ concrete ConjunctionGer of Conjunction =
s1 = \\c => xs.s ! False ! c ++ bigNP xs ++ comma ++ x.s1 ! c ;
s2 = x.s2 ;
a = conjAgr xs.a x.a } ;
BaseAP x y = lin AP {
BaseAP x y = {
s1 = bigAP x ;
s2 = bigAP y ;
isPre = andB x.isPre y.isPre ;
c = <[],[]> ;
ext = []} ;
ConsAP xs x = lin AP {
ConsAP xs x = {
s1 = \\a => (bigAP xs) ! a ++ comma ++ x.s1 ! a ;
s2 = x.s2 ;
isPre = andB x.isPre xs.isPre ;
@@ -62,12 +66,12 @@ concrete ConjunctionGer of Conjunction =
ext = []} ;
BaseRS x y = twoTable RelGenNum x y ** {c = y.c} ;
ConsRS xs x = consrTable RelGenNum comma xs x ** {c = xs.c} ;
BaseCN x y = lin CN {
BaseCN x y = {
s1 = bigCN x ;
s2 = bigCN y ;
g = x.g ; --- gender of first CN, used e.g. in articles
} ;
ConsCN x xs = lin CN {
ConsCN x xs = {
s1 = \\a,n,c => bigCN x ! a ! n ! c ++ comma ++ xs.s1 ! a ! n ! c ;
s2 = xs.s2 ;
g = x.g ; --- gender of first CN, used e.g. in articles

View File

@@ -1,42 +1,28 @@
--# -path=.:../abstract
concrete ConstructionGer of Construction = CatGer **
open SyntaxGer, SymbolicGer, (P = ParadigmsGer),
concrete ConstructionGer of Construction = CatGer **
open SyntaxGer, SymbolicGer, ParadigmsGer,
(L = LexiconGer), (E = ExtraGer), (G = GrammarGer), (I = IrregGer), (R = ResGer), (N = NounGer), Prelude in {
flags coding=utf8 ;
oper
mkPrep : Str -> P.Case -> Prep = P.mkPrep ;
mkV2 : V -> V2 = P.mkV2 ;
accPrep = P.accPrep ;
datPrep = P.datPrep ;
anDat_Prep = P.anDat_Prep ;
inDat_Prep = P.inDat_Prep ;
dative = P.dative ;
accusative = P.accusative ;
feminine = P.feminine ;
neuter = P.neuter ;
regV = P.regV ;
invarA = P.invarA ;
lin
hungry_VP = mkVP (P.mkA "hungrig") ;
thirsty_VP = mkVP (P.mkA "durstig") ;
tired_VP = mkVP (P.mkA "müde") ;
scared_VP = mkVP have_V2 (mkNP (P.mkN "Angst" "Ängste" feminine)) ;
ill_VP = mkVP (P.mkA "krank") ;
ready_VP = mkVP (P.mkA "bereit") ;
hungry_VP = mkVP (mkA "hungrig") ;
thirsty_VP = mkVP (mkA "durstig") ;
tired_VP = mkVP (mkA "müde") ;
scared_VP = mkVP have_V2 (mkNP (mkN "Angst" "Ängste" feminine)) ;
ill_VP = mkVP (mkA "krank") ;
ready_VP = mkVP (mkA "bereit") ;
has_age_VP card = mkVP (lin AP (mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> L.year_N))) L.old_A)) ;
have_name_Cl x y = mkCl (lin NP x) (mkV2 I.heißen_V) (lin NP y) ;
married_Cl x y = ----mkCl (lin NP x) L.married_A2 (lin NP y) |
mkCl (mkNP and_Conj (lin NP x) (lin NP y)) (P.mkA "verheiratet") ;
mkCl (mkNP and_Conj (lin NP x) (lin NP y)) (mkA "verheiratet") ;
what_name_QCl x = mkQCl how_IAdv (mkCl (lin NP x) I.heißen_V) ;
---- how_old_QCl x = mkQCl (E.ICompAP (mkAP L.old_A)) (lin NP x) ; ---- compilation slow
how_old_QCl x = mkQCl (E.IAdvAdv (P.mkAdv "alt")) (mkCl (lin NP x) G.UseCopula) ; ----
how_old_QCl x = mkQCl (E.IAdvAdv (ParadigmsGer.mkAdv "alt")) (mkCl (lin NP x) G.UseCopula) ; ----
how_far_QCl x = mkQCl (E.IAdvAdv L.far_Adv) (mkCl (mkVP (SyntaxGer.mkAdv to_Prep (lin NP x)))) ;
-- some more things
@@ -45,24 +31,12 @@ lin
is_right_VP = mkVP have_V2 (mkNP (ParadigmsGer.mkN "Recht")) ;
is_wrong_VP = mkVP have_V2 (mkNP (ParadigmsGer.mkN "Unrecht")) ;
-- n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP card cn))) a ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
n_unit_CN card unit cn = mkCN (invarA (mkUtt (mkNP <lin Card card : Card> (lin CN unit))).s) cn ;
-- n_unit_CN card unit cn = mkCN (invarA (mkUtt (mkNP <lin Card card : Card> (lin CN unit))).s) cn ;
n_unit_CN card unit cn = mkCN (invarA ((mkUtt card).s ++ (mkUtt unit).s)) cn ;
bottle_of_CN np = N.ApposCN (mkCN (P.mkN "Flasche")) np ;
cup_of_CN np = N.ApposCN (mkCN (P.mkN "Tasse")) np ;
glass_of_CN np = N.ApposCN (mkCN (P.mkN "Glas" "Gläser" neuter)) np ;
few_X_short_of_Y np x y = -- np.dat fehlen (wenige x).nom an y
let
xs : NP = (mkNP G.few_Det x) ;
ys : NP = (mkNP G.IndefArt y) ;
fehlen_V3 : V3 = P.mkV3 (regV "fehlen") datPrep (mkPrep "an" dative) ;
vp : VP = mkVP (mkVPSlash fehlen_V3 np) ys
in
mkS (mkCl xs vp) ;
bottle_of_CN np = N.ApposCN (mkCN (mkN "Flasche")) np ;
cup_of_CN np = N.ApposCN (mkCN (mkN "Tasse")) np ;
glass_of_CN np = N.ApposCN (mkCN (mkN "Glas" "Gläser" neuter)) np ;
-- spatial deixis and motion verbs
where_go_QCl np = mkQCl (lin IAdv (ss "wohin")) (mkCl np (mkVP L.go_V)) ;
@@ -72,103 +46,15 @@ lin
come_here_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "her") ;
come_from_here_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "von hier") ;
go_there_VP = SyntaxGer.mkVP (SyntaxGer.mkVP L.go_V) (ParadigmsGer.mkAdv "hin") ;
go_there_VP = mkVP (mkVP L.go_V) (ParadigmsGer.mkAdv "hin") ;
come_there_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "hin") ;
come_from_there_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "von dort") ;
lincat
Timeunit = N ;
Hour = {short:Str ; long:Str ; adv:Adv} ;
Weekday = N ;
Monthday = NP ;
Month = N ;
Year = NP ;
-- timeunitAdv : Card -> Timeunit -> Adv ; -- (for) three hours
-- timeunitRange : Card -> Card -> Timeunit -> Adv ; -- (cats live) ten to twenty years
lin
timeunitAdv n time =
let n_hours_NP : NP = mkNP n time
in SyntaxGer.mkAdv (for_Prep | accPrep) n_hours_NP ;
timeunitRange l u time =
{s = l.s ! R.Masc ! R.Nom ++ "bis" ++ u.s ! R.Masc ! R.Nom ++ time.s ! R.Pl ! R.Nom} ;
oper
mkHour : Str -> Str -> Str -> Hour
= \n,m,daytime ->
let numeral : Str -> Str = \k -> (SyntaxGer.mkUtt (SyntaxGer.mkCard k)).s
in lin Hour {short = numeral n ; long = numeral m ; adv = P.mkAdv daytime} ;
lin
oneHour = mkHour "1" "1" "nachts" ;
twoHour = mkHour "2" "2" "nachts" ;
threeHour = mkHour "3" "3" "nachts" ;
fourHour = mkHour "4" "4" "morgens" ;
fiveHour = mkHour "5" "5" "morgens" ;
sixHour = mkHour "6" "6" "morgens" ;
sevenHour = mkHour "7" "7" "morgens" ;
eightHour = mkHour "8" "8" "vormittags" ;
nineHour = mkHour "9" "9" "vormittags" ;
tenHour = mkHour "10" "10" "vormittags" ;
elevenHour = mkHour "11" "11" "vormittags" ;
twelveHour = mkHour "12" "12" "mittags" ;
thirteenHour = mkHour "13" "1" "mittags" ;
fourteenHour = mkHour "14" "2" "mittags" ;
fifteenHour = mkHour "15" "3" "nachmittags" ;
sixteenHour = mkHour "16" "4" "nachmittags" ;
seventeenHour = mkHour "17" "5" "nachmittags" ;
eighteenHour = mkHour "18" "6" "nachmittags" ;
nineteenHour = mkHour "19" "7" "abends" ;
twentyHour = mkHour "20" "8" "abends" ;
twentyOneHour = mkHour "21" "9" "abends" ;
twentyTwoHour = mkHour "22" "10" "abends" ;
twentyThreeHour = mkHour "23" "11" "abends" ;
twentyFourHour = mkHour "24" "12" "nachts" ;
-- timeHour : Hour -> Adv -- at three a.m./p.m.
-- um drei Uhr nachts/nachmittags
timeHour h = let ada : AdA = lin AdA {s = "um" ++ h.long ++ "Uhr"}
in SyntaxGer.mkAdv ada h.adv ;
-- timeHourMinute : Hour -> Card -> Adv ; -- at six forty a.m./p.m.
-- um sechs/achtzehn Uhr vierzig
timeHourMinute h card =
let min : Str = (SyntaxGer.mkUtt card).s
in P.mkAdv ("um" ++ h.short ++ "Uhr" ++ min) ;
{- -- Remark (HL 7/2023):
-- To avoid massive overgeneration, we'd better replace Card here by
cat
Minute ;
fun
timeHourMinute : Hour -> Minute -> Adv ; -- at six forty a.m./p.m.
min_1 : Minute ;
min_2 : Minute ; -- ... min_60 : Minute ;
lastMinute : Minute ;
oper
Min : PType = Predef.Ints 3 ; -- short for 60
minutes : Min => Str = table {0 => "0" ; 1 => "1" ; 2 => "2" ; 3 => "3"} ;
mkMinute : Min -> Minute = \j -> lin Minute {s = minutes ! j ; i = j} ;
lincat
Minute = { s : Str ; i : Min } ;
lin
min_1 = mkMinute 1 ;
min_2 = mkMinute 2 ;
lastMinute = mkMinute 3 ;
timeHourMinute h m = P.mkAdv ("um" ++ h.short ++ ":" ++ m.s ++ "Uhr") ;
-- But this definition of timeHourMinute causes a compiler error! In
-- timeHourMinute = \h,m -> mkAdv (... ++ m.s ++ ..)
-- the argument m is not really restricted to Min, but an unbounded Int, so
-- m.s = {s = minutes ! j ; i = j}.s = (table (Ints 3) [...]) ! j
-- cannot be reduced in Compute.ConcreteNew, as *the compiler does not enforce*
-- 0 =< j =< 3.
-}
lin
weekdayPunctualAdv w = SyntaxGer.mkAdv anDat_Prep (mkNP the_Det w) ; -- am Montag
weekdayHabitualAdv w = SyntaxGer.mkAdv (mkPrep "" accusative) (mkNP every_Det w) ; ---- jeden Montag
@@ -177,9 +63,9 @@ lin
monthAdv m = SyntaxGer.mkAdv inDat_Prep (mkNP the_Det m) ;
yearAdv y = SyntaxGer.mkAdv (mkPrep "im Jahr" dative) y ; ----
dayMonthAdv d m = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom) ; -- am 17 Mai
dayMonthAdv d m = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom) ; -- am 17. Mai
monthYearAdv m y = SyntaxGer.mkAdv inDat_Prep (mkNP the_Det (mkCN m y)) ; -- im Mai 2012
dayMonthYearAdv d m y = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom ++ y.s ! False ! accusative) ; -- am 17 Mai 2013
dayMonthYearAdv d m y = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom ++ y.s ! True ! accusative) ; -- am 17. Mai 2013
intYear = symb ;
intMonthday = symb ;
@@ -192,45 +78,37 @@ lin
weekdayN w = w ;
monthN m = m ;
weekdayPN w = P.mkPN w ;
monthPN m = P.mkPN m ;
weekdayPN w = mkPN w ;
monthPN m = mkPN m ;
languageNP l = mkNP l ;
languageCN l = mkCN l ;
oper mkLanguage : Str -> N = \s -> P.mkN s neuter ; ---- produces Neuter
oper mkLanguage : Str -> N = \s -> mkN s neuter ; ---- produces Neuter
----------------------------------------------
---- lexicon of special names
lin second_Timeunit = P.mkN "Sekunde" ;
lin minute_Timeunit = P.mkN "Minute" ;
lin hour_Timeunit = P.mkN "Stunde" ;
lin day_Timeunit = P.mkN "Tag" ;
lin week_Timeunit = P.mkN "Woche" ;
lin month_Timeunit = P.mkN "Monat";
lin year_Timeunit = P.mkN "Jahr" "Jahre" neuter ;
lin monday_Weekday = mkN "Montag" ;
lin tuesday_Weekday = mkN "Dienstag" ;
lin wednesday_Weekday = mkN "Mittwoch" ;
lin thursday_Weekday = mkN "Donnerstag" ;
lin friday_Weekday = mkN "Freitag" ;
lin saturday_Weekday = mkN "Samstag" ;
lin sunday_Weekday = mkN "Sonntag" ;
lin monday_Weekday = P.mkN "Montag" ;
lin tuesday_Weekday = P.mkN "Dienstag" ;
lin wednesday_Weekday = P.mkN "Mittwoch" ;
lin thursday_Weekday = P.mkN "Donnerstag" ;
lin friday_Weekday = P.mkN "Freitag" ;
lin saturday_Weekday = P.mkN "Samstag" ;
lin sunday_Weekday = P.mkN "Sonntag" ;
lin january_Month = P.mkN "Januar" ;
lin february_Month = P.mkN "Februar" ;
lin march_Month = P.mkN "März" ;
lin april_Month = P.mkN "April" ;
lin may_Month = P.mkN "Mai" ;
lin june_Month = P.mkN "Juni" ;
lin july_Month = P.mkN "Juli" ;
lin august_Month = P.mkN "August" ;
lin september_Month = P.mkN "September" ;
lin october_Month = P.mkN "Oktober" ;
lin november_Month = P.mkN "November" ;
lin december_Month = P.mkN "Dezember" ;
lin january_Month = mkN "Januar" ;
lin february_Month = mkN "Februar" ;
lin march_Month = mkN "März" ;
lin april_Month = mkN "April" ;
lin may_Month = mkN "Mai" ;
lin june_Month = mkN "Juni" ;
lin july_Month = mkN "Juli" ;
lin august_Month = mkN "August" ;
lin september_Month = mkN "September" ;
lin october_Month = mkN "Oktober" ;
lin november_Month = mkN "November" ;
lin december_Month = mkN "Dezember" ;
lin afrikaans_Language = mkLanguage "Afrikaans" ;
lin amharic_Language = mkLanguage "Amharisch" ;

View File

@@ -40,66 +40,6 @@ lin
)
} ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Eigenname" ++
"("+case <pn.g,pn.n> of {
<Masc,Sg> => heading masculine_Parameter ;
<Fem,Sg> => heading feminine_Parameter ;
<Neutr,Sg> => heading neuter_Parameter ;
<_,Pl> => heading plural_Parameter
} ++")") ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (pn.s ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (pn.s ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (pn.s ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (pn.s ! Acc))
)
} ;
InflectionGN = \gn -> {
t = "vn" ;
s1 = heading1 ("Vorname" ++
case gn.g of {
Male => "(männlich)" ;
Female => "(weiblich)"
}) ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (gn.s ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (gn.s ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (gn.s ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (gn.s ! Acc))
) ;
} ;
InflectionSN = \sn -> {
t = "fn" ;
s1 = heading1 ("Familienname") ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (sn.s ! Male ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (sn.s ! Male ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (sn.s ! Male ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (sn.s ! Male ! Acc))
) ;
} ;
InflectionLN = \ln -> {
t = "pn" ;
s1 = heading1 ("Standortnamen" ++
"("+case <ln.g,ln.n> of {
<Masc,Sg> => heading masculine_Parameter ;
<Fem,Sg> => heading feminine_Parameter ;
<Neutr,Sg> => heading neuter_Parameter ;
<_,Pl> => heading plural_Parameter
} ++")") ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (ln.s ! Strong ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (ln.s ! Strong ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (ln.s ! Strong ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (ln.s ! Strong ! Acc))
)
} ;
InflectionA, InflectionA2 = \adj ->
let
gforms : Degree -> ResGer.Case -> Str = \d,c ->
@@ -223,7 +163,7 @@ oper
let
vfin : VForm -> Str = \f ->
verb.s ! f ++ verb.prefix ;
gforms : ParadigmsGer.Number -> Person -> Str = \n,p ->
gforms : 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

@@ -4,10 +4,11 @@ concrete ExtendGer of Extend =
CatGer ** ExtendFunctor
- [
InOrderToVP,
VPS, ListVPS, VPI, ListVPI,
VPS, ListVPS, VPI, ListVPI, RNP, RNPList,
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
GenModNP,
ComplSlashPartLast,
Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, Conj_RNP,
CardCNCard, CompoundN,
PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP
]
@@ -26,9 +27,9 @@ concrete ExtendGer of Extend =
VPS = {s : Order => Agr => Str} ;
[VPS] = {s1,s2 : Order => Agr => Str} ;
lin
lin
InOrderToVP vp = {s = "um" ++ useInfVP False vp} ;
InOrderToVP vp = {s = "um" ++ useInfVP False vp} ;
BaseVPI = twoTable Bool ;
ConsVPI = consrTable Bool comma ;
@@ -70,7 +71,7 @@ concrete ExtendGer of Extend =
t = tm.t ;
m = tm.m ;
subj = [] ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
verb = vps.s ! ord ! agr2vagr agr ! VPFinite m t a ;
haben = verb.inf2 ;
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
-- obj1 = (vp.nn ! agr).p1 ;
@@ -123,25 +124,25 @@ concrete ExtendGer of Extend =
} ;
UseDAPMasc det = {
s = \\_,c => det.sp ! Masc ! c ;
s = \\b,c => det.sp ! Masc ! c ;
a = agrP3 det.n ;
w = WLight ;
rc, ext = []
} ;
UseDAPFem det = {
s = \\_,c => det.sp ! Fem ! c ;
s = \\b,c => det.sp ! Fem ! c ;
a = agrP3 det.n ;
w = WLight ;
rc, ext = []
} ;
CardCNCard card cn = {
s = \\g,c =>
(Grammar.DetCN (Grammar.DetQuant Grammar.IndefArt (Grammar.NumCard card)) cn).s ! False ! c ;
n = Pl
} ;
lin
CardCNCard card cn = {
s = \\g,c =>
(Grammar.DetCN (Grammar.DetQuant Grammar.IndefArt (Grammar.NumCard card)) cn).s ! False ! c ;
n = Pl
} ;
lin PassVPSlash vp =
insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
@@ -167,7 +168,7 @@ lin PastPartAgentAP vp 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 ! GPl -- junk if not TV
++ vp.c2.s ! GPl -- junk if not TV
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
@@ -186,4 +187,118 @@ lin CompoundN a x =
g = x.g
} ;
-- Reflexive noun phrases -- (HL 5/2022: improved and completed, RNPList added)
lincat
RNP = {s : Agr => Case => Str ; rc,ext : Str ; isPron : Bool} ; -- Case, not PCase !!!
RNPList = {s1,s2 : Agr => Case => Str} ;
linref
RNP = \rnp -> rnp.s ! AgSgP3 Masc ! Acc ++ rnp.ext ++ rnp.rc ;
lin
ReflRNP vps rnp =
insertObjReflNP rnp vps ;
ReflPron = { -- with personal pronoun nominative
s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ;
-- 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
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 : Number = case pred.a of {PAg n => n ; _ => numberAgr a} ;
g : Gender = genderAgr a ;
d = case pred.c.k of {NoCase => c ; PredCase k => (prepC k).c} ;
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 ! 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 {False => <compl, []> ; True => <[], compl>} ;
ext = rnp.ext ++ rnp.rc
} ;
PossPronRNP pron num cn rnp =
GrammarGer.DetCN (GrammarGer.DetQuant (GrammarGer.PossPron pron) num)
(GrammarGer.PossNP cn (lin NP {s = \\pc => -- usePrepC pc (\c -> rnp.s ! pron.a ! c) ;
rnp.s ! pron.a ! pc ;
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" ;
-- reflPossPron : Agr -> Number -> Gender -> Case -> Str =
-- let eigen = adjForms "eigen" "eigen" in
-- \a,n,g,c -> possPron a n g c ++ (eigen ! (AMod (gennum g n) c)) ;
insertObjReflNP : RNP -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022
\rnp,vp -> insertObjRNP rnp vp.c2 vp ;
insertObjRNP : RNP -> Preposition -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022
\rnp,prep,vp -> -- generalize ResGer.insertObjRefl
let -- prep = vp.c2 ;
c = case prep.c of { NPC cc => cc ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ?
obj : Agr => Str = \\a => prep.s ++ 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
<False,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
<False,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
<False,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
<True,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
} ;
-}
}

View File

@@ -1,6 +1,5 @@
concrete ExtraGer of ExtraGerAbs = CatGer **
open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer), (N = NounGer) in {
flags coding=utf8 ;
lincat
@@ -30,21 +29,21 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
CompIQuant iq = {s = table {Ag g n p => iq.s ! n ! g ! Nom} ; ext = ""} ;
CompIQuant iq = {s = table {a => iq.s ! numberAgr a ! genderAgr a ! Nom} ; ext = ""} ;
IAdvAdv adv = {s = "wie" ++ adv.s} ;
DetNPMasc det = {
s = \\b,c => det.sp ! b ! Masc ! c ;
a = agrgP3 Masc det.n ;
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
w = WLight ;
ext, rc = []
} ;
DetNPFem det = {
s = \\b,c => det.sp ! b ! Fem ! c ;
a = agrgP3 Fem det.n ;
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
w = WLight ;
ext, rc = []
} ;
@@ -55,10 +54,8 @@ 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} } ;
-- regulates passivised object: accusative objects -> nom; all others: same case
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
@@ -85,7 +82,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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 ! GPl -- junk if not TV
++ vp.c2.s ! GPl -- junk if not TV
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
isPre = True ;
c = <[],[]> ;
@@ -122,12 +119,13 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
Sub => True ; -- glue prefix to verb
_ => False
} ;
vagr = agr2vagr agr ;
b = p.p ;
a = tm.a ;
t = tm.t ;
m = tm.m ;
subj = [] ++ tm.s ++ p.s ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
verb = vps.s ! ord ! vagr ! VPFinite m t a ;
haben = verb.inf2 ;
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
-- obj1 = (vp.nn ! agr).p1 ;
@@ -179,13 +177,13 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
RNPList = {s1,s2 : Agr => Case => Str} ;
linref
RNP = \rnp -> rnp.s ! (Ag Masc Sg P3) ! Acc ++ rnp.ext ++ rnp.rc ;
RNP = \rnp -> rnp.s ! AgSgP3 Masc ! Acc ++ rnp.ext ++ rnp.rc ;
lin
ReflRNP vps rnp =
insertObj (\\a => appPrep vps.c2 (rnp.s ! a)) vps ;
insertObjReflNP rnp vps ;
ReflPron = { -- personal pronoun, with "sich" in P3 Sg
ReflPron = { -- with personal pronoun nominative
s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ;
-- We might define ReflPron by the stronger reflPronSelf below, using "selbst"
@@ -208,11 +206,12 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
-- 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 ;
s = \\a,c => let n : Number = case pred.a of {PAg n => n ; _ => numberAgr a} ;
g : Gender = 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 ;
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} ;
@@ -229,11 +228,11 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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
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>} ;
c = case adj.c2.isPrep of {isPrep => <[], compl> ; _ => <compl, []>} ;
ext = rnp.ext ++ rnp.rc
} ;
@@ -253,7 +252,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
** {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_nr_RNP x y = twoTable2 Agr Case {s = \\a,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 ;
@@ -266,10 +265,13 @@ 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)) ;
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 ?
insertObjReflNP : RNP -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022
\rnp,vp -> insertObjRNP rnp vp.c2 vp ;
insertObjRNP : RNP -> Preposition -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022
\rnp,prep,vp -> -- generalize ResGer.insertObjRefl
let -- prep = vp.c2 ;
c : Case = case prep.c of { cc => cc ; _ => 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 =>
@@ -280,7 +282,20 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
<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
} ;
{- insertObjRNP : RNP -> Preposition -> ResGer.VPSlash -> ResGer.VPSlash = -- HL 8/2023
\rnp,prep,vp -> -- generalize ResGer.insertObjNP
let c = case prep.c of { NPC cc => cc ; _ => Acc } ;
obj : Agr => Str = \\a => prep.s ++ 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
<False,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
<False,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
<False,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
<True,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
} ;
-}
-- SS: implementation of some of the relevant Foc rules from Extra
lincat
@@ -325,19 +340,19 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
-- "es wird gelacht"; generating formal sentences
lincat
FClause = ResGer.VP ** {subj : ResGer.NP ; lock_FClause : {}} ;
FClause = ResGer.VP ** {subj : ResGer.NP} ;
lin
VPass v =
let vp = predV werdenPass
in lin FClause (vp ** {subj = esSubj ;
inf = vp.inf ** {s = v.s ! VPastPart APred } }) ; -- construct the formal clause
in vp ** {subj = esSubj ;
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
FtoCl cl =
let subj = mkSubject cl.subj cl.c1
in DisToCl subj.s subj.a cl ;
FtoCl cl =
let subj = mkSubject cl.subj cl.c1
in DisToCl subj.s subj.a cl ;
oper -- extra operations for ExtraGer
@@ -348,7 +363,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
esSubj : CatGer.NP = lin NP {
s = \\_,_ => "es" ;
rc, ext = [] ;
a = Ag Neutr Sg P3 ;
a = AgSgP3 Neutr ;
w = WPron
} ;
@@ -360,7 +375,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
Sub => True ; -- glue prefix to verb
_ => False
} ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
verb = vps.s ! ord ! agr2vagr agr ! VPFinite m t a ;
neg = vp.a1 ++ negation ! b ; -- HL 8/19 vp.a1 ! b ;
obj1 = (vp.nn ! agr).p1 ;
obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ;

View File

@@ -29,7 +29,7 @@ abstract ExtraGerAbs = Extra [
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
-- further constructions usin RNP, declared in abstract/Extra.gf:
-- further constructions using RNP, declared in abstract/Extra.gf or Extend.gf:
AdvRNP : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
AdvRVP : VP -> Prep -> RNP -> VP ; -- lectured about her travels
@@ -39,4 +39,5 @@ abstract ExtraGerAbs = Extra [
-- NOTE: generalizes ReflA2
PossPronRNP : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
}

View File

@@ -1,7 +1,7 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarGer of Grammar =
NounGer,
concrete GrammarGer of Grammar =
NounGer,
VerbGer,
AdjectiveGer,
AdverbGer,
@@ -13,7 +13,7 @@ concrete GrammarGer of Grammar =
PhraseGer,
TextX - [Tense,Temp],
IdiomGer,
StructuralGer, -- AR: keep for BW comp - [part_Prep,possess_Prep], -- use PartNP, PossNP instead
StructuralGer,
TenseGer,
NamesGer
** {

View File

@@ -8,24 +8,25 @@ concrete IdiomGer of Idiom = CatGer **
ImpersCl vp = mkClause "es" (agrP3 Sg) vp ;
GenericCl vp = mkClause "man" (agrP3 Sg) vp ;
CleftNP np rs = mkClause "es" (agrP3 Sg)
CleftNP np rs = mkClause "es" (agrP3 Sg)
(insertExtrapos (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ----
(insertObj (\\_ => (np.s ! False ! rs.c ++ bigNP np)) (predV MorphoGer.sein_V))) ; --HL
(insertObj (\\_ => np.s ! False ! rs.c ++ bigNP np) (predV MorphoGer.sein_V))) ;
CleftAdv ad s = mkClause "es" (agrP3 Sg)
CleftAdv ad s = mkClause "es" (agrP3 Sg)
(insertExtrapos (conjThat ++ s.s ! Sub)
(insertObj (\\_ => ad.s) (predV MorphoGer.sein_V))) ;
ExistNP np =
mkClause "es" (agrP3 Sg)
mkClause "es" (agrP3 Sg)
(insertObj (\\_ => appPrep geben.c2 (np.s ! False) ++ bigNP np)
(predV geben)) ;
ExistIP ip = {
s = \\m,t,a,p =>
let
cls = (mkClause "es" (agrP3 Sg) (predV geben)).s ! m ! t ! a ! p ;
s = \\m,t,a,p =>
let
cls =
(mkClause "es" (agrP3 Sg) (predV geben)).s ! m ! t ! a ! p ;
who = ip.s ! Acc
in table {
QDir => who ++ cls ! Inv ;
@@ -53,7 +54,7 @@ concrete IdiomGer of Idiom = CatGer **
ProgrVP = insertAdv "eben" ; ----
ImpPl1 vp = {s =
(mkClause "wir" (Ag Fem Pl P1) vp).s !
(mkClause "wir" (AgPl P1) vp).s !
MConjunct ! Pres ! Simul ! Pos ! Inv
} ;
@@ -65,7 +66,7 @@ concrete IdiomGer of Idiom = CatGer **
SelfAdvVP vp = insertAdv "selbst" vp ;
SelfAdVVP vp = insertAdv "selbst" vp ;
SelfNP np = np ** {
s = \\_,c => np.s ! False ! c ++ "selbst" ++ bigNP np ;
s = \\b,c => np.s ! b ! c ++ "selbst" ++ bigNP np ;
isPron = False ;
} ;

View File

@@ -13,7 +13,6 @@ 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" ;
@@ -59,7 +58,7 @@ lin
clever_A = mk3A "klug" "klüger" "klügste" ;
close_V2 = dirV2 Irreg.schließen_V ;
coat_N = mkN "Jacke" | mkN "Mantel" "Mantel" masculine;
cold_A = mk3A "kalt" "kälter" "kälteste" ;
cold_A = regA "kalt" ;
come_V = seinV (mk6V "kommen" "kommt" "komm" "kam" "käme" "gekommen") ;
computer_N = reg2N "Rechner" "Rechner" masculine ;
country_N = reg2N "Land" "Länder" neuter ;
@@ -186,8 +185,7 @@ 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 "Stern" ; -- HL 7/22
star_N = mkN "Sterne" ;
steel_N = mkN "Stahl" ;
stone_N = mkN "Stein" ;
stop_V = seinV Irreg.halten_V ;
@@ -213,9 +211,7 @@ 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" "auf den" "auf die" "aufs" accusative) | (mkPrep "auf" accusative));
wait_V2 = prepV2 (regV "warten") (mkPrep "auf" "auf den" "auf die" ("aufs" | "auf das") accusative);
wait_V2 = prepV2 (regV "warten") (mkPrep "auf" accusative) ;
walk_V = seinV Irreg.gehen_V ;
warm_A = mk3A "warm" "wärmer" "wärmste" ;
war_N = mkN "Krieg" ;
@@ -239,14 +235,14 @@ lin
dry_A = regA "trocken" ;
dull_A = regA "stumpf" ;
full_A = regA "voll" ;
heavy_A = mkA "schwer" "schwerer" "schwerste" ;
heavy_A = mkA "schwer" "schwere" "schwerer" "schwerste" ;
near_A = mk3A "nahe" "näher" "nächste" ;
rotten_A = regA "verdorben" ;
round_A = regA "rund" ;
sharp_A = mk3A "scharf" "schärfer" "schärfste" ;
smooth_A = regA "glatt" ;
straight_A = regA "gerade" ;
wet_A = mk4A "naß" "nass" "nasser" "nasseste" ;
wet_A = regA "naß" ;
wide_A = regA "breit" ;
animal_N = reg2N "Tier" "Tiere" neuter ;
ashes_N = mkN "Asche" ;

View File

@@ -5,7 +5,7 @@ resource MakeStructuralGer = open CatGer, (P = ParadigmsGer), MorphoGer, Prelude
oper
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
mkSubj : Str -> Subj = \x ->
{s = x ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\_,_,_ => s ; lock_IQuant = <>} ;
@@ -13,16 +13,16 @@ oper
mkPredet = overload {
mkPredet : A -> Predet = \a ->
lin Predet {
s = appAdj a ;
s = appAdj a ;
c = noCase ;
a = PAgNone
} ;
} ;
mkPredet : A -> Str -> Case -> Bool -> Number -> Predet = \a,p,c,b,n ->
lin Predet {
s = appAdj a ;
c = {p = p ; k = PredCase c} ;
s = appAdj a ;
c = {p = p ; k = PredCase c} ;
a = case b of {True => PAg n ; _ => PAgNone}
}
}
} ;
-- e.g. das selbe

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common:../prelude:
--# -path=.:../abstract:../common
concrete MarkupGer of Markup = CatGer, MarkHTMLX ** open Prelude in {
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

View File

@@ -20,20 +20,21 @@ oper
mkPrep : Str -> Case -> Preposition = \s,c ->
{s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep} ;
nameNounPhrase : Gender -> {s : Case => Str} -> {s : Bool => Case => Str ;
a : Agr ;
w : Weight ;
ext,rc : Str} =
nameNounPhrase : Gender -> {s : Case => Str} -> {s : Bool => Case => Str ;
a : Agr ;
w : Weight ;
ext,rc : Str} =
\g,name -> {
s = \\_,c => name.s ! c ;
a = agrgP3 g Sg ;
ext,rc = [] ;
ext, rc = [] ;
w = WHeavy -- ok?
} ;
detLikeAdj : Bool -> Number -> Str ->
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} ;

View File

@@ -1,31 +1,27 @@
--# -path=.:../abstract:../common:
concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
flags optimize=all_subs ;
-- Remark: np.isLight makes ResGer.insertObjNP expensive, for ComplSlash, SlashVP
-- np.isLight = True and np.isPron = True are now part of np.w
-- HL 21.7.2022: the dropping of DefArt in Prep+DefArt works by selecting from
-- np.s via b = det.hasDefArt = True the forms without det.s and from prep.s
-- the preposition glued with definite article singular, depending on gender, case.
lin
DetCN det cn = {
s = \\b,c => det.s ! b ! cn.g ! c ++ cn.s ! (adjfCase det.a c) ! det.n ! c ++ cn.adv ;
a = agrgP3 cn.g det.n ;
s = \\b,c => det.s ! b ! 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
-- 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 => case det.hasDefArt of { True => WDefArt ;
_ => WLight } ;
-- 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 => case det.hasDefArt of {True => WDefArt ;
_ => WLight } ;
_ => WHeavy } ;
rc = cn.rc ! det.n ;
ext = cn.ext
rc = cn.rc ! det.n ;
ext = cn.ext
} ;
DetNP det = { -- more genders in ExtraGer -- HL: der+er,den+en ; der drei,den drei+en
s = \\b,c => det.sp ! b ! Neutr ! c ;
DetNP det = {
s = \\b,c => det.sp ! b ! Neutr ! c ; -- more genders in ExtraGer -- HL: der+er,den+en ; der drei,den drei+en
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 } ;
rc, ext = []
@@ -33,13 +29,13 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
UsePN pn = {
s = \\_,c => pn.s ! c ;
a = agrgP3 pn.g Sg ;
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
a = agrgP3 pn.g pn.n ;
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 => pron.s ! NPCase c ;
s = \\_,c => pron.s ! NPCase c ;
a = pron.a ;
w = WPron ;
rc, ext = []
@@ -55,45 +51,45 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ;
PPartNP np v2 = np ** {
s = \\b,c => np.s ! b ! c ++ (embedInCommas (v2.s ! VPastPart APred)) ; --- invar part
w = WHeavy
s = \\b,c => np.s ! b ! c ++ embedInCommas (v2.s ! VPastPart APred) ; --- invar part
w = WHeavy
} ;
-- SS: "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 = \\b,c => np.s ! b ! c ++ adv.s ;
w = WHeavy
w = WHeavy
} ;
ExtAdvNP np adv = np ** {
s = \\b,c => np.s ! b ! c ++ (embedInCommas adv.s) ;
w = WHeavy
s = \\b,c => np.s ! b ! c ++ embedInCommas adv.s ;
w = WHeavy
} ;
DetQuantOrd quant num ord =
let
let
n = num.n ;
a = quant.a
in {
s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s!g!c ++
ord.s ! agrAdj g (adjfCase a c) n c ;
sp = \\b,g,c => quant.sp ! b ! num.isNum ! n ! g ! c ++ num.s!g!c ++
ord.s ! agrAdj g (adjfCase quant.aPl c) n c ;
s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s!g!c
++ ord.s ! agrAdj g (adjfCase a c) n c ;
sp = \\b,g,c => quant.sp ! b ! num.isNum ! n ! g ! c ++ 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
DetQuant quant num =
let
n = num.n ;
a = quant.a ;
b = andB quant.hasDefArt (case num.n of {Sg => True ; _ => False}) ;
b = andB quant.hasDefArt (case num.n of {Sg => True ; _ => False})
in {
s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s ! g ! c ;
sp = \\_,g,c => quant.sp ! False ! num.isNum ! n ! g ! c ++ num.s!g!c ;
s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s ! g ! c ;
sp = \\_,g,c => quant.sp ! False ! 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} ;
@@ -101,6 +97,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
hasDefArt = quant.hasDefArt ;
} ;
PossPron p = {
s = \\_,_,n,g,c => p.s ! NPPoss (gennum g n) c ;
sp = \\_,_,n,g,c => p.s ! NPPoss (gennum g n) c ;
@@ -117,7 +114,7 @@ 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} ;
NumDecimal numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
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} ;
@@ -129,20 +126,21 @@ 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 = table{True => \\_,n,g,c => [] ; -- defart dropped
s = table{True => \\_,n,g,c => [] ; -- definite article dropped
False => \\_,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 } ;
<Pl,Dat> => "denen" ; -- HL 6/2019
<Pl,Gen> => "derer" ; -- HL 6/2019
_ => artDef ! (gennum g n) ! c } ; -- von den+en
a, aPl = Weak ;
hasDefArt = True
hasDefArt = True
} ;
IndefArt = {
s = \\_ => table {
True => \\_,_,c => [] ;
False => table {
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ;
Pl => \\_,c => []
}
} ;
@@ -160,7 +158,9 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
MassNP cn = {
s = \\_,c => cn.s ! Strong ! Sg ! c ++ cn.adv ;
a = agrgP3 cn.g Sg ;
w = WLight ; -- ich trinke Bier nicht vs. ich trinke kein Bier
-- isLight = True ; -- ich trinke Bier nicht vs. ich trinke kein Bier
-- isPron = False ;
w = WLight ;
rc = cn.rc ! Sg ;
ext = cn.ext ;
hasDefArt = False
@@ -176,8 +176,8 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
ComplN2 f x = {
s = \\_,n,c => f.s ! n ! c ++ appPrepNP f.c2 x ;
g = f.g ;
rc = \\_ => [] ;
ext,adv = []
rc = \\_ => [] ;
ext,adv = []
} ;
ComplN3 f x = {
@@ -187,7 +187,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
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 ;
} ;
@@ -197,11 +197,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) ;
@@ -214,7 +214,7 @@ 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))) ;
w = case isPron np of { True => WLight ; _ => np.w }
w = case isPron np of { True => WLight ; _ => np.w }
} ;
SentCN cn s = cn ** {ext = cn.ext ++ embedInCommas s.s} ;
@@ -224,35 +224,34 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
ApposCN cn np = let g = cn.g in cn ** {
s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! c ++ 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 ++ appPrep vonDat (np.s ! False) ++ bigNP np } ; -- HL, ad hoc
s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ bigNP np } ;
PartNP cn np = case np.w of {
WPron => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ np.rc} ;
_ => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! Gen} -- HL 7/2022, ad hoc
_ => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! Gen ++ np.ext ++ np.rc}
}; -- glass of wine
CountNP det np = -- drei der Kinder | drei von den Kindern -- HL 7/22, ad-hoc TODO
-- det or numeral? np or rather (DefArt +) cn? drei (einiger Kinder) ?
let g = genderAgr np.a
let g : Gender = genderAgr np.a
in {
s = \\b,c => det.s ! b ! g ! c ++ appPrepNP vonDat np ++ bigNP np ;
a = agrgP3 g det.n ;
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
rc = np.rc ;
ext = np.ext
ext = np.ext
} ;
AdjDAP dap ap = -- the large (one) -- HL 8/22 der auf dich stolze; die ihm treue; der so dumme, infzu
{s, sp = \\g,c => dap.s ! g ! c ++ ap.c.p1 ++ ap.c.p2 ++ ap.s ! (AMod (gennum g dap.n) c) ++ ap.ext ;
{s, sp = \\g,c => dap.s ! g ! c ++ ap.c.p1 ++ ap.c.p2 ++ ap.s ! (AMod (gennum g dap.n) c) ++ ap.ext ;
a = dap.a ; n = dap.n ; isDef = dap.isDef ; hasDefArt = dap.hasDefArt } ;
DetDAP det = {s = \\g,c => det.s ! False ! g ! c ; -- HL 7/22 todo: check
sp = \\g,c => det.sp ! False ! g ! c ;
n = det.n ; a = det.a ; isDef = det.isDef ; hasDefArt = det.hasDefArt} ;
DetDAP det = {
s = \\g,c => det.s ! False ! g ! c ; -- HL 7/22 todo: check
sp = \\g,c => det.sp ! False ! g ! c ;
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) ;
@@ -262,4 +261,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
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

@@ -2,7 +2,7 @@
--1 German Lexical Paradigms
--
-- Aarne Ranta, Harald Hammarström and Björn Bringert2003--2007
-- Aarne Ranta, Harald Hammarström and Björn Bringert 2003--2007
--
-- This is an API for the user of the resource grammar
-- for adding lexical items. It gives functions for forming
@@ -141,7 +141,6 @@ mkN : overload {
} ;
mkGN : overload {
mkGN : Str -> Sex -> GN ; -- regular name with genitive in "s"
mkGN : (nom,gen : Str) -> Sex -> GN ; -- name with other genitive
@@ -160,36 +159,10 @@ mkN : overload {
mkSN : (nom,acc,dat,gen : Str) -> GN ; -- name with all case forms
} ;
mkLN = overload {
mkLN : Str -> LN = \s -> regLN s Masc ; -- regular name with genitive in "s", masculine
mkLN : Str -> Number -> LN = \s,n -> regLN s Masc ** {n=n} ; -- regular name with genitive in "s", masculine
mkLN : Str -> Gender -> LN = regLN ; -- regular name with genitive in "s"
-- If only the genitive differs, two strings are needed.
mkLN : (nom,gen : Str) -> Gender -> LN = mk2LN ; -- name with other genitive
-- In the worst case, all four forms are needed.
mkLN : (nom,acc,dat,gen : Str) -> Gender -> LN = \nom,acc,dat,gen,g ->
lin LN {s = \\a => table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ;
g = g ; n = Sg ;
hasArt = False}
} ;
defLN : LN -> LN = \n -> n ** {hasArt = True} ;
mk2LN : (karolus, karoli : Str) -> Gender -> LN = \karolus, karoli, g ->
lin LN {s = \\a => table {Gen => karoli ; _ => karolus} ; g = g ; n = Sg ;
hasArt = False} ;
regLN : (horst : Str) -> Gender -> LN = \horst, g ->
mk2LN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) g ;
-- To extract the number of a noun phrase
-- ifPluralNP : NP -> Bool
-- = \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
ifPluralNP : CatGer.NP -> Bool
= \np -> case (numberAgr np.a) of {Sg => False ; Pl => True} ;
--2 Adjectives
@@ -234,9 +207,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:
-- for prepositions glued with DefArt in singular
-- e.g. "auf" "auf den" "auf die" "aufs" + accusative
mkPrep : Str -> Str -> Str -> Str-> Case -> Prep ;
mkPrep : Str -> Str -> Str -> Str -> Case -> Prep ;
mkPrep : Case -> Prep ; -- convert case to preposition
} ;
@@ -246,15 +219,14 @@ mkN : overload {
datPrep : Prep ; -- no string, just dative case
genPrep : Prep ; -- no string, just genitive case
-- A couple of common prepositions (the first three always with the dative).
-- 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
bei_Prep : Prep ; -- bei + dative, with contraction beim
anDat_Prep : Prep ; -- an + dative, with contraction am
inDat_Prep : Prep ; -- in + dative, with contraction im
inAcc_Prep : Prep ; -- in + accusative, with contraction ins
aufAcc_Prep : Prep ; -- auf + accusative, with contraction aufs
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
anAcc_Prep : Prep ; -- an + accusative, with contraction ans
inAcc_Prep : Prep ; -- in + accusative, with contraction ins
--2 Verbs
@@ -337,12 +309,12 @@ mkV2 : overload {
-- Three-place (ditransitive) verbs need two prepositions, of which
-- 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)
accdatV3 : V -> V3 ; -- geben + dat(c2) + acc(c3) (Eng: give sb sth)
dirV3 : V -> Prep -> V3 ; -- senden + acc(c2) + nach(c3)
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(c2) + über(c3)
} ;
--3 Other complement patterns
@@ -353,39 +325,39 @@ mkV2 : overload {
mkV0 : V -> V0 ; --%
mkVS : V -> VS ;
mkV2V : overload { -- with zu; object-control
mkV2V : V -> V2V ;
mkV2V : V -> Prep -> V2V ;
mkV2V : overload { -- with zu
mkV2V : V -> V2V ; -- object-control verb (zu-inf), e.g. bitte jmdn, sich auszuruhen
mkV2V : V -> Prep -> V2V ; -- object-control verb with prep, e.g. appelliere an jmdn, zu schweigen
} ;
auxV2V : overload { -- without zu
auxV2V : V -> V2V ;
auxV2V : V -> V2V ; -- object-control auxiliary, e.g. lasse jmdn sich ausruhen
auxV2V : V -> Prep -> V2V ;
} ;
subjV2V : V2V -> V2V ; -- force subject-control
subjV2V : V2V -> V2V ; -- force subject-control, e.g. verspreche jmdm, mich auszuruhen
mkV2A : overload {
mkV2A : V -> V2A ;
mkV2A : V -> V2A ; -- e.g. male etwas blau
mkV2A : V -> Prep -> V2A ;
} ;
mkV2S : overload {
mkV2S : V -> V2S ;
mkV2S : V -> Prep -> V2S ;
mkV2S : V -> V2S ; -- e.g. antworte jmdm, dass S
mkV2S : V -> Prep -> V2S ; -- e.g. berichte an jmdn, dass S
} ;
mkV2Q : overload {
mkV2Q : V -> V2Q ;
mkV2Q : V -> V2Q ; -- e.g. frage jmdn, ob S
mkV2Q : V -> Prep -> V2Q ;
} ;
mkVV : V -> VV ; -- with zu
auxVV : V -> VV ; -- without zu
mkVV : V -> VV ; -- with zu, e.g. versuche, zu schlafen
auxVV : V -> VV ; -- without zu, e.g. will schlafen
mkVA : overload {
mkVA : V -> VA ;
mkVA : V -> VA ; -- e.g. bleibe gesund
mkVA : V -> Prep -> VA ;
} ;
mkVQ : V -> VQ ;
mkVQ : V -> VQ ; -- e.g. frage mich, ob S
mkAS : A -> AS ; --%
@@ -411,9 +383,8 @@ mkV2 : overload {
-- hidden from the document.
Gender = MorphoGer.Gender ;
Case = MorphoGer.Case ;
Case = MorphoGer.Case ;
Number = MorphoGer.Number ;
masculine = Masc ;
feminine = Fem ;
neuter = Neutr ;
@@ -566,7 +537,7 @@ mkV2 : overload {
dunk + "el" => mk3A a (dunk + "ler") (dunk + "leste") ;
te + "uer" => mk3A a (te + "urer") (te + "ureste") ;
_ + "e" => mk3A a (a + "r") (a + "ste") ;
_ + ("t" | "d" | "s" | "ß" | "sch" | "z" | "au" | "eu") => mk3A a (a + "er") (a + "este") ;
_ + ("t" | "d" | "s" | "ß" | "sch" | "z" | "au" | "eu") => mk3A a (a + "er") (a + "este") ;
_ => mk3A a (a + "er") (a + "ste")
} ;
@@ -582,27 +553,24 @@ mkV2 : overload {
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 = \\_ => 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 = <>} ;
{s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>}
} ;
accPrep = mkPrep accusative ;
datPrep = mkPrep dative ;
genPrep = mkPrep genitive ;
--von_Prep = mkPrep "von" dative ;
von_Prep = mkPrep "von" "vom" "von der" "vom" dative ;
zu_Prep = mkPrep "zu" "zum" "zur" "zum" dative ;
bei_Prep = mkPrep "bei" "beim" "bei der" "beim" dative ;
inDat_Prep = mkPrep "in" "im" "in der" "im" dative ;
inAcc_Prep = mkPrep "in" "in den" "in die" "ins" accusative ;
anDat_Prep = mkPrep "an" "am" "an der" "am" dative ;
anAcc_Prep = mkPrep "an" "an den" "an die" "ans" accusative ;
aufAcc_Prep = mkPrep "auf" "auf den" "auf die" "aufs" accusative ;
mk6V geben gibt gib gab gaebe gegeben =
let
@@ -672,7 +640,7 @@ mkV2 : overload {
= \v,c,d -> lin V3 (v ** {c2 = c ; c3 = d}) ;
} ;
dirV3 v p = mkV3 v accPrep p ;
dirV3 v p = mkV3 v accPrep p ; -- accPrep sets isPrep=False
accdatV3 v = mkV3 v datPrep accPrep ; -- to fit to Eng ditransitives (no preposition):
-- give sb(indir) sth(dir) = geben jmdm(dat) etwas(acc)
mkVS v = v ** {lock_VS = <>} ;
@@ -687,34 +655,35 @@ 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 = <>} ;
} ;

View File

@@ -1,4 +1,3 @@
--# -path=.:../abstract:../common:prelude -- HL
concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in {
flags optimize=all_subs ;

View File

@@ -14,14 +14,14 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
} ;
QuestVP ip vp = {
s = \\m,t,a,p =>
s = \\m,t,a,p =>
let
who = appPrep vp.c1 ip.s ;
cl = (mkClause who (agrP3 ip.n) vp).s ! m ! t ! a ! p
in table {
QDir => cl ! Main ;
QIndir => cl ! Sub
}
QDir => cl ! Main ;
QIndir => cl ! Sub
}
} ;
QuestSlash ip slash = {

View File

@@ -1,4 +1,4 @@
concrete RelativeGer of Relative = CatGer ** open Prelude, ResGer in {
concrete RelativeGer of Relative = CatGer ** open ResGer, Prelude in {
flags optimize=all_subs ;
@@ -18,7 +18,7 @@ concrete RelativeGer of Relative = CatGer ** open Prelude, ResGer in {
} ;
agr = case rp.a of {
RNoAg => agrP3 (numGenNum gn) ;
RAg n p => Ag Neutr n p
RAg n p => case n of {Sg => AgSgP3 Neutr ; Pl => AgPl p}
} ;
cl = mkClause (rp.s ! rgn ! Nom) agr vp
in

View File

@@ -35,16 +35,41 @@ resource ResGer = ParamX ** open Prelude in {
GenNum = GSg Gender | GPl ;
RelGenNum = RGenNum GenNum | RSentence ;
-- Agreement of $NP$ has three parts.
-- Agreement of $NP$ has three parts: gender, number and person.
Agr = Ag Gender Number Person ;
-- These 3*2*3 = 18 values can be reduced to 8, since gender is used only
-- in 3rd person singular. To select reflexive and possessive forms for "Sie"
-- in (mkClause str agr vp), add a value AgPlPol, for "man", add AgSgP3Gen. HL 29.9.2023
Agr = AgSgP1 | AgSgP2 | AgSgP3 Gender | AgSgP3Gen | AgPl Person | AgPlPol ;
oper
mkAgr : {g : Gender ; n : Number ; p : Person} -> Agr = \r ->
Ag r.g r.n r.p ;
genderAgr : Agr -> Gender = \r -> case r of {Ag g _ _ => g} ;
numberAgr : Agr -> Number = \r -> case r of {Ag _ n _ => n} ;
personAgr : Agr -> Person = \r -> case r of {Ag _ _ p => p} ;
genderAgr : Agr -> Gender = \r -> case r of {AgSgP3 g => g ; _ => Masc} ;
numberAgr = overload {
numberAgr : Agr -> Number = \r -> case r of {
AgSgP1 | AgSgP2 | AgSgP3 _ | AgSgP3Gen => Sg ;
AgPl _ | AgPlPol => Pl
} ;
numberAgr : VAgr -> Number = \r -> case r of {VAg n _ => n} ;
} ;
personAgr = overload {
personAgr : Agr -> Person = \r -> case r of {
AgSgP1 | AgPl P1 => P1 ;
AgSgP2 | AgPl P2 => P2 ;
AgSgP3 _ | AgSgP3Gen => P3 ;
AgPl P3 | AgPlPol => P3
} ;
personAgr : VAgr -> Person = \r -> case r of {VAg _ p => p}
} ;
conjAgr : Agr -> Agr -> Agr = \a,b ->
let n : Number = conjNumber (numberAgr a) (numberAgr b) ;
p : Person = conjPerson (personAgr a) (personAgr b)
in case <n,p> of {<Pl,p> => AgPl p ;
<Sg,P3> => AgSgP3 Neutr ;
<Sg,P1> => AgSgP1 ;
<Sg,P2> => AgSgP2 } ;
-- Pronouns are the worst-case noun phrases, which have both case
-- and possessive forms.
@@ -58,16 +83,14 @@ resource ResGer = ParamX ** open Prelude in {
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
Weight = WPron | WLight | WHeavy | WDefArt ; -- HL: may need WIndefArt for nicht+ein => kein
oper -- to handle clause negation properly
Weight = WPron | WLight | WHeavy | WDefArt ;
oper
isPron : {w : Weight} -> Bool = \np ->
case np.w of {WPron => True ; _ => False} ;
isLight : {w : Weight} -> Bool = \np ->
@@ -82,6 +105,9 @@ resource ResGer = ParamX ** open Prelude in {
--2 For $Verb$
param VAgr = -- Gender is irrelevant for verb forms, HL 8/2023
VAg Number Person ; -- except participles
param VForm =
VInf Bool -- True = with the particle "zu"
| VFin Bool VFormFin -- True = prefix glued to verb
@@ -130,8 +156,10 @@ resource ResGer = ParamX ** open Prelude in {
oper
agrP3 : Number -> Agr = agrgP3 Neutr ;
agrgP3 : Gender -> Number -> Agr = \g,n ->
Ag g n P3 ;
agrgP3 : Gender -> Number -> Agr = \g,n -> case n of {
Sg => AgSgP3 g ;
Pl => AgPl P3 -- no gender in Pl
} ;
gennum : Gender -> Number -> GenNum = \g,n ->
case n of {
@@ -172,10 +200,10 @@ resource ResGer = ParamX ** open Prelude in {
_ => Weak
} ;
vFin : Bool -> Mood -> Tense -> Agr -> VForm = \b,m,t,a ->
vFin : Bool -> Mood -> Tense -> VAgr -> VForm = \b,m,t,a ->
let
an = numberAgr a ;
ap = personAgr a ;
an : Number = numberAgr a ;
ap : Person = personAgr a ;
in
case <t,m> of {
<Pres,MIndic> => VFin b (VPresInd an ap) ;
@@ -186,11 +214,15 @@ resource ResGer = ParamX ** open Prelude in {
_ => VInf False --# notpresent
} ;
conjAgr : Agr -> Agr -> Agr = \a,b -> mkAgr {
g = Neutr ; ----
n = conjNumber (numberAgr a) (numberAgr b) ;
p = conjPerson (personAgr a) (personAgr b)
} ;
agr2vagr : Agr -> VAgr = \r -> case r of {
AgSgP1 => VAg Sg P1 ;
AgSgP2 => VAg Sg P2 ;
AgSgP3 _ | AgSgP3Gen => VAg Sg P3 ;
AgPl p => VAg Pl p ;
AgPlPol => VAg Pl P3
} ;
vagrP3 : Number -> VAgr = \n -> VAg n P3 ;
--------------------------------------------
--TYPE DEFINITIONS + WORST-CASE CONSTRUCTORS
@@ -415,51 +447,44 @@ resource ResGer = ParamX ** open Prelude in {
-- To apply a preposition to a complement.
appPrep : Preposition -> (Case => Str) -> Str = \prep,arg ->
prep.s ! GPl ++ arg ! prep.c ++ prep.s2 ;
prep.s ! GPl ++ arg ! prep.c ++ prep.s2 ;
appPrepNP : Preposition -> NP -> Str = \prep,np ->
let
g = (genderAgr np.a) ;
n = (numberAgr np.a) ;
g : Gender = genderAgr np.a ;
n : Number = numberAgr np.a ;
glues = case <prep.isPrep,n> of {<isPrepDefArt,Sg> => True ; _ => False} ;
nps = np.s ! glues ! prep.c
in
case <glues, np.w> of {
<True, WDefArt> => -- e.g. "zum Hof|zur Tür|zum Fenster herein"
prep.s ! (GSg g) ++ nps ++ np.ext ++ prep.s2 ++ np.rc ;
_ => prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc
} ;
{-
-- Simplify to test the effect on grammar compilation complexity (without SlashV2VNP):
-- with glues = False: 27096 msec, 3,2M VerbGer.gfo, 854K SentenceGer.gfo
-- and SlashV2VNP:102597 msec, 16 M VerbGer.gfo, 854K SentenceGer.gfo (good!)
appPrepNP : Preposition -> NP -> Str = \prep,np ->
let
glues = False ;
nps = np.s ! glues ! prep.c
in prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc ;
_ => prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc
} ;
{- -- Simplify to test the effect on grammar compilation complexity (without SlashV2VNP):
-- with glues = False: 27096 msec, 3,2M VerbGer.gfo, 854 SentenceGer.gfo
-- and SlashV2VNP:102597 msec, 16 M VerbGer.gfo, 854 SentenceGer.gfo (good!)
appPrepNP : Preposition -> NP -> Str = \prep,np ->
let
glues = False ;
nps = np.s ! glues ! prep.c
in prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ 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 ->
{s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase} ;
-- To build a preposition from just a case. -- HL 9/19: moved to mkPrep in ParadigmsGer
PrepNom : Preposition = {s = \\_ => []; isPrep = isCase ; c = Nom ; s2 = []} ;
vonDat : Preposition = {s=table{GPl => "von" ; GSg Fem => "von der"; _ => "vom"};
s2=[]; c=Dat; isPrep=isPrepDefArt} ;
-- for testing:
Dat' : Preposition = {s = \\_ => []; s2 = []; c=Dat; isPrep=isCase} ;
mit' : Preposition = {s = \\_ => "zusammen mit"; s2 = []; c=Dat; isPrep=isPrep} ;
zuDat' : Preposition = {s=\\_ => "zu"; s2="herein"; c=Dat; isPrep=isPrep} ;
zum' : Preposition = {s= table{GPl => "zu"; GSg Fem =>"zur"; _ => "zum"};
s2="herein"; c=Dat; isPrep=isPrepDefArt} ;
inDat' : Preposition = {s= \\_ => "in" ; s2="drin"; c=Dat; isPrep=isPrep} ;
im' : Preposition = {s= table{GPl => "in"; GSg Fem=>"in der"; _ =>"im"};
s2="drin"; c=Dat; isPrep=isPrepDefArt} ;
inAcc' : Preposition = {s=\\_ => "in"; s2="hinein"; c=Acc; isPrep=isPrep} ;
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
@@ -473,8 +498,8 @@ resource ResGer = ParamX ** open Prelude in {
-- Here we define personal and relative pronouns.
-- All personal pronouns, except "ihr", conform to the simple pattern $mkPronPers$.
mkPronPers : (x1,_,_,_,x5 : Str) -> Gender -> Number -> Person ->
{s : NPForm => Str ; a : Agr} =
mkPronPers : (x1,_,_,_,x5 : Str) -> Gender -> Number -> Person ->
{s : NPForm => Str ; a : Agr} =
\ich,mich,mir,meiner,mein,g,n,p -> {
s = table {
NPCase c => caselist ich mich mir meiner ! c ;
@@ -486,7 +511,12 @@ resource ResGer = ParamX ** open Prelude in {
}
}
} ;
a = Ag g n p
a = case <g,n,p> of {
<_,Pl,p > => AgPl p ;
<g,Sg,P3> => AgSgP3 g ;
<_,Sg,P1> => AgSgP1 ;
<_,Sg,P2> => AgSgP2 -- for "man", "Sie", set in StructuralGer HL
}
} ;
pronEnding : GenNum => Case => Str = table {
@@ -503,30 +533,14 @@ resource ResGer = ParamX ** open Prelude in {
GPl => caselist "die" "die" "den" "der"
} ;
{- -- used in SymbolGer:
artDefContr : GenNum -> PCase -> Str = \gn,np -> case np of {
NPC c => artDef ! gn ! c ;
NPP p => case <p,gn> of {
<CAnDat, GSg (Masc | Neutr)> => "am" ;
<CInAcc, GSg Neutr> => "ins" ;
<CInDat, GSg (Masc | Neutr)> => "im" ;
<CZuDat, GSg Masc> => "zum" ;
<CZuDat, GSg Neutr> => "zum" ;
<CZuDat, GSg Fem> => "zur" ;
<CVonDat, GSg (Masc | Neutr)> => "vom" ;
_ => let sp = prepC np in sp.s ++ artDef ! gn ! sp.c
}
} ;
-}
-- This is used when forming determiners that are like adjectives.
appAdj : Adjective -> Number => Gender => Case => Str = \adj ->
let
ad : GenNum -> Case -> Str = \gn,c ->
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} ;
\\n,g,c => case n of {Sg => ad (GSg g) c ; _ => ad GPl c} ;
-- This auxiliary gives the forms in each degree of adjectives.
@@ -559,7 +573,7 @@ resource ResGer = ParamX ** open Prelude in {
-- For $Verb$.
VPC : Type = {
s : Bool => Agr => VPForm => { -- True = prefix glued to verb
s : Bool => VAgr => VPForm => { -- True = prefix glued to verb
fin : Str ; -- wird
inf, inf2 : Str -- lesen,[] | gelesen,haben | können,haben (= gekonnt,haben)
} -- HL 11/6/2019 Fut Anter: lesen gekonnt haben => haben lesen können
@@ -575,8 +589,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
-- objCtrl distinguishes object-control from subject-control verb v:V2V in VP.s:
@@ -587,26 +602,26 @@ resource ResGer = ParamX ** open Prelude in {
let
isAux = vp.isAux ;
verb = vp.s ;
vfin : Bool -> Mood -> Tense -> Agr -> Str = \b,m,t,a ->
vfin : Bool -> Mood -> Tense -> VAgr -> Str = \b,m,t,a ->
verb.s ! vFin b m t a ;
vinf = verb.s ! VInf False ;
vpart = if_then_Str isAux vinf (verb.s ! VPastPart APred) ;
vHaben = auxPerfect verb ;
hat : Mood -> Tense -> Agr -> Str = \m,t,a ->
hat : Mood -> Tense -> VAgr -> Str = \m,t,a ->
vHaben ! vFin False m t a ;
haben : Str = vHaben ! VInf False ;
wird : Mood -> Agr -> Str = \m,a ->
wird : Mood -> VAgr -> Str = \m,a ->
let
an = numberAgr a ;
ap = personAgr a ;
an : Number = numberAgr a ;
ap : Person = personAgr a ;
in
case m of {
MIndic => werden_V.s ! VFin False (VPresInd an ap) ;
MIndic => werden_V.s ! VFin False (VPresInd an ap) ;
MConjunct => werden_V.s ! VFin False (VPresSubj an ap)
} ;
wuerde : Agr -> Str = \a -> --# notpresent
} ;
wuerde : VAgr -> Str = \a -> --# notpresent
werden_V.s ! VFin False (VImpfSubj (numberAgr a) (personAgr a)) ; --# notpresent
auf = verb.prefix ;
@@ -730,10 +745,10 @@ resource ResGer = ParamX ** open Prelude in {
insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp ->
let obj = appPrepNP prep np ;
b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ;
b : Bool = case isPrep of {isPrep | isPrepDefArt => True ; _ => False} ;
w = np.w ;
c = prep.c
in insertObj' obj b w c vp ;
in insertObj' obj b w c vp ;
insertObj' : Str -> Bool -> Weight -> Case -> VPSlash -> VPSlash = \obj,isPrep,w,c,vp ->
vp ** {
@@ -759,10 +774,9 @@ 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)
insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron
let prep = vp.c2 ; -- HL 7/22 reduced to c:Case
obj : Agr => Str = \\a => prep.s ! GPl ++ reflPron ! a ! prep.c ++ prep.s2 ;
let prep = vp.c2 ;
obj : Agr => Str = \\a => prep.s ! GPl ++ reflPron ! a ! prep.c ++ prep.s2
in vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in
@@ -837,14 +851,15 @@ resource ResGer = ParamX ** open Prelude in {
} ;
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp ->
let vps = useVP vp in {
let vagr = agr2vagr agr ;
vps = useVP vp in {
s = \\m,t,a,b,o =>
let
ord = case o of {
Sub => True ; -- glue prefix to verb
_ => False
} ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
verb = vps.s ! ord ! vagr ! VPFinite m t a ;
haben = verb.inf2 ;
neg = negation ! b ;
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
@@ -912,7 +927,7 @@ resource ResGer = ParamX ** open Prelude in {
in
<
\\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.a2,
vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos
vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! vagrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos
vp.inf.inpl.p2, -- ! HL
infExt ++ vp.ext
> ;
@@ -923,7 +938,7 @@ resource ResGer = ParamX ** open Prelude in {
{
objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
pred = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
pred = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! vagrP3 Sg ! VPInfinit ant).inf ;
-- inplace and extracted parts of vp.inf:
inpl = vp.inf.inpl ;
extr = vp.inf.extr
@@ -934,7 +949,7 @@ resource ResGer = ParamX ** open Prelude in {
\isAux, ant, pol, vp -> let vps = useVP vp in
{ objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
pred = vp.inf.inpl.p2 ++ vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
pred = vp.inf.inpl.p2 ++ vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! vagrP3 Sg ! VPInfinit ant).inf ;
-- inplace and extracted parts of vp.inf:
inpl = <vp.inf.inpl.p1, []> ; -- move the predicate part to pred
extr = vp.inf.extr
@@ -945,7 +960,7 @@ resource ResGer = ParamX ** open Prelude in {
-- let vpi = infVP isAux vp in
-- vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ;
let vpi = infVP isAux Simul Pos vp ; -- HL 3/2022
agr : Agr = (Ag Masc Sg P3) ;
agr : Agr = AgSgP3Gen ; -- HL 17.8.2023
glue : (Agr => Str)*Str -> Str = \i -> i.p1!agr ++ i.p2
in
glue (embedInf vpi.inpl <vpi.objs, vpi.pred>) ++ vpi.extr!agr ++ vp.ext ;
@@ -953,47 +968,64 @@ resource ResGer = ParamX ** open Prelude in {
-- The nominative case is not used as reflexive, but defined here
-- so that we can reuse this in personal pronouns.
reflPron : Agr => Case => Str = table {
Ag _ Sg P1 => caselist "ich" "mich" "mir" "meiner" ;
Ag _ Sg P2 => caselist "du" "dich" "dir" "deiner" ;
Ag Masc Sg P3 => caselist "er" "sich" "sich" "seiner" ;
Ag Fem Sg P3 => caselist "sie" "sich" "sich" "ihrer" ;
Ag Neutr Sg P3 => caselist "es" "sich" "sich" "seiner" ;
Ag _ Pl P1 => caselist "wir" "uns" "uns" "unser" ;
Ag _ Pl P2 => caselist "ihr" "euch" "euch" "euer" ;
Ag _ Pl P3 => caselist "sie" "sich" "sich" "ihrer"
reflPron : Agr => Case => Str = table { -- with persPron nominative
AgSgP1 => caselist "ich" "mich" "mir" "meiner" ;
AgSgP2 => caselist "du" "dich" "dir" "deiner" ;
AgSgP3 Masc => caselist "er" "sich" "sich" "seiner" ;
AgSgP3 Fem => caselist "sie" "sich" "sich" "ihrer" ;
AgSgP3 Neutr => caselist "es" "sich" "sich" "seiner" ;
AgSgP3Gen => caselist "man selbst" "sich" "sich" "seiner" ; -- älter als man selbst sein
AgPl P1 => caselist "wir" "uns" "uns" "unser" ;
AgPl P2 => caselist "ihr" "euch" "euch" "euer" ;
AgPl P3 => caselist "sie" "sich" "sich" "ihrer" ;
AgPlPol => caselist "Sie" "sich" "sich" "Ihrer" -- HL 8/2023
-- ; AgPlReci => caselist "man" "einander" "einander" "einander" -- reciPron ?
} ;
possPron : Agr -> Number -> Gender -> Case -> Str = \a,n,g,c -> case <a,n,g> of {
<Ag _ Sg P1,Sg,Masc> => caselist "mein" "meinen" "meinem" "meines" ! c ;
<Ag _ Sg P1,Sg,Fem> => caselist "meine" "meine" "meiner" "meiner" ! c ;
<Ag _ Sg P1,Sg,Neutr> => caselist "mein" "mein" "meinem" "meines" ! c ;
<Ag _ Sg P1,Pl,_> => caselist "meine" "meine" "meinen" "meiner" ! c ;
<Ag _ Sg P2,Sg,Masc> => caselist "dein" "deinen" "deinem" "deines" ! c ;
<Ag _ Sg P2,Sg,Fem> => caselist "deine" "deine" "deiner" "deiner" ! c ;
<Ag _ Sg P2,Sg,Neutr> => caselist "dein" "dein" "deinem" "deines" ! c ;
<Ag _ Sg P2,Pl,_> => caselist "deine" "deine" "deinen" "deiner" ! c ;
<Ag (Masc|Neutr) Sg P3,Sg,Masc> => caselist "sein" "seinen" "seinem" "seines" ! c ;
<Ag (Masc|Neutr) Sg P3,Sg,Fem> => caselist "seine" "seine" "seiner" "seiner" ! c ;
<Ag (Masc|Neutr) Sg P3,Sg,Neutr> => caselist "sein" "sein" "seinem" "seines" ! c ;
<Ag (Masc|Neutr) Sg P3,Pl,_> => caselist "seine" "seine" "seinen" "seiner" ! c ;
<AgSgP1,Sg,Masc> => caselist "mein" "meinen" "meinem" "meines" ! c ;
<AgSgP1,Sg,Fem> => caselist "meine" "meine" "meiner" "meiner" ! c ;
<AgSgP1,Sg,Neutr> => caselist "mein" "mein" "meinem" "meines" ! c ;
<AgSgP1,Pl,_> => caselist "meine" "meine" "meinen" "meiner" ! c ;
<AgSgP2,Sg,Masc> => caselist "dein" "deinen" "deinem" "deines" ! c ;
<AgSgP2,Sg,Fem> => caselist "deine" "deine" "deiner" "deiner" ! c ;
<AgSgP2,Sg,Neutr> => caselist "dein" "dein" "deinem" "deines" ! c ;
<AgSgP2,Pl,_> => caselist "deine" "deine" "deinen" "deiner" ! c ;
<Ag _ _ P3,Sg,Masc> => caselist "ihr" "ihren" "ihrem" "ihres" ! c ;
<Ag _ _ P3,Sg,Fem> => caselist "ihre" "ihre" "ihrer" "ihrer" ! c ;
<Ag _ _ P3,Sg,Neutr> => caselist "ihr" "ihr" "ihrem" "ihres" ! c ;
<Ag _ _ P3,Pl,_> => caselist "ihre" "ihre" "ihren" "ihrer" ! c ;
<AgSgP3 Fem,Sg,Masc> => caselist "ihr" "ihren" "ihrem" "ihres" ! c ;
<AgSgP3 Fem,Sg,Fem> => caselist "ihre" "ihre" "ihrer" "ihrer" ! c ;
<AgSgP3 Fem,Sg,Neutr> => caselist "ihr" "ihr" "ihrem" "ihres" ! c ;
<AgSgP3 Fem,Pl,_> => caselist "ihre" "ihre" "ihren" "ihrer" ! c ;
<Ag _ Pl P1,Sg,Masc> => caselist "unser" "unseren" "unserem" "unseres" ! c ;
<Ag _ Pl P1,Sg,Fem> => caselist "unsere" "unsere" "unserer" "unserer" ! c ;
<Ag _ Pl P1,Sg,Neutr> => caselist "unser" "unser" "unserem" "unseres" ! c ;
<Ag _ Pl P1,Pl,_> => caselist "unsere" "unsere" "unseren" "unserer" ! c ;
<Ag _ Pl P2,Sg,Masc> => caselist "euer" "euren" "eurem" "eures" ! c ;
<Ag _ Pl P2,Sg,Fem> => caselist "eure" "eure" "eurer" "eurer" ! c ;
<Ag _ Pl P2,Sg,Neutr> => caselist "euer" "euer" "eurem" "eures" ! c ;
<Ag _ Pl P2,Pl,_> => caselist "eure" "eure" "euren" "eurer" ! c
<AgSgP3 _,Sg,Masc> => caselist "sein" "seinen" "seinem" "seines" ! c ;
<AgSgP3 _,Sg,Fem> => caselist "seine" "seine" "seiner" "seiner" ! c ;
<AgSgP3 _,Sg,Neutr> => caselist "sein" "sein" "seinem" "seines" ! c ;
<AgSgP3 _,Pl,_> => caselist "seine" "seine" "seinen" "seiner" ! c ;
<AgSgP3Gen,Sg,Masc> => caselist "sein" "seinen" "seinem" "seines" ! c ;
<AgSgP3Gen,Sg,Fem> => caselist "seine" "seine" "seiner" "seiner" ! c ;
<AgSgP3Gen,Sg,Neutr> => caselist "sein" "sein" "seinem" "seines" ! c ;
<AgSgP3Gen,Pl,_> => caselist "seine" "seine" "seinen" "seiner" ! c ;
<AgPl P1,Sg,Masc> => caselist "unser" "unseren" "unserem" "unseres" ! c ;
<AgPl P1,Sg,Fem> => caselist "unsere" "unsere" "unserer" "unserer" ! c ;
<AgPl P1,Sg,Neutr> => caselist "unser" "unser" "unserem" "unseres" ! c ;
<AgPl P1,Pl,_> => caselist "unsere" "unsere" "unseren" "unserer" ! c ;
<AgPl P2,Sg,Masc> => caselist "euer" "euren" "eurem" "eures" ! c ;
<AgPl P2,Sg,Fem> => caselist "eure" "eure" "eurer" "eurer" ! c ;
<AgPl P2,Sg,Neutr> => caselist "euer" "euer" "eurem" "eures" ! c ;
<AgPl P2,Pl,_> => caselist "eure" "eure" "euren" "eurer" ! c ;
<AgPl P3,Sg,Masc> => caselist "ihr" "ihren" "ihrem" "ihres" ! c ;
<AgPl P3,Sg,Fem> => caselist "ihre" "ihre" "ihrer" "ihrer" ! c ;
<AgPl P3,Sg,Neutr> => caselist "ihr" "ihr" "ihrem" "ihres" ! c ;
<AgPl P3,Pl,_> => caselist "ihre" "ihre" "ihren" "ihrer" ! c ;
<AgPlPol,Sg,Masc> => caselist "Ihr" "Ihren" "Ihrem" "Ihres" ! c ;
<AgPlPol,Sg,Fem> => caselist "Ihre" "Ihre" "Ihrer" "Ihrer" ! c ;
<AgPlPol,Sg,Neutr> => caselist "Ihr" "Ihr" "Ihrem" "Ihres" ! c ;
<AgPlPol,Pl,_> => caselist "Ihre" "Ihre" "Ihren" "Ihrer" ! c
} ;
conjThat : Str = "dass" ;
@@ -1022,11 +1054,10 @@ resource ResGer = ParamX ** open Prelude in {
} ;
-- Function that allows the construction of non-nominative subjects.
mkSubject : NP -> Preposition -> {s:Str ; a:Agr} = \np, prep ->
let
subj = appPrepNP prep np ;
agr = case prep.c of { Nom => np.a ; _ => Ag Masc Sg P3 }
agr = case prep.c of { Nom => np.a ; _ => AgSgP3 Masc } ;
subj = appPrepNP prep np
in {s = subj ; a = agr} ;
sex2gender : Sex -> Gender = \g ->

View File

@@ -21,17 +21,22 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
s = \\pol,n =>
let
ps = case n of {
ImpF _ True => <P3,"Sie",True> ; -- setzen Sie sich
_ => <P2,[],False>
} ;
agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
neg = negation ! pol ;
ImpF _ True => <P3,"Sie",True> ; -- setzen Sie sich Ihren Hut auf
_ => <P2,[],False> -- but: nimm [ihren | deinen | *Ihren] Hut
} ; -- vp should be reflexive, ComplRSlash
vagr = VAg (numImp n) ps.p1 ;
verb = vps.s ! False ! vagr ! VPImperat ps.p3 ;
agr = case <numImp n, ps.p1, ps.p3> of {
<_, P3,True> => AgPlPol ; -- sich | Ihr-
<Sg,P2,False> => AgSgP2 ; -- dich | dein-
<Pl,P2,False> => AgPl P2 ; -- euch | euer-
_ => AgSgP1 -- default, does not occur
} ;
inf = vp.inf.inpl.p2 ++ verb.inf ; -- HL .s/.inpl.p2
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.adj
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
in
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ neg ++ obj ++ vp.a2 ++ inf ++ vp.ext
} ;
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
} ;
AdvImp adv imp = {
s = \\pol,impform => adv.s ++ imp.s ! pol ! impform
@@ -42,9 +47,9 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
-- + SlashVP 414720 (28224,204)
SlashVP np vp =
let subj = mkSubject np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
in mkClause subj.s subj.a vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
-- cf. tests/german/TestLangGer.gf
let subj = mkSubject np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
in mkClause subj.s subj.a vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
-- cf. tests/german/TestLangGer.gf
AdvSlash slash adv = {
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
c2 = slash.c2
@@ -54,7 +59,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
SlashVS np vs slash =
let subj = mkSubject np PrepNom ;
vp = (insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs))
vp = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)
in mkClause subj.s subj.a vp ** {c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s ! Sub} ; -- no leading comma, if sentence-initial

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, (R = ResGer) in {
@@ -52,13 +52,13 @@ 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 = P.inDat_Prep ; -- HL 7/2022
in_Prep = P.inDat_Prep ;
it_Pron = mkPronPers "es" "es" "ihm" "seiner" "sein" Neutr Sg P3 ;
less_CAdv = X.mkCAdv "weniger" "als" ;
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 = { -- HL 5/2022
s = \\n,g,c => let gn = R.gennum g n ;
adj = (P.mkA "viel" "mehr" "meiste").s ! Superl
@@ -67,7 +67,7 @@ concrete StructuralGer of Structural = CatGer **
c = {p = [] ; k = PredCase Gen} ;
a = PAg Pl} ;
much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ;
n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ;
n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ;
must_VV = auxVV
(mkV
"müssen" "muss" "musst" "muss" "müsst" "müss"
@@ -81,26 +81,27 @@ concrete StructuralGer of Structural = CatGer **
on_Prep = mkPrep "auf" P.dative ;
or_Conj = {s1 = [] ; s2 = "oder" ; n = Sg} ;
otherwise_PConj = ss "sonst" ;
part_Prep = P.von_Prep ; -- obsolete, use PartNP cn np
part_Prep = P.von_Prep ; -- obsolete, better use PartNP cn np
please_Voc = ss "bitte" ;
possess_Prep = P.von_Prep ; -- obsolete, use PossNP cn np
possess_Prep = P.von_Prep ; -- obsolete, better use PossNP cn np
quite_Adv = ss "ziemlich" ;
she_Pron = mkPronPers "sie" "sie" "ihr" "ihrer" "ihr" Fem Sg P3 ;
so_AdA = ss "so" ;
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} ;
in {s,sp = asQuant tab ; n = Pl ; a = Weak ; isDef = True ; hasDefArt = False} ;
someSg_Det = {
s,sp = asQuant (\\g,c => "ein" + pronEnding ! GSg g ! c) ; ---- einer,eines
n = Sg ;
a = Strong ;
hasNum = True ;
isDef = False ; hasDefArt = False
isDef = False ;
hasDefArt = False
} ;
something_NP = nameNounPhrase Neutr {s = \\_ => "etwas"} ;
somewhere_Adv = ss "irgendwo" ;
that_Quant = let
jener : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "jen").s in
jener : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "jen").s in
{s,sp = \\_,_ => jener ; a,aPl = Weak ; hasDefArt = False} ;
---b that_NP = nameNounPhrase Neutr {s = caselist "das" "das" "dem" "dessen"} ; ----
there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ;
@@ -110,7 +111,7 @@ 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 => Case => Str = \\n => (detUnlikeAdj True n "dies").s in
dieser : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "dies").s in
{s,sp = \\_,_ => dieser ; a,aPl = Weak ; hasDefArt = False} ;
---b this_NP = nameNounPhrase Neutr {s = caselist "dies" "dies" "diesem" "dieses"} ; ----
---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ;
@@ -142,7 +143,7 @@ concrete StructuralGer of Structural = CatGer **
with_Prep = mkPrep "mit" P.dative ;
youSg_Pron = mkPronPers "du" "dich" "dir" "deiner" "dein" Fem Sg P2 ;
youPl_Pron = mkPronPers "ihr" "euch" "euch" "eurer" "euer" Fem Pl P2 ; ---- poss
youPol_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Fem Pl P3 ;
youPol_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Fem Pl P3 ** {a = AgPlPol} ;
yes_Utt = ss "ja" ;
not_Predet = {s = \\_,_,_ => "nicht" ; c = noCase ; a = PAgNone} ;
@@ -168,15 +169,14 @@ concrete StructuralGer of Structural = CatGer **
lin language_title_Utt = ss "Deutsch" ;
oper
asQuant : (Gender => Case => Str) -> (Bool => Gender => Case => Str) =
\tab -> \\_,g,c => tab ! g ! c ;
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} ;
appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str =
\adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ;
oper
asQuant : (Gender => Case => Str) -> (Bool => Gender => Case => Str) =
\tab -> \\_,g,c => tab ! g ! c ;
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} ;
appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str =
\adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ;
}

View File

@@ -9,7 +9,7 @@ lin
NumPN i = {s = i.s ! Neutr ; g = Neutr ; n = Sg} ; --- c
CNIntNP cn i = {
s = \\b,c => cn.s ! Weak ! Sg ! Nom ++ i.s ;
s = \\_,c => cn.s ! Weak ! Sg ! Nom ++ i.s ;
a = agrP3 Sg ;
w = WLight ;
ext,rc = [] -- added
@@ -21,11 +21,11 @@ lin
ext,rc = [] -- added
} ;
CNNumNP cn i = {
-- s = \\c => artDefContr (GSg cn.g) c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ;
s = \\_,c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; -- HL 8/22 ad hoc
a = agrP3 Sg ;
w = WLight ;
ext,rc = []
s = \\b,c => case b of {True => [] ; False => artDef ! (GSg cn.g) ! c}
++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ;
a = agrgP3 cn.g Sg ; -- HL 27.9.2023
w = WDefArt ; -- im Haus 14
ext,rc = [] -- added
} ;
SymbS sy = {s = \\_ => sy.s} ;

View File

@@ -21,14 +21,13 @@ 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 = -- (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
@@ -40,14 +39,12 @@ 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 (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
let vp = case vps.objCtrl of { True => objAgr np vps ; _ => vps }
** { c2 = vps.c2 ; objCtrl = vps.objCtrl } ;
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
@@ -92,17 +89,18 @@ 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
-- to save a lot compile time and memory, avoid insertObjNP with glueing of prep+DefArt:
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}) ;
let prep = v.c2 ;
obj = appPrep prep (np.s!False) ; -- simplify: no glueing of prep+DefArt, HL 8/22
b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ;
c = prep.c ;
w = np.w ;
vps = (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl})
in
insertObj' obj b w c vps ;
-- to save a lot compile time and memory, avoid insertObjNP with glueing of prep+DefArt:
-- + SlashV2VNP 110.592.000 (46080,240)
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}) ;
let prep = v.c2 ;
obj = appPrep prep (np.s!False) ; -- simplify: no glueing of prep+DefArt, HL 8/22
b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ;
c = prep.c ;
w = np.w ;
vps = (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl})
in
insertObj' obj b w c vps ;
UseComp comp =
insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used
@@ -130,8 +128,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
AdvVPSlash vp adv = vp ** insertAdv adv.s vp ;
AdVVPSlash adv vp = vp ** insertAdv adv.s vp ;
-- ReflVP vp = insertObj (\\a => appPrep vp.c2
-- (\\k => usePrepC k (\c -> reflPron ! a ! c))) vp ;
-- ReflVP vp = insertObj (\\a => appPrep vp.c2 (reflPron ! a)) vp ;
ReflVP vp = insertObjRefl vp ; -- HL, 19/06/2019
PassV2 v = -- acc object -> nom subject; all others: same PCase
@@ -161,6 +158,6 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
(ist verheiratet:VP mit:Prep):VPSlash,
ComplA2 is used to parse "sie ist verheiratet mit mir"
-}
VPSlashPrep vp prep = vp ** {c2 = prep ; objCtrl = False} ;
VPSlashPrep vp prep = vp ** {c2 = prep ; objCtrl = False} ; -- HL 7.8.23
}