summaryrefslogtreecommitdiff
path: root/examples/numerals/basque.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/basque.gf
parenta401820e3718a936cc926c457d29ec145e189be5 (diff)
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/basque.gf')
-rw-r--r--examples/numerals/basque.gf62
1 files changed, 62 insertions, 0 deletions
diff --git a/examples/numerals/basque.gf b/examples/numerals/basque.gf
new file mode 100644
index 000000000..9b0dc0e93
--- /dev/null
+++ b/examples/numerals/basque.gf
@@ -0,0 +1,62 @@
+concrete basque of Numerals = {
+-- include numerals.Abs.gf ;
+
+oper LinDigit = {s : DForm => Str ; even20 : Even20 ; size : Size} ;
+
+oper mk20Ten : Str -> Str -> Str -> Str -> LinDigit =
+ \tri -> \t -> \fiche -> \h ->
+ { s = table {unit => tri ; teen => t ; twenty => fiche ; hund => h + "ehun"} ; even20 = ten ; size = pl} ;
+
+oper mkEven20 : Str -> Str -> Str -> Str -> LinDigit =
+ \se -> \t -> \trifichid -> \h ->
+ { s = table {unit => se ; teen => t ; twenty => trifichid ; hund => h + "ehun"} ; even20 = even ; size = pl} ;
+
+param Even20 = ten | even ;
+param DForm = unit | teen | twenty | hund ;
+param Size = sg | pl ;
+
+lincat Numeral = {s : Str} ;
+lincat Digit = LinDigit ;
+lincat Sub10 = LinDigit ;
+lincat Sub100 = {s : Str ; size : Size} ;
+lincat Sub1000 = {s : Str ; size : Size } ;
+lincat Sub1000000 = {s : Str} ;
+lin num x0 =
+ {s = x0.s} ;
+lin n2 = mkEven20 "bi" "hamabi" "hogei" "berr" ;
+lin n3 = mk20Ten "hiru" (variants {"hamahiru" ; "hamahirur"}) "hogei" "hirur";
+lin n4 = mkEven20 "lau" (variants {"hamalau" ; "hamalaur"}) "berrogei" "laur";
+lin n5 = mk20Ten "bost" (variants {"hamabost" ; "hamabortz"}) "berrogei" "bost";
+lin n6 = mkEven20 "sei" "hamasei" "hirurogei" "seir" ;
+lin n7 = mk20Ten "zazpi" "hamazazpi" "hirurogei" "zazpi" ;
+lin n8 = mkEven20 "zortzi" "hemezortzi" "laurogei" "zortzi" ;
+lin n9 = mk20Ten "bederatzi" "hemeretzi" "laurogei" "bederatzi" ;
+
+lin pot01 =
+ {s = table {unit => "bat" ; hund => "ehun" ; _ => "dummy"} ; even20 = ten ; size = sg};
+lin pot0 d = {s = d.s ; even20 = d.even20 ; size = d.size} ;
+lin pot110 = {s = "hamar" ; size = pl} ;
+lin pot111 = {s = variants {"hamaika" ; "hameka"} ; size = pl} ;
+lin pot1to19 d = {s = d.s ! teen ; size = pl} ;
+lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
+lin pot1 d =
+ {s = table {even => d.s ! twenty ;
+ ten => d.s ! twenty ++ "tahamar"} ! d.even20 ; -- glue
+ size = pl} ;
+lin pot1plus d e =
+ {s = table {even => d.s ! twenty ++ "ta" ++ e.s ! unit;
+ ten => d.s ! twenty ++ "ta" ++ e.s ! teen} ! (d.even20) ;
+ size = pl} ;
+
+lin pot1as2 n = n ;
+lin pot2 d = {s = d.s ! hund ; size = pl} ;
+lin pot2plus d e =
+ {s = variants {d.s ! hund ++ e.s ; d.s ! hund ++ "ta" ++ e.s} ; size = pl} ;
+lin pot2as3 n =
+ {s = n.s } ;
+lin pot3 n =
+ {s = table {sg => [] ; pl => n.s } ! n.size ++ "mila"} ;
+lin pot3plus n m =
+ {s = table {sg => [] ; pl => n.s } ! n.size ++ "mila" ++ "ta" ++ m.s } ;
+
+}