added pot5art and fixed inflection for large numerals

This commit is contained in:
Krasimir Angelov
2023-08-30 21:03:37 +02:00
parent b72ea1e2f1
commit 28afb4d0dc
4 changed files with 31 additions and 5 deletions

View File

@@ -63,6 +63,7 @@ data
pot51 : Sub1000000000000 ; -- a billion instead of one billion pot51 : Sub1000000000000 ; -- a billion instead of one billion
pot5 : Sub1000 -> Sub1000000000000 ; -- m * 1000000000 pot5 : Sub1000 -> Sub1000000000000 ; -- m * 1000000000
pot5art : Sub1000000000000 ; -- a/an instead of one
pot5plus : Sub1000 -> Sub1000000000 -> Sub1000000000000 ; -- m * 1000000000 + n pot5plus : Sub1000 -> Sub1000000000 -> Sub1000000000000 ; -- m * 1000000000 + n
pot5decimal : Decimal -> Sub1000000000000 ; -- 3.5 billion pot5decimal : Decimal -> Sub1000000000000 ; -- 3.5 billion

View File

@@ -112,7 +112,7 @@ lin pot41 = {
lin pot4 n = { lin pot4 n = {
s = \\c,nf => case n.n of { s = \\c,nf => case n.n of {
Sg => mkCardOrd100 "милион" "милионите" "милионен" ! c ; Sg => mkCardOrd100 "милион" "милионите" "милионен" ! c ;
Pl => n.s ! NCard (CFFem Indef) ! nf ++ mkCardOrd100 "милиони" "милионите" "милионен" ! c Pl => n.s ! NCard (CFFem Indef) ! nf ++ mkCardOrd100 "милиона" "милионите" "милионен" ! c
} ; } ;
n = Pl n = Pl
} ; } ;
@@ -142,10 +142,14 @@ lin pot51 = {
lin pot5 n = { lin pot5 n = {
s = \\c,nf => case n.n of { s = \\c,nf => case n.n of {
Sg => mkCardOrd100 "милиярд" "милиярдите" "милиярден" ! c ; Sg => mkCardOrd100 "милиярд" "милиярдите" "милиярден" ! c ;
Pl => n.s ! NCard (CFFem Indef) ! nf ++ mkCardOrd100 "милиярд" "милиярдите" "милиярден" ! c Pl => n.s ! NCard (CFFem Indef) ! nf ++ mkCardOrd100 "милиярда" "милиярдите" "милиярден" ! c
} ; } ;
n = Pl n = Pl
} ; } ;
lin pot5art = {
s = \\o,_ => "" ;
n = Sg
} ;
lin pot5plus n1 n2 = { lin pot5plus n1 n2 = {
s = \\o,f => (pot5 n1).s ! o ! f ++ "и" ++ n2.s ! o ! f; s = \\o,f => (pot5 n1).s ! o ! f ++ "и" ++ n2.s ! o ! f;
n = Pl n = Pl
@@ -154,7 +158,7 @@ lin pot5decimal d = {
s = \\c,nf => d.s ! NCard (CFFem Indef) ++ s = \\c,nf => d.s ! NCard (CFFem Indef) ++
case d.n of { case d.n of {
Sg => mkCardOrd100 "милиярд" "милиярда" "милиярден" ! c ; Sg => mkCardOrd100 "милиярд" "милиярда" "милиярден" ! c ;
Pl => mkCardOrd100 "милиярди" "милиярдите" "милиярден" ! c Pl => mkCardOrd100 "милиярда" "милиярдите" "милиярден" ! c
} ; } ;
n = Pl n = Pl
} ; } ;

View File

@@ -86,6 +86,10 @@ lin pot5 n = {
s = \\d,o,c => n.s ! d ! NCard ! Nom ++ pot51.s ! True ! o ! c ; s = \\d,o,c => n.s ! d ! NCard ! Nom ++ pot51.s ! True ! o ! c ;
n = Pl n = Pl
} ; } ;
lin pot5art = {
s = \\d,o,c => case d of {True => []; False => artIndef};
n = Sg
} ;
lin pot5plus n1 n2 = { lin pot5plus n1 n2 = {
s = \\d,o,c => n1.s ! d ! NCard ! Nom ++ pot51.s ! True ! NCard ! Nom ++ "and" ++ n2.s ! True ! o ! c; s = \\d,o,c => n1.s ! d ! NCard ! Nom ++ pot51.s ! True ! NCard ! Nom ++ "and" ++ n2.s ! True ! o ! c;
n = Pl n = Pl

View File

@@ -52,7 +52,12 @@ lin
pot41 = numPl (cardOrd "miljon" "miljonde") ; pot41 = numPl (cardOrd "miljon" "miljonde") ;
pot4 n = pot4 n =
numPl (\\g => n.s ! NCard Utr ++ cardOrd "miljon" "miljonde" ! g) ; numPl (\\g => n.s ! NCard Utr ++
cardOrd (case n.n of {
Sg => "miljon" ;
Pl => "miljoner"
})
"miljonde" ! g) ;
pot4plus n m = pot4plus n m =
{s = \\g => n.s ! NCard Utr ++ BIND ++ "miljon" ++ m.s ! g ; n = Pl} ; {s = \\g => n.s ! NCard Utr ++ BIND ++ "miljon" ++ m.s ! g ; n = Pl} ;
pot4as5 n = n ; pot4as5 n = n ;
@@ -60,8 +65,20 @@ lin
numPl (\\g => d.s ! NCard Utr ++ cardOrd "miljoner" "miljonde" ! g) ; numPl (\\g => d.s ! NCard Utr ++ cardOrd "miljoner" "miljonde" ! g) ;
pot51 = numPl (cardOrd "miljard" "miljarde") ; pot51 = numPl (cardOrd "miljard" "miljarde") ;
pot5art = {
s = table {
NCard g => case g of {Neutr => "ett" ; _ => "en"} ;
_ => "första"
} ;
n = Sg
} ;
pot5 n = pot5 n =
numPl (\\g => n.s ! NCard Utr ++ cardOrd "miljard" "miljarde" ! g) ; numPl (\\g => n.s ! NCard Utr ++
cardOrd (case n.n of {
Sg => "miljard" ;
Pl => "miljarder"
})
"miljarde" ! g) ;
pot5plus n m = pot5plus n m =
{s = \\g => n.s ! NCard Utr ++ BIND ++ "miljard" ++ m.s ! g ; n = Pl} ; {s = \\g => n.s ! NCard Utr ++ BIND ++ "miljard" ++ m.s ! g ; n = Pl} ;
pot5decimal d = pot5decimal d =