Skip to content

Commit

Permalink
Merge pull request #444 from hleiss/smallAgr
Browse files Browse the repository at this point in the history
Smaller Agr for Ger
  • Loading branch information
inariksit authored Nov 17, 2023
2 parents 7f2bfa1 + 96076d6 commit 64ef1d9
Show file tree
Hide file tree
Showing 23 changed files with 534 additions and 375 deletions.
18 changes: 9 additions & 9 deletions src/german/AdjectiveGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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 ** {
Expand Down
6 changes: 2 additions & 4 deletions src/german/AdverbGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 7 additions & 9 deletions src/german/CatGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 } ;

}
14 changes: 9 additions & 5 deletions src/german/ConjunctionGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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} ;
Expand Down
17 changes: 7 additions & 10 deletions src/german/ConstructionGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ oper
neuter = P.neuter ;
regV = P.regV ;
invarA = P.invarA ;

lin
hungry_VP = mkVP (P.mkA "hungrig") ;
thirsty_VP = mkVP (P.mkA "durstig") ;
Expand All @@ -42,14 +42,11 @@ lin
-- some more things
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;

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 ;
is_right_VP = mkVP have_V2 (mkNP (P.mkN "Recht")) ;
is_wrong_VP = mkVP have_V2 (mkNP (P.mkN "Unrecht")) ;

-- 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 ;
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 ;

bottle_of_CN np = N.ApposCN (mkCN (P.mkN "Flasche")) np ;
cup_of_CN np = N.ApposCN (mkCN (P.mkN "Tasse")) np ;
Expand Down Expand Up @@ -177,9 +174,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 ;
Expand Down
22 changes: 11 additions & 11 deletions src/german/DocumentationGerFunctor.gf
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ oper
lin
InflectionN, InflectionN2, InflectionN3 = \noun -> {
t = "s" ;
s1 = heading1 (heading noun_Category ++
s1 = heading1 (heading noun_Category ++
case noun.g of {
Masc => "("+heading masculine_Parameter+")" ;
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")" ;
Neutr => "("+heading neuter_Parameter+")"
}) ;
s2 = frameTable (
s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
tr (th (heading nominative_Parameter) ++ td (noun.s ! Sg ! Nom) ++ td (noun.s ! Pl ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (noun.s ! Sg ! Gen) ++ td (noun.s ! Pl ! Gen)) ++
Expand All @@ -42,9 +42,9 @@ lin

InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Eigenname" ++
s1 = heading1 ("Eigenname" ++
"("+case <pn.g,pn.n> of {
<Masc,Sg> => heading masculine_Parameter ;
<Masc,Sg> => heading masculine_Parameter ;
<Fem,Sg> => heading feminine_Parameter ;
<Neutr,Sg> => heading neuter_Parameter ;
<_,Pl> => heading plural_Parameter
Expand All @@ -59,9 +59,9 @@ lin

InflectionGN = \gn -> {
t = "vn" ;
s1 = heading1 ("Vorname" ++
s1 = heading1 ("Vorname" ++
case gn.g of {
Male => "(männlich)" ;
Male => "(männlich)" ;
Female => "(weiblich)"
}) ;
s2 = frameTable (
Expand All @@ -85,9 +85,9 @@ lin

InflectionLN = \ln -> {
t = "pn" ;
s1 = heading1 ("Standortnamen" ++
s1 = heading1 ("Standortnamen" ++
"("+case <ln.g,ln.n> of {
<Masc,Sg> => heading masculine_Parameter ;
<Masc,Sg> => heading masculine_Parameter ;
<Fem,Sg> => heading feminine_Parameter ;
<Neutr,Sg> => heading neuter_Parameter ;
<_,Pl> => heading plural_Parameter
Expand All @@ -108,8 +108,8 @@ lin
td (adj.s ! d ! (AMod (GSg Neutr) c)) ++
td (adj.s ! d ! (AMod GPl c)) ;
dtable : Parameter -> Degree -> Str = \s,d ->
paragraph (heading2 (heading s) ++ frameTable (
tr (th [] ++ th (heading masculine_Parameter) ++ th (heading feminine_Parameter) ++ th (heading neuter_Parameter) ++
paragraph (heading2 (heading s) ++ frameTable (
tr (th [] ++ th (heading masculine_Parameter) ++ th (heading feminine_Parameter) ++ th (heading neuter_Parameter) ++
th (heading plural_Parameter)) ++
tr (th (heading nominative_Parameter) ++ gforms d Nom) ++
tr (th (heading genitive_Parameter) ++ gforms d Gen) ++
Expand Down
Loading

0 comments on commit 64ef1d9

Please sign in to comment.