concrete NumeralsRus of Numerals = open MorphoRus, Prelude in {
flags  coding=utf8 ;

-- Toiska, 13/8/2000, AR with Arto Mustajoki.

-- the same as in SyntaxRus.gf, which is not visible here:
lincat Numeral = {s : Case => Gender => Str } ;

lincat Digit = {s : DForm => Gender => Str ; size : Size} ;
lincat Sub10 = {s : Place => DForm => Gender => Str ; size : Size} ;
lincat Sub100 = {s : Place => Gender => Str ; size : Size} ;
lincat Sub1000 = {s : Place => Gender => Str ; size : Size} ;
lincat Sub1000000 = {s : Gender => Str} ;

lin num x = {s = table{ _ => x.s }};

lin n2  =
  {s = table {{unit} => table {{Fem} => "две" ; _ => "два"} ; 
            {teen} => gg "двенадцать" ; 
            {ten}  => gg "двадцать" ;
            {hund} => gg "двести"} ; 
   size = sgg} ;
lin n3  =
  {s = table {{unit} => gg "три" ; 
            {teen} => gg "тринадцать" ; 
            {ten}  => gg "тридцать" ;
            {hund} => gg "триста"} ; 
  size = sgg} ;
lin n4  =
  {s = table {{unit} => gg "четыре" ; 
            {teen} => gg "четырнадцать" ; 
            {ten}  => gg "сорок" ;
            {hund} => gg "четыреста"} ; 
  size = sgg} ;
lin n5  =
  {s = table {{unit} => gg "пять" ; 
            {teen} => gg "пятнадцать" ; 
            {ten}  => gg "пятьдесят" ;
            {hund} => gg "пятьсот"} ; 
  size = plg} ;
lin n6  =
  {s = table {{unit} => gg "шесть" ; 
            {teen} => gg "шестнадцать" ; 
            {ten}  => gg "шестьдесят" ;
            {hund} => gg "шестьсот"} ; 
  size = plg} ;
lin n7  =
  {s = table {{unit} => gg "семь" ; 
            {teen} => gg "семнадцать" ; 
            {ten}  => gg "семьдесят" ;
            {hund} => gg "семьсот"} ; 
  size = plg} ;
lin n8  =
  {s = table {{unit} => gg "восемь" ; 
            {teen} => gg "восемнадцать" ; 
            {ten}  => gg "восемьдесят" ;
            {hund} => gg "восемьсот"} ; 
  size = plg} ;
lin n9  =
  {s = table {{unit} => gg "девять" ; 
            {teen} => gg "девятнадцать" ; 
            {ten}  => gg "девяносто" ;
            {hund} => gg "девятьсот"} ; 
  size = plg} ;


lin pot01  =
  {s = table {{attr} => table {{hund} => gg "сто" ; _ => gg []} ; 
            _ => table {{hund} => gg "сто" ; 
                     _ => table {{Masc} => "один" ; {Fem} => "одна" ; _ => "одно"}}} ;
   size = nom} ;
lin pot0 d =
  {s = table {_ => d.s} ; size = d.size} ;
lin pot110  =
  {s = table {_ => gg "десять"} ; size = plg} ;
lin pot111  =
  {s = table {_ => gg "одиннадцать"} ; size = plg} ; --- 11
lin pot1to19 d =
  {s = table {_ => d.s ! teen} ; size = plg} ;
lin pot0as1 n =
  {s = table {p => n.s ! p ! unit} ; size = n.size} ;
lin pot1 d =
  {s = table {_ => d.s ! ten} ; size = plg} ; ---
lin pot1plus d e =
  {s = table {_ => 
            table {g => d.s ! ten ! g ++ e.s ! indep ! unit ! g}} ; size = e.size} ;
lin pot1as2 n =
  {s = n.s ; size = n.size} ;
lin pot2 d =
  {s = table {p => d.s ! p ! hund} ; size = plg} ;
lin pot2plus d e =
  {s = table {p => table {g => d.s ! p ! hund ! g ++ e.s ! indep ! g}} ; size = e.size} ;
lin pot2as3 n =
  {s = n.s ! indep} ;
lin pot3 n =
  {s = gg (n.s ! attr ! Fem ++ mille ! n.size)} ;
lin pot3plus n m =
  {s = table {g => n.s ! attr ! Fem ++ mille ! n.size ++ m.s ! indep ! g}} ;

--- TODO
--- raz/odin
}
