Skip to content

Commit

Permalink
(Ger) Some lincats changed to remove number in plural; DetQuant and D…
Browse files Browse the repository at this point in the history
…etQuantOrd reimplemented
  • Loading branch information
hleiss committed Dec 22, 2023
1 parent c365d80 commit 21db782
Show file tree
Hide file tree
Showing 17 changed files with 221 additions and 178 deletions.
4 changes: 2 additions & 2 deletions src/german/AdjectiveGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
-- $SuperlA$ belongs to determiner syntax in $Noun$.

ComplA2 a np =
let CExt = case a.c2.isPrep of {
let CExt = case a.c2.t of {
isCase => <appPrepNP a.c2 np, []> ;
_ => <[], appPrepNP a.c2 np> }
in {
Expand All @@ -54,7 +54,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in {
ReflA2 a =
let
compl = appPrep a.c2 (reflPron ! agrP3 Sg) ;
CExt = case a.c2.isPrep of
CExt = case a.c2.t of
{isCase => <compl, []> ; _ => <[], compl> }
in {
s = a.s ! Posit ;
Expand Down
23 changes: 11 additions & 12 deletions src/german/CatGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ concrete CatGer of Cat =
IP = {s : Case => Str ; n : Number} ;
IComp = {s : Agr => Str ; ext : Str} ;
IDet = {s : Gender => Case => Str ; n : Number} ;
IQuant = {s : Number => Gender => Case => Str} ;
IQuant = {s : GenNum => Case => Str} ;

-- Relative

Expand Down Expand Up @@ -59,26 +59,25 @@ concrete CatGer of Cat =
g : Gender
} ;
NP = ResGer.NP ;
Pron = {s : NPForm => Str ; a : Agr} ;
Pron = {s : NPForm => Str ; a : Agr ; sp : PossForm => Str} ;
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 ;
a : Adjf ;
aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde"
hasDefArt : Bool
s,sp : GenNum => Case => Str ;
a : Adjf ;
hasDefArt : Bool ;
delCardOne : Bool -- delete following cardinal 1 (IndefArt and no_Quant)
} ;
Predet = {
s : Number => Gender => Case => Str ;
c : {p : Str ; k : PredetCase} ;
a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ...
} ;

Num = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ;
Card = {s : Gender => Case => Str ; n : Number} ;
Num = {s,sp : AForm => Str ; n : Number ; isNum : Bool} ; -- Num,Card.s AForm HL 12/23
Card = {s : AForm => Str ; n : Number} ; -- inflection mainly for: einer,eine,eines
Ord = {s : AForm => Str} ;

-- Numeral
Expand Down Expand Up @@ -140,7 +139,7 @@ concrete CatGer of Cat =
Conj = \c -> c.s1 ++ c.s2 ;

Det = \det -> det.s ! False ! Masc ! Nom ;
Prep = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ;
_ => prep.s ! GPl } ;
Prep = \prep -> case prep.t of {isPrepDefArt => prep.s ! GSg Masc ;
_ => prep.s ! GPl } ;

}
2 changes: 1 addition & 1 deletion src/german/ConstructionGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ lin
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} ;
{s = l.s ! R.AMod (R.gennum R.Masc l.n) R.Nom ++ "bis" ++ u.s ! R.AMod (R.gennum R.Masc u.n) R.Nom ++ time.s ! R.Pl ! R.Nom} ;

oper
mkHour : Str -> Str -> Str -> Hour
Expand Down
4 changes: 2 additions & 2 deletions src/german/ExtendGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ lin CompoundN a x =
in {
s = adj.s ! Posit ;
isPre = True ;
c = case adj.c2.isPrep of {False => <compl, []> ; True => <[], compl>} ;
c = case adj.c2.t of {False => <compl, []> ; True => <[], compl>} ;
ext = rnp.ext ++ rnp.rc
} ;
Expand Down Expand Up @@ -294,7 +294,7 @@ lin CompoundN a x =
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
case <prep.t, 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
Expand Down
10 changes: 5 additions & 5 deletions src/german/ExtraGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ 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 {a => iq.s ! numberAgr a ! genderAgr a ! Nom} ; ext = ""} ;
CompIQuant iq = {s = table {a => iq.s ! (gennum (genderAgr a) (numberAgr a))! Nom} ; ext = ""} ;

