1
0
forked from GitHub/gf-rgl

(Por) Numeral: add spacing and handle case of millions (not in RGL, only in ParseExtend)

This commit is contained in:
odanoburu
2018-09-12 18:02:49 +00:00
parent 6fc46c2176
commit 625bf5485f
2 changed files with 19 additions and 16 deletions

View File

@@ -8,8 +8,7 @@
-- $ParadigmsPor$, which gives a higher-level access to this module. -- $ParadigmsPor$, which gives a higher-level access to this module.
resource MorphoPor = CommonRomance, ResPor ** resource MorphoPor = CommonRomance, ResPor **
open PhonoPor, Prelude, Predef, open PhonoPor, Prelude, Predef, CatPor in {
CatPor in {
flags optimize=all ; flags optimize=all ;
coding=utf8 ; coding=utf8 ;

View File

@@ -60,45 +60,45 @@ concrete NumeralPor of Numeral = CatPor [Numeral,Digits] **
} ; } ;
pot0 d = {s = d.s ; n = Pl} ; pot0 d = {s = d.s ; n = Pl} ;
pot110 = spl (pot01.s ! ten) ; pot110 = spl (pot01.s ! ten) ;
pot111 = spl (pot01.s ! teen) ; pot111 = spl (pot01.s ! teen) ;
pot1to19 d = spl (d.s ! teen) ; pot1to19 d = spl (d.s ! teen) ;
pot0as1 n = {s = n.s ! unit ; n = n.n} ; pot0as1 n = {s = n.s ! unit ; n = n.n} ;
pot1 d = spl (d.s ! ten) ; pot1 d = spl (d.s ! ten) ;
pot1plus d e = pot1plus d e =
{s = \\g => d.s ! ten ! g {s = \\g => d.s ! ten ! g
++ e_CardOrd g ++ e.s ! unit ! g ; ++ e_CardOrd g ++ e.s ! unit ! g ;
n = Pl} ; n = Pl} ;
pot1as2 n = n ; pot1as2 n = n ;
pot2 d = pot2 d =
let n = case d.n of { let n = case d.n of {
Sg => mkNumStr "cem" "centésimo" ; Sg => mkNumStr "cem" "centésimo" ;
_ => d.s ! hundred _ => d.s ! hundred
} }
in spl n ; in spl n ;
pot2plus d e = pot2plus d e =
{s = \\g => d.s ! hundred ! g {s = \\g => d.s ! hundred ! g
++ e_CardOrd g ++ e.s ! g ; ++ e_CardOrd g ++ e.s ! g ;
n = Pl} ; n = Pl} ;
pot2as3 n = n ; pot2as3 n = n ;
pot3 n = pot3 n =
let n = case n.n of { let n = case n.n of {
Sg => [] ; Sg => [] ;
_ => n.s ! NCard Masc _ => n.s ! NCard Masc
} ; } ;
in spl (\\co => n ++ mil ! co) ; in spl (\\co => n ++ mil ! co) ;
pot3plus n m = pot3plus n m =
let n = case n.n of { let n = case n.n of {
Sg => [] ; Sg => [] ;
@@ -126,8 +126,12 @@ concrete NumeralPor of Numeral = CatPor [Numeral,Digits] **
} }
} ; } ;
regCard : Str -> Gender -> Number -> Str = \vigesimo -> regCard : Str -> Gender -> Number -> Str ;
pronForms (adjPreto vigesimo) ; regCard vigesimo = case vigesimo of {
-- to handle milhão case (in ParseExtend module)
milh + "ão" => \g, n -> genNumForms vigesimo vigesimo (milh + "ões") vigesimo ! g ! n;
_ => pronForms (adjPreto vigesimo)
} ;
spl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \s -> { spl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \s -> {
s = s ; s = s ;