diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-08-04 18:26:48 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-08-04 18:26:48 +0000 |
| commit | a9893f45724299e6cc773bbb2fa2cf315fe85206 (patch) | |
| tree | b5c6222b2422a3db7bf4dd676aa4872adf22daf4 /examples/numerals/zaiwa.gf | |
| parent | a401820e3718a936cc926c457d29ec145e189be5 (diff) | |
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/zaiwa.gf')
| -rw-r--r-- | examples/numerals/zaiwa.gf | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/examples/numerals/zaiwa.gf b/examples/numerals/zaiwa.gf new file mode 100644 index 000000000..e93af3421 --- /dev/null +++ b/examples/numerals/zaiwa.gf @@ -0,0 +1,61 @@ +concrete zaiwa of Numerals = { +-- include numerals.Abs.gf ; + +-- flags lexer = words ; + +param Size = sg | sub10 | pl ; + +oper LinDigit = {s : Str ; size : Size} ; + +lincat Numeral = { s : Str } ; +lincat Digit = LinDigit ; +lincat Sub10 = LinDigit ; +lincat Sub100 = {s : Str ; s2 : Str ; size : Size} ; +lincat Sub1000 = {s : Str ; s2 : Str ; size : Size} ; +lincat Sub1000000 = { s : Str } ; + +oper mkNum : Str -> LinDigit = \u -> {s = u ; size = sub10} ; + +lin n2 = mkNum "i55" ; +lin n3 = mkNum "sum11" ; +lin n4 = mkNum "mi11" ; +lin n5 = mkNum "ngo11" ; +lin n6 = mkNum "kyuq5" ; +lin n7 = mkNum "ngit5" ; +lin n8 = mkNum "sit5" ; +lin n9 = mkNum "gau11" ; + +oper ten : Str = variants {"cue31" ; "sue31"}; +oper mun : Str = variants {"mun11" ; ("mun11" + "mo35")} ; +oper xmun : Size => Str = table {pl => [] ; _ => mun} ; + +lin num x = {s = x.s} ; -- TODO + +lin pot01 = {s = "ra11" ; size = sg } ; +lin pot0 d = d ; +lin pot110 = {s = "le1" ++ ten ; + s2 = "le1" ++ mun ; size = pl} ; +lin pot111 = {s = ("le1" ++ ten) ++ "ra11"; + s2 = ("le1" ++ mun) ++ ("le1" ++ "hing55"); size = pl} ; +lin pot1to19 d = {s = ("le1" ++ ten) ++ d.s ; + s2 = ("le1" ++ mun) ++ d.s ++ "hing55"; size = pl}; +lin pot0as1 n = {s = n.s ; s2 = ifsg n.s ! n.size ++ "hing55" ; size = n.size}; +lin pot1 d = {s = d.s ++ ten ; s2 = d.s ++ mun ; size = pl} ; +lin pot1plus d e = {s = d.s ++ ten ++ e.s ; s2 = d.s ++ mun ++ ifsg e.s ! e.size ++ "hing55" ; size = pl} ; +lin pot1as2 n = n ; +lin pot2 d = {s = ifsg d.s ! d.size ++ "syo31" ; + s2 = ifsg d.s ! d.size ++ ten ++ mun ; + size = pl } ; +lin pot2plus d e = {s = ifsg d.s ! d.size ++ "syo31" ++ e.s; + s2 = ifsg d.s ! d.size ++ ten ++ xmun ! e.size ++ e.s2 ; + size = pl} ; +lin pot2as3 n = {s = n.s} ; +lin pot3 n = {s = n.s2 } ; +lin pot3plus n m = {s = n.s2 ++ m.s } ; + +oper ifsg : Str -> Size => Str = \attr -> table {sg => "le1" ; _ => attr} ; + + + + +} |