IAdvAdv adv = {s = "wie" ++ adv.s} ;

Expand Down Expand Up @@ -194,7 +194,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **

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,
in possPron a num.n cn.g c ++ num.s ! AMod (gennum cn.g num.n) 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 ;
Expand Down Expand Up @@ -231,7 +231,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
in {
s = adj.s ! Posit ;
isPre = True ;
c = case adj.c2.isPrep of {isCase => <compl, []> ; _ => <[], compl>} ;
c = case adj.c2.t of {isCase => <compl, []> ; _ => <[], compl>} ;
ext = rnp.ext ++ rnp.rc
} ;

Expand Down Expand Up @@ -275,7 +275,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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
case <prep.t, rnp.isPron, c> of { -- consider non-pron rnp as light, add to vpnn.p2
<isCase,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
<isCase,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
<isCase,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
Expand All @@ -288,7 +288,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
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
case <prep.t, 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
Expand Down
6 changes: 3 additions & 3 deletions src/german/MakeStructuralGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ oper
mkSubj : Str -> Subj = \x ->
{s = x ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\_,_,_ => s ; lock_IQuant = <>} ;
{s = \\_,_ => s ; lock_IQuant = <>} ;

mkPredet = overload {
mkPredet : A -> Predet = \a ->
Expand All @@ -27,11 +27,11 @@ oper

-- e.g. das selbe
mmkQuant : Quant -> A -> Quant = \q,a -> q ** {
s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c ++ a.s ! Posit ! agrAdj g q.a n c
s,sp = \\gn,c => q.s ! gn ! c ++ a.s ! Posit ! agrAdj q.a gn c
} ;
-- e.g. derjenige
mmbQuant : Quant -> A -> Quant = \q,a -> q ** {
s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c + a.s ! Posit ! agrAdj g q.a n c
s,sp = \\gn,c => q.s ! gn ! c + a.s ! Posit ! agrAdj q.a gn c
} ;

}
8 changes: 4 additions & 4 deletions src/german/MorphoGer.gf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--# -path=.:../common:../../prelude
--# -path=.:../common:../prelude:
--
----1 A Simple German Resource Morphology
----
Expand All @@ -18,7 +18,7 @@ oper
-- For $StructuralGer$.

mkPrep : Str -> Case -> Preposition = \s,c ->
{s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep} ;
{s = \\_ => s ; s2 = [] ; c = c ; t = isPrep} ;

nameNounPhrase : Gender -> {s : Case => Str} -> {s : Bool => Case => Str ;
a : Agr ;
Expand Down Expand Up @@ -83,7 +83,7 @@ oper

cardOrd : Str -> Str -> CardOrd => Str = \drei,dritte ->
table {
NCard _ _ => drei ;
NCard _ => drei ;
NOrd a => (regA (init dritte)).s ! Posit ! a
} ;

Expand All @@ -102,7 +102,7 @@ oper
regDigit : Str -> LinDigit = \vier ->
mkDigit vier (vier + "zehn") (vier + "zig") (vier + "te") ;

invNum : CardOrd = NCard Masc Nom ;
invNum : CardOrd = NCard (AMod (GSg Masc) Nom) ;

} ;

2 changes: 1 addition & 1 deletion src/german/NamesGer.gf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ lin InLN ln = {
lin AdjLN ap ln = ln ** {
s = \\a,c =>
preOrPost ap.isPre
(ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj ln.g a ln.n c ++ ap.ext)
(ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj a (gennum ln.g ln.n) c ++ ap.ext)
(ln.s ! a ! c) ;
} ;

Expand Down
Loading

0 comments on commit 21db782

Please sign in to comment.