diff options
| author | hallgren <hallgren@chalmers.se> | 2010-11-12 16:46:44 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2010-11-12 16:46:44 +0000 |
| commit | b46442ab0b50fe58417b85d34a97a16e7b06de05 (patch) | |
| tree | afc01daec398af317ece15253a463d72b19c8af7 /examples/numerals/chinese.gf | |
| parent | bad36015d23f125ce2d3f1faedd5047aedb6c398 (diff) | |
examples/numerals: adapt to current GF syntax
Diffstat (limited to 'examples/numerals/chinese.gf')
| -rw-r--r-- | examples/numerals/chinese.gf | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/examples/numerals/chinese.gf b/examples/numerals/chinese.gf index 72cf910ce..375c260b4 100644 --- a/examples/numerals/chinese.gf +++ b/examples/numerals/chinese.gf @@ -7,12 +7,12 @@ param Qform = bai | bai0 | shiwan | shiwan0 ; param Bform = shi | shi0 | wan | wan0 ; param Zero = zero | nozero ; oper ling : Zero * Zero => Str = - table {<{zero},z> => "零" ; - <z,{zero}> => "零" ; - <{nozero},{nozero}> => []} ; + table {<zero,z> => "零" ; + <z,zero> => "零" ; + <nozero,nozero> => []} ; oper Wan : Zero => Str = - table {{zero} => "万" ; - {nozero} => []} ; + table {zero => "万" ; + nozero => []} ; lincat Numeral = {s : Str} ; lincat Digit = {s : Str} ; lincat Sub10 = {s : Str} ; @@ -44,66 +44,66 @@ lin pot0 d = lin pot110 = {inh = nozero ; s = table { - {shi} => "壹拾" ; - {shi0} => "壹拾" ; - {wan} => "壹万" ; - {wan0} => "壹万"}} ; + shi => "壹拾" ; + shi0 => "壹拾" ; + wan => "壹万" ; + wan0 => "壹万"}} ; lin pot111 = {inh = nozero ; s = table { - {shi} => "拾壹" ; - {shi0} => "壹拾壹" ; - {wan} => "拾壹万" ; - {wan0} => "拾壹万"}} ; + shi => "拾壹" ; + shi0 => "壹拾壹" ; + wan => "拾壹万" ; + wan0 => "拾壹万"}} ; lin pot1to19 d = {inh = nozero ; s = table { - {shi} => "壹拾" ++ d.s ; - {shi0} => "壹拾" ; - {wan} => "壹万" ++ d.s ++ "仟" ; - {wan0} => "壹万" ++ d.s ++ "仟"}} ; + shi => "壹拾" ++ d.s ; + shi0 => "壹拾" ; + wan => "壹万" ++ d.s ++ "仟" ; + wan0 => "壹万" ++ d.s ++ "仟"}} ; lin pot0as1 n = {inh = zero ; s = table { - {shi} => n.s ; - {shi0} => n.s ; - {wan} => n.s ++ "仟" ; - {wan0} => n.s ++ "仟"}} ; + shi => n.s ; + shi0 => n.s ; + wan => n.s ++ "仟" ; + wan0 => n.s ++ "仟"}} ; lin pot1 d = {inh = zero ; s = table { - {shi} => d.s ++ "拾" ; - {shi0} => d.s ++ "拾" ; - {wan0} => d.s ++ "万" ; - {wan} => d.s ++ "万"}} ; + shi => d.s ++ "拾" ; + shi0 => d.s ++ "拾" ; + wan0 => d.s ++ "万" ; + wan => d.s ++ "万"}} ; lin pot1plus d e = {inh = nozero ; s = table { - {shi} => d.s ++ "拾" ++ e.s ; - {shi0} => d.s ++ "拾" ++ e.s ; - {wan} => d.s ++ "万" ++ e.s ++ "仟" ; - {wan0} => d.s ++ "万" ++ e.s ++ "仟"}} ; + shi => d.s ++ "拾" ++ e.s ; + shi0 => d.s ++ "拾" ++ e.s ; + wan => d.s ++ "万" ++ e.s ++ "仟" ; + wan0 => d.s ++ "万" ++ e.s ++ "仟"}} ; lin pot1as2 n = {inh = zero ; s = table { - {bai} => n.s ! shi ; - {bai0} => n.s ! shi ; - {shiwan} => n.s ! wan ; - {shiwan0} => n.s ! wan0}} ; + bai => n.s ! shi ; + bai0 => n.s ! shi ; + shiwan => n.s ! wan ; + shiwan0 => n.s ! wan0}} ; lin pot2 d = {inh = zero ; s = table { - {bai} => d.s ++ "佰" ; - {bai0} => d.s ++ "佰" ; - {shiwan0} => d.s ++ "拾万" ; - {shiwan} => d.s ++ "拾万"}} ; + bai => d.s ++ "佰" ; + bai0 => d.s ++ "佰" ; + shiwan0 => d.s ++ "拾万" ; + shiwan => d.s ++ "拾万"}} ; lin pot2plus d e = {inh = nozero ; s = table { - {bai} => d.s ++ "佰" ++ (ling ! <e.inh,e.inh>) ++ e.s ! shi0 ; - {bai0} => d.s ++ "佰" ++ (ling ! <e.inh,e.inh>) ++ e.s ! shi0 ; - {shiwan} => d.s ++ "拾" ++ (Wan ! (e.inh)) ++ e.s ! wan ; - {shiwan0} => d.s ++ "拾" ++ (Wan ! (e.inh)) ++ e.s ! wan0}} ; + bai => d.s ++ "佰" ++ (ling ! <e.inh,e.inh>) ++ e.s ! shi0 ; + bai0 => d.s ++ "佰" ++ (ling ! <e.inh,e.inh>) ++ e.s ! shi0 ; + shiwan => d.s ++ "拾" ++ (Wan ! (e.inh)) ++ e.s ! wan ; + shiwan0 => d.s ++ "拾" ++ (Wan ! (e.inh)) ++ e.s ! wan0}} ; lin pot2as3 n = {s = n.s ! bai} ; lin pot3 n = |
