summaryrefslogtreecommitdiff
path: root/examples/numerals
diff options
context:
space:
mode:
authoraarne <unknown>2005-05-18 07:51:54 +0000
committeraarne <unknown>2005-05-18 07:51:54 +0000
commitd57b5b24165a26d3eb5b492a3f2bd35a0daf9ad4 (patch)
tree26a763f6901f656bc9c3a12addd6c8b27c36305f /examples/numerals
parent6446a9f8b5e18cd10dd24a14543ed4013b10ee07 (diff)
reformulate vint-i
Diffstat (limited to 'examples/numerals')
-rw-r--r--examples/numerals/catalan.gf10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/numerals/catalan.gf b/examples/numerals/catalan.gf
index b1396c6b3..e16e0c6b2 100644
--- a/examples/numerals/catalan.gf
+++ b/examples/numerals/catalan.gf
@@ -2,7 +2,7 @@ include numerals.Abs.gf ;
oper bind : Str -> Str -> Str = \s1 -> \s2 -> s1 ++ s2 ;
-param DForm = unit | teen | ten | hundred | vint ;
+param DForm = unit | teen | ten | hundred | vint | null ;
param Size = sg | two | pl ;
lincat Numeral = {s : Str} ;
@@ -14,12 +14,13 @@ lincat Sub1000000 = {s : Str} ;
oper mkNum : Str -> Str -> Str -> Lin Digit =
\dois -> \doze -> \vinte ->
- {s = table {unit => dois ; teen => doze ; ten => vinte ; hundred => dois + "-" + "cents" ; vint => "vint-i-" + dois } ; size = pl} ;
+ {s = table {unit => dois ; teen => doze ; ten => vinte ; hundred => dois + "-" + "cents" ; vint => "vint-i-" + dois ; null => [] } ; size = pl} ;
lin num x0 =
{s = x0.s} ;
-lin n2 = {s = table {unit => "dos" ; teen => "dotze" ; ten => "vint" ; hundred => "dos-cents" ; vint => "vint-i-" + "dos" } ; size = two } ;
+lin n2 = {s = table {unit => "dos" ; teen => "dotze" ; ten => "vint" ;
+hundred => "dos-cents" ; vint => "vint-i-" + "dos" ; null => []} ; size = two } ;
lin n3 = mkNum "tres" "tretze" "trenta" ;
lin n4 = mkNum "quatre" "catorze" "quaranta" ;
lin n5 = mkNum "cinc" "quinze" "cinqanta" ;
@@ -41,7 +42,8 @@ lin pot0as1 n =
lin pot1 d =
{s = d.s ! ten ; size = pl} ;
lin pot1plus d e =
- {s = table {two => e.s ! vint ; _ => bind (bind (d.s ! ten) "-") (e.s ! unit) } ! d.size ; size = pl} ;
+ {s = table {two => e.s ! vint ++ d.s ! null ; _ => bind (bind (d.s ! ten) "-") (e.s ! unit) } ! d.size ; size = pl} ;
+--{s = table {two => e.s ! vint ; _ => bind (bind (d.s ! ten) "-") (e.s ! unit) } ! d.size ; size = pl} ;
lin pot1as2 n = n ;
lin pot2 d =
{s = d.s ! hundred ; size = pl} ;