Added n : Number field to German Numeral and Num.

This commit is contained in:
bringert
2007-05-11 16:07:03 +00:00
parent e426957777
commit e857cdf485
3 changed files with 22 additions and 18 deletions

View File

@@ -49,12 +49,12 @@ concrete CatGer of Cat =
QuantSg, QuantPl = {s : Gender => Case => Str ; a : Adjf} ; QuantSg, QuantPl = {s : Gender => Case => Str ; a : Adjf} ;
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ; Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
Predet = {s : Number => Gender => Case => Str} ; Predet = {s : Number => Gender => Case => Str} ;
Num = {s : Str} ; Num = {s : Str; n : Number } ;
Ord = {s : AForm => Str} ; Ord = {s : AForm => Str} ;
-- Numeral -- Numeral
Numeral = {s : CardOrd => Str} ; Numeral = {s : CardOrd => Str; n : Number } ;
-- Structural -- Structural

View File

@@ -43,7 +43,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
} ; } ;
DetPl quant num ord = DetPl quant num ord =
let let
n = Pl ; n = num.n ;
a = quant.a a = quant.a
in { in {
s = \\g,c => quant.s ! g ! c ++ s = \\g,c => quant.s ! g ! c ++
@@ -66,16 +66,20 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
a = Strong --- need separately weak for Pl ? a = Strong --- need separately weak for Pl ?
} ; } ;
NoNum = {s = []} ; NoNum = {s = []; n = Pl } ;
NoOrd = {s = \\_ => []} ; NoOrd = {s = \\_ => []} ;
NumInt n = {s = n.s} ; NumInt n = {s = n.s; n = table (Predef.Ints 1 * Predef.Ints 9) {
<0,1> => Sg ;
_ => Pl
} ! <n.size,n.last>
} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; OrdInt n = {s = \\_ => n.s ++ "."} ;
NumNumeral numeral = {s = numeral.s ! NCard} ; NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n } ;
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ; OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
AdNum adn num = {s = adn.s ++ num.s} ; AdNum adn num = {s = adn.s ++ num.s; n = num.n } ;
OrdSuperl a = {s = a.s ! Superl} ; OrdSuperl a = {s = a.s ! Superl} ;

View File

@@ -4,9 +4,9 @@ flags optimize = all_subs ;
lincat lincat
Digit = {s : DForm => CardOrd => Str} ; Digit = {s : DForm => CardOrd => Str} ;
Sub10 = {s : DForm => CardOrd => Str} ; Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
Sub100, Sub1000, Sub1000000 = Sub100, Sub1000, Sub1000000 =
{s : CardOrd => Str} ; {s : CardOrd => Str ; n : Number} ;
lin lin
num x = x ; num x = x ;
@@ -28,20 +28,20 @@ lin
n = Sg n = Sg
} ; } ;
pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ; pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ;
pot110 = {s = cardReg "zehn"} ; pot110 = {s = cardReg "zehn"; n = Pl} ;
pot111 = {s = cardReg "elf"} ; pot111 = {s = cardReg "elf"; n = Pl} ;
pot1to19 d = {s = d.s ! DTeen} ; pot1to19 d = {s = d.s ! DTeen; n = Pl} ;
pot0as1 n = {s = n.s ! DUnit} ; pot0as1 n = {s = n.s ! DUnit; n = n.n } ;
pot1 d = {s = d.s ! DTen} ; pot1 d = {s = d.s ! DTen; n = Pl} ;
pot1plus d e = {s = \\g => e.s ! DUnit ! invNum ++ "und" ++ d.s ! DTen ! g} ; pot1plus d e = {s = \\g => e.s ! DUnit ! invNum ++ "und" ++ d.s ! DTen ! g; n = Pl} ;
pot1as2 n = n ; pot1as2 n = n ;
pot2 d = pot2 d =
{s = \\g => d.s ! DUnit ! invNum ++ cardOrd "hundert" "hunderte" ! g} ; {s = \\g => d.s ! DUnit ! invNum ++ cardOrd "hundert" "hunderte" ! g ; n = Pl} ;
pot2plus d e = pot2plus d e =
{s = \\g => d.s ! DUnit ! invNum ++ "hundert" ++ e.s ! g} ; {s = \\g => d.s ! DUnit ! invNum ++ "hundert" ++ e.s ! g ; n = Pl} ;
pot2as3 n = n ; pot2as3 n = n ;
pot3 n = pot3 n =
{s = \\g => n.s ! invNum ++ cardOrd "tausend" "tausendte" ! g} ; ---- {s = \\g => n.s ! invNum ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ----
pot3plus n m = pot3plus n m =
{s = \\g => n.s ! invNum ++ "tausend" ++ m.s ! g ; n = Pl} ; {s = \\g => n.s ! invNum ++ "tausend" ++ m.s ! g ; n = Pl} ;