summaryrefslogtreecommitdiff
path: root/examples/numerals/norwegian_book.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-08-04 18:26:48 +0000
committeraarne <aarne@cs.chalmers.se>2008-08-04 18:26:48 +0000
commita9893f45724299e6cc773bbb2fa2cf315fe85206 (patch)
treeb5c6222b2422a3db7bf4dd676aa4872adf22daf4 /examples/numerals/norwegian_book.gf
parenta401820e3718a936cc926c457d29ec145e189be5 (diff)
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/norwegian_book.gf')
-rw-r--r--examples/numerals/norwegian_book.gf50
1 files changed, 50 insertions, 0 deletions
diff --git a/examples/numerals/norwegian_book.gf b/examples/numerals/norwegian_book.gf
new file mode 100644
index 000000000..93e1e2316
--- /dev/null
+++ b/examples/numerals/norwegian_book.gf
@@ -0,0 +1,50 @@
+concrete norwegian_book of Numerals = {
+-- norsk bokmol, by Herman R Jervell herman.jervell@ilf.uio.no, 6/3/2001
+
+-- include numerals.Abs.gf ;
+
+param DForm = ental | ton | tiotal ;
+
+lincat Numeral = {s : Str} ;
+oper LinDigit = {s : DForm => Str} ;
+lincat Digit = LinDigit ;
+
+lincat Sub10 = {s : DForm => Str} ;
+lincat Sub100 = {s : Str} ;
+lincat Sub1000 = {s : Str} ;
+lincat Sub1000000 = {s : Str} ;
+
+oper mkTal : Str -> Str -> Str -> LinDigit =
+ \två -> \tolv -> \tjugo ->
+ {s = table {ental => två ; ton => tolv ; tiotal => tjugo}} ;
+oper regTal : Str -> LinDigit = \fem -> mkTal fem (fem + "ten") (fem + "ti") ;
+oper ss : Str -> {s : Str} = \s -> {s = s} ;
+
+lin num x = x ;
+
+lin n2 = mkTal "to" "tolv" "tjue" ;
+lin n3 = mkTal "tre" "tretten" "tretti" ;
+lin n4 = mkTal "fire" "fjorten" "førti" ;
+lin n5 = regTal "fem" ;
+lin n6 = regTal "seks" ;
+lin n7 = mkTal "sju" "sytten" "sytti" ;
+lin n8 = mkTal "åtte" "atten" "åtti" ;
+lin n9 = mkTal "ni" "nitten" "nitti" ;
+
+lin pot01 = {s = table {f => "ett"}} ;
+lin pot0 d = {s = table {f => d.s ! f}} ;
+lin pot110 = ss "ti" ;
+lin pot111 = ss "elleve" ;
+lin pot1to19 d = ss (d.s ! ton) ;
+lin pot0as1 n = ss (n.s ! ental) ;
+lin pot1 d = ss (d.s ! tiotal) ;
+lin pot1plus d e = ss (d.s ! tiotal ++ e.s ! ental) ;
+lin pot1as2 n = n ;
+lin pot2 d = ss (d.s ! ental ++ "hundre") ;
+lin pot2plus d e = ss (d.s ! ental ++ "hundre" ++ "og" ++ e.s) ;
+lin pot2as3 n = n ;
+lin pot3 n = ss (n.s ++ "tusen") ;
+lin pot3plus n m = ss (n.s ++ "tusen" ++ m.s) ;
+
+
+}