Skip to content

Commit

Permalink
(Ger) Made AP a split phrase with movable comparison NP
Browse files Browse the repository at this point in the history
  • Loading branch information
hleiss committed Jan 14, 2024
1 parent 4249c33 commit 00f8b78
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 44 deletions.
44 changes: 23 additions & 21 deletions src/german/AdjectiveGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
flags optimize=all_subs ;

lin

PositA a = {
s = a.s ! Posit ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;
ComparA a np =
let nps = np.s ! False ! Nom ++ bigNP np
in {
s = \\af => a.s ! Compar ! af ++ conjThan ++ nps ;
ComparA a np = {
s = \\af => a.s ! Compar ! af ;
s2 = \\c => conjThan ++ np.s ! False ! c ++ np.ext ++ np.rc ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;
CAdvAP ad ap np =
let nps = np.s ! False ! Nom ++ bigNP np in
ap ** {
s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ nps ;
isPre = False
CAdvAP adv ap np = ap ** {
s = \\af => adv.s ++ ap.s ! af ;
s2 = \\c => adv.p ++ np.s ! False ! c ++ np.ext ++ np.rc ;
isPre = True -- HL 1/2023
} ;
UseComparA a = {
s = \\af => a.s ! Compar ! af ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;

AdjOrd a = {
s = a.s ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = []
Expand All @@ -41,25 +41,24 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
-- $SuperlA$ belongs to determiner syntax in $Noun$.

ComplA2 a np =
let CExt = case a.c2.t of {
isCase => <appPrepNP a.c2 np, []> ;
_ => <[], appPrepNP a.c2 np> }
let
obj = appPrepNP a.c2 np
in {
s = a.s ! Posit ;
isPre = True ;
c = CExt ;
ext = []
s = a.s ! Posit ;
s2 = \\_ => [] ;
isPre = True ;
c = case a.c2.t of {isCase => <obj, []> ; _ => <[], obj>} ;
ext = []
} ;

ReflA2 a =
let
compl = appPrep a.c2 (reflPron ! agrP3 Sg) ;
CExt = case a.c2.t of
{isCase => <compl, []> ; _ => <[], compl> }
obj = appPrep a.c2 (reflPron ! agrP3 Sg) ;
in {
s = a.s ! Posit ;
s2 = \\_ => [] ;
isPre = True ;
c = CExt ;
c = case a.c2.t of {isCase => <obj, []> ; _ => <[], obj>} ;
ext = []
} ;

Expand All @@ -72,9 +71,12 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {

UseA2 a = {
s = a.s ! Posit ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = []
} ;

AdvAP ap adv = ap ** {s = \\a => adv.s ++ ap.s ! a} ; -- HL 1/2024

}
13 changes: 8 additions & 5 deletions src/german/CatGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ concrete CatGer of Cat =

-- Adjective (HL 7/23: we need c : Agr => Str * Str to handle reflexive objects, cf ReflA2)

AP = {s : AForm => Str ; isPre : Bool ; c: Str * Str ; ext : Str} ;
-- ich bin [c1 ihm] treu
-- du bist so klug gewesen [ext ihn zu lesen]
-- ich bin stolz [c2 auf dich]
AP = {
s : AForm => Str ;
s2 : Case => Str ; -- comparison np, e.g. [s kleineres] (Tier) [s2 als den Hund] HL 1/34
isPre : Bool ; -- pre-nominal as attribute, e.g. False with sentential complement
c: Str * Str ; -- pp,np-complement, e.g. (ich bin) [c1 ihm] treu ; stolz [c2 auf dich]
ext : Str -- s,inf-complement, (du bist) so klug (gewesen) [ext ihn zu lesen]
} ;

-- Noun

Expand Down Expand Up @@ -127,7 +130,7 @@ concrete CatGer of Cat =
VP = \vp -> useInfVP False vp ;
VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ! GPl ++ vps.ext;

AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ;
AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.s2 ! Nom ++ ap.ext ;
A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ! GPl ;

V, VS, VQ, VA = \v -> useInfVP False (predV v) ;
Expand Down
5 changes: 3 additions & 2 deletions src/german/ConjunctionGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concrete ConjunctionGer of Conjunction =
in (conjAgr agr ss.a) }) ;

ConjAP conj ss = conjunctDistrTable AForm conj ss ** {
s2 = \\c => [] ; -- comparison np of ap = {s:AForm => Str; s2:Case => Str} HL 1/23
isPre = ss.isPre ; c = ss.c ; ext = ss.ext} ;

ConjRS conj ss = conjunctDistrTable RelGenNum conj ss ** {
Expand Down Expand Up @@ -87,8 +88,8 @@ concrete ConjunctionGer of Conjunction =
[CN] = {s1,s2 : Adjf => Number => Case => Str ; g : Gender} ;

oper
bigAP : AP -> AForm => Str = \ap ->
\\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext;
bigAP : AP -> AForm => Str = \ap -> -- HL 1/23: not always ok:
\\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext ++ ap.s2 ! Nom ; -- comparison np in Nom
bigCN : CN -> Adjf => Number => Case => Str = \cn ->
\\a,n,c => cn.s ! a ! n ! c ++ cn.adv ++ cn.ext ++ cn.rc ! n ;

Expand Down
3 changes: 3 additions & 0 deletions src/german/ExtendGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ concrete ExtendGer of Extend =
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 ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = vp.ext
Expand All @@ -177,6 +178,7 @@ concrete ExtendGer of Extend =
++ 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 ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = []
Expand Down Expand Up @@ -291,6 +293,7 @@ concrete ExtendGer of Extend =
compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
in {
s = adj.s ! Posit ;
s2 = \\_ => [] ;
isPre = True ;
c = case adj.c2.t of {isCase => <compl, []> ; _ => <[], compl>} ;
ext = rnp.ext ++ rnp.rc
Expand Down
3 changes: 3 additions & 0 deletions src/german/ExtraGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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 ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = vp.ext
Expand All @@ -84,6 +85,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
++ 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 ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
ext = []
Expand Down Expand Up @@ -230,6 +232,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
in {
s = adj.s ! Posit ;
s2 = \\_ => [] ;
isPre = True ;
c = case adj.c2.t of {isCase => <compl, []> ; _ => <[], compl>} ;
ext = rnp.ext ++ rnp.rc
Expand Down
8 changes: 5 additions & 3 deletions src/german/NounGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
let
g = cn.g
in cn ** {
s = \\a,n,c =>
preOrPost ap.isPre
s = case ap.isPre of { -- HL 1/2023 False only for ap = SentAP ap' sc
True => \\a,n,c => -- besserer cn als a.s2 [instead: cn, besser als a.s2,]
(ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj a (gennum g n) c)
(cn.s ! a ! n ! c) ++ ap.ext ; -- comparison part of ap HL 11/2023;
++ (cn.s ! a ! n ! c) ++ ap.s2 ! c ++ ap.ext ;
False => \\a,n,c => cn.s ! a ! n ! c ++ -- postnominal ap with sc
embedInCommas (ap.c.p1 ++ ap.c.p2 ++ ap.s ! APred ++ ap.s2 ! c ++ ap.ext)} ;
g = g
} ;

Expand Down
16 changes: 9 additions & 7 deletions tests/german/TestLangGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ concrete TestLangGer of TestLang =
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++
(vp.nn ! agrP3 Sg).p3 ++ (vp.nn ! agrP3 Sg).p4 ++ vp.adj ++ vp.a2
++ vp.inf.inpl.p2 ++ vp.s.s ! VPastPart af ;
s2 = \\_ => [] ;
isPre = True ;
c = <[],[]> ;
adj = [] ;
Expand Down Expand Up @@ -183,7 +184,7 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa
s = \\m,t,a,p =>
let
cls = slash.s ! m ! t ! a ! p ;
who = appPrepC slash.c2 ip.s ;
who = appPrep slash.c2 ip.s ;
in table {
QDir => who ++ cls ! Inv ! (RGenNum gn);
QIndir => who ++ cls ! Sub ! (RGenNum gn)
Expand All @@ -201,10 +202,10 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa
} ;

SlashVS np vs slash =
let subj = mkSubj np PrepNom ;
let subj = mkSubject np PrepNom ;
vps = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)
** {c2 = slash.c2 ; objCtrl = False} -- default objCtrl guessed
in mkClSlash subj.p1 subj.p2 vps ;
in mkClSlash subj.s subj.a vps ;

UseSlash t p cl = {
s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o ! RSentence ;
Expand All @@ -213,9 +214,9 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa

oper
gnToAgr : RelGenNum -> Agr = \gn ->
case gn of {RGenNum (GSg g) => Ag g Sg P3 ;
RGenNum GPl => Ag Neutr Pl P3 ;
RSentence => Ag Neutr Sg P3} ;
case gn of {RGenNum (GSg g) => AgSgP3 g ;
RGenNum GPl => AgPl P3 ;
RSentence => AgSgP3 Neutr} ;


mkClSlash : Str -> Agr -> ResGer.VPSlash -> ClauseSlash = \subj,agr,vp ->
Expand All @@ -227,7 +228,8 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa
Sub => True ; -- glue prefix to verb
_ => False
} ;
verb = vps.s ! ord ! agr ! VPFinite m t a ;
vagr = agr2vagr agr ;
verb = vps.s ! ord ! vagr ! VPFinite m t a ;
haben = verb.inf2 ;
neg = negation ! b ;
ag : Agr = case vp.objCtrl of {True => gnToAgr gn ; _ => agr} ;
Expand Down
8 changes: 6 additions & 2 deletions tests/german/TestLexiconEng.gf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ lin
kaufen_bei_fuer_V4 = dirV4 (irregV "buy" "bought" "bought") (mkPrep "from") (mkPrep "for") ;
mieten_von_fuer_V4 = dirV4 (regV "rent") (mkPrep "from") (mkPrep "for") ;

neugierig_auf_A2 = mkA2 (regA "curious") (mkPrep "about") ;

wagen_VV = mkVV (regV "dare") ; -- typ=VVInf
versuchen_VV = mkVV (irregV "try" "tried" "tried") ; -- typ=VVInf
helfen_V2V = defaultV2V (regV "help") ;
Expand All @@ -62,4 +60,10 @@ lin
-- aci verb:
sehen_V2V = mkV2V (I.see_V) ;
hoeren_V2V = mkV2V (I.hear_V) ;

-- Adjectives

neugierig_auf_A2 = mkA2 (regA "curious") (mkPrep "about") ;
treu_A2 = mkA2 (compoundA (mkA "faithful")) (mkPrep "to") ;
stolz_A2 = mkA2 (mkA "proud" "prouder") (mkPrep "of") ;
}
9 changes: 7 additions & 2 deletions tests/german/TestLexiconGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ lin
kaufen_bei_fuer_V4 = dirV4 (regV "kaufen") bei_Prep fuer_Prep ;
mieten_von_fuer_V4 = dirV4 (regV "mieten") von_Prep fuer_Prep ;

neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ;

-- verbs with infinitival object (non-modal):
wagen_VV = mkVV (regV "wagen") ;
versuchen_VV = mkVV (irregV "versuchen" "versucht" "versuchte" "versuchte" "versucht") ;
Expand All @@ -72,4 +70,11 @@ lin
-- aci verb:
sehen_V2V = auxV2V (irregV "sehen" "sieht" "sah" "sähe" "gesehen") accPrep ;
hoeren_V2V = auxV2V (regV "hören") accPrep ;

-- Adjectives

neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ;
treu_A2 = mkA2 (mk3A "treu" "treuer" "treueste") datPrep ;
stolz_A2 = mkA2 (mk3A "stolz" "stolzer" "stolzeste") (mkPrep "auf" accusative) ;

}
8 changes: 6 additions & 2 deletions tests/german/TestLexiconGerAbs.gf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ fun
entschuldigen_bei_fuer_rV3 : V3 ;
raechen_am_fuer_rV3 : V3 ;

neugierig_auf_A2 : A2 ;

wagen_VV : VV ;
versuchen_VV : VV ;

Expand All @@ -43,4 +41,10 @@ fun
kaufen_bei_fuer_V4 : V4 ;
mieten_von_fuer_V4 : V4 ;

-- Adjectives

neugierig_auf_A2 : A2 ;
treu_A2 : A2 ; -- Ger: dative complement
stolz_A2 : A2 ;

}

0 comments on commit 00f8b78

Please sign in to comment.