1
0
forked from GitHub/gf-rgl

(Ger) APred superlative and NOrd forms of numerals corrected

This commit is contained in:
Hans Leiss
2023-12-04 15:48:36 +01:00
parent 88be4ca0ae
commit c365d802fe
4 changed files with 34 additions and 27 deletions

View File

@@ -119,7 +119,7 @@ concrete CatGer of Cat =
linref
NP = \np -> np.s ! False ! Nom ++ np.ext ++ np.rc ; -- HL 7/2022 Bool added
CN = \cn -> cn.s ! Strong ! Pl ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Pl ;
CN = \cn -> cn.s ! Strong ! Sg ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Sg ;
SSlash = \ss -> ss.s ! Main ++ ss.c2.s ! GPl ;
ClSlash = \cls -> cls.s ! MIndic ! Pres ! Simul ! Pos ! Main ++ cls.c2.s ! GPl ;

View File

@@ -113,20 +113,26 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
NumSg = {s = \\g,c => []; n = Sg ; isNum = False} ;
NumDigits numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
OrdDigits numeral = {s = table{APred => "am" ++ numeral.s ! NOrd APred ++ BIND ++ "en" ;
af => numeral.s ! NOrd af}} ;
NumFloat dig1 dig2 = {s = \\g,c => dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! NCard g c ; n = Pl } ;
NumDecimal numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ;
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
OrdNumeral numeral = {s = table{APred => "am" ++ numeral.s ! NOrd APred ++ BIND ++ "en" ;
af => numeral.s ! NOrd af}} ;
AdNum adn num = {s = \\g,c => adn.s ++ num.s!g!c; n = num.n } ;
OrdSuperl a = {s = a.s ! Superl} ;
OrdNumeralSuperl n a = {s = \\af => n.s ! NOrd APred ++ Predef.BIND ++ a.s ! Superl ! af} ; -- drittbeste
OrdSuperl a = {s = table {APred => "am" ++ a.s ! Superl ! APred ++ BIND ++ "en" ;
af => a.s ! Superl ! af}} ;
OrdNumeralSuperl n a =
{s = table {APred => "am" ++ n.s ! NOrd APred ++ Predef.BIND
++ a.s ! Superl ! APred ++ BIND ++ "en" ; -- am drittbesten
af => n.s ! NOrd APred ++ Predef.BIND ++ a.s ! Superl ! af} -- drittbeste
} ;
DefArt = {
s = table{True => \\_,n,g,c => [] ; -- definite article dropped
False => \\_,n,g,c => artDef ! (gennum g n) ! c} ;

View File

@@ -40,22 +40,22 @@ lin
pot1as2 n = n ;
pot2 d = {s = \\g =>
multiple (d.s ! DUnit) d.n ++ cardOrd "hundert" "hunderte" ! g ; n = Pl} ;
multiple (d.s ! DUnit) d.n ++ cardOrd "hundert" "hundertste" ! g ; n = Pl} ;
pot2plus d e = {s = \\g =>
multiple (d.s ! DUnit) d.n ++ "hundert" ++ BIND ++ e.s ! g ; n = Pl} ;
pot2as3 n = n ;
pot3 n = {s = \\g =>
multiple n.s n.n ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ----
multiple n.s n.n ++ cardOrd "tausend" "tausendste" ! g ; n = Pl} ;
pot3plus n m = {s = \\g =>
multiple n.s n.n ++ "tausend" ++ m.s ! g ; n = Pl} ;
pot3as4 n = n ;
pot3decimal d = {s = \\g =>
d.s ! invNum ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ----
d.s ! invNum ++ cardOrd "tausend" "tausendste" ! g ; n = Pl} ;
pot4as5 n = n ;
pot4decimal d = {s = \\g =>
d.s ! invNum ++ cardOrd "Millionen" "Millionte" ! g ; n = Pl} ; ----
d.s ! invNum ++ cardOrd "Millionen" "Millionste" ! g ; n = Pl} ; -- * 1 Million
pot51 = {s = \\g => "einer Milliarde"; n = Pl} ; -- KA: case inflection missing
@@ -70,15 +70,14 @@ oper
lin
IDig d = {s = table{NCard g c => d.s ! NCard g c ;
NOrd APred => "am" ++ d.s ! invNum ++ BIND ++ "ten";
NOrd amod => d.s ! NOrd amod} ;
n = d.n ;
isDig = True ;
tail1to19 = notB d.isZero} ;
-- HL 11/2023 added case endings or ordinals to digits
-- HL 11/2023 added case endings of ordinals to digits
-- NCard Masc Nom (= invNum): 0,1, 19, 20,21,...
-- NOrd (AMid (GSg Masc) Nom): 0ter,1ter,...,19ter, 20ster,21ster,...,99ster, 100ster
-- NOrd (AMod (GSg Masc) Nom): 0ter,1ter,...,19ter, 20ster,21ster,...,99ster, 100ster
-- 101ter,...,119ter,120ster,... , 200ster
IIDig d i =
let isPld : Bool = case d.n of {Sg => False ; _ => True} ;
@@ -86,15 +85,14 @@ oper
i' : Digits = case b of {True => IDig (mkDig (i.s ! invNum ++ BIND ++ "s")) ;
_ => i }
in {s = table {NCard g c => d.s ! invNum ++ BIND ++ i.s ! NCard g c ;
NOrd APred => "am" ++ d.s ! invNum ++ BIND ++ i'.s ! invNum ++ BIND ++ "ten" ;
NOrd af => d.s ! invNum ++ BIND ++ i'.s ! NOrd af} ;
n = Pl ;
isDig = False ;
tail1to19 = case i.isDig of {True => notB isPld ; False => i.tail1to19}
} ;
D_0 = mk2Dig "0" Sg ** {isZero = True} ;
D_1 = mk2Dig "1" Sg ;
D_0 = mkDig "0" ** {isZero = True} ;
D_1 = mk2Dig "1" ; -- with cardinal inflection and number Sg
D_2 = mkDig "2" ;
D_3 = mkDig "3" ;
D_4 = mkDig "4" ;
@@ -106,24 +104,20 @@ oper
PosDecimal d = d ** {hasDot=False} ;
NegDecimal d = {
s = \\o => case o of {
NOrd APred => "am" ++ "-" ++ BIND ++ d.s ! NOrd (AMod GPl Dat) ;
_ => "-" ++ BIND ++ d.s ! o} ;
s = \\o => "-" ++ BIND ++ d.s ! o ;
n = Pl ;
hasDot=False
} ;
IFrac d i = {
s=\\o=>d.s ! invNum ++
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
i.s ! o;
s = \\o => d.s ! invNum ++
if_then_Str d.hasDot BIND (BIND ++ "." ++ BIND) ++
i.s ! o;
n = Pl;
hasDot=True
} ;
oper
mkDig : Str -> TDigit = \c -> mk2Dig c Pl ;
mk2Dig : Str -> Number -> TDigit = \c,n -> mk3Dig c (c + "t") n ; -- like Duden 464 (4.Auflage)
mkDig : Str -> TDigit = \c -> mk3Dig c (c + "t") Pl ; -- like Duden 464 (4.Auflage)
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
s = table {NCard _ _ => c ; -- 0,...,9
@@ -132,6 +126,13 @@ oper
isZero = False
} ;
mk2Dig : Str -> TDigit = \crd ->
{s = table {NCard g c => crd ;
NOrd af => (regA (crd + "t")).s ! Posit ! af} ;
n = Sg ;
isZero = False
} ;
TDigit = {
n : Number ;
s : CardOrd => Str ;

View File

@@ -307,8 +307,8 @@ resource ResGer = ParamX ** open Prelude in {
{s = table {
Posit => adjForms gut gute ;
Compar => adjForms besser besser ;
Superl => adjForms ("am" ++ besten) best
}
Superl => adjForms best best -- HL 12/2023: build ("am" ++ besten) via (OrdSuperl a)
} -- to get zweitbeste, am zweitbesten; *zweit am besten
} ;
-- Verbs need as many as 12 forms, to cover the variations with