mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 13:09:33 -06:00
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
This commit is contained in:
35
examples/numerals/Numerals.gf
Normal file
35
examples/numerals/Numerals.gf
Normal file
@@ -0,0 +1,35 @@
|
||||
abstract Numerals = {
|
||||
|
||||
-- numerals from 1 to 999999 in decimal notation
|
||||
|
||||
flags startcat=Numeral ;
|
||||
|
||||
cat
|
||||
Numeral ; -- 0..
|
||||
Digit ; -- 2..9
|
||||
Sub10 ; -- 1..9
|
||||
Sub100 ; -- 1..99
|
||||
Sub1000 ; -- 1..999
|
||||
Sub1000000 ; -- 1..999999
|
||||
|
||||
fun
|
||||
num : Sub1000000 -> Numeral ;
|
||||
|
||||
n2, n3, n4, n5, n6, n7, n8, n9 : Digit ;
|
||||
|
||||
pot01 : Sub10 ; -- 1
|
||||
pot0 : Digit -> Sub10 ; -- d * 1
|
||||
pot110 : Sub100 ; -- 10
|
||||
pot111 : Sub100 ; -- 11
|
||||
pot1to19 : Digit -> Sub100 ; -- 10 + d
|
||||
pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9
|
||||
pot1 : Digit -> Sub100 ; -- d * 10
|
||||
pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
|
||||
pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99
|
||||
pot2 : Sub10 -> Sub1000 ; -- m * 100
|
||||
pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
|
||||
pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999
|
||||
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||
|
||||
}
|
||||
53
examples/numerals/af_tunni.gf
Normal file
53
examples/numerals/af_tunni.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete af_tunni of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
param DForm = unit | ten ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO: Encoding
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \mbili -> \lama ->
|
||||
{s = table {unit => mbili ; ten => lama }; size = pl };
|
||||
|
||||
-- lin n1 = mkNum "ków" ;
|
||||
lin n2 = mkNum "lámma" "labaatón";
|
||||
lin n3 = mkNum "síddi?" "soddón" ;
|
||||
lin n4 = mkNum "áfar" "afartón";
|
||||
lin n5 = mkNum "s^án" "kontón";
|
||||
lin n6 = mkNum "lí?" "lihdón";
|
||||
lin n7 = mkNum "toddóbo" "toddobátan";
|
||||
lin n8 = mkNum "siyéed" "siyyeétan" ;
|
||||
lin n9 = mkNum "sagáal" "sagaás^an";
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {f => "ków" }; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "tómon" ;
|
||||
lin pot111 = ss ("tómon" ++ "i" ++ "ków") ;
|
||||
lin pot1to19 d = ss ("tómon" ++ "i" ++ (d.s ! unit)) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size } ;
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e = ss (d.s ! ten ++ "i" ++ e.s ! unit) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (selsg d.size (d.s ! unit) ++ "boqól" );
|
||||
lin pot2plus d e = ss ((selsg d.size (d.s ! unit)) ++ "boqól" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = (selsg n.size n.s) ++ "kún"} ;
|
||||
lin pot3plus n m = {s = (selsg n.size n.s) ++ "kún" ++ m.s} ;
|
||||
|
||||
oper selsg : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => attr ; sg => [] } ! sz ;
|
||||
|
||||
}
|
||||
50
examples/numerals/albanian.gf
Normal file
50
examples/numerals/albanian.gf
Normal file
@@ -0,0 +1,50 @@
|
||||
concrete albanian of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str };
|
||||
oper LinSub100 = {s : Str } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = LinSub100 ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \tri ->
|
||||
{ s = table {unit => tri ; teen => tri + "mbë" + "dhjetë" ; ten => tri + "dhjetë" }};
|
||||
|
||||
lin num x = {s = x.s } ;
|
||||
|
||||
lin n2 = {s = table {unit => "dy" ; teen => "dy" + "mbë" + "dhjetë" ; ten => "njëzet" }};
|
||||
lin n3 = mkNum "tre" ;
|
||||
lin n4 = {s = table {unit => "katër" ; teen => "katër" + "mbë" + "dhjetë" ; ten => "dyzet" } };
|
||||
lin n5 = mkNum "pesë" ;
|
||||
lin n6 = mkNum "gjashtë";
|
||||
lin n7 = mkNum "shtatë";
|
||||
lin n8 = mkNum "tetë";
|
||||
lin n9 = mkNum "nëntë";
|
||||
|
||||
oper mkR : Str -> LinSub100 = \n -> {s = n } ;
|
||||
|
||||
lin pot01 = { s = table {_ => "një" }};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkR "dhjetë" ;
|
||||
lin pot111 = mkR ("një" + "mbë" + "dhjetë") ;
|
||||
lin pot1to19 d = mkR (d.s ! teen) ;
|
||||
lin pot0as1 n = mkR (n.s ! unit) ;
|
||||
lin pot1 d = mkR (d.s ! ten) ;
|
||||
lin pot1plus d e = mkR ((d.s ! ten) ++ "e" ++ (e.s ! unit)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = mkR (bind (d.s ! unit) "qind") ;
|
||||
lin pot2plus d e = mkR ((bind (d.s ! unit) "qind") ++ "e" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = n.s ++ "mijë" } ;
|
||||
lin pot3plus n m = {s = n.s ++ "mijë" ++ m.s} ;
|
||||
|
||||
|
||||
}
|
||||
86
examples/numerals/amharic.gf
Normal file
86
examples/numerals/amharic.gf
Normal file
@@ -0,0 +1,86 @@
|
||||
concrete amharic of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=ethiopic ;
|
||||
|
||||
-- 14, 15 have variants in pronounciation {asraratt, asrammIst}
|
||||
|
||||
-- No long consonants marked in the indigen. script
|
||||
-- s is set intersection s
|
||||
-- h is set union h
|
||||
-- H is three-fork h
|
||||
-- x is hook-looking h
|
||||
-- L is sin-looking s
|
||||
-- X is h looking like k with a roof
|
||||
-- ) is chair-vowel i.e historically glottal stop
|
||||
-- ( is round-shape vowel sign i.e historically 3ayn
|
||||
-- Z is zh
|
||||
-- $ is sh
|
||||
-- N is n~
|
||||
-- I is i" ዕ6ትህ ሮውእ
|
||||
-- አ ኢስ ኣ" (1st row)
|
||||
-- Capitalis for ejectives KPTCS
|
||||
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param Size = sg | pl | tenplus ;
|
||||
param S100 = indep | tenpart | tenelfu | sihpart ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
oper LinSub100 = {s : S100 => Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \hulatt -> \haya ->
|
||||
{s = table {unit => hulatt ; ten => haya} ; size = pl} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ;
|
||||
lin n2 = mkNum "ሁለት" (variants {"ሃያ" ; "ሓያ" ; "ኃያ" ; "ካያ" }) ;
|
||||
lin n3 = mkNum "ሦስት" "ሠላሳ" ;
|
||||
lin n4 = mkNum "ኣራት" "ኣርባ" ;
|
||||
lin n5 = mkNum "ኣምስት" (variants { "ኣምሳ" ; "ኃምሳ" }) ;
|
||||
lin n6 = mkNum "ስድስት" (variants { "ስድሳ" ; "ስልሳ" }) ;
|
||||
lin n7 = mkNum "ሰባት" "ሰባ" ;
|
||||
lin n8 = mkNum "ስምንት" "ሰማንያ" ;
|
||||
lin n9 = mkNum "ዘጠኝ" "ዘጠና" ;
|
||||
|
||||
oper ss1 : Str -> Str -> Str -> LinSub100 = \assir -> \ten -> \unitpart ->
|
||||
{s = table {indep => assir ; tenpart => ten ; tenelfu => [] ; sihpart => unitpart} ; size = tenplus } ;
|
||||
|
||||
oper ss : Str -> Str -> Str -> LinSub100 = \assir -> \ten -> \unitpart ->
|
||||
{s = table {indep => assir ; tenpart => ten ; tenelfu => ten ; sihpart => unitpart} ; size = tenplus } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "ኣንድ" ; ten => "ኣስራ" }; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss1 "ኣስር" "ኣንድ" [] ;
|
||||
lin pot111 = ss1 (variants {"ኣስራንድ" ; "ኣስራ" ++ "ኣንድ" }) "ኣንድ" Sih ;
|
||||
lin pot1to19 d = ss1 ("ኣስራ" ++ d.s ! unit) "ኣንድ" (mkSih d.size (d.s ! unit)) ;
|
||||
lin pot0as1 n = {s = table {indep => n.s ! unit ; sihpart => mkSih n.size (n.s ! unit) ; _ => [] } ; size = n.size} ;
|
||||
lin pot1 d = ss (d.s ! ten) (d.s ! unit) [] ;
|
||||
lin pot1plus d e = ss ((d.s ! ten) ++ (e.s ! unit))
|
||||
(d.s ! unit)
|
||||
(mkSih e.size (e.s ! unit));
|
||||
|
||||
lin pot1as2 n = {s = n.s ! indep ; s2 = n.s ! tenelfu ++ "እሌፍ" ++ n.s ! sihpart ; size = n.size} ;
|
||||
|
||||
lin pot2 d = {s = (sel d.size [] (d.s ! unit)) ++ "መቶ" ;
|
||||
s2 = sel d.size "ኣስር" (d.s ! ten) ; size = tenplus} ;
|
||||
lin pot2plus d e = {s = (sel d.size [] (d.s ! unit)) ++ "መቶ" ++ e.s ! indep ; s2 = d.s ! ten ++ e.s ! tenpart ++ "እሌፍ" ++ e.s ! sihpart ; size = tenplus} ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = table {pl => n.s ++ Sih ; sg => Sih ; tenplus => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m = {s = table {pl => n.s ++ Sih ; sg => Sih ; tenplus => n.s2 } ! n.size ++ m.s} ;
|
||||
|
||||
oper Sih : Str = variants {"ሺህ" ; "ሺ"} ;
|
||||
|
||||
oper mkSih : Size -> Str -> Str = \sz -> \attr -> (sel sz [] attr) ++ Sih ;
|
||||
|
||||
oper sel : Size -> Str -> Str -> Str = \sz -> \a -> \b -> table {sg => a ; _ => b} ! sz ;
|
||||
|
||||
}
|
||||
101
examples/numerals/arabic_classical.gf
Normal file
101
examples/numerals/arabic_classical.gf
Normal file
@@ -0,0 +1,101 @@
|
||||
concrete arabic_classical of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=arabic0600 ;
|
||||
|
||||
-- There is uncertainty as to wthere forms like 102 000 should be
|
||||
-- hundred and thousand<DUAL> or hundred and two thousands<GEN.PL> or
|
||||
-- as implemented hundred and two thousand<DUAL>
|
||||
|
||||
param DForm = unit Place | teen | ten | hund ;
|
||||
param Size = sg | pl | dual | eleventonineteen ;
|
||||
param Place = attr | indep ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Arabic0x0600 environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {(unit attr) => [] ;
|
||||
(unit indep) => "اثنان" ;
|
||||
teen => "اثنا" ;
|
||||
ten => "عشرون" ;
|
||||
hund => "مائتان"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "ثلاثة" ;
|
||||
teen => "ثلاثة" ;
|
||||
ten => "ثلاثون" ;
|
||||
hund => variants {"ثلاث" ++ "مائة" ; "ثلاثمائة"}} ;
|
||||
size = pl} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "أربعة" ;
|
||||
teen => "أربعة" ;
|
||||
ten => "أربعون" ;
|
||||
hund => variants {"أربع" ++ "مائة" ; "أربعمائة"}} ;
|
||||
size = pl} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "خمسة" ;
|
||||
teen => "خمسة" ;
|
||||
ten => "خمسون" ;
|
||||
hund => variants {"خمس" ++ "مائة" ; "خمسمائة"}} ; size = pl} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "ستة" ;
|
||||
teen => "ستة" ;
|
||||
ten => "ستون" ;
|
||||
hund => variants {"ست" ++ "مائة" ; "ستمائة"}} ; size = pl} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "سبعة" ;
|
||||
teen => "سبعة" ;
|
||||
ten => "سبعون" ;
|
||||
hund => variants {"سبع" ++ "مائة" ; "سبعمائة"}} ; size = pl} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "ثمانية" ;
|
||||
teen => "ثمانية" ;
|
||||
ten => "ثمانون" ;
|
||||
hund => variants {"ثمان" ++ "مائة" ; "ثمانمائة"}} ;
|
||||
size = pl} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "تسعة" ;
|
||||
teen => "تسعة" ;
|
||||
ten => "تسعون" ;
|
||||
hund => variants {"تسع" ++ "مائة" ; "تسعمائة"}} ;
|
||||
size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => (variants {"مائة" ; "م0ة"} ) ; (unit attr) => [] ; f => "واحد"} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "عشرة"} ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "احد" ++ "عشر"} ; size = eleventonineteen} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen ++ "عشر"} ; size = eleventonineteen} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! unit p} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten} ; size = eleventonineteen} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => e.s ! unit indep ++ "و" ++ d.s ! ten} ; size = e.size} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {_ => d.s ! hund} ; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {_ => d.s ! hund ++ "و" ++ e.s ! indep} ; size = e.size} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ Alf ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ Alf ! n.size ++ "و" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{pl} => "آلاف" ; {dual} => "الفان" ; {eleventonineteen} => "الفا" ; sg => "الف"} ;
|
||||
|
||||
|
||||
}
|
||||
94
examples/numerals/arabic_modern.gf
Normal file
94
examples/numerals/arabic_modern.gf
Normal file
@@ -0,0 +1,94 @@
|
||||
concrete arabic_modern of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=arabic ;
|
||||
|
||||
--- flags unlexer=reverse ;
|
||||
param DForm = unit Place | teen | ten | hund ;
|
||||
param Size = small | large | dual ;
|
||||
param Place = attr | indep ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Arabic environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {(unit attr) => [] ;
|
||||
(unit indep) => "ﺍﺛﻨﻴﻦ" ;
|
||||
teen => "ﺍﺛﻨﻰ" ;
|
||||
ten => "ﻋﺸﺮﻳﻦ" ;
|
||||
hund => "ﻣﺎﺋﺘﻴﻦ"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "ﺛﻼﺛﺔ" ;
|
||||
teen => "ﺛﻼﺛﺔ" ;
|
||||
ten => "ﺛﻼﺛﻴﻦ" ;
|
||||
hund => "ﺛﻼﺛﻤﺎﺋﺔ"} ; size = small} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "ﺃﺭﺑﻌﺔ" ;
|
||||
teen => "ﺃﺭﺑﻌﺔ" ;
|
||||
ten => "ﺃﺭﺑﻌﻴﻦ" ;
|
||||
hund => "ﺃﺭﺑﻌﻤﺎﺋﺔ"} ; size = small} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "ﺧﻤﺴﺔ" ;
|
||||
teen => "ﺧﻤﺴﺔ" ;
|
||||
ten => "ﺧﻤﺴﻴﻦ" ;
|
||||
hund => "ﺧﻤﺴﻤﺎﺋﺔ"} ; size = small} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "ﺳﺘﺔ" ;
|
||||
teen => "ﺳﺘﺔ" ;
|
||||
ten => "ﺳﺘﻴﻦ" ;
|
||||
hund => "ﺳﺘﻤﺎﺋﺔ"} ; size = small} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "ﺳﺒﻌﺔ" ;
|
||||
teen => "ﺳﺒﻌﺔ" ;
|
||||
ten => "ﺳﺒﻌﻴﻦ" ;
|
||||
hund => "ﺳﺒﻌﻤﺎﺋﺔ"} ; size = small} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "ﺛﻤﺎﻧﻴﺔ" ;
|
||||
teen => "ﺛﻤﺎﻧﻴﺔ" ;
|
||||
ten => "ﺛﻤﺎﻧﻴﻦ" ;
|
||||
hund => "ﺛﻤﺎﻧﻤﺎﺋﺔ"} ; size = small} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "ﺗﺴﻌﺔ" ;
|
||||
teen => "ﺗﺴﻌﺔ" ;
|
||||
ten => "ﺗﺴﻌﻴﻦ" ;
|
||||
hund => "ﺗﺴﻌﻤﺎﺋﺔ"} ; size = small} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "ﻣﺎﺋﺔ"; (unit attr) => [] ; f => "ﻭﺍﺣﺪ"} ; size = large} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "ﻋﺸﺮﺓ"} ; size = small} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "ﺍﺣﺪ" ++ "ﻋﺸﺮ"} ; size = large} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen ++ "ﻋﺸﺮ"} ; size = large} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! unit p} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten} ; size = large} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => e.s ! unit indep ++ "ﻭ" ++ d.s ! ten} ; size = large} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {_ => d.s ! hund} ; size = large} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {_ => d.s ! hund ++ "ﻭ" ++ e.s ! indep} ; size = large} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ Alf ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ Alf ! n.size ++ "ﻭ" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{small} => "ﺁﻻﻑ" ; {dual} => "ﺍﻟﻔﻴﻦ" ; _ => "ﺍﻟﻒ"} ;
|
||||
|
||||
|
||||
}
|
||||
62
examples/numerals/basque.gf
Normal file
62
examples/numerals/basque.gf
Normal file
@@ -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 } ;
|
||||
|
||||
}
|
||||
49
examples/numerals/bearlake_slave.gf
Normal file
49
examples/numerals/bearlake_slave.gf
Normal file
@@ -0,0 +1,49 @@
|
||||
concrete bearlake_slave of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | hundred ;
|
||||
|
||||
oper LinDigit = {s : Str } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str } ;
|
||||
lincat Sub1000 = {s : Str } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \two ->
|
||||
{s = two } ;
|
||||
|
||||
-- TODO: Transl.
|
||||
|
||||
lin num x = x ;
|
||||
-- lin n1 mkNum "l-ée" ;
|
||||
lin n2 = mkNum "nákee" ;
|
||||
lin n3 = mkNum "tai" ;
|
||||
lin n4 = mkNum "di,i," ;
|
||||
lin n5 = mkNum "so,lái" ;
|
||||
lin n6 = mkNum "?ehts'é,tai" ;
|
||||
lin n7 = mkNum "l-á,hdi,i," ;
|
||||
lin n8 = mkNum "?ehts'é,di,i," ;
|
||||
lin n9 = mkNum "l-óto," ;
|
||||
|
||||
oper o : Str = "?ó," ;
|
||||
|
||||
lin pot01 = {s = "l-ée" } ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = variants {"honéno," ; "hóno" }} ;
|
||||
lin pot111 = {s = variants {"honéno," ; "hóno" } ++ o ++ "l-ée" } ;
|
||||
lin pot1to19 d = {s = (variants {"honéno," ; "hóno" }) ++ o ++ d.s } ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = {s = d.s ++ (variants {"honéno," ; "óno,"})} ;
|
||||
lin pot1plus d e = {s = d.s ++ (variants {"honéno," ; "óno,"}) ++ o ++ e.s } ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ++ "lak'o, óno,"} ;
|
||||
lin pot2plus d e = {s = d.s ++ "lak'o, óno," ++ e.s} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = n.s ++ "lamíl"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "lamíl" ++ m.s } ;
|
||||
|
||||
|
||||
}
|
||||
58
examples/numerals/bulgarian.gf
Normal file
58
examples/numerals/bulgarian.gf
Normal file
@@ -0,0 +1,58 @@
|
||||
concrete bulgarian of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- ä is ya
|
||||
-- q is [ch]
|
||||
-- w for [sh]
|
||||
-- j for i kratkoe i.e i with a thing
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=russian ;
|
||||
|
||||
param Size = sg | below10 | tenover ;
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
|
||||
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 } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit = \tri -> \trijset -> \trista ->
|
||||
{ s = table {unit => tri ; teen => variants {tri + "надесет" ; tri + "найсет" }; ten => trijset ; hund => trista} ; size = below10};
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ []} ; -- the (Russian) Cyrillic ad-hoc translation
|
||||
|
||||
lin n2 = {s = table {unit => "две" ; teen => variants {"дванадесет" ; "дванайсет"}; ten => "двайсет" ; hund => "двеста" } ; size = below10 } ;
|
||||
lin n3 = mkNum "три" (variants {"трийсет"; "тридесет"}) "триста" ;
|
||||
lin n4 = mkNum "четири" (variants {"четирисет" ; "четирийсет" ; "четиридесет"}) "четиристотин" ;
|
||||
lin n5 = mkNum "пет" "петдесет" "петстотин" ;
|
||||
lin n6 = mkNum "шест" (variants {"шестдесет" ; "шейсет"}) "шестстотин" ;
|
||||
lin n7 = mkNum "седем" "седемдесет" "седемстотин" ;
|
||||
lin n8 = mkNum "осем" "осемдесет" "осемстотин" ;
|
||||
lin n9 = mkNum "девет" "деветдесет" "деветстотин" ;
|
||||
|
||||
lin pot01 = { s = table {unit => "едно" ; hundred => "сот" ; _ => "думмю" } ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "десет" ; size = below10};
|
||||
lin pot111 = {s = variants {"единадесет" ; "единайсет" }; size = tenover};
|
||||
lin pot1to19 d = {s = d.s ! teen ; size = tenover};
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size } ;
|
||||
lin pot1 d = {s = d.s ! ten ; size = tenover} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "и" ++ e.s ! unit ; size = tenover} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! hundred ; size = tenover} ;
|
||||
lin pot2plus d e = { s = d.s ! hundred ++ maybei e.size ++ e.s ; size = tenover } ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = mkThou n.size n.s} ;
|
||||
lin pot3plus n m = {s = mkThou n.size n.s ++ m.s} ;
|
||||
|
||||
oper mkThou : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {sg => "жиляда" ; _ => attr ++ "жиляди" } ! sz ;
|
||||
|
||||
oper maybei : Size -> Str = \sz -> table {tenover => [] ; _ => "и"} ! sz ;
|
||||
|
||||
|
||||
}
|
||||
63
examples/numerals/catalan.gf
Normal file
63
examples/numerals/catalan.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
concrete catalan of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \s1 -> \s2 -> s1 ++ s2 ;
|
||||
|
||||
param DForm = unit | teen | ten | hundred | vint | null ;
|
||||
param Size = sg | two | pl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size } ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit =
|
||||
\dois -> \doze -> \vinte ->
|
||||
{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" ; null => []} ; size = two } ;
|
||||
lin n3 = mkNum "tres" "tretze" "trenta" ;
|
||||
lin n4 = mkNum "quatre" "catorze" "quaranta" ;
|
||||
lin n5 = mkNum "cinc" "quinze" "cinqanta" ;
|
||||
lin n6 = mkNum "sis" "setze" "seixanta" ;
|
||||
lin n7 = mkNum "set" "disset" "setanta" ;
|
||||
lin n8 = mkNum "vuit" "divuit" "vuitanta" ;
|
||||
lin n9 = mkNum "nou" "dinou" "noranta" ;
|
||||
|
||||
lin pot01 = {s = table {unit => "u" ; hundred => "cent" ; vint => "vint-i-" + "u" ; _ => "dummy"} ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 =
|
||||
{s = "deu" ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = "onze" ; 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 = d.s ! ten ; size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{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} ;
|
||||
lin pot2plus d e =
|
||||
{s = d.s ! hundred ++ e.s ; size = pl} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = table {sg => "mil" ; _ => n.s ++ "mil"} ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {sg => "mil" ; _ => n.s ++ "mil"} ! n.size ++ m.s } ;
|
||||
|
||||
|
||||
}
|
||||
115
examples/numerals/chinese.gf
Normal file
115
examples/numerals/chinese.gf
Normal file
@@ -0,0 +1,115 @@
|
||||
concrete chinese of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
flags coding=utf8 ;
|
||||
|
||||
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}> => []} ;
|
||||
oper Wan : Zero => Str =
|
||||
table {{zero} => "万" ;
|
||||
{nozero} => []} ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : Str} ;
|
||||
lincat Sub10 = {s : Str} ;
|
||||
lincat Sub100 = {inh : Zero ; s : Bform => Str} ;
|
||||
lincat Sub1000 = {inh : Zero ; s : Qform => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{s = "贰"} ;
|
||||
lin n3 =
|
||||
{s = "叁"} ;
|
||||
lin n4 =
|
||||
{s = "肆"} ;
|
||||
lin n5 =
|
||||
{s = "伍"} ;
|
||||
lin n6 =
|
||||
{s = "陆"} ;
|
||||
lin n7 =
|
||||
{s = "柒"} ;
|
||||
lin n8 =
|
||||
{s = "捌"} ;
|
||||
lin n9 =
|
||||
{s = "玖"} ;
|
||||
lin pot01 =
|
||||
{s = "壹"} ;
|
||||
lin pot0 d =
|
||||
{s = d.s} ;
|
||||
lin pot110 =
|
||||
{inh = nozero ;
|
||||
s = table {
|
||||
{shi} => "壹拾" ;
|
||||
{shi0} => "壹拾" ;
|
||||
{wan} => "壹万" ;
|
||||
{wan0} => "壹万"}} ;
|
||||
lin pot111 =
|
||||
{inh = nozero ;
|
||||
s = table {
|
||||
{shi} => "拾壹" ;
|
||||
{shi0} => "壹拾壹" ;
|
||||
{wan} => "拾壹万" ;
|
||||
{wan0} => "拾壹万"}} ;
|
||||
lin pot1to19 d =
|
||||
{inh = nozero ;
|
||||
s = table {
|
||||
{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 ++ "仟"}} ;
|
||||
lin pot1 d =
|
||||
{inh = zero ;
|
||||
s = table {
|
||||
{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 ++ "仟"}} ;
|
||||
lin pot1as2 n =
|
||||
{inh = zero ;
|
||||
s = table {
|
||||
{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 ++ "拾万"}} ;
|
||||
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}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! bai} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! shiwan} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! shiwan0) ++ (ling ! <n.inh,m.inh>) ++ m.s ! bai0} ;
|
||||
|
||||
|
||||
}
|
||||
77
examples/numerals/croatian.gf
Normal file
77
examples/numerals/croatian.gf
Normal file
@@ -0,0 +1,77 @@
|
||||
concrete croatian of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
param DForm = unit | teen | ten | hund ;
|
||||
|
||||
-- [c^], [s^], [c']
|
||||
|
||||
|
||||
param ThForm = onlyone | lastone | twoorthreeorfour | fiveup ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
lincat Sub100 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> ThForm -> LinDigit =
|
||||
\dwa -> \dwanascie -> \dwadziescia -> \dwiescie -> \thform ->
|
||||
{ s = table {unit => dwa ; teen => dwanascie ; ten => dwadziescia ; hund =>
|
||||
dwiescie };
|
||||
o = thform ; t = thform
|
||||
};
|
||||
|
||||
oper mkRegNum : Str -> LinDigit =
|
||||
\sedam ->
|
||||
{ s = table { unit => sedam ; teen => sedam + "naest" ;
|
||||
ten => sedam + "deset" ; hund => sedam ++ "stotina"
|
||||
};
|
||||
o = fiveup ; t = fiveup
|
||||
};
|
||||
|
||||
oper mkTh : Str -> ThForm => Str = \attr ->
|
||||
table { onlyone => variants {"hiljada" ; "tisuća"} ; lastone => attr ++ "hiljada" ;
|
||||
twoorthreeorfour => attr ++ "hiljade" ; fiveup => attr ++ "hiljada"
|
||||
};
|
||||
|
||||
oper ss : Str -> ThForm -> {s : Str ; t : ThForm} = \str -> \th -> {s = str; t = th} ;
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ []} ; -- Latin A Supplement environment
|
||||
|
||||
lin n2 = mkNum "dva" "dvanaest" "dvadeset" (variants { "dve" ++ "stotine" ; "dvesta" } ) twoorthreeorfour ;
|
||||
lin n3 = mkNum "tri" "trinaest" "trideset" (variants { "tri" ++ "stotine" ; "trista" } ) twoorthreeorfour ;
|
||||
lin n4 = mkNum "četiri" "četrnaest" "četrdeset" ("četiri" ++ "stotine") twoorthreeorfour ;
|
||||
lin n5 = mkNum "pet" "petnaest" "pedeset" ("pet" ++ "stotina") fiveup ;
|
||||
lin n6 = mkNum "šest" "šesnaest" "šezdeset" ("šest" ++ "stotina") fiveup ;
|
||||
lin n7 = mkRegNum "sedam" ;
|
||||
lin n8 = mkRegNum "osam" ;
|
||||
lin n9 = mkNum "devet" "devetnaest" "devedeset" ("devet" ++ "stotina") fiveup;
|
||||
|
||||
lin pot01 = { s = table {hund => variants {"sto" ; "stotina" }; f => "jedan" };
|
||||
o = onlyone ; t = lastone
|
||||
};
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; o = d.o ; t = d.t} ;
|
||||
lin pot110 = ss "deset" fiveup ;
|
||||
lin pot111 = ss "jedanaest" fiveup ;
|
||||
lin pot1to19 d = {s = d.s ! teen ; t = fiveup} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; t = n.o} ;
|
||||
lin pot1 d = {s = d.s ! ten ; t = fiveup} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "i" ++ e.s ! unit; t = e.t} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! hund ; t = fiveup} ;
|
||||
lin pot2plus d e = { s = d.s ! hund ++ e.s ;
|
||||
t = table { onlyone => lastone ; f => f } ! e.t
|
||||
} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = (mkTh n.s) ! n.t} ;
|
||||
lin pot3plus n m = {s = (mkTh n.s) ! n.t ++ m.s} ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
67
examples/numerals/czech.gf
Normal file
67
examples/numerals/czech.gf
Normal file
@@ -0,0 +1,67 @@
|
||||
concrete czech of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \s1 -> \s2 -> s1 ++ s2 ;
|
||||
|
||||
-- [c^], [s^], [r^], [e^]
|
||||
|
||||
param Size = sg | twothreefour | fiveup ;
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str; size : Size } ;
|
||||
lincat Sub1000 = {s : Str; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> Size -> LinDigit =
|
||||
\dva -> \dvanast -> \dvadsat -> \dveste -> \sz ->
|
||||
{ s = table {unit => dva ; teen => dvanast + "náct" ; ten => dvadsat ; hundred => dveste } ; size = sz };
|
||||
|
||||
oper mk2Num : Str -> Str -> Str -> Str -> LinDigit = \unit -> \teenbase -> \tenbase -> \hundred ->
|
||||
mkNum unit teenbase (tenbase + "cet") hundred twothreefour ;
|
||||
|
||||
oper mk5Num : Str -> Str -> Str -> LinDigit = \unit -> \teenbase -> \tenbase ->
|
||||
mkNum unit teenbase (tenbase + "desát") (unit ++ "set") fiveup ;
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ [] } ; -- Latin A supplement encoding
|
||||
|
||||
lin n2 = mk2Num "dva" "dva" "dva" ("dve^" ++ "ste^") ;
|
||||
lin n3 = mk2Num "tr^i" "tr^i" "tr^i" ("tr^i" ++ "sta") ;
|
||||
lin n4 = mk2Num "čtyr^i" "čtr" "čtyr^i" ("čtyr^i" ++ "sta") ;
|
||||
lin n5 = mk5Num "pe^t" "pat" "pa" ;
|
||||
lin n6 = mk5Num "šest" "šest" "še" ;
|
||||
lin n7 = mk5Num "sedm" "sedm" "sedm";
|
||||
lin n8 = mk5Num "osm" "osm" "osm";
|
||||
lin n9 = mk5Num "deve^t" "devate" "deva" ;
|
||||
|
||||
lin pot01 = {s = table {unit => "jeden" ; hundred => "sto" ; _ => "dummy" } ;
|
||||
size = sg } ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "deset" ; size = fiveup } ;
|
||||
lin pot111 = {s = "jedenáct" ; size = fiveup };
|
||||
lin pot1to19 d = {s = d.s ! teen ; size = fiveup} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; size = fiveup} ;
|
||||
lin pot1plus d e = {s = variants { d.s ! ten ++ e.s ! unit ; bind (bind (e.s ! unit) "a") (d.s ! ten)} ; size = tfSize e.size} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! hundred ; size = fiveup} ;
|
||||
lin pot2plus d e = {s = d.s ! hundred ++ e.s ; size = tfSize e.size} ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = (mkTh n.s) ! n.size} ;
|
||||
lin pot3plus n m = {s = (mkTh n.s) ! n.size ++ m.s} ;
|
||||
|
||||
oper tfSize : Size -> Size = \sz ->
|
||||
table {sg => fiveup ; other => other} ! sz ;
|
||||
|
||||
oper mkTh : Str -> Size => Str = \attr ->
|
||||
table {sg => "tisíc" ;
|
||||
twothreefour => attr ++ "tisíce" ;
|
||||
fiveup => attr ++ "tisíc" } ;
|
||||
|
||||
}
|
||||
62
examples/numerals/dagur.gf
Normal file
62
examples/numerals/dagur.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
concrete dagur of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param Size = sg | pl | tenplus ;
|
||||
param S100 = indep | tenpart | tenelfu | sihpart ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
oper LinSub100 = {s : S100 => Str ; size : Size} ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \hulatt -> \haya ->
|
||||
{s = table {unit => hulatt ; ten => haya} ; size = pl} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s } ;
|
||||
lin n2 = mkNum "hoire" "hori" ;
|
||||
lin n3 = mkNum "guarebe" "goci" ;
|
||||
lin n4 = mkNum "durube" "duci" ;
|
||||
lin n5 = mkNum "taau" "tabi" ;
|
||||
lin n6 = mkNum "jireuoo" "jari" ;
|
||||
lin n7 = mkNum "doloo" "dale" ;
|
||||
lin n8 = mkNum "naime" "nai" ;
|
||||
lin n9 = mkNum "ise" "ire" ;
|
||||
|
||||
oper ss1 : Str -> Str -> Str -> LinSub100 = \assir -> \ten -> \unitpart ->
|
||||
{s = table {indep => assir ; tenpart => ten ; tenelfu => [] ; sihpart => unitpart} ; size = tenplus } ;
|
||||
|
||||
oper ss : Str -> Str -> Str -> LinSub100 = \assir -> \ten -> \unitpart ->
|
||||
{s = table {indep => assir ; tenpart => ten ; tenelfu => ten ; sihpart => unitpart} ; size = tenplus } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "neke" ; ten => "harebe" }; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss1 "harebe" "neke" [] ;
|
||||
lin pot111 = ss1 ("hareben" ++ "neke") "neke" "miange" ;
|
||||
lin pot1to19 d = ss1 ("hareben" ++ d.s ! unit) "neke" (mkmiange d.size (d.s ! unit)) ;
|
||||
lin pot0as1 n = {s = table {indep => n.s ! unit ; sihpart => mkmiange n.size (n.s ! unit) ; _ => [] } ; size = n.size} ;
|
||||
lin pot1 d = ss (d.s ! ten) (d.s ! unit) [] ;
|
||||
lin pot1plus d e = ss ((d.s ! ten) ++ (e.s ! unit))
|
||||
(d.s ! unit)
|
||||
(mkmiange e.size (e.s ! unit));
|
||||
|
||||
lin pot1as2 n = {s = n.s ! indep ; s2 = n.s ! tenelfu ++ "tume" ++ n.s ! sihpart ; size = n.size} ;
|
||||
|
||||
lin pot2 d = {s = (sel d.size [] (d.s ! unit)) ++ "jau" ;
|
||||
s2 = sel d.size "harebe" (d.s ! ten) ; size = tenplus} ;
|
||||
lin pot2plus d e = {s = (sel d.size [] (d.s ! unit)) ++ "jau" ++ e.s ! indep ; s2 = d.s ! ten ++ e.s ! tenpart ++ "tume" ++ e.s ! sihpart ; size = tenplus} ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = table {pl => n.s ++ "miange" ; sg => "miange" ; tenplus => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m = {s = table {pl => n.s ++ "miange" ; sg => "miange" ; tenplus => n.s2 } ! n.size ++ m.s} ;
|
||||
|
||||
oper mkmiange : Size -> Str -> Str = \sz -> \attr -> (sel sz [] attr) ++ "miange" ;
|
||||
|
||||
oper sel : Size -> Str -> Str -> Str = \sz -> \a -> \b -> table {sg => a ; _ => b} ! sz ;
|
||||
|
||||
}
|
||||
49
examples/numerals/danish.gf
Normal file
49
examples/numerals/danish.gf
Normal file
@@ -0,0 +1,49 @@
|
||||
concrete danish of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- AR 12/10/2002 following www.geocities.com/tsca.geo/dansk/dknummer.html
|
||||
|
||||
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 =
|
||||
\to, tolv, tyve ->
|
||||
{s = table {ental => to ; ton => tolv ; tiotal => tyve}} ;
|
||||
oper regTal : Str -> LinDigit = \fem -> mkTal fem (fem + "ton") (fem + "tio") ;
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkTal "to" "tolv" "tyve" ;
|
||||
lin n3 = mkTal "tre" "tretten" "tredive" ;
|
||||
lin n4 = mkTal "fire" "fjorten" "fyrre" ;
|
||||
lin n5 = mkTal "fem" "femten" "halvtreds" ;
|
||||
lin n6 = mkTal "seks" "seksten" "tres" ;
|
||||
lin n7 = mkTal "syv" "sytten" "halvfjerds" ;
|
||||
lin n8 = mkTal "otte" "atten" "firs" ;
|
||||
lin n9 = mkTal "ni" "nitten" "halvfems" ;
|
||||
|
||||
lin pot01 = {s = table {f => "en"}} ; ---
|
||||
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 (e.s ! ental ++ "og" ++ d.s ! tiotal) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (d.s ! ental ++ "hundrede") ;
|
||||
lin pot2plus d e = ss (d.s ! ental ++ "hundrede" ++ "og" ++ e.s) ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = ss (n.s ++ "tusind") ;
|
||||
lin pot3plus n m = ss (n.s ++ "tusind" ++ "og" ++ m.s) ; ---
|
||||
|
||||
}
|
||||
49
examples/numerals/decimal.gf
Normal file
49
examples/numerals/decimal.gf
Normal file
@@ -0,0 +1,49 @@
|
||||
concrete decimal of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- flags lexer=chars ; unlexer=concat ;
|
||||
|
||||
param Zeros = noz | zz ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = { s : Str } ;
|
||||
lincat Sub10 = { s : Str } ;
|
||||
lincat Sub100 = {s : Zeros => Str} ;
|
||||
lincat Sub1000 = {s : Zeros => Str} ;
|
||||
lincat Sub1000000 = {s : Zeros => Str} ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
oper mkz : Str -> {s : Zeros => Str} = \s -> {s = table {_ => s}} ;
|
||||
|
||||
lin num n = {s = n.s ! noz} ;
|
||||
lin n2 = ss "2" ;
|
||||
lin n3 = ss "3" ;
|
||||
lin n4 = ss "4" ;
|
||||
lin n5 = ss "5" ;
|
||||
lin n6 = ss "6" ;
|
||||
lin n7 = ss "7" ;
|
||||
lin n8 = ss "8" ;
|
||||
lin n9 = ss "9" ;
|
||||
|
||||
lin pot01 = ss "1" ;
|
||||
lin pot0 d = d ;
|
||||
|
||||
lin pot110 = mkz ("1" ++ "0") ;
|
||||
lin pot111 = mkz ("1" ++ "1") ;
|
||||
lin pot1to19 d = mkz ("1" ++ d.s) ;
|
||||
|
||||
lin pot0as1 n = {s = table {noz => n.s ; zz => "0" ++ n.s}} ;
|
||||
|
||||
lin pot1 d = mkz (d.s ++ "0") ;
|
||||
lin pot1plus d e = mkz (d.s ++ e.s) ;
|
||||
|
||||
lin pot1as2 n = {s = table {noz => n.s ! noz ; zz => "0" ++ n.s ! zz}} ;
|
||||
lin pot2 d = mkz (d.s ++ "0" ++ "0") ;
|
||||
lin pot2plus d e = mkz (d.s ++ e.s ! zz) ;
|
||||
|
||||
lin pot2as3 n = {s = table {noz => n.s ! noz ; zz => "0" ++ n.s ! zz}} ;
|
||||
|
||||
lin pot3 n = mkz (n.s ! noz ++ "0" ++ "0" ++ "0") ;
|
||||
lin pot3plus n m = {s = table {z => n.s ! z ++ m.s ! zz}} ;
|
||||
|
||||
}
|
||||
53
examples/numerals/dutch.gf
Normal file
53
examples/numerals/dutch.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete dutch of Numerals = {
|
||||
-- Koen Claessen from Deu, 11/1/2001.
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
param Place = indep | prae | attr ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm * Place => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkGetal : Str -> Str -> Str -> LinDigit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {unit => två ; teen => tolv ; ten => tjugo}} ;
|
||||
oper regGetal : Str -> LinDigit =
|
||||
\vier -> mkGetal vier (vier + "tien") (vier + "tig") ;
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkGetal "twee" "twaalf" "twintig" ;
|
||||
lin n3 = mkGetal "drie" "dertien" "dertig" ;
|
||||
lin n4 = mkGetal "vier" "veertien" "veertig";
|
||||
lin n5 = regGetal "vijf" ;
|
||||
lin n6 = regGetal "zes" ;
|
||||
lin n7 = regGetal "zeven" ;
|
||||
lin n8 = mkGetal "acht" "achttien" "tachtig";
|
||||
lin n9 = regGetal "negen" ;
|
||||
|
||||
lin pot01 = {s = table {<f,indep> => "een" ; <f,prae> => "een" ; <f,attr> => []}} ;
|
||||
lin pot0 d = {s = table {<f,p> => d.s ! f}} ;
|
||||
lin pot110 = {s = table {p => "tien"}} ;
|
||||
lin pot111 = {s = table {p => "elf"}} ;
|
||||
lin pot1to19 d = {s = table {p => d.s ! teen}} ;
|
||||
lin pot0as1 n = {s = table {p => n.s ! <unit,p>}} ;
|
||||
lin pot1 d = {s = table {p => d.s ! ten}} ;
|
||||
lin pot1plus d e = {s = table {p => e.s ! <unit,prae> ++ "en" ++ d.s ! ten}} ;
|
||||
lin pot1as2 n = {s = table {p => n.s ! p}} ;
|
||||
lin pot2 d = {s = table {p => d.s ! <unit,attr> ++ "honderd"}} ;
|
||||
lin pot2plus d e = {s = table {
|
||||
_ => d.s ! <unit,attr> ++ "honderd" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n = ss (n.s ! indep) ;
|
||||
lin pot3 n = ss (n.s ! attr ++ "duizend") ;
|
||||
lin pot3plus n m = ss (n.s ! attr ++ "duizend" ++ m.s ! prae) ;
|
||||
|
||||
|
||||
}
|
||||
48
examples/numerals/english.gf
Normal file
48
examples/numerals/english.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
concrete english of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
|
||||
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 mkNum : Str -> Str -> Str -> LinDigit =
|
||||
\two -> \twelve -> \twenty ->
|
||||
{s = table {unit => two ; teen => twelve ; ten => twenty}} ;
|
||||
oper regNum : Str -> LinDigit =
|
||||
\six -> mkNum six (six + "teen") (six + "ty") ;
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin num x = x ;
|
||||
lin n2 = mkNum "two" "twelve" "twenty" ;
|
||||
lin n3 = mkNum "three" "thirteen" "thirty" ;
|
||||
lin n4 = mkNum "four" "fourteen" "forty" ;
|
||||
lin n5 = mkNum "five" "fifteen" "fifty" ;
|
||||
lin n6 = regNum "six" ;
|
||||
lin n7 = regNum "seven" ;
|
||||
lin n8 = mkNum "eight" "eighteen" "eighty" ;
|
||||
lin n9 = regNum "nine" ;
|
||||
|
||||
lin pot01 = {s = table {f => "one"}} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f}} ;
|
||||
lin pot110 = ss "ten" ;
|
||||
lin pot111 = ss "eleven" ;
|
||||
lin pot1to19 d = {s = d.s ! teen} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ;
|
||||
lin pot1 d = {s = d.s ! ten} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "-" ++ e.s ! unit} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! unit ++ "hundred"} ;
|
||||
lin pot2plus d e = {s = d.s ! unit ++ "hundred" ++ "and" ++ e.s} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = n.s ++ "thousand"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ;
|
||||
|
||||
|
||||
}
|
||||
63
examples/numerals/finnish.gf
Normal file
63
examples/numerals/finnish.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
concrete finnish of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Place = indep | attr ;
|
||||
param Nm = sg | pl ;
|
||||
oper sata : Nm => Str =
|
||||
table {{sg} => "sata" ; {pl} => "sataa"} ;
|
||||
oper tuhat : Nm => Str =
|
||||
table {{sg} => "tuhat" ; {pl} => "tuhatta"} ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : Str} ;
|
||||
lincat Sub10 = {inh : Nm ; s : Place => Str} ;
|
||||
lincat Sub100 = {inh : Nm ; s : Place => Str} ;
|
||||
lincat Sub1000 = {inh : Nm ; s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{s = "kaksi"} ;
|
||||
lin n3 =
|
||||
{s = "kolme"} ;
|
||||
lin n4 =
|
||||
{s = "neljä"} ;
|
||||
lin n5 =
|
||||
{s = "viisi"} ;
|
||||
lin n6 =
|
||||
{s = "kuusi"} ;
|
||||
lin n7 =
|
||||
{s = "seitsemän"} ;
|
||||
lin n8 =
|
||||
{s = "kahdeksan"} ;
|
||||
lin n9 =
|
||||
{s = "yhdeksän"} ;
|
||||
lin pot01 =
|
||||
{inh = sg ; s = table {{attr} => [] ; {indep} => "yksi"}} ;
|
||||
lin pot0 d =
|
||||
{inh = pl ; s = table {p => d.s}} ;
|
||||
lin pot110 =
|
||||
{inh = pl ; s = table {p => "kymmenen"}} ;
|
||||
lin pot111 =
|
||||
{inh = pl ; s = table {p => "yksi"++"toista"}} ;
|
||||
lin pot1to19 d =
|
||||
{inh = pl ; s = table {p => d.s ++ "toista"}} ;
|
||||
lin pot0as1 n =
|
||||
{inh = n.inh ; s = table {p => n.s ! p}} ;
|
||||
lin pot1 d =
|
||||
{inh = pl ; s = table {p => d.s ++ "kymmentä"}} ;
|
||||
lin pot1plus d e =
|
||||
{inh = pl ; s = table {p => d.s ++ "kymmentä" ++ e.s ! indep}} ;
|
||||
lin pot1as2 n =
|
||||
{inh = n.inh ; s = table {p => n.s ! p}} ;
|
||||
lin pot2 d =
|
||||
{inh = pl ; s = table {p => (d.s ! attr) ++ sata ! (d.inh)}} ;
|
||||
lin pot2plus d e =
|
||||
{inh = pl ; s = table {p => (d.s ! attr) ++ (sata ! (d.inh)) ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = (n.s ! attr) ++ tuhat ! (n.inh)} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! attr) ++ (tuhat ! (n.inh)) ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
63
examples/numerals/french.gf
Normal file
63
examples/numerals/french.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
concrete french of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | jten | ten | tenplus ;
|
||||
param Nm = sg | pl ;
|
||||
param Place = indep | attr ;
|
||||
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {inh : DForm ; inh1 : Nm ; s : DForm => Str} ;
|
||||
lincat Sub10 = {inh : Nm ; s : {p1 : DForm ; p2 : Place} => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "deux" ; teen => "douze" ; jten => "vingt" ; ten => "vingt" ; tenplus => "vingt"}} ;
|
||||
lin n3 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "trois" ; teen => "treize" ; jten => "trente" ; ten => "trente" ; tenplus => "trente"}} ;
|
||||
lin n4 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "quatre" ; teen => "quatorze" ; jten => "quarante" ; ten => "quarante" ; tenplus => "quarante"}} ;
|
||||
lin n5 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "cinq" ; teen => "quinze" ; jten => "cinquante" ; ten => "cinquante" ; tenplus => "cinquante"}} ;
|
||||
lin n6 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "six" ; teen => "seize" ; jten => "soixante" ; ten => "soixante" ; tenplus => "soixante"}} ;
|
||||
lin n7 =
|
||||
{inh = teen ; inh1 = sg ; s = table {unit => "sept" ; teen => "dix" ++ "-" ++ "sept" ; jten => "soixante" ++ "-" ++ "dix" ; ten => "soixante" ++ "-" ++ "dix" ; tenplus => "soixante"}} ;
|
||||
lin n8 =
|
||||
{inh = unit ; inh1 = pl ; s = table {unit => "huit" ; teen => "dix" ++ "-" ++ "huit" ; jten => "quatre" ++ "-" ++ "vingts" ; ten => "quatre" ++ "-" ++ "vingt" ; tenplus => "quatre" ++ "-" ++ "vingt"}} ;
|
||||
lin n9 =
|
||||
{inh = teen ; inh1 = pl ; s = table {unit => "neuf" ; teen => "dix" ++ "-" ++ "neuf" ; jten => "quatre" ++ "-" ++ "vingt" ++ "-" ++ "dix" ; ten => "quatre" ++ "-" ++ "vingt" ++ "-" ++ "dix" ; tenplus => "quatre" ++ "-" ++ "vingt"}} ;
|
||||
lin pot01 =
|
||||
{inh = sg ; s = table {{p1 = unit ; p2 = indep} => "un" ; {p1 = unit ; p2 = attr} => [] ; {p1 = teen ; p2 = indep} => "onze" ; {p1 = teen ; p2 = attr} => [] ; {p1 = jten ; p2 = indep} => "dix" ; {p1 = jten ; p2 = attr} => [] ; {p1 = ten ; p2 = indep} => "dix" ; {p1 = ten ; p2 = attr} => [] ; {p1 = tenplus ; p2 = indep} => "dix" ; {p1 = tenplus ; p2 = attr} => []}} ;
|
||||
lin pot0 d =
|
||||
{inh = pl ; s = table {{p1 = unit ; p2 = indep} => d.s ! unit ; {p1 = unit ; p2 = attr} => d.s ! unit ; {p1 = teen ; p2 = indep} => d.s ! teen ; {p1 = teen ; p2 = attr} => d.s ! teen ; {p1 = jten ; p2 = indep} => d.s ! jten ; {p1 = jten ; p2 = attr} => d.s ! jten ; {p1 = ten ; p2 = indep} => d.s ! ten ; {p1 = ten ; p2 = attr} => d.s ! ten ; {p1 = tenplus ; p2 = indep} => d.s ! tenplus ; {p1 = tenplus ; p2 = attr} => d.s ! tenplus}} ;
|
||||
lin pot110 =
|
||||
{s = table {indep => "dix" ; attr => "dix"}} ;
|
||||
lin pot111 =
|
||||
{s = table {indep => "onze" ; attr => "onze"}} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {indep => d.s ! teen ; attr => d.s ! teen}} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {indep => n.s ! {p1 = unit ; p2 = indep} ; attr => n.s ! {p1 = unit ; p2 = attr}}} ;
|
||||
lin pot1 d =
|
||||
{s = table {indep => d.s ! jten ; attr => d.s ! ten}} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep => (d.s ! tenplus) ++ (table {{p1 = sg ; p2 = sg} => "et" ; {p1 = sg ; p2 = pl} => "-" ; {p1 = pl ; p2 = sg} => "-" ; {p1 = pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++ e.s ! {p1 = d.inh ; p2 = indep} ; attr => (d.s ! tenplus) ++ (table {{p1 = sg ; p2 = sg} => "et" ; {p1 = sg ; p2 = pl} => "-" ; {p1 = pl ; p2 = sg} => "-" ; {p1 = pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++ e.s ! {p1 = d.inh ; p2 = indep}}} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {indep => n.s ! indep ; attr => n.s ! attr}} ;
|
||||
lin pot2 d =
|
||||
{s = table {indep => (d.s ! {p1 = unit ; p2 = attr}) ++ table {sg => "cent" ; pl => "cents"} ! (d.inh) ; attr => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent"}} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep ; attr => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = (n.s ! attr) ++ "mille"} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! attr) ++ "mille" ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
94
examples/numerals/french_belgian.gf
Normal file
94
examples/numerals/french_belgian.gf
Normal file
@@ -0,0 +1,94 @@
|
||||
concrete french_belgian of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
param Nm = sg | pl ;
|
||||
param Place
|
||||
= indep -- stands by itself; as "cents" in "deux cents"
|
||||
| attr ; -- as in "deux cent trois"
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {inh1 : Nm; -- Nm = pl => quarante et un
|
||||
-- Nm = sg => quatre-vingt-un
|
||||
-- (governs whether "et" is required between tens and units)
|
||||
s : DForm => Str} ;
|
||||
lincat Sub10 = {inh : Nm ; s : {p2 : Place} => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{inh1 = sg ; s = table {unit => "deux" ; teen => "douze" ; ten => "vingt" }} ;
|
||||
lin n3 =
|
||||
{inh1 = sg ; s = table {unit => "trois" ; teen => "treize" ; ten => "trente" }} ;
|
||||
lin n4 =
|
||||
{inh1 = sg ; s = table {unit => "quatre" ; teen => "quatorze" ; ten => "quarante" }} ;
|
||||
lin n5 =
|
||||
{inh1 = sg ; s = table {unit => "cinq" ; teen => "quinze" ; ten => "cinquante" }} ;
|
||||
lin n6 =
|
||||
{inh1 = sg ; s = table {unit => "six" ; teen => "seize" ; ten => "soixante" }} ;
|
||||
lin n7 =
|
||||
{inh1 = sg ; s = table {unit => "sept" ; teen => "dix" ++ "-" ++ "sept" ; ten => "septante" }} ;
|
||||
lin n8 =
|
||||
{inh1 = pl ; s = table {unit => "huit" ; teen => "dix" ++ "-" ++ "huit" ; ten => "quatre-vingt" }} ;
|
||||
lin n9 =
|
||||
{inh1 = sg ; s = table {unit => "neuf" ; teen => "dix" ++ "-" ++ "neuf" ; ten => "nonante" }} ;
|
||||
lin pot01 =
|
||||
{inh = sg ;
|
||||
s = table {{p2 = indep} => "un" ;
|
||||
{p2 = attr} => [] }};
|
||||
|
||||
lin pot0 d =
|
||||
{inh = pl ;
|
||||
s = table {{p2 = indep} => d.s ! unit ;
|
||||
{p2 = attr} => d.s ! unit }} ;
|
||||
|
||||
oper pluralMark = table {sg => ""; pl => "s"};
|
||||
|
||||
lin pot110 =
|
||||
{s = table {indep => "dix" ; attr => "dix"}} ;
|
||||
lin pot111 =
|
||||
{s = table {indep => "onze" ; attr => "onze"}} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {indep => d.s ! teen ; attr => d.s ! teen}} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {indep => n.s ! {p1 = unit ; p2 = indep} ; attr => n.s ! {p1 = unit ; p2 = attr}}} ;
|
||||
lin pot1 d =
|
||||
{s = table {indep => (d.s ! ten) ++ (pluralMark ! d.inh1); attr => d.s ! ten}} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep =>
|
||||
(d.s ! ten) ++ (table {{p1 = sg ; p2 = sg} => "et" ;
|
||||
{p1 = sg ; p2 = pl} => "-" ;
|
||||
{p1 = pl ; p2 = sg} => "-" ;
|
||||
{p1 = pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++
|
||||
e.s ! {p2 = indep} ;
|
||||
attr =>
|
||||
(d.s ! ten) ++ (table {{p1 = sg ; p2 = sg} => "et" ;
|
||||
{p1 = sg ; p2 = pl} => "-" ;
|
||||
{p1 = pl ; p2 = sg} => "-" ;
|
||||
{p1 = pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++
|
||||
e.s ! {p2 = indep}}} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {indep => n.s ! indep ; attr => n.s ! attr}} ;
|
||||
|
||||
lin pot2 d =
|
||||
{s = table {indep =>
|
||||
(d.s ! {p1 = unit ; p2 = attr}) ++
|
||||
table {sg => "cent" ; pl => "cents"} ! (d.inh) ;
|
||||
attr =>
|
||||
(d.s ! {p1 = unit ; p2 = attr}) ++
|
||||
"cent"}} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep ;
|
||||
attr => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
|
||||
lin pot3 n =
|
||||
{s = (n.s ! attr) ++ "mille"} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! attr) ++ "mille" ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
91
examples/numerals/french_swiss.gf
Normal file
91
examples/numerals/french_swiss.gf
Normal file
@@ -0,0 +1,91 @@
|
||||
concrete french_swiss of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
param Nm = sg | pl ;
|
||||
param Place
|
||||
= indep -- stands by itself; as "cents" in "deux cents"
|
||||
| attr ; -- as in "deux cent trois"
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {inh1 : Nm; -- Nm = pl => quarante et un
|
||||
-- Nm = sg => quatre-vingt-un
|
||||
-- (governs whether "et" is required between tens and units)
|
||||
s : DForm => Str} ;
|
||||
lincat Sub10 = {inh : Nm ; s : {p2 : Place} => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{inh1 = sg ; s = table {unit => "deux" ; teen => "douze" ; ten => "vingt" }} ;
|
||||
lin n3 =
|
||||
{inh1 = sg ; s = table {unit => "trois" ; teen => "treize" ; ten => "trente" }} ;
|
||||
lin n4 =
|
||||
{inh1 = sg ; s = table {unit => "quatre" ; teen => "quatorze" ; ten => "quarante" }} ;
|
||||
lin n5 =
|
||||
{inh1 = sg ; s = table {unit => "cinq" ; teen => "quinze" ; ten => "cinquante" }} ;
|
||||
lin n6 =
|
||||
{inh1 = sg ; s = table {unit => "six" ; teen => "seize" ; ten => "soixante" }} ;
|
||||
lin n7 =
|
||||
{inh1 = sg ; s = table {unit => "sept" ; teen => "dix" ++ "-" ++ "sept" ; ten => "septante" }} ;
|
||||
lin n8 =
|
||||
{inh1 = pl ; s = table {unit => "huit" ; teen => "dix" ++ "-" ++ "huit" ; ten => "huitante" }} ;
|
||||
lin n9 =
|
||||
{inh1 = pl ; s = table {unit => "neuf" ; teen => "dix" ++ "-" ++ "neuf" ; ten => "nonante" }} ;
|
||||
lin pot01 =
|
||||
{inh = sg ;
|
||||
s = table {{p2 = indep} => "un" ;
|
||||
{p2 = attr} => [] }};
|
||||
|
||||
lin pot0 d =
|
||||
{inh = pl ;
|
||||
s = table {{p2 = indep} => d.s ! unit ;
|
||||
{p2 = attr} => d.s ! unit }} ;
|
||||
|
||||
lin pot110 =
|
||||
{s = table {indep => "dix" ; attr => "dix"}} ;
|
||||
lin pot111 =
|
||||
{s = table {indep => "onze" ; attr => "onze"}} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {indep => d.s ! teen ; attr => d.s ! teen}} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {indep => n.s ! {p1 = unit ; p2 = indep} ; attr => n.s ! {p1 = unit ; p2 = attr}}} ;
|
||||
lin pot1 d =
|
||||
{s = table {indep => d.s ! ten ; attr => d.s ! ten}} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep =>
|
||||
(d.s ! ten) ++ (table {{p1 = sg ; p2 = sg} => "et" ;
|
||||
{p1 = sg ; p2 = pl} => "-" ;
|
||||
{p1 = pl ; p2 = sg} => "-" ;
|
||||
{p1 = pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++
|
||||
e.s ! {p2 = indep} ;
|
||||
attr =>
|
||||
(d.s ! ten) ++ (table {{p1 = sg ; p2 = sg} => "et" ;
|
||||
{p1 = sg ; p2 = pl} => "-" ;
|
||||
{p1 = pl ; p2 = sg} => "-" ;
|
||||
{p1 = pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++
|
||||
e.s ! {p2 = indep}}} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {indep => n.s ! indep ; attr => n.s ! attr}} ;
|
||||
|
||||
lin pot2 d =
|
||||
{s = table {indep =>
|
||||
(d.s ! {p1 = unit ; p2 = attr}) ++
|
||||
table {sg => "cent" ; pl => "cents"} ! (d.inh) ;
|
||||
attr =>
|
||||
(d.s ! {p1 = unit ; p2 = attr}) ++
|
||||
"cent"}} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep ;
|
||||
attr => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = (n.s ! attr) ++ "mille"} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! attr) ++ "mille" ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
53
examples/numerals/fulfulde.gf
Normal file
53
examples/numerals/fulfulde.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete fulfulde of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl | two;
|
||||
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = Form ;
|
||||
lincat Sub10 = Form ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO: Encoding
|
||||
|
||||
oper mkNum = ss ;
|
||||
|
||||
oper ss : Str -> Form = \f -> {s = f ; size = pl } ;
|
||||
|
||||
-- lin n1 = mkNum "go'o" ;
|
||||
lin n2 = {s = "d.id.i" ; size = two } ;
|
||||
lin n3 = mkNum "tati" ;
|
||||
lin n4 = mkNum "nai" ;
|
||||
lin n5 = mkNum "jowi" ;
|
||||
lin n6 = mkNum "jowe:go" ;
|
||||
lin n7 = mkNum "jowe:d.id.i" ;
|
||||
lin n8 = mkNum "jowe:tati" ;
|
||||
lin n9 = mkNum "jowe:nai" ;
|
||||
|
||||
lin pot01 = {s = "go'o" ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "sappo" ;
|
||||
lin pot111 = ss ("sappo" ++ "e" ++ "go'o") ;
|
||||
lin pot1to19 d = ss ("sappo" ++ "e" ++ d.s) ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = ss (mkten d.size d.s) ;
|
||||
lin pot1plus d e = ss ((mkten d.size d.s) ++ "e" ++ e.s) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (mkhund d.size d.s) ;
|
||||
lin pot2plus d e = ss ((mkhund d.size d.s) ++ "e" ++ e.s) ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = ss (mkthou n.size n.s) ;
|
||||
lin pot3plus n m = ss ((mkthou n.size n.s) ++ m.s) ;
|
||||
|
||||
oper mkten : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {two => "no:gas" ; _ => "chappand.e" ++ attr } ! sz ;
|
||||
oper mkhund : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {sg => "temerre" ; _ => "temed.d.e" ++ attr} ! sz ;
|
||||
oper mkthou : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {sg => "ujine:re"; _ => variants {"ujine" ++ attr ; "ujine:je" ++ attr}} ! sz ;
|
||||
|
||||
}
|
||||
126
examples/numerals/geez.gf
Normal file
126
examples/numerals/geez.gf
Normal file
@@ -0,0 +1,126 @@
|
||||
concrete geez of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=ethiopic ;
|
||||
|
||||
-- No long consonants marked in the indigen. script
|
||||
-- s is set intersection s
|
||||
-- h is set union h
|
||||
-- H is three-fork h
|
||||
-- x is hook-looking h
|
||||
-- L is sin-looking s
|
||||
-- X is h looking like k with a roof
|
||||
-- Z is zh
|
||||
-- $ is sh
|
||||
-- ) is the glottal stop hamza = independent vowel in word
|
||||
-- ( is 3ayn
|
||||
-- Capitalis for ejectives KPTCS
|
||||
-- stress not indicated in indigen. script
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param Size = sg | less100 | more100 ;
|
||||
param Ending = zero | nonzero | tenzero;
|
||||
param S100 = tenp | tenpalf | unitp ;
|
||||
param S1000 = indep | alf | tenm | tailform ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; s2 : S100 => Str ; unitp_ending : Ending ; size : Size} ;
|
||||
lincat Sub1000 = {s : S1000 => Str ; ending : Ending ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- The Ethiopic script environment
|
||||
lin n2 = mkNum "ክልኤቱ" "ዕሽራ" ;
|
||||
lin n3 = mkNum "ሠላስቱ" "ሠላሳ" ;
|
||||
lin n4 = mkNum "አርባዕቱ" "አርብዓ" ;
|
||||
lin n5 = mkNum "ኀምስቱ" "ኀምሳ" ;
|
||||
lin n6 = mkNum "ስድስቱ" "ስስሳ" ;
|
||||
lin n7 = mkNum (variants { "ሰብዐቱ" ; "ሰብዓቱ" }) "ሰብዓ" ;
|
||||
lin n8 = mkNum (variants { "ሰማንቱ" ; "ሰማኒቱ" }) "ሰማንያ" ;
|
||||
lin n9 = mkNum (variants { "ትስዐቱ" ; "ተስዐቱ" ; "ተሳዕቱ" }) (variants {"ተስዓ" ; "ትስዓ"}) ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \tva -> \tjugo ->
|
||||
{s = table {unit => tva ; ten => tjugo} ; size = less100 } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "አሐዱ" ; ten => "ዐሸርቱ" } ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "ዐሸርቱ" ;
|
||||
s2 = table {tenp => "ወ" ++ "አሐዱ" ;
|
||||
tenpalf => "እልፍ" ;
|
||||
unitp => [] } ;
|
||||
unitp_ending = zero ;
|
||||
size = less100} ;
|
||||
lin pot111 = {s = "ዐሸርቱ" ++ "ወ" ++ "አሐዱ" ;
|
||||
s2 = table {tenp => "ወ" ++ "አሐዱ" ;
|
||||
tenpalf => "እልፍ" ;
|
||||
unitp => "ዐሸርቱ" } ;
|
||||
unitp_ending = nonzero ;
|
||||
size = less100} ;
|
||||
lin pot1to19 d =
|
||||
{s = "ዐሸርቱ" ++ "ወ" ++ d.s ! unit ;
|
||||
s2 = table {tenp => "ወ" ++ "አሐዱ" ;
|
||||
tenpalf => "እልፍ" ;
|
||||
unitp => d.s ! ten } ;
|
||||
unitp_ending = nonzero ;
|
||||
size = less100} ;
|
||||
lin pot0as1 n =
|
||||
{s = n.s ! unit ;
|
||||
s2 = table {unitp => n.s ! ten ; _ => [] };
|
||||
unitp_ending = nonzero ;
|
||||
size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = d.s ! ten ;
|
||||
s2 = table {tenp => "ወ" ++ d.s ! unit ;
|
||||
tenpalf => d.s ! unit ++ "እልፍ" ;
|
||||
unitp => [] } ;
|
||||
unitp_ending = tenzero ;
|
||||
size = less100} ;
|
||||
lin pot1plus d e =
|
||||
{s = d.s ! ten ++ "ወ" ++ e.s ! unit ;
|
||||
s2 = table {tenp => "ወ" ++ d.s ! unit ;
|
||||
tenpalf => d.s ! unit ++ "እልፍ" ;
|
||||
unitp => e.s ! ten } ;
|
||||
unitp_ending = nonzero ;
|
||||
size = less100} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {indep => n.s ;
|
||||
tailform => n.s ;
|
||||
tenm => n.s2 ! unitp ;
|
||||
alf => n.s2 ! tenpalf ++ n.s2 ! unitp } ;
|
||||
ending = n.unitp_ending ;
|
||||
size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {indep => table {sg => "ምእት" ; _ => d.s ! unit ++ "ምእት" } ! d.size ;
|
||||
tenm => "ዱምምይ" ;
|
||||
alf => d.s ! ten ++ "እልፍ" ;
|
||||
tailform => d.s ! unit ++ "ምእት" } ;
|
||||
size = more100 ;
|
||||
ending = zero} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => table {sg => "ምእት" ; _ => d.s ! unit ++ "ምእት" } ! d.size ++ e.s ;
|
||||
tenm => "ዱምምይ";
|
||||
alf => d.s ! ten ++ e.s2 ! tenp ++ "እልፍ" ++ e.s2 ! unitp ;
|
||||
tailform => d.s ! unit ++ "ምእት" ++ e.s} ;
|
||||
size = more100 ;
|
||||
ending = e.unitp_ending } ;
|
||||
|
||||
lin pot2as3 n = {s = n.s ! indep } ;
|
||||
lin pot3 n =
|
||||
{s = table {more100 => mkmit n.ending (n.s ! alf) ; _ => n.s ! tenm ++ "ምእት"} ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table
|
||||
{more100 => table {more100 => n.s ! alf ; less100 => n.s ! alf ; _ => n.s ! tenm} ! n.size ++
|
||||
table {zero => m.s ! indep ;
|
||||
tenzero => m.s ! indep ;
|
||||
nonzero => "ወ" ++ m.s ! tailform } ! n.ending;
|
||||
_ => table {more100 => mkmit n.ending (n.s ! alf) ;
|
||||
less100 => n.s ! alf ++ table {nonzero => "ምእት" ; _ => []} ! n.ending ;
|
||||
_ => n.s ! tenm ++ "ምእት"} ! n.size ++ m.s ! indep} ! m.size } ;
|
||||
|
||||
oper mkmit : Ending -> Str -> Str = \e -> \s -> table {zero => [] ; _ => s ++"ምእት" } ! e;
|
||||
|
||||
}
|
||||
52
examples/numerals/german.gf
Normal file
52
examples/numerals/german.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
concrete german of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
param Place = indep | prae | attr ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm*Place => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkZahl : Str -> Str -> Str -> LinDigit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {unit => två ; teen => tolv ; ten => tjugo}} ;
|
||||
oper regZahl : Str -> LinDigit =
|
||||
\vier -> mkZahl vier (vier + "zehn") (vier + "zig") ;
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkZahl "zwei" "zwölf" "zwanzig" ;
|
||||
lin n3 = mkZahl "drei" "dreizehn" "dreissig" ;
|
||||
lin n4 = regZahl "vier" ;
|
||||
lin n5 = regZahl "fünf" ;
|
||||
lin n6 = mkZahl "sechs" "sechzehn" "sechzig" ;
|
||||
lin n7 = mkZahl "sieben" "siebzehn" "siebzig" ;
|
||||
lin n8 = regZahl "acht" ;
|
||||
lin n9 = regZahl "neun" ;
|
||||
|
||||
lin pot01 = {s = table {<f,indep> => "eins" ; <f,prae> => "ein" ; <f,attr> => []}} ;
|
||||
lin pot0 d = {s = table {<f,p> => d.s ! f}} ;
|
||||
lin pot110 = {s = table {p => "zehn"}} ;
|
||||
lin pot111 = {s = table {p => "elf"}} ;
|
||||
lin pot1to19 d = {s = table {p => d.s ! teen}} ;
|
||||
lin pot0as1 n = {s = table {p => n.s ! <unit,p>}} ;
|
||||
lin pot1 d = {s = table {p => d.s ! ten}} ;
|
||||
lin pot1plus d e = {s = table {p => e.s ! <unit,prae> ++ "und" ++ d.s ! ten}} ;
|
||||
lin pot1as2 n = {s = table {p => n.s ! p}} ;
|
||||
lin pot2 d = {s = table {p => d.s ! <unit,attr> ++ "hundert"}} ;
|
||||
lin pot2plus d e = {s = table {
|
||||
attr => d.s ! <unit,attr> ++ "hundert" ++ e.s ! prae ;
|
||||
_ => d.s ! <unit,attr> ++ "hundert" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n = ss (n.s ! indep) ;
|
||||
lin pot3 n = ss (n.s ! attr ++ "tausend") ;
|
||||
lin pot3plus n m = ss (n.s ! attr ++ "tausend" ++ m.s ! prae) ;
|
||||
|
||||
|
||||
}
|
||||
204
examples/numerals/greek_classical.gf
Normal file
204
examples/numerals/greek_classical.gf
Normal file
@@ -0,0 +1,204 @@
|
||||
concrete greek_classical of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=greek ;
|
||||
|
||||
-- Classical Greek (of Athens)
|
||||
-- Aarne's transliteration
|
||||
-- There are attested variant forms. kai:s between the elements in bigger ->
|
||||
-- smaller order is also possible but not common.
|
||||
|
||||
param DForm = unit | tkismyr | teen | ten | hund | kisxil | kismyr |
|
||||
tenkismyr | tenkis ;
|
||||
param InterData = indep Order | xiliad | myriad Order ;
|
||||
param Tenpart = kis1 | tkis1 ;
|
||||
param Size = sg | pl | tenoverpl ;
|
||||
param Order = des | asc;
|
||||
lincat Numeral = {s : Str} ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
oper LinSub1000 = {s : InterData => Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ;
|
||||
size : Size} ;
|
||||
lincat Sub100 = {s : InterData => Str ;
|
||||
s1 : Tenpart => Str ;
|
||||
s2 : Str ;
|
||||
size : Size} ;
|
||||
lincat Sub1000 = LinSub1000 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- Greek environment
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\dyo -> \dis -> \dwdekakis -> \dwdeka -> \eikosi -> \diakosioi ->
|
||||
\eikosakis ->
|
||||
{s = table {unit => dyo ;
|
||||
tkismyr => dwdekakis + "μύριοι" ;
|
||||
teen => dwdeka ;
|
||||
ten => eikosi ;
|
||||
hund => diakosioi ;
|
||||
kisxil => dis + "χίλιοι" ;
|
||||
kismyr => dis + "μύριοι" ;
|
||||
tenkis => eikosakis ;
|
||||
tenkismyr => eikosakis + "μύριοι"} };
|
||||
|
||||
lin n2 = mkNum
|
||||
"δύο"
|
||||
"δισ"
|
||||
"δωδεκακισ"
|
||||
"δώδεκα"
|
||||
"εἴκοσι"
|
||||
"διακόσιοι"
|
||||
"εἰκοσάκισ" ;
|
||||
|
||||
lin n3 = mkNum
|
||||
"τρεῖς"
|
||||
"τρισ"
|
||||
"τρεισκαιδεκακισ"
|
||||
(variants {"τρεῖς" ++ "καὶ" ++ "δέκα" ; "τρεισκαίδεκα"} )
|
||||
"τριάκοντα"
|
||||
"τριακόσιοι"
|
||||
"τριακοντάκισ" ;
|
||||
|
||||
lin n4 = mkNum
|
||||
"τέτταρες"
|
||||
"τετρακισ"
|
||||
"τετταρεσκαιδεκακισ"
|
||||
(variants {"τέτταρες" ++ "καὶ" ++ "δέκα" ; "τετταρεσκαίδεκα"})
|
||||
"τετταράκοντα"
|
||||
"τετρακόσιοι"
|
||||
"τετταρακοντάκισ" ;
|
||||
|
||||
lin n5 = mkNum
|
||||
"πέντε"
|
||||
"πεντακισ"
|
||||
"πεντεκαιδεκακισ"
|
||||
"πεντεκαίδεκα"
|
||||
"πεντήκοντα"
|
||||
"πεντακόσιοι"
|
||||
"πεντηκοντάκισ" ;
|
||||
|
||||
lin n6 = mkNum
|
||||
"ἕξ"
|
||||
"ἑξακισ"
|
||||
"ἑκκαιδεκακισ"
|
||||
"ἑκκαίδεκα"
|
||||
"ἑξήκοντα"
|
||||
"ἑξακόσιοι"
|
||||
"ἑξηκοντάκισ" ;
|
||||
|
||||
lin n7 = mkNum
|
||||
"ἑπτά"
|
||||
"ἑπτακισ"
|
||||
"ἑπτακαιδεκακισ"
|
||||
"ἑπτακαίδεκα"
|
||||
"ἑβδομήκοντα"
|
||||
"ἑπτακόσιοι"
|
||||
"ἑβδομηκοντάκισ" ;
|
||||
|
||||
lin n8 = mkNum
|
||||
"ὀκτώ"
|
||||
"ὀκτακισ"
|
||||
"ὀκτωκαιδεκακισ"
|
||||
"ὀκτωκαίδεκα"
|
||||
"ὀγδοήκοντα"
|
||||
"ὀκτακόσιοι"
|
||||
"ὀγδοηκοντάκισ" ;
|
||||
|
||||
lin n9 = mkNum
|
||||
"ἐννέα"
|
||||
"ἐνακισ"
|
||||
"ἐννεακαιδεκακισ"
|
||||
"ἐννεακαίδεκα"
|
||||
"ἐνενήκοντα"
|
||||
"ἐνακόσιοι"
|
||||
"ἐνενηκοντάκισ" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "ἑκατόν" ;
|
||||
kisxil => "χίλιοι" ;
|
||||
kismyr => "ἅπαξ" + "μύριοι" ;
|
||||
_ => "εἵς" } ;
|
||||
size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = pl} ;
|
||||
lin pot110 =
|
||||
{s = table {xiliad => "δψμμυ" ;
|
||||
(myriad _) => "μύριοι" ;
|
||||
(indep _) => "δέκα" };
|
||||
s1 = table {kis1 => "ἅπαξ" + "μύριοι" ; tkis1 => "ἑνδεκάκισ" + "μύριοι"} ;
|
||||
s2 = [] ;
|
||||
size = tenoverpl} ;
|
||||
lin pot111 =
|
||||
{s = table {xiliad => "δψμμυ" ;
|
||||
(myriad des) => "μύριοι" ++ "χίλιοι" ;
|
||||
(myriad asc) => "χίλιοι" ++ "καὶ" ++ "μύριοι" ;
|
||||
(indep _) => "ἕνδεκα" } ;
|
||||
s1 = table {kis1 => "ἅπαξ" + "μύριοι" ; tkis1 => "ἑνδεκάκισ" + "μύριοι"} ;
|
||||
s2 = "χίλιοι" ;
|
||||
size = tenoverpl} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {xiliad => "δψμμυ" ;
|
||||
(myriad des) => "μύριοι" ++ d.s ! kisxil ;
|
||||
(myriad asc) => d.s ! kisxil ++ "καὶ" ++ "μύριοι" ;
|
||||
(indep _) => d.s ! teen } ;
|
||||
s1 = table {kis1 => "ἅπαξ" + "μύριοι" ; tkis1 => "ἑνδεκάκισ" + "μύριοι" } ;
|
||||
s2 = d.s ! kisxil ;
|
||||
size = tenoverpl} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {xiliad => n.s ! kisxil ;
|
||||
(indep _) => n.s ! unit ;
|
||||
(myriad _) => "δψμμυ" } ;
|
||||
s1 = table {_ => []} ;
|
||||
s2 = n.s ! kisxil ;
|
||||
size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {xiliad => "δψμμυ" ;
|
||||
(myriad _) => d.s ! kismyr ;
|
||||
(indep _) => d.s ! ten} ;
|
||||
s1 = table {kis1 => d.s ! kismyr ; tkis1 => d.s ! tkismyr } ;
|
||||
s2 = [];
|
||||
size = tenoverpl} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {xiliad => "δψμμυ" ;
|
||||
(myriad des) => d.s ! kismyr ++ e.s ! kisxil ;
|
||||
(myriad asc) => e.s ! kisxil ++ "καὶ" ++ d.s ! kismyr ;
|
||||
(indep des) => d.s ! ten ++ e.s ! unit ;
|
||||
(indep asc) => e.s ! unit ++ "καὶ" ++ d.s ! ten } ;
|
||||
s1 = table {kis1 => d.s ! kismyr ; tkis1 => d.s ! tkismyr } ;
|
||||
s2 = e.s ! kisxil ;
|
||||
size = tenoverpl} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {(indep _) => d.s ! hund ;
|
||||
(myriad _) => d.s ! tenkismyr;
|
||||
xiliad => "δψμμυ"} ;
|
||||
size = tenoverpl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {(myriad _) => table {sg => e.s1 ! tkis1 ;
|
||||
pl => d.s ! tenkis ++ e.s1 ! kis1 ;
|
||||
tenoverpl => "δψμμυ" } ! d.size ++ e.s2 ;
|
||||
(indep des) => d.s ! hund ++ e.s ! indep des ;
|
||||
(indep asc) => (e.s ! indep asc) ++ "καὶ" ++ d.s ! hund ;
|
||||
xiliad => "δψμμυ" } ;
|
||||
size = tenoverpl} ;
|
||||
|
||||
lin pot2as3 n =
|
||||
{s = variants { n.s ! indep des ; n.s ! indep asc}} ;
|
||||
lin pot3 n =
|
||||
{s = variants {(Myr n des) ! n.size ; (Myr n asc) ! n.size} } ;
|
||||
lin pot3plus n m =
|
||||
{s = variants {(Myr n des) ! n.size ++ m.s ! indep des;
|
||||
m.s ! indep asc ++ "καὶ" ++ (Myr n asc) ! n.size }} ;
|
||||
|
||||
oper Myr : LinSub1000 -> Order -> Size => Str = \n -> \order ->
|
||||
table {sg => "χίλιοι" ;
|
||||
pl => n.s ! xiliad ;
|
||||
tenoverpl => n.s ! myriad order} ;
|
||||
|
||||
|
||||
}
|
||||
76
examples/numerals/greek_modern.gf
Normal file
76
examples/numerals/greek_modern.gf
Normal file
@@ -0,0 +1,76 @@
|
||||
concrete greek_modern of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=greek ;
|
||||
|
||||
-- Free variation on accents on m'ia and d'yo
|
||||
|
||||
oper vowel : Strs = strs {"ε" ; "ο" ; "α" ; "έ" ; "ό" ; "ά"} ;
|
||||
|
||||
param DForm = unit | fem | femteen | teen | ten | hundredneut | hundredfem ;
|
||||
param Use = indep | femattr ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Use => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Use => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- Greek environment
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\dyo -> \dwdeka -> \eikosi -> \diakosi -> \dyofem -> \dwdekafem ->
|
||||
{s = table {unit => dyo ; teen => dwdeka ; ten => eikosi ;
|
||||
hundredneut => diakosi + "α" ; hundredfem => diakosi + "ες" ;
|
||||
fem => dyofem ; femteen => dwdekafem}} ;
|
||||
|
||||
oper mkIndeclNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\dyo -> \dwdeka -> \eikosi -> \diakosi ->
|
||||
{s = table {unit => dyo ; teen => dwdeka ; ten => eikosi ;
|
||||
hundredneut => diakosi + "α" ; hundredfem => diakosi + "ες" ;
|
||||
fem => dyo ; femteen => dwdeka}} ;
|
||||
|
||||
lin n2 = mkIndeclNum "δύο" "δώδεκα" "είκοσι" "διακόσι" ;
|
||||
lin n3 = mkNum "τρία" "δεκατρία" "τριάντα" "τριακόσι" "τρείς" "δεκατρείσ" ;
|
||||
lin n4 = mkNum "τέσσερα" "δεκατέσσερα" "σαράντα" "τετρακόσι" "τέσσερις" "δεκατέσσερις" ;
|
||||
lin n5 = mkIndeclNum "πέντε" "δεκαπέντε" "πενήντα" "πεντακόσι" ;
|
||||
lin n6 = mkIndeclNum "έξι" (variants { "δεκαέξι" ; "δεκαέξι" }) "εξήντα" "εξακόσι" ;
|
||||
lin n7 = mkIndeclNum (variants {"επτά" ; "εφτά" }) "δεκαεφτά" "εβδομήντα" "εφτακόσι" ;
|
||||
lin n8 = mkIndeclNum "οχτώ" "δεκαοχτώ" "ογδόντα" "οχτακόσι" ;
|
||||
lin n9 = mkIndeclNum (variants {"εννέα" ; "εννία" }) "δεκαεννέα" "ενενήντα" "εννιακόσι" ;
|
||||
lin pot01 =
|
||||
{s = table {unit => "ένα" ; fem => "μία" ; _ => "εκατό" + pre {[] ; "ν" / vowel}} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = pl} ;
|
||||
lin pot110 =
|
||||
{s = table {indep => "δέκα" ; femattr => "δέκα"} ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = table {indep => "έντεκα" ; femattr => "έντεκα" } ; size = pl} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {indep => d.s ! teen; femattr => d.s ! femteen } ; size = pl} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {indep => n.s ! unit ; femattr => n.s ! fem } ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {indep => d.s ! ten ; femattr => d.s ! ten } ; size = pl } ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep => d.s ! ten ++ e.s ! unit ; femattr => d.s ! ten ++ e.s ! fem } ; size = pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d =
|
||||
{s = table {indep => d.s ! hundredneut ; femattr => d.s ! hundredfem} ; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => d.s ! hundredneut ++ e.s ! indep ; femattr => d.s ! hundredfem ++ e.s ! femattr} ; size = pl} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep } ;
|
||||
lin pot3 n =
|
||||
{s = (Xilias (n.s ! femattr)) ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = (Xilias (n.s ! femattr)) ! n.size ++ m.s ! indep} ;
|
||||
|
||||
oper Xilias : Str -> Size => Str =
|
||||
\s -> table {sg => "χίλια" ; pl => s ++ "χιλιάδες" } ;
|
||||
|
||||
}
|
||||
50
examples/numerals/guahibo.gf
Normal file
50
examples/numerals/guahibo.gf
Normal file
@@ -0,0 +1,50 @@
|
||||
concrete guahibo of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper All = {s : Str ; size : Size};
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = All ;
|
||||
lincat Sub10 = All ;
|
||||
lincat Sub100 = All ;
|
||||
lincat Sub1000 = All ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> All = \tri ->
|
||||
{ s = tri ; size = pl};
|
||||
|
||||
lin num x = {s = x.s } ;
|
||||
|
||||
lin n2 = mkNum "aniha" ;
|
||||
lin n3 = mkNum "akueya" ;
|
||||
lin n4 = mkNum "yana" ;
|
||||
lin n5 = mkNum "kobe" ;
|
||||
lin n6 = mkNum "ku" ;
|
||||
lin n7 = mkNum "iwi" ;
|
||||
lin n8 = mkNum "yu" ;
|
||||
lin n9 = mkNum "ho" ;
|
||||
|
||||
oper ss : Str -> All = \s1 -> {s = s1 ; size = pl } ;
|
||||
|
||||
lin pot01 = { s = "kae" ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "xu" ;
|
||||
lin pot111 = ss ("xu" + "kae") ;
|
||||
lin pot1to19 d = ss (bind "xu" d.s) ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = ss (bind d.s "bae" );
|
||||
lin pot1plus d e = ss ((bind d.s "bae") ++ e.s ) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (bind ((selsg d.s) ! d.size) "sia" ) ;
|
||||
lin pot2plus d e = ss ((bind ((selsg d.s) ! d.size) "sia") ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = bind ((selsg n.s) ! n.size) "sunu" } ;
|
||||
lin pot3plus n m = {s = (bind ((selsg n.s) ! n.size) "sunu") ++ m.s} ;
|
||||
|
||||
oper selsg : Str -> Size => Str = \s -> table {sg => [] ; pl => s } ;
|
||||
|
||||
}
|
||||
53
examples/numerals/guarani.gf
Normal file
53
examples/numerals/guarani.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete guarani of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper All = {s : Str ; s2 : Str ; size : Size};
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = All ;
|
||||
lincat Sub10 = All ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> All = \tri ->
|
||||
{ s = tri ; s2 = "kua" + tri ; size = pl};
|
||||
|
||||
oper mkNum2 : Str -> Str -> All = \tri -> \teen ->
|
||||
{ s = tri ; s2 = "kua" + teen ; size = pl};
|
||||
|
||||
lin num x = {s = x.s } ; -- TODO
|
||||
|
||||
lin n2 = mkNum2 "moko~i" "ko~i";
|
||||
lin n3 = mkNum2 "mpohapy" "py";
|
||||
lin n4 = mkNum2 "irundy" "rundy";
|
||||
lin n5 = mkNum "po" ;
|
||||
lin n6 = mkNum "potei~" ;
|
||||
lin n7 = mkNum "poko~i" ;
|
||||
lin n8 = mkNum "poapy" ;
|
||||
lin n9 = mkNum "porundy" ;
|
||||
|
||||
oper ss : Str -> {s : Str ; size : Size} = \s1 -> {s = s1 ; size = pl } ;
|
||||
|
||||
lin pot01 = { s = "petei~" ; s2 = "dummy" ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "kua~" ;
|
||||
lin pot111 = ss ("kua" + "tei~") ;
|
||||
lin pot1to19 d = ss d.s2 ;
|
||||
lin pot0as1 n = {s = n.s ; size = n.size} ;
|
||||
lin pot1 d = ss (bind d.s "kua~" );
|
||||
lin pot1plus d e = ss ((bind d.s "kua~") ++ e.s ) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (((selsg d.s) ! d.size) ++ "sa~" ) ;
|
||||
lin pot2plus d e = ss ((((selsg d.s) ! d.size) ++ "sa~") ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = bind ((selsg n.s) ! n.size) "ma" } ;
|
||||
lin pot3plus n m = {s = (bind ((selsg n.s) ! n.size) "ma") ++ m.s} ;
|
||||
|
||||
oper selsg : Str -> Size => Str = \s -> table {sg => variants {[]; "petei~"}; pl => s } ;
|
||||
|
||||
}
|
||||
93
examples/numerals/hebrew_biblical.gf
Normal file
93
examples/numerals/hebrew_biblical.gf
Normal file
@@ -0,0 +1,93 @@
|
||||
concrete hebrew_biblical of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=hebrew ;
|
||||
|
||||
param DForm = unit Place | cons | ten | hund ;
|
||||
param Size = small | large | dual ;
|
||||
param Place = attr | indep ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Hebrew environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {(unit attr) => [] ;
|
||||
(unit indep) => "שנים" ;
|
||||
cons => "שני" ;
|
||||
ten => "עשרים" ;
|
||||
hund => "מאתים"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "שלשה" ;
|
||||
cons => "שלשת" ;
|
||||
ten => "שלשים" ;
|
||||
hund => "שלש" ++ "מאות"} ; size = small} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "ארבעה" ;
|
||||
cons => "ארבעת" ;
|
||||
ten => "ארבעים" ;
|
||||
hund => "ארבע" ++ "מאות"} ; size = small} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "חמשה" ;
|
||||
cons => "חמשת" ;
|
||||
ten => "חמשים" ;
|
||||
hund => "חמש" ++ "מאות"} ; size = small} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "ששה" ;
|
||||
cons => "ששת" ;
|
||||
ten => "ששים" ;
|
||||
hund => "שש" ++ "מאות"} ; size = small} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "שבעה" ;
|
||||
cons => "שבעת" ;
|
||||
ten => "שבעים" ;
|
||||
hund => "שבע" ++ "מאות"} ; size = small} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "שמנה" ;
|
||||
cons => "שמנת" ;
|
||||
ten => "שמנים" ;
|
||||
hund => "שמנה" ++ "מאות"} ; size = small} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "תשעה" ;
|
||||
cons => "תשעת" ;
|
||||
ten => "תשעים" ;
|
||||
hund => "תשע" ++ "מאות"} ; size = small} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "מאה"; (unit attr) => [] ; f => "אחד"} ; size = large} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "עשר"} ; size = small} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => variants {"אחד" ++ "עשר" ; "עשתי" ++ "עשר"} } ; size = large} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! unit indep ++ "עשר"} ; size = large} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! unit p} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten} ; size = large} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => d.s ! ten ++ "ו" ++ e.s ! unit indep} ; size = large} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {_ => d.s ! hund} ; size = large} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {_ => d.s ! hund ++ "ו" ++ e.s ! indep} ; size = large} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ Alf ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ Alf ! n.size ++ "ו" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{small} => "אלפים" ; {dual} => "אלפים" ; _ => "אלף"} ;
|
||||
|
||||
|
||||
}
|
||||
107
examples/numerals/hindi.gf
Normal file
107
examples/numerals/hindi.gf
Normal file
@@ -0,0 +1,107 @@
|
||||
concrete hindi of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=devanagari ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ;
|
||||
param Size = sing | less100 | more100 ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : DSize} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : DSize} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Devana:gari environment
|
||||
|
||||
|
||||
-- H is for aspiration (h is a sepaarate letter)
|
||||
-- M is anusvara
|
||||
-- ~ is candrabindhu
|
||||
-- c is is Eng. ch in e.g chop
|
||||
-- cH is chH
|
||||
-- _: is length
|
||||
-- T, D, R are the retroflexes
|
||||
|
||||
oper mkNum : Str -> Str -> DSize -> LinDigit =
|
||||
\do -> \bis -> \sz ->
|
||||
{s = table {unit => do ; ten => bis } ;
|
||||
size = sz } ;
|
||||
|
||||
-- lin n1 mkNum "एक" "ग्यारह" "दस"
|
||||
lin n2 = mkNum "दो" "बीस" r2 ;
|
||||
lin n3 = mkNum "तीन" "तीस" r3 ;
|
||||
lin n4 = mkNum "चार" "चालीस" r4 ;
|
||||
lin n5 = mkNum "पाँ्न्च" "पचास" r5 ;
|
||||
lin n6 = mkNum (variants {"छह" ; "छः" ; "छै"}) "साठ" r6 ;
|
||||
lin n7 = mkNum "सात" "सत्तर" r7;
|
||||
lin n8 = mkNum "आठ" "अस्सी" r8;
|
||||
lin n9 = mkNum "नौ" (variants {"नव्वे" ; "नब्बे" }) r9 ;
|
||||
|
||||
oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table {
|
||||
sg => a1 + "अह" ;
|
||||
r2 => a2 + "ईस" ;
|
||||
r3 => a3 + "तीस" ;
|
||||
r4 => a4 + "आलीस" ;
|
||||
r5 => a5 + "अन" ;
|
||||
r6 => a6 + "सठ" ;
|
||||
r7 => a7 + "हत्तर" ;
|
||||
r8 => a8 + "आसी" ;
|
||||
r9 => a9 + "आनवे"
|
||||
} ;
|
||||
|
||||
oper rows : DSize => DSize => Str = table {
|
||||
sg => mkR "ग्यार" "इक्क" "इकत" "एक्त" "इक्याव" "इक" "इक" "इक्य" "इक्य" ;
|
||||
r2 => mkR "बार" "बा" "बत" "बय" "बाव" "बा" "ब" "बय" "ब" ;
|
||||
r3 => mkR "तेर" "ते" "तैं" "तैंत" "तिर्प" "तिर" "ति" "तिर" "तिर" ;
|
||||
r4 => mkR "चौद" "चौब" "चौं" "चव" "चौप" "चौं" "चौ" "चौर" "चौर" ;
|
||||
r5 => mkR "पंद्र" "पच्च" "पैं" "पैंत" "पच्प" "पैं" "पच" "पच" "पच" ;
|
||||
r6 => mkR "सोल" "छब्ब" "छत" "छिय" "छप्प" "छिया" "छि" "छिय" "छिय" ;
|
||||
r7 => mkR (variants { "सत्त्र" ; "सत्र"}) "सत्ताव" "सैं" "सैंत" "सत्ता" "सर" "सत" (variants {"सत्त" ; "सत" }) "सत्त" ;
|
||||
r8 => mkR "अठार" "अट्ठा" "अR" "अR्त" "अट्ठाव" "अR" "अठ" (variants { "अट्ठ" ; "अठ" }) "अट्ठ" ;
|
||||
r9 => table {sg => "उन्नीस" ; r2 => "उनतीस" ; r3 => "उनतालीस" ;
|
||||
r4 => "उनचास" ; r5 => "उनसठ" ; r6 => "उनहत्तर" ;
|
||||
r7 => (variants{"उन्नासी" ; "उन्यासी"}) ;
|
||||
r8 => "नवासी" ; r9 => "निन्यानवे" }
|
||||
} ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "एक" ; _ => "दुम्म्य" } ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "दस" ; size = less100} ;
|
||||
lin pot111 = {s = rows ! sg ! sg ; size = less100} ;
|
||||
lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = table {sg => sing ; _ => less100} ! n.size } ;
|
||||
|
||||
lin pot1 d = {s = d.s ! ten ; size = less100} ;
|
||||
lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100} ;
|
||||
|
||||
lin pot1as2 n = {s = n.s ; s2 = "दुम्म्य" ; size = n.size } ;
|
||||
lin pot2 d = {s = (mksau (d.s ! unit) d.size) ;
|
||||
s2 = d.s ! unit ++ "लाख" ; size = more100} ;
|
||||
lin pot2plus d e =
|
||||
{s = (mksau (d.s ! unit) d.size) ++ e.s ;
|
||||
s2 = (d.s ! unit) ++ "लाख" ++ (mkhazar e.s e.size) ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = table { sing => ekhazar ;
|
||||
less100 => n.s ++ "हज़ार" ;
|
||||
more100 => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {sing => ekhazar ;
|
||||
less100 => n.s ++ "हज़ार" ;
|
||||
more100 => n.s2 } ! n.size ++ m.s} ;
|
||||
|
||||
|
||||
oper ekhazar : Str = variants {"हज़ार" ; "एक" ++ "हज़ार"} ;
|
||||
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "हज़ार"} ! sz ;
|
||||
oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "सौ" ; _ => s ++ "सौ"} ! sz ;
|
||||
|
||||
}
|
||||
64
examples/numerals/hungarian.gf
Normal file
64
examples/numerals/hungarian.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
concrete hungarian of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- by Patrik Jansson, Chalmers
|
||||
|
||||
param DForm = ental | tiotal ;
|
||||
param Place = attr | indep ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : (DForm*Place) => Str} ;
|
||||
lincat Sub10 = {s : (DForm*Place) => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{s = table {<ental,indep> => "kettö" ;
|
||||
<tiotal,indep> => "húsz" ;
|
||||
<ental,attr> => "két" ;
|
||||
<tiotal, attr> => "huszon"}} ;
|
||||
lin n3 =
|
||||
{s = table {<ental,p> => "három" ; <tiotal,p> => "harminc"}} ;
|
||||
lin n4 =
|
||||
{s = table {<ental,p> => "négy" ; <tiotal,p> => "negyven"}} ;
|
||||
lin n5 =
|
||||
{s = table {<ental,p> => "öt" ; <tiotal,p> => "ötven"}} ;
|
||||
lin n6 =
|
||||
{s = table {<ental,p> => "hat" ; <tiotal,p> => "hatvan"}} ;
|
||||
lin n7 =
|
||||
{s = table {<ental,p> => "hét" ; <tiotal,p> => "hetven"}} ;
|
||||
lin n8 =
|
||||
{s = table {<ental,p> => "nyolc" ; <tiotal,p> => "nyolcvan"}} ;
|
||||
lin n9 =
|
||||
{s = table {<ental,p> => "kilenc" ; <tiotal,p> => "kilencven"}} ;
|
||||
lin pot01 =
|
||||
{s = table {<f,attr> => [] ; <f,indep> => "egy"}} ;
|
||||
lin pot0 d =
|
||||
{s = table {<f,p> => d.s ! <f,p>}} ;
|
||||
lin pot110 =
|
||||
{s = table {p => "tíz"}} ;
|
||||
lin pot111 =
|
||||
{s = table {p => "tizen" ++ "egy"}} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {p => "tizen" ++ d.s ! <ental,indep>}} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! <ental,p>}} ;
|
||||
lin pot1 d =
|
||||
{s = table {p => d.s ! <tiotal,indep>}} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {p => (d.s ! <tiotal,attr>) ++ e.s ! <ental,indep>}} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {p => n.s ! p}} ;
|
||||
lin pot2 d =
|
||||
{s = table {p => (d.s ! <ental,attr>) ++ "száz"}} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {p => (d.s ! <ental,attr>) ++ "száz" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ "ezer"} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ "ezer" ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
56
examples/numerals/icelandic.gf
Normal file
56
examples/numerals/icelandic.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
concrete icelandic of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten | neuter ;
|
||||
param Gen = com | neut ;
|
||||
param Size = sg | less10 | pl ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Gen => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Gen => Str ; size : Size} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\two -> \twelve -> \twenty -> \tvo ->
|
||||
{s = table {unit => two ; teen => twelve ; ten => twenty ; neuter => tvo}} ;
|
||||
oper regNum : Str -> LinDigit =
|
||||
\fimm -> mkNum fimm (fimm + "tán") (fimm + "tíu") fimm;
|
||||
|
||||
oper ss : Str -> {s : Gen => Str ; size : Size} = \s -> {s = table {_ => s } ; size = pl};
|
||||
|
||||
lin num x = x ;
|
||||
lin n2 = mkNum "tveir" "tólf" "tuttugu" "tvö" ;
|
||||
lin n3 = mkNum "Þrír" "Þréttán" "Þrjátíu" "Þrjú" ;
|
||||
lin n4 = mkNum "fjórir" "fjórtán" "fjörutíu" "fjögur";
|
||||
lin n5 = regNum "fimm" ;
|
||||
lin n6 = regNum "sex" ;
|
||||
lin n7 = mkNum "sjö" "sautján" "sjötíu" "sjö" ;
|
||||
lin n8 = mkNum "átta" "átján" "áttíu" "átta" ;
|
||||
lin n9 = mkNum "níu" "nítján" "níutíu" "níu" ;
|
||||
|
||||
lin pot01 = {s = table {f => "einn"} ; size = sg } ;
|
||||
lin pot0 d = {s = d.s ; size = less10 } ;
|
||||
lin pot110 = ss "tíu" ;
|
||||
lin pot111 = ss "ellefu" ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = table {com => n.s ! unit ; neut => n.s ! neuter } ; size = n.size } ;
|
||||
lin pot1 d = {s = table {_ => d.s ! ten } ; size = pl};
|
||||
lin pot1plus d e = {s = table {com => d.s ! ten ++ "og" ++ e.s ! unit ;
|
||||
neut => d.s ! ten ++ "og" ++ e.s ! neuter} ; size = pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = table {_ => omitsg (d.s ! neuter) d.size ++ "hundrað" } ; size = pl} ;
|
||||
lin pot2plus d e = {s = table {f => omitsg (d.s ! neuter) d.size ++ "hundrað" ++ (maybeog) e.size ++ e.s ! f} ; size = pl} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s ! com } ;
|
||||
lin pot3 n = {s = omitsg (n.s ! neut) n.size ++ "Þúsund"} ;
|
||||
lin pot3plus n m = {s = omitsg (n.s ! neut) n.size ++ "Þúsund" ++ (maybeog m.size) ++ m.s ! com} ;
|
||||
|
||||
|
||||
oper maybeog : Size -> Str = \sz -> table {pl => [] ; _ => "og" } ! sz ;
|
||||
oper omitsg : Str -> Size -> Str = \s -> \sz -> table {sg => [] ; _ => s } ! sz ;
|
||||
|
||||
}
|
||||
61
examples/numerals/interlingua.gf
Normal file
61
examples/numerals/interlingua.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
concrete interlingua of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
|
||||
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 mkNum : Str -> Str -> LinDigit =
|
||||
\duo-> \vinti->
|
||||
{s = table {unit => duo ; ten => vinti}} ;
|
||||
|
||||
oper regNum : Str -> LinDigit =
|
||||
\cinque ->
|
||||
case cinque of {
|
||||
nov + "em"=> mkNum cinque (nov + "anta");
|
||||
cinqu + "e" => mkNum cinque (cinqu + "anta");
|
||||
cinqu + "o" => mkNum cinque (cinqu + "anta");
|
||||
sex => mkNum sex (sex + "anta")
|
||||
};
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin num x = x ;
|
||||
lin n2 = mkNum "duo" "vinti";
|
||||
lin n3 = mkNum "tres" "trenta";
|
||||
lin n4 = mkNum "quatro" "quaranta";
|
||||
lin n5 = regNum "cinque";
|
||||
lin n6 = regNum "sex" ;
|
||||
lin n7 = regNum "septe" ;
|
||||
lin n8 = regNum "octo" ;
|
||||
lin n9 = regNum "novem" ;
|
||||
|
||||
lin pot01 = {s = table {f => "un"}} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f}} ;
|
||||
lin pot110 = ss "dece" ;
|
||||
lin pot111 = ss ("dece" ++ "-" ++ "un");
|
||||
lin pot1to19 d = {s = "dece" ++ "-" ++ d.s ! unit} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ;
|
||||
|
||||
lin pot1 d = {s = d.s ! ten} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "-" ++ e.s ! unit} ;
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
|
||||
lin pot2 d = {s = d.s ! unit ++ "cento"} ;
|
||||
lin pot2plus d e = {s = d.s ! unit ++ "cento" ++ e.s} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
|
||||
lin pot3 n = {s = n.s ++ "mille"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "mille" ++ m.s} ;
|
||||
|
||||
|
||||
}
|
||||
82
examples/numerals/irish.gf
Normal file
82
examples/numerals/irish.gf
Normal file
@@ -0,0 +1,82 @@
|
||||
concrete irish of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- Not the archaic base-10 system fiche, triocha, daichead, caoga, seasca, seachtó, ochtó, nócha
|
||||
-- scór can be used in place of fiche but is not implemented (since it's much less preferred)
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; even20 : Even20 ; size : Size} ;
|
||||
oper mk20Ten : Str -> Str -> Size -> LinDigit =
|
||||
\tri -> \fiche -> \thesize ->
|
||||
{ s = table {unit => tri ; twenty => fiche ; teen => tri ++ "déag" ; attrib => tri} ; even20 = ten ; size = thesize} ;
|
||||
|
||||
oper mkEven20 : Str -> Str -> Size -> LinDigit =
|
||||
\se -> \trifichid -> \thesize ->
|
||||
{ s = table {unit => se ; twenty => trifichid ; teen => se ++ "déag" ; attrib => se} ; even20 = even ; size = thesize} ;
|
||||
|
||||
param HForm = attr | indep ;
|
||||
param Even20 = ten | even ;
|
||||
param DForm = unit | twenty | teen | attrib ;
|
||||
param Size = sg | onetosix | seventonine | tenover | eventen ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : HForm => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : HForm => Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{s = table {unit => "dó" ; twenty => "fiche" ; attrib => "dhá" ; teen => "dó" ++ "dhéag" } ; even20 = even ; size = onetosix } ;
|
||||
lin n3 = mk20Ten "trí" "fiche" onetosix ;
|
||||
lin n4 =
|
||||
{s = table {unit => "ceathair" ; twenty => "dhá" ++ "fhichead" ; teen => "dó" ++ "dhéag" ; attrib => "ceithre" } ; even20 = even ; size = onetosix} ;
|
||||
lin n5 = mk20Ten "cúig" ("dhá" ++ "fhichead") onetosix ;
|
||||
lin n6 = mkEven20 "sé" ("trí" ++ "fichid") onetosix ;
|
||||
lin n7 = mk20Ten "seacht" ("trí" ++ "fichid") seventonine ;
|
||||
lin n8 = mkEven20 "hocht" ("cheithre" ++ "fichid") seventonine ;
|
||||
lin n9 = mk20Ten "naoi" ("cheithre" ++ "fichid") seventonine ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "haon" ; attrib => [] ; _ => "dummy"} ; even20 = ten ; size = sg};
|
||||
lin pot0 d =
|
||||
{s = d.s ; even20 = d.even20 ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {attr => "deich" ; indep => "a" ++ "deich"} ; size = tenover} ;
|
||||
lin pot111 =
|
||||
{s = table {attr => "haon" ++ "déag" ; indep => "a" ++ "haon" ++ "déag"} ; size = tenover} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {attr => d.s ! teen ; indep => "a" ++ d.s ! teen } ; size = tenover} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {attr => n.s ! attrib ; indep => "a" ++ n.s ! unit} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {attr => d.s ! twenty ++ AddDeich ! (d.even20) ;
|
||||
indep => d.s ! twenty ++ AddADeich ! (d.even20)} ;
|
||||
size = eventen} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {attr => (d.s ! twenty) ++ e.s ! unit ++
|
||||
table {ten => "déag" ; _ => []} ! (d.even20) ;
|
||||
indep => (d.s ! twenty) ++ "a" ++ e.s ! unit ++
|
||||
table {ten => "déag" ; _ => []} ! (d.even20)} ;
|
||||
size = e.size} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {attr => n.s ! attr ; indep => n.s ! indep} ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {_ => d.s ! attrib ++ EclipseLeniteCead ! d.size} ; size = tenover} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {_ => d.s ! attrib ++ EclipseLeniteCead ! d.size ++ AddIs ! e.size ++ e.s ! indep} ; size = e.size} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ LeniteMile ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ LeniteMile ! n.size ++ m.s ! indep} ;
|
||||
|
||||
oper AddDeich : Even20 => Str = table {ten => "deich" ; _ => []} ;
|
||||
oper AddADeich : Even20 => Str = table {ten => "a" ++ "deich" ; _ => []} ;
|
||||
oper AddIs : Size => Str = table {eventen => "is" ; _ => []} ;
|
||||
oper EclipseLeniteCead : Size => Str = table {onetosix => "chead" ; seventonine => "gcéad" ; _ => "céad" } ;
|
||||
oper LeniteMile : Size => Str = table {onetosix => "mhíle" ; _ => "míle" } ;
|
||||
|
||||
|
||||
}
|
||||
51
examples/numerals/italian.gf
Normal file
51
examples/numerals/italian.gf
Normal file
@@ -0,0 +1,51 @@
|
||||
concrete italian of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = ental Pred | ton | tiotal ;
|
||||
param Num = sg | pl ;
|
||||
param Pred = pred | indip ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; n : Num} ;
|
||||
lincat Sub100 = {s : Str ; n : Num} ;
|
||||
lincat Sub1000 = {s : Str ; n : Num} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkTal : Str -> Str -> Str -> LinDigit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {ental _ => två ; ton => tolv ; tiotal => tjugo}} ;
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
oper spl : Str -> {s : Str ; n : Num} = \s -> {s = s ; n = pl} ;
|
||||
oper mille : Num => Str = table {sg => "mille" ; pl => "mila"} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkTal "due" "dodici" "venti" ;
|
||||
lin n3 = mkTal "tre" "tredici" "trenta" ;
|
||||
lin n4 = mkTal "quattro" "quattordici" "quaranta" ;
|
||||
lin n5 = mkTal "cinque" "quindici" "cinquanta" ;
|
||||
lin n6 = mkTal "sei" "sedici" "sessanta" ;
|
||||
lin n7 = mkTal "sette" "diciassette" "settanta" ;
|
||||
lin n8 = mkTal "otto" "diciotto" "ottanta" ;
|
||||
lin n9 = mkTal "nove" "diciannove" "novanta" ;
|
||||
|
||||
lin pot01 = {s = table {ental pred => [] ; _ => "uno"} ; n = sg} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; n = pl} ;
|
||||
lin pot110 = spl "dieci" ;
|
||||
lin pot111 = spl "undici" ;
|
||||
lin pot1to19 d = spl (d.s ! ton) ;
|
||||
lin pot0as1 n = {s = n.s ! ental indip ; n = n.n} ;
|
||||
lin pot1 d = spl (d.s ! tiotal) ;
|
||||
lin pot1plus d e = spl (d.s ! tiotal ++ e.s ! ental indip) ;
|
||||
lin pot1as2 n = {s = n.s ; n = n.n} ;
|
||||
lin pot2 d = spl (d.s ! ental pred ++ "cento") ;
|
||||
lin pot2plus d e = spl (d.s ! ental pred ++ "cento" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s ; n = n.n} ;
|
||||
lin pot3 n = ss (n.s ++ mille ! n.n) ;
|
||||
lin pot3plus n m = ss (n.s ++ mille ! n.n ++ m.s) ;
|
||||
|
||||
|
||||
}
|
||||
64
examples/numerals/japanese.gf
Normal file
64
examples/numerals/japanese.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
concrete japanese of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=japanese ;
|
||||
|
||||
param DForm = unit | attr | ten | hundred | thousand ;
|
||||
param Size = sg | pl | more10 ;
|
||||
param S100 = tenp | senp ;
|
||||
param S1000 = indep | man | sen;
|
||||
|
||||
-- Standard Romajii
|
||||
-- Everything should be glued
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str ; s2 : S100 => Str; size : Size} ;
|
||||
lincat Sub1000 = {s : S1000 => Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \base ->
|
||||
{s = table {unit => base ; attr => base ; ten => base + "ぢゅう" ; hundred => base + "ひゃく" ; thousand => base + "せん" } ; size = pl} ;
|
||||
|
||||
oper mkNum4 : Str -> Str -> Str -> Str -> LinDigit = \ni -> \base -> \nihyaku -> \nisen ->
|
||||
{s = table {unit => ni ; attr => base ; ten => base + "ぢゅう" ; hundred => nihyaku ; thousand => nisen } ; size = pl} ;
|
||||
|
||||
oper mkNum2 : Str -> Str -> LinDigit = \yon -> \base ->
|
||||
{s = table {unit => yon ; attr => base ; ten => base + "ぢゅう" ; hundred => base + "ひゃく" ; thousand => base + "せん" } ; size = pl} ;
|
||||
|
||||
-- lin n1 = mkNum "いち" ;
|
||||
lin n2 = mkNum "に" ;
|
||||
lin n3 = mkNum4 "さん" "さん" "さんびゃく" "さんぜん" ;
|
||||
lin n4 = mkNum2 (variants { "し" ; "よん" }) "よん" ;
|
||||
lin n5 = mkNum "ご" ;
|
||||
lin n6 = mkNum4 "ろく" "ろく" "ろっぴゃく" "ろくせん" ;
|
||||
lin n7 = mkNum2 (variants {"なな" ; "しち" }) "なな" ;
|
||||
lin n8 = mkNum4 "はち" "はち" "はっぴゃく" "はっせん" ;
|
||||
lin n9 = mkNum2 (variants {"きゅう" ; "く" }) "きゅう" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "いち" ; attr => [] ; ten => "ぢゅう" ; hundred => "ひゃく" ; thousand => "せん"} ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "ぢゅう" ; s2 = table {tenp => "いち" + "まん" ; senp => []} ; size = more10} ;
|
||||
lin pot111 = {s = "ぢゅう" + "いち" ; s2 = table {tenp => "いち" + "まん" ; senp => "せん"} ; size = more10} ;
|
||||
lin pot1to19 d = {s = "ぢゅう" ++ d.s ! unit ; s2 = table {tenp => "いち" + "まん" ; senp => d.s ! thousand} ; size = more10} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = table {tenp => [] ; senp => n.s ! thousand} ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; s2 = table {tenp => d.s ! unit ++ "まん" ; senp => []} ; size = more10} ;
|
||||
lin pot1plus d e =
|
||||
{s = d.s ! ten ++ e.s ! unit ;
|
||||
s2 = table {tenp => d.s ! unit ++ "まん" ; senp => e.s ! thousand} ;
|
||||
size = more10} ;
|
||||
|
||||
lin pot1as2 n = {s = table {indep => n.s ; man => n.s2 ! tenp ++ n.s2 ! senp ; sen => n.s2 ! senp} ; size = n.size} ;
|
||||
lin pot2 d = {s = table {indep => d.s ! hundred ; man => d.s ! ten ++ "まん" ; sen => "uっmy"} ; size = more10 };
|
||||
lin pot2plus d e = {s = table {indep => d.s ! hundred ++ e.s ; man => d.s ! ten ++ e.s2 ! tenp ++ e.s2 ! senp ; sen => "uっmy" } ; size = more10 };
|
||||
lin pot2as3 n = {s = n.s ! indep } ;
|
||||
lin pot3 n = {s = table {more10 => n.s ! man ; _ => n.s ! sen} ! n.size} ;
|
||||
lin pot3plus n m = {s = table {more10 => n.s ! man ; _ => n.s ! sen} ! n.size ++ m.s ! indep} ;
|
||||
|
||||
|
||||
}
|
||||
85
examples/numerals/kabardian.gf
Normal file
85
examples/numerals/kabardian.gf
Normal file
@@ -0,0 +1,85 @@
|
||||
concrete kabardian of Numerals = {
|
||||
-- Kabardian
|
||||
|
||||
-- W is superscript w (= IPA labialisation)
|
||||
-- & is schwa upside down e
|
||||
-- s'
|
||||
-- L is lambda
|
||||
-- L is lambda with dash across
|
||||
-- x^ is x with ^ ontop
|
||||
-- G is gamma
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | unite | unitra | teen | ten | tenra | hund | thou;
|
||||
|
||||
oper LinDigit = {s : DForm => Str };
|
||||
oper LinS100 = {s : Str; s2 : Str } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \dwa ->
|
||||
{s = table {unit => dwa ; unite => dwa + "&" ; unitra => dwa + "&ra" ;
|
||||
ten => dwa + "&s'" ; tenra => dwa + "&s'ra" ;
|
||||
teen => "p's''&" + "k'W&" + dwa ;
|
||||
hund => "s'a" + "&y" + dwa ;
|
||||
thou => variants {"m&yn"+"&y"+dwa ; dwa+"a"+"s''a"++"m&yn"}}};
|
||||
|
||||
oper mkNum2 : Str -> LinDigit = \dwa ->
|
||||
{s = table {unit => dwa ; unite => dwa + "&" ; unitra => dwa + "&ra" ;
|
||||
ten => dwa + "as'" ; tenra => dwa + "as'ra" ;
|
||||
teen => "p's''&"+"k'W&"+"t'" ;
|
||||
hund => "s'a" + "&y" + "t'" ;
|
||||
thou => variants {"m&yn"+"&y"+"t'" ; dwa+"a"+"s''a"++"m&yn"}}};
|
||||
|
||||
oper mkNum3 : Str -> LinDigit = \dwa ->
|
||||
{s = table {unit => dwa ; unite => dwa + "&" ; unitra => dwa + "&ra" ;
|
||||
ten => dwa + "as'" ; tenra => dwa + "as'ra" ;
|
||||
teen => "p's''&"+"k'W&"+dwa ;
|
||||
hund => "s'a" + "&y" + dwa ;
|
||||
thou => variants {"m&yn"+"&y"+dwa ; dwa+"a"+"s''a"++"m&yn"}}};
|
||||
|
||||
lin num x = {s = x.s } ; -- TODO ;
|
||||
|
||||
lin n2 = mkNum2 "t'?W" ;
|
||||
lin n3 = mkNum3 "s'" ;
|
||||
lin n4 = mkNum "p'L-'" ;
|
||||
lin n5 = mkNum "tx^W" ;
|
||||
lin n6 = mkNum "x^";
|
||||
lin n7 = mkNum "bL" ;
|
||||
lin n8 = mkNum "y" ;
|
||||
lin n9 = mkNum "bGW" ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \s1 -> \s2 -> s1 ++ s2 ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "z" ; unite => "z&" ; unitra => "z&" + "ra" ;
|
||||
teen => "p's''&"+"k'W&"+"z" ; ten => "dummy" ; tenra => "dummy" ;
|
||||
hund => "s'a" ; thou => "m&yn"}};
|
||||
|
||||
oper ss : Str -> LinS100 = \f ->
|
||||
{s = f ; s2 = variants {("m&yn"+"&y") ++ f ; (bind f "as'a") ++ "m&yn"}};
|
||||
|
||||
lin pot0 d = d ;
|
||||
lin pot110 =
|
||||
{s = "p's''&" ;
|
||||
s2 = variants {"m&yn"+"&y"+"p's''" ; "p's''"+"a"+"s''a"++"m&yn"}};
|
||||
lin pot111 = ss ("p's''&"+"k'W&"+"z") ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = n.s ! unite ; s2 = n.s ! thou } ;
|
||||
lin pot1 d = ss (variants {(d.s ! ten) ; (d.s ! unite) ++ "p's''&wa"}) ;
|
||||
-- extra variant p's''ay = 80
|
||||
lin pot1plus d e = ss ((d.s ! tenra) ++ (e.s ! unitra)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (d.s ! hund) ;
|
||||
lin pot2plus d e = ss ((d.s ! hund) ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = n.s2} ;
|
||||
lin pot3plus n m = {s = n.s2 ++ m.s} ;
|
||||
|
||||
}
|
||||
52
examples/numerals/kambera.gf
Normal file
52
examples/numerals/kambera.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
concrete kambera of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | two | pl ;
|
||||
|
||||
oper Form = {s : Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = Form ;
|
||||
lincat Sub10 = Form ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Form = \two ->
|
||||
{s = two ; size = pl} ;
|
||||
|
||||
lin num x = x ;
|
||||
-- lin n1 mkNum "diha" ;
|
||||
lin n2 = {s = "dua" ; size = two} ;
|
||||
lin n3 = mkNum "tailu" ;
|
||||
lin n4 = mkNum "patu" ;
|
||||
lin n5 = mkNum "lima" ;
|
||||
lin n6 = mkNum "nomu" ;
|
||||
lin n7 = mkNum "pitu" ;
|
||||
lin n8 = mkNum "walu" ;
|
||||
lin n9 = mkNum "hiwa" ;
|
||||
|
||||
oper ss : Str -> {s : Str ; size : Size} = \s1 -> {s = s1 ; size = pl} ;
|
||||
|
||||
lin pot01 = {s = "diha" ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "hakambulu" ;
|
||||
lin pot111 = ss ("hakambulu" ++ "hau") ;
|
||||
lin pot1to19 d = ss ("hakambulu" ++ (if12 d.size d.s)) ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = ss (d.s ++ "kambulu" ) ;
|
||||
lin pot1plus d e = ss (d.s ++ "kambulu" ++ (if12 e.size e.s)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (selsg d.size "hangahu" (d.s ++ "ngahu")) ;
|
||||
lin pot2plus d e = ss (selsg d.size "hangahu" (d.s ++ "ngahu") ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = (selsg n.size "hariu" (n.s ++ "riu"))} ;
|
||||
lin pot3plus n m = {s = (selsg n.size "hariu" (n.s ++ "riu")) ++ m.s } ;
|
||||
|
||||
oper if12 : Size -> Str -> Str = \sz -> \a ->
|
||||
table {sg => "hau" ; two => "dambu" ; _ => a} ! sz ;
|
||||
oper selsg : Size -> Str -> Str -> Str = \sz -> \a -> \b ->
|
||||
table {sg => a ; _ => b} ! sz ;
|
||||
|
||||
|
||||
}
|
||||
44
examples/numerals/kawaiisu.gf
Normal file
44
examples/numerals/kawaiisu.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
concrete kawaiisu of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
oper na : {s : Str } = {s = "N/A" } ;
|
||||
|
||||
oper LinDigit = {s : Str ; s2 : Str ; s3 : Str} ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str } ;
|
||||
lincat Sub1000 = {s : Str } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO
|
||||
|
||||
oper mkNum : Str -> LinDigit = \s1 -> {s = s1 ; s2 = s1 + "yu" ; s3 = s1 + "suu"} ;
|
||||
oper mkNum2 : Str -> LinDigit = \s1 -> {s = s1 ; s2 = s1 + "yu" ; s3 = s1 + "cuu"} ;
|
||||
lin n2 = mkNum "waha" ;
|
||||
lin n3 = mkNum "pehe" ;
|
||||
lin n4 = mkNum "wacuu" ;
|
||||
lin n5 = mkNum2 "mani-gi" ;
|
||||
lin n6 = mkNum2 "navaha" ;
|
||||
lin n7 = {s = "no?mi-zi" ; s2 = "no?mi-zi" ; s3 = "no?mi-zicuu" };
|
||||
lin n8 = {s = "nanawacuu" ; s2 = "nanawacuu"; s3 = "nanawacuucuu" };
|
||||
lin n9 = mkNum2 "sukumi-su" ;
|
||||
|
||||
lin pot01 = mkNum "suu" ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "mi-mi-suuyu" } ;
|
||||
lin pot111 = {s = "mi-mi-susuuyu" } ;
|
||||
lin pot1to19 d = {s = bind "mi-mi-susuu" d.s2 } ;
|
||||
lin pot0as1 n = {s = n.s } ;
|
||||
lin pot1 d = {s = bind d.s3 "yu"} ;
|
||||
lin pot1plus d e = {s = bind d.s3 e.s2 } ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = na ;
|
||||
lin pot2plus d e = na ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = na ;
|
||||
lin pot3plus n m = na ;
|
||||
|
||||
}
|
||||
57
examples/numerals/khmer.gf
Normal file
57
examples/numerals/khmer.gf
Normal file
@@ -0,0 +1,57 @@
|
||||
concrete khmer of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=extradiacritics ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper LinDigit = {s : DForm => 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 -> Str -> LinDigit = \u -> \t -> {s = table {unit => u ; ten => t} ; size = pl} ;
|
||||
|
||||
lin n2 = mkNum "bīra" "mbhai" ;
|
||||
lin n3 = mkNum "pī" ("sāma" ++ "sipa") ;
|
||||
lin n4 = mkNum "pwna" ("sē" ++ "sipa") ;
|
||||
lin n5 = mkNum "prāṃ" ("hā" ++ "sipa") ;
|
||||
lin n6 = mkNum ("prāṃ" ++ "mwya") ("huka" ++ "sipa") ;
|
||||
lin n7 = mkNum ("prāṃ" ++ "bīra") ("cita" ++ "sipa") ;
|
||||
lin n8 = mkNum ("prāṃ" ++ "pī") ("pēta" ++ "sipa") ;
|
||||
lin n9 = mkNum ("prāṃ" ++ "pwna") ("kau" ++ "sipa") ;
|
||||
|
||||
oper bana : Str = variants {"mwya" ++ "bā'na" ; "mpā'na"} ;
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ []} ; -- for the diacritics
|
||||
|
||||
lin pot01 = {s = table { _ => "mwya" } ; size = sg } ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "ṭa'pa" ; s2 = "hmɨna" ; size = pl} ;
|
||||
lin pot111 = {s = "mwya" ++ "ṭaṇta'pa" ; s2 = "hmɨna" ++ bana; size = pl} ;
|
||||
lin pot1to19 d = {s = (d.s ! unit) ++ "ṭaṇta'pa" ; s2 = "hmɨna" ++ (d.s ! unit) ++ "bā'na" ; size = pl } ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = xsg n.size bana (n.s ! unit ++ "bā'na") ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; s2 = d.s ! unit ++ "hmɨna" ; size = pl} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ e.s ! unit ; s2 = d.s ! unit ++ "hmɨna" ++ xsg e.size bana (e.s ! unit ++ "bā'na") ; size = pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = xsg d.size (variants {"raya" ; "mraya"}) (d.s ! unit ++ "raya") ;
|
||||
s2 = (d.s ! unit) ++ "sēna" ;
|
||||
size = pl } ;
|
||||
lin pot2plus d e = {s = xsg d.size (variants {"raya" ; "mraya"}) (d.s ! unit ++ "raya") ++ e.s ;
|
||||
s2 = (d.s ! unit) ++ "sēna" ++ 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 xsg : Size -> Str -> Str -> Str = \sz -> \s1 -> \s2 -> table {sg => s1 ; _ => s2} ! sz ;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
62
examples/numerals/khowar.gf
Normal file
62
examples/numerals/khowar.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
concrete khowar of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
-- 2 has a non-general variant "joowáloo" ;
|
||||
|
||||
param DForm = unit | ten S100 | teen ;
|
||||
param Size = sg | pl | more100;
|
||||
param Par20 = even | odd ;
|
||||
param S100 = attr | preceded ;
|
||||
param S1000 = indep | dep | lakh ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size ; par20 : Par20} ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : S100 => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : S1000 => Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- Latin A Supplement
|
||||
|
||||
oper mkNum : Str -> Str -> Par20 -> LinDigit = \s -> \tw -> \p20 ->
|
||||
{s = table {unit => s ; teen => "jọsh" + "-" + s ; ten _ => tw ++ "bîsher"} ; size = pl ; par20 = p20} ;
|
||||
|
||||
-- lin n1 = mkNum variants {"î" ; "îwáloo"} ;
|
||||
lin n2 =
|
||||
{s = table {unit => "joo" ; teen => "jọsh" + "-" + "joo" ; ten attr => "bîsher" ; ten preceded => "î" ++ "bîsher" } ; size = pl ; par20 = even };
|
||||
lin n3 =
|
||||
{s = table {unit => "troi" ; teen => "jọsh" + "-" + "troi" ; ten attr => "bîsher" ; ten preceded => "î" ++ "bîsher" } ; size = pl ; par20 = odd };
|
||||
lin n4 = mkNum "chọr" "joo" even ;
|
||||
lin n5 = mkNum "pọnj" "joo" odd ;
|
||||
lin n6 = mkNum "chöi" "troi" even ;
|
||||
lin n7 = mkNum "sọt" "troi" odd ;
|
||||
lin n8 = mkNum "ọsht" "chöi" even ;
|
||||
lin n9 = mkNum "nyun" "chöi" odd ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "î" ; _ => "dummy" } ; size = sg ; par20 = odd};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = table {_ => "jọsh" } ; size = pl} ;
|
||||
lin pot111 = {s = table {_ => "jọsh" + "-" + "î" } ; size = pl} ;
|
||||
lin pot1to19 d = {s = table {_ => d.s ! teen }; size = pl} ;
|
||||
lin pot0as1 n = {s = table {_ => n.s ! unit } ; size = n.size} ;
|
||||
lin pot1 d = {s = table {f => table {even => d.s ! ten f ; odd => d.s ! ten f ++ "jọsh" } ! d.par20 } ; size = pl} ;
|
||||
lin pot1plus d e = {s = table {f => table {even => d.s ! ten f ++ e.s ! unit ; odd => d.s ! ten f ++ e.s ! teen } ! d.par20 }; size = pl} ;
|
||||
lin pot1as2 n = {s = table {indep => n.s ! attr ; dep => n.s ! preceded ; lakh => "dummy"} ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {lakh => table {sg => "lakh" ; _ => d.s ! unit ++ "lakh"} ! d.size ;
|
||||
_ => table {sg => "shọr" ; _ => d.s ! unit ++ "shọr" } ! d.size } ;
|
||||
size = more100 };
|
||||
lin pot2plus d e =
|
||||
{s = table {lakh => table {sg => "lakh" ; _ => d.s ! unit ++ "lakh"} ! d.size ++ table {sg => [] ; _ => e.s ! preceded } ! e.size ++ "hazâr" ;
|
||||
_ => table {sg => "shọr" ; _ => d.s ! unit ++ "shọr" } ! d.size ++ "oché" ++ e.s ! preceded } ;
|
||||
size = more100} ;
|
||||
lin pot2as3 n = {s = table {sg => [] ++ variants {"î" ; "îwáloo"} ; _ => n.s ! indep} ! n.size } ;
|
||||
lin pot3 n = {s = table {pl => n.s ! indep ++ "hazâr" ; sg => "hazâr" ; more100 => n.s ! lakh} ! n.size} ;
|
||||
lin pot3plus n m = {s = table {pl => n.s ! indep ++ "hazâr" ; sg => "hazâr" ; more100 => n.s ! lakh} ! n.size ++ m.s ! dep} ;
|
||||
|
||||
}
|
||||
50
examples/numerals/kolyma_yukaghir.gf
Normal file
50
examples/numerals/kolyma_yukaghir.gf
Normal file
@@ -0,0 +1,50 @@
|
||||
concrete kolyma_yukaghir of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper na = {s = "N/A" };
|
||||
|
||||
param DForm = u | teen ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str } ;
|
||||
lincat Sub1000 = {s : Str } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \a ->
|
||||
{s = table {u => a ; teen => "kun'il" ++ a ++ "budie"}} ;
|
||||
oper mkNum2 : Str -> Str -> LinDigit = \a -> \b ->
|
||||
{s = table {u => a ; teen => b ++ "budie"}} ;
|
||||
|
||||
lin num x = x ;
|
||||
-- lin n1 mkNum "irkin" ;
|
||||
lin n2 = mkNum2 "ataqun" ("kun" ++ "ataqun") ;
|
||||
lin n3 = mkNum2 "ja:n" ("kun'il" ++ "ja:l");
|
||||
lin n4 = mkNum "ilekun" ;
|
||||
lin n5 = mkNum "n'ahanbo:d'e" ;
|
||||
lin n6 = mkNum "malha:n" ;
|
||||
lin n7 = mkNum "purki:n" ;
|
||||
lin n8 = mkNum "malhi:lek" ;
|
||||
lin n9 = mkNum "kunirkil'd'o:j" ;
|
||||
|
||||
lin pot01 = mkNum2 "irkin" ("kun" ++ "irku");
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "kun'in"};
|
||||
lin pot111 = {s = ("kun" ++ "irkubudie")} ;
|
||||
lin pot1to19 d = {s = d.s ! teen} ;
|
||||
lin pot0as1 n = {s = n.s ! u} ;
|
||||
lin pot1 d = {s = d.s ! u ++ "kun'el"} ;
|
||||
lin pot1plus d e = {s = d.s ! u ++ "kun'el" ++ e.s ! u};
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = "kun'in" ++ "kun'in" ++ d.s ! u ++ "budie"} ;
|
||||
lin pot2plus d e = {s = "kun'in" ++ "kun'in" ++ d.s ! u ++ "budie" ++ e.s } ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = na ;
|
||||
lin pot3plus n m = na ;
|
||||
|
||||
}
|
||||
116
examples/numerals/korean.gf
Normal file
116
examples/numerals/korean.gf
Normal file
@@ -0,0 +1,116 @@
|
||||
concrete korean of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
param DForm = unit | teen | ten | tenq | chi | chiten ;
|
||||
param Size = sg | twotoeight | nine | exten | more10 ;
|
||||
param S100 = tenpart | chenpart ;
|
||||
|
||||
-- Korean
|
||||
-- Sorry, no hangul transliteration
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str ; s2 : S100 => Str; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNumq : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\twul -> \yelqtwul -> \sumul -> \i ->
|
||||
{s = table {unit => twul ; teen => yelqtwul ; ten => sumul ; tenq => sumul + "q" ; chi => i ; chiten => i ++ "sip"} ; size = twotoeight} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\twul -> \yelqtwul -> \sumul -> \i ->
|
||||
{s = table {unit => twul ; teen => yelqtwul ; ten => sumul ; tenq => sumul ; chi => i ; chiten => i ++ "sip"} ; size = twotoeight} ;
|
||||
|
||||
oper mkNum6 : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\twul -> \yelqtwul -> \sumul -> \i ->
|
||||
{s = table {unit => twul ; teen => yelqtwul ; ten => sumul ; tenq => sumul + "q" ; chi => i ; chiten => (i + "q") ++ "sip"} ; size = twotoeight} ;
|
||||
|
||||
oper mkNum9 : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\twul -> \yelqtwul -> \sumul -> \i ->
|
||||
{s = table {unit => twul ; teen => yelqtwul ; ten => sumul ; tenq => sumul + "q" ; chi => i ; chiten => i ++ "sip"} ; size = nine} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ [] } ; -- just makes colons into length bar ontop of char
|
||||
|
||||
-- lin n1 = mkNum variants{"hana" ; "han"} ; variants {"yelhana" ;"yelhan"}
|
||||
|
||||
lin n2 = mkNumq (variants {"twūl" ; "twu" })
|
||||
(variants {"yelqtwul" ; "yelqtwu" })
|
||||
(variants {"sumul" ; "sumu" })
|
||||
"ī" ;
|
||||
lin n3 = mkNum (variants {"sēys" ; "sēy" ; "sēk" ; "sē" })
|
||||
(variants {"yelqseys" ; "yelqsey" ; "yelqsek" ; "yelqse" })
|
||||
(variants {"seun" ; "sehun" })
|
||||
"sam" ;
|
||||
lin n4 = mkNum (variants {"nēys" ; "nēy" ; "nēk" ; "nē" })
|
||||
(variants {"yelneys" ; "yelney" ; "yelnek" ; "yelne" })
|
||||
"mahun" "sā" ;
|
||||
lin n5 = mkNum "tases" "yelqtases" "swīn" "ō";
|
||||
lin n6 = mkNum6 "yeses" (variants {"yelqyeses" ; "yelyeses"}) "yeyswun" "yuk" ;
|
||||
lin n7 = mkNum6 "ilkop" (variants {"yelqilkop" ; "yelilkop"}) "ilhun" "chil" ;
|
||||
lin n8 = mkNum6 "yetel" (variants {"yelqyetel" ; "yelyetel"}) "yetun" "phal" ;
|
||||
lin n9 = mkNum9 "ahop" "yelahop" "ahun" "kwu" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => variants {"hana" ; "han"} ;
|
||||
ten => variants {"yel" ; "yelq"} ;
|
||||
tenq => "dummy" ;
|
||||
teen => variants {"yelhana" ; "yelhan" } ;
|
||||
chi => "il" ; chiten => "sip"} ;
|
||||
size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = variants {"yel" ; "yelq"} ;
|
||||
s2 = table {tenpart => "il" ++ "man" ;
|
||||
chenpart => [] } ;
|
||||
size = exten} ;
|
||||
lin pot111 = {s = variants {"yelhana" ; "yelhan"} ;
|
||||
s2 = table {tenpart => "il" ++ "man" ;
|
||||
chenpart => maybeil sg "il" "chen" } ;
|
||||
size = more10} ;
|
||||
lin pot1to19 d = {s = d.s ! teen ;
|
||||
s2 = table {tenpart => "il" ++ "man" ;
|
||||
chenpart => maybeil d.size (d.s ! chi) "chen" } ;
|
||||
size = more10} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ;
|
||||
s2 = table {tenpart => "man" ;
|
||||
chenpart => maybeil n.size (n.s ! chi) "chen" } ;
|
||||
size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ;
|
||||
s2 = table {tenpart => d.s ! chi ++ "man" ;
|
||||
chenpart => [] } ;
|
||||
size = more10} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {twotoeight => d.s ! tenq ;
|
||||
_ => d.s ! ten } ! e.size ++ e.s ! unit;
|
||||
s2 = table {tenpart => d.s ! chi ++ "man";
|
||||
chenpart => maybeil e.size (e.s ! chi) "chen" } ;
|
||||
size = more10} ;
|
||||
|
||||
lin pot1as2 n = {s = n.s ;
|
||||
s2 = table {more10 => n.s2 ! tenpart ;
|
||||
exten => (variants {"mān" ; "il" ++ "man"}) ;
|
||||
_ => []} ! n.size ++ n.s2 ! chenpart ;
|
||||
size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = maybeil d.size (d.s ! chi) "payk" ;
|
||||
s2 = d.s ! chiten ;
|
||||
size = more10 };
|
||||
lin pot2plus d e =
|
||||
{s = (maybeil d.size (d.s ! chi) "payk") ++ e.s ;
|
||||
s2 = d.s ! chiten ++ e.s2 ! tenpart ++ e.s2 ! chenpart ;
|
||||
size = more10 };
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = n.s2 } ;
|
||||
lin pot3plus n m = {s = n.s2 ++ m.s } ;
|
||||
|
||||
oper maybeil : Size -> Str -> Str -> Str = \sz -> \a -> \chen ->
|
||||
table {twotoeight => a ++ chen ; sg => variants {chen ; "il" ++ chen } ; _ => a ++ chen} ! sz ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
62
examples/numerals/kulung.gf
Normal file
62
examples/numerals/kulung.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
concrete kulung of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = basic | belowtenform | tenindep | ten;
|
||||
param Size = sg | less100 | more100 ;
|
||||
param Scale = reg | lakh ;
|
||||
|
||||
-- From Krishna Bahadur Rai in Werner Winter: When Numeral Systems are
|
||||
-- Expanded in Jadranka Gvozdanovic' (ed.) Numeral Types and Changes
|
||||
-- Worldwide, 1999
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Scale => Str ; size : Size} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\two -> \two2 -> \twenty -> \twenty2 ->
|
||||
{s = table {basic => two ; belowtenform => two2 ; tenindep => twenty ; ten => twenty2}} ;
|
||||
|
||||
oper mkRegNum : Str -> LinDigit =
|
||||
\su ->
|
||||
{ s = table { basic => su ; belowtenform => su + "kci" ; tenindep => su + "kká" ; ten => su + "k"} };
|
||||
|
||||
lin num x = x ;
|
||||
-- lin n1 mkNum "i" "ibim" ... ;
|
||||
lin n2 = mkNum "ni" "nicci" (variants { "nissá" ; "nukká" }) "nuk" ;
|
||||
lin n3 = mkRegNum "su" ;
|
||||
lin n4 = mkNum "li" "lici" "likká" "lik" ;
|
||||
lin n5 = mkNum "ngá" "ngá" "ngakká" "ngak" ;
|
||||
lin n6 = mkRegNum "tu" ;
|
||||
lin n7 = mkRegNum "nu" ;
|
||||
lin n8 = mkRegNum "re" ;
|
||||
lin n9 = mkNum "vau" "vauci" "vavau" "vavau" ;
|
||||
|
||||
oper ss : Str -> {s : Str ; size : Size} = \s -> {s = s ; size = less100} ;
|
||||
|
||||
lin pot01 = {s = table {f => variants {"i" ; "ibim"}} ; size = sg} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; size = less100} ;
|
||||
lin pot110 = ss ( variants { "pau" ; "pauci" }) ;
|
||||
lin pot111 = ss ("pau" ++ "i") ;
|
||||
lin pot1to19 d = ss ("pau" ++ d.s ! basic) ;
|
||||
lin pot0as1 n = {s = variants {n.s ! basic ; n.s ! belowtenform} ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! tenindep ; size = less100} ;
|
||||
lin pot1plus d e = {s = (d.s ! ten) ++ e.s ! basic ; size = less100} ;
|
||||
lin pot1as2 n = {s = table {_ => n.s } ; size = n.size} ;
|
||||
lin pot2 d = {s = table {lakh => omitsg (d.s ! basic) d.size ++ "lankau" ; reg => omitsg (d.s ! basic) d.size ++ "chhum" }; size = more100} ;
|
||||
lin pot2plus d e = {s = table {lakh => omitsg (d.s ! basic) d.size ++ "lankau" ++ omitsg e.s e.size ++ "habau" ; reg => omitsg (d.s ! basic) d.size ++ "chhum" ++ e.s } ; size = more100} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s ! reg };
|
||||
lin pot3 n = {s = mklankau n.size (n.s ! reg) (n.s ! lakh)} ;
|
||||
lin pot3plus n m = {s = mklankau n.size (n.s ! reg) (n.s ! lakh) ++ m.s ! reg} ;
|
||||
|
||||
oper mklankau : Size -> Str -> Str -> Str = \sz -> \attr -> \lankau ->
|
||||
table {sg => "habau" ; less100 => attr ++ "habau" ; more100 => lankau} ! sz;
|
||||
oper omitsg : Str -> Size -> Str = \s -> \sz -> table {sg => [] ; _ => s} ! sz ;
|
||||
|
||||
}
|
||||
55
examples/numerals/kwami.gf
Normal file
55
examples/numerals/kwami.gf
Normal file
@@ -0,0 +1,55 @@
|
||||
concrete kwami of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
-- D^ is from implosive d IPA symbol
|
||||
-- N Num
|
||||
|
||||
param Size = sg | two | three | other ;
|
||||
|
||||
oper LinDigit = {s : Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinDigit ;
|
||||
lincat Sub1000 = LinDigit ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \kunun ->
|
||||
{s = kunun ; size = other} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- for D^
|
||||
|
||||
lin n2 = {s = variants {"póllów" ; "fóllów"} ; size = two };
|
||||
lin n3 = {s = "kúnún" ; size = three } ;
|
||||
lin n4 = mkNum (variants {"pòD^òw" ; "fòD^òw"}) ;
|
||||
lin n5 = mkNum (variants {"páaD^í" ; "fáaD^í"}) ;
|
||||
lin n6 = mkNum (variants {"páyíndì" ; "fáyíndì"}) ;
|
||||
lin n7 = mkNum (variants {"pópíllów" ; "fópíllów"}) ;
|
||||
lin n8 = mkNum (variants {"pówùrD^ów" ; "fówùrD^ów"}) ;
|
||||
lin n9 = mkNum "làmbáD^à" ;
|
||||
|
||||
oper thirty : Str = variants {("kúu" ++ "kúnún") ; "tàlàatín"} ;
|
||||
oper two100 : Str = variants {"dálmágí" ++ "póllów" ; "mèetán"} ;
|
||||
oper thousand : Str = variants {("dálmágí" ++ "kúmó") ; "dùbúk" ; "dúbúk"} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = "múndí" ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkNum "kúmó" ;
|
||||
lin pot111 = mkNum ("kúmó" ++ "kán" ++ "múndí") ;
|
||||
lin pot1to19 d = mkNum ((variants {"kúmó" ++ "kán" ; "tùrò"}) ++ d.s ) ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = mkNum (table {three => thirty ; _ => "kúu" ++ d.s} ! d.size) ;
|
||||
lin pot1plus d e = mkNum ((table {three => thirty ; _ => "kúu" ++ d.s} ! d.size) ++ "kán" ++ e.s) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = mkNum (table {sg => (variants {"dálmágí" ; "dálmák"}) ; two => two100 ; _ => "dálmágí" ++ d.s } ! d.size) ;
|
||||
lin pot2plus d e = mkNum ((table {two => two100 ; sg => (variants {"dálmágí" ; "dálmák"}) ; _ => "dálmágí" ++ d.s } ! d.size) ++ "kán" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = table {sg => thousand ; _ => "dùbúk" ++ n.s} ! n.size } ;
|
||||
lin pot3plus n m = {s = table {sg => thousand ; _ => "dùbúk" ++ n.s} ! n.size ++ m.s} ;
|
||||
|
||||
}
|
||||
40
examples/numerals/kwaza.gf
Normal file
40
examples/numerals/kwaza.gf
Normal file
@@ -0,0 +1,40 @@
|
||||
concrete kwaza of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : Str } ;
|
||||
lincat Sub10 = {s : Str } ;
|
||||
lincat Sub100 = {s : Str } ;
|
||||
lincat Sub1000 = {s : Str } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO
|
||||
|
||||
oper na = {s = "N/A" } ;
|
||||
|
||||
lin n2 = {s = "aky'hy~" };
|
||||
lin n3 = {s = "e'ma~" };
|
||||
lin n4 = {s = "ElE'lE" };
|
||||
lin n5 = {s = "bwako'je" };
|
||||
lin n6 = na ;
|
||||
lin n7 = na ;
|
||||
lin n8 = na ;
|
||||
lin n9 = na ;
|
||||
|
||||
lin pot01 =
|
||||
{s = "tei'hy~"};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = na ;
|
||||
lin pot111 = na ;
|
||||
lin pot1to19 d = na ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = na ;
|
||||
lin pot1plus d e = na ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = na ;
|
||||
lin pot2plus d e = na ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = na ;
|
||||
lin pot3plus n m = na ;
|
||||
|
||||
}
|
||||
45
examples/numerals/lalo.gf
Normal file
45
examples/numerals/lalo.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
concrete lalo of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Zero = yes | nozero ;
|
||||
|
||||
oper LinS100 = {s : Str ; zero : Zero } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : Str} ;
|
||||
lincat Sub10 = {s : Str} ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
-- TODO encoding
|
||||
|
||||
oper ss : Str -> LinS100 = \s1 -> {s = s1 ; zero = nozero} ;
|
||||
|
||||
lin num x0 = {s = x0.s} ;
|
||||
lin n2 = {s = "`n."} ;
|
||||
lin n3 = {s = "sa" } ;
|
||||
lin n4 = {s = "i"} ;
|
||||
lin n5 = {s = "Nà" } ;
|
||||
lin n6 = {s = "khùq" } ;
|
||||
lin n7 = {s = "x`&" } ;
|
||||
lin n8 = {s = "hìq" } ;
|
||||
lin n9 = {s = "kw" } ;
|
||||
lin pot01 = {s = "tjh`&"} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "tjhí" ;
|
||||
lin pot111 = ss "tjhítì" ;
|
||||
lin pot1to19 d = ss ("tjhí" ++ d.s) ;
|
||||
lin pot0as1 n = {s = n.s ; zero = yes } ;
|
||||
lin pot1 d = ss (d.s ++ "tjhí") ;
|
||||
lin pot1plus d e = ss (d.s ++ "tjhí" ++ e.s) ;
|
||||
lin pot1as2 n = {s = n.s ; zero = yes } ;
|
||||
lin pot2 d = ss (d.s ++ "há") ;
|
||||
lin pot2plus d e = ss (d.s ++ "há" ++ if0 ! e.zero ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = n.s ++ "t'w" };
|
||||
lin pot3plus n m = ss (n.s ++ "t'w" ++ if0 ! m.zero ++ m.s) ;
|
||||
|
||||
oper if0 = table {yes => "ni" ++ "ka" ; nozero => []} ;
|
||||
|
||||
}
|
||||
100
examples/numerals/lamani.gf
Normal file
100
examples/numerals/lamani.gf
Normal file
@@ -0,0 +1,100 @@
|
||||
concrete lamani of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- the sporadic kam-forms not implemented (general minus formations are hardly possible to implement)
|
||||
|
||||
param DForm = unit | ten | teen | tene | next | inv ;
|
||||
param Size = sg | two | five | seven | nine | e25 | e75 | e50s | e90s | other ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; s2 : Str ; size : Size} ;
|
||||
oper LinSub100 = {s : Str ; s2 : Str ; s3 : Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\do -> \baara -> \bis -> \nxt -> \inverse ->
|
||||
{s = table {unit => do ; teen => baara ; ten => bis ; tene => bis + "e" ; next => nxt ; inv => inverse} ;
|
||||
s2 = do ++ "hajaar" ;
|
||||
size = other } ;
|
||||
|
||||
oper mkNumS : Str -> Str -> Str -> Str -> Str -> Size -> LinDigit =
|
||||
\do -> \baara -> \bis -> \nxt -> \inverse -> \sz ->
|
||||
{s = table {unit => do ; teen => baara ; ten => bis ; tene => bis + "e" ; next => nxt ; inv => inverse} ;
|
||||
s2 = do ++ "hajaar" ;
|
||||
size = sz } ;
|
||||
|
||||
-- lin n1 mkNum "ek" "gyaara" "das"
|
||||
lin n2 = mkNum "di" "baara" "vis" ("tin" ++ "se") "aaT" ;
|
||||
lin n3 = mkNumS "tin" "tera" "tis" ("caar"++ "se") "saat" two ;
|
||||
lin n4 = mkNum "caar" "cawda" "caaLis" ("paanc" ++ "se") "cho" ;
|
||||
lin n5 = mkNumS "paanc" "pandra" "pacaas" ("cho" ++ "se") "paanc" five;
|
||||
lin n6 = mkNum "cho" "sola" "saaT" ("saat" ++ "se") "caar" ;
|
||||
lin n7 = mkNumS "saat" "satara" "sattar" ("aaT" ++ "se") "tin" seven ;
|
||||
lin n8 = mkNum "aaT" "aTara" "ãysi" ("naw" ++ "se") "di" ;
|
||||
lin n9 = mkNumS "naw" "wagNis" "nawwad" "hajaar" "ek" nine;
|
||||
|
||||
oper ss : Str -> LinSub100 = \s1 -> {s = s1 ; s2 = s1 ++ "hajaar" ; s3 = s1 ; size = other} ;
|
||||
oper sssize : Str -> Str -> Size -> LinSub100 = \s1 -> \aux -> \sz ->
|
||||
{s = s1 ; s2 = s1 ++ "hajaar" ; s3 = aux ; size = sz} ;
|
||||
|
||||
oper spcsize : Size -> Size -> Size = \s1 -> \s2 ->
|
||||
table {two => table {five => e25 ; _ => other} ;
|
||||
five => table {_ => e50s} ;
|
||||
seven => table {five => e75 ; _ => other} ;
|
||||
nine => table {_ => e90s} ;
|
||||
_ => table {_ => other}} ! s1 ! s2 ;
|
||||
|
||||
lin pot01 = {s = table {unit => "ek" ; next => "di" ; inv => "naw" ; _ => "dummy" } ; s2 = "hajaar" ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "das" ;
|
||||
lin pot111 = ss "gyaara" ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = n.s2 ; s3 = (n.s ! unit) ; size = n.size} ;
|
||||
|
||||
lin pot1 d = sssize (d.s ! ten) [] (table {five => e50s ; _ => other} ! d.size) ;
|
||||
lin pot1plus d e = sssize (variants {(d.s ! tene) ++ "par" ++ (e.s ! unit) ; (d.s ! ten) ++ "an" ++ (e.s ! unit)}) (table {nine => e.s ! inv ; _ => e.s ! unit} ! d.size) (spcsize d.size e.size) ;
|
||||
|
||||
lin pot1as2 n = {s = n.s ; s2 = n.s2 } ;
|
||||
|
||||
lin pot2 d = {s = selsg d.size "so" ((d.s ! unit) ++ "se") ;
|
||||
s2 = selsg d.size [] ((d.s ! unit) ++ "laak") } ;
|
||||
|
||||
lin pot2plus d e =
|
||||
{s = mkso d.size e.size (table {e75 => d.s ! next ; e90s => d.s ! next ; _ => d.s ! unit} ! e.size)
|
||||
(table {e50s => e.s3 ; e90s => e.s3 ; _ => e.s } ! e.size) ;
|
||||
s2 = (d.s ! unit) ++ "laak" ++ (selsg e.size "hajaar" (e.s ++ "hajaar")) } ;
|
||||
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = n.s2 } ;
|
||||
lin pot3plus n m = {s = n.s2 ++ m.s } ;
|
||||
|
||||
oper selsg : Size -> Str -> Str -> Str = \sz -> \s1 -> \s2 -> table {sg => s1 ; _ => s2} ! sz ;
|
||||
|
||||
oper mkso : Size -> Size -> Str -> Str -> Str = \ds -> \es -> \auxd -> \auxe -> table {
|
||||
sg => table {e25 => "sawaa" + "se" ;
|
||||
e50s => "DoD" ++ "se" ++ auxe ;
|
||||
e75 => "pawNe" ++ auxd ;
|
||||
e90s => variants { auxd ++ "kam" ++ auxe ; auxe ++ "kam" ++ auxd} ;
|
||||
_ => "ek" ++ "so" ++ auxe} ;
|
||||
two => table {e50s => "aDaai" ++ auxe ;
|
||||
e25 => "sawaa" ++ auxd ++ "se" ;
|
||||
e75 => "pawNe" ++ auxd ;
|
||||
e90s => variants { auxd ++ "kam" ++ auxe ; auxe ++ "kam" ++ auxd} ;
|
||||
_ => "do" ++ "se" ++ auxe} ;
|
||||
_ => table {e50s => "saaDe" ++ auxd ++ "se" ++ auxe ;
|
||||
e25 => "sawaa" ++ auxd ++ "se" ;
|
||||
e75 => "pawNe" ++ auxd ;
|
||||
e90s => variants { auxd ++ "kam" ++ auxe ; auxe ++ "kam" ++ auxd} ;
|
||||
_ => auxd ++ "se" ++ auxe}
|
||||
} ! ds ! es ;
|
||||
|
||||
|
||||
}
|
||||
56
examples/numerals/latvian.gf
Normal file
56
examples/numerals/latvian.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
concrete latvian of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- c^
|
||||
-- s^
|
||||
-- n, is n with a comma under
|
||||
-- u^ with line over
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; s2 : Str };
|
||||
oper LinSub100 = {s : Str ; s2 : Str } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = LinSub100 ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \tri -> \tribase ->
|
||||
{ s = table {unit => tri ; teen => tribase + "padsmit" ; ten => tribase + "desmit" ; hundred => variants {tribase + "simt" ; tri ++ "simti"} } ; s2 = tribase + "tu^kstoš" };
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ []} ; -- Latin A Supplement diacritics ;
|
||||
|
||||
lin n2 = mkNum "divi" "div" ;
|
||||
lin n3 = mkNum "trīs" "trīs" ;
|
||||
lin n4 = mkNum "četri" "četr" ;
|
||||
lin n5 = mkNum "pieci" "piec" ;
|
||||
lin n6 = mkNum "seši" "seš" ;
|
||||
lin n7 = mkNum "septin,i" "septin," ;
|
||||
lin n8 = mkNum "aston,i" "aston," ;
|
||||
lin n9 = mkNum "devin,i" "devin," ;
|
||||
|
||||
oper mkR : Str -> LinSub100 = \n -> {s = n ; s2 = n ++ "tu^kstoš" } ;
|
||||
|
||||
lin pot01 = { s = table {hundred => "simts" ; _ => "viens" } ; s2 = "tu^kstotis" };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkR "desmit" ;
|
||||
lin pot111 = mkR "vienpadsmit" ;
|
||||
lin pot1to19 d = mkR (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = n.s2 } ;
|
||||
lin pot1 d = mkR (d.s ! ten) ;
|
||||
lin pot1plus d e = mkR ((d.s ! ten) ++ (e.s ! unit)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = mkR (d.s ! hundred) ;
|
||||
lin pot2plus d e = mkR ((d.s ! hundred) ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = n.s2} ;
|
||||
lin pot3plus n m = {s = n.s2 ++ m.s} ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
61
examples/numerals/lithuanian.gf
Normal file
61
examples/numerals/lithuanian.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
concrete lithuanian of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- y:
|
||||
-- e:
|
||||
-- i~
|
||||
-- s^
|
||||
-- m~
|
||||
-- n~
|
||||
-- ú:
|
||||
-- u,
|
||||
|
||||
param Size = sg | pl ;
|
||||
param DForm = unit | teen | ten ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size };
|
||||
oper LinSub100 = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = LinSub100 ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit = \tri -> \dvylika -> \tribase ->
|
||||
{ s = table {unit => tri ; teen => dvylika ; ten => tribase + "des^imt" } ; size = pl};
|
||||
|
||||
lin num x = {s = x.s} ; -- TODO ;
|
||||
|
||||
lin n2 = mkNum "dù" "dvýlika" "dvì" ;
|
||||
lin n3 = mkNum "try:s" "trýlika" "trìs" ;
|
||||
lin n4 = mkNum "keturì" "keturiólika" "ke:turias" ;
|
||||
lin n5 = mkNum "penkì" "penkiólika" "pen~kias" ;
|
||||
lin n6 = mkNum "s^es^ì" "s^es^iólika" "s^e:s^ias" ;
|
||||
lin n7 = mkNum "septynì" "septyniólika" "septýnias" ;
|
||||
lin n8 = mkNum "as^tuonì" "as^tuoniólika" "as^túonias" ;
|
||||
lin n9 = mkNum "devynì" "devyniólika" "devýnias" ;
|
||||
|
||||
oper mkR : Str -> LinSub100 = \n -> {s = n ; size = pl } ;
|
||||
|
||||
lin pot01 = { s = table {_ => "víenas" } ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkR (variants {"de:s^imt"; "des^imtìs" });
|
||||
lin pot111 = mkR "vienúolika" ;
|
||||
lin pot1to19 d = mkR (d.s ! teen) ;
|
||||
lin pot0as1 n = mkR (n.s ! unit) ;
|
||||
lin pot1 d = mkR (d.s ! ten) ;
|
||||
lin pot1plus d e = mkR ((d.s ! ten) ++ (e.s ! unit)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = mkR (selsg d.size "s^im~tas" ((d.s ! unit) ++ "s^imtai~")) ;
|
||||
lin pot2plus d e = mkR ((selsg d.size "s^im~tas" ((d.s ! unit) ++ "s^imtai~")) ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = selsg n.size "tú:kstantis" (n.s ++ "tú:kstanc^iu,") } ;
|
||||
lin pot3plus n m = {s = (selsg n.size "tú:kstantis" (n.s ++ "tú:kstanc^iu,")) ++ m.s} ;
|
||||
|
||||
oper selsg : Size -> Str -> Str -> Str = \sz -> \s1 -> \s2 ->
|
||||
table {sg => s1 ; pl => s2} ! sz ;
|
||||
|
||||
|
||||
}
|
||||
64
examples/numerals/lotuxo.gf
Normal file
64
examples/numerals/lotuxo.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
concrete lotuxo of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = Form ;
|
||||
lincat Sub10 = Form ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO: Encoding
|
||||
|
||||
oper mkNum : Str -> Form = \mbili ->
|
||||
{s = mbili; size = pl };
|
||||
|
||||
-- N [ng]
|
||||
-- E epsilon
|
||||
-- I i without dot
|
||||
-- O IPA for o in cod
|
||||
|
||||
-- lin n1 = mkNum "âbotye" ;
|
||||
lin n2 = mkNum "ârrexai" ;
|
||||
lin n3 = mkNum "xunixoi" ;
|
||||
lin n4 = mkNum "aNwan" ;
|
||||
lin n5 = mkNum "miet" ;
|
||||
lin n6 = mkNum "IllE" ;
|
||||
lin n7 = mkNum "xattarIk" ;
|
||||
lin n8 = mkNum "xottoxunik" ;
|
||||
lin n9 = mkNum "xOttONwan" ;
|
||||
|
||||
oper xo : Str = pre {"xO" ;
|
||||
"xo" / strs {"m" ; "xu" ; "xo"} ;
|
||||
"x'" / strs {"â" ; "a"}} ;
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = "âbotye" ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "'tOmOn" ;
|
||||
lin pot111 = ss ("'tOmOn" ++ xo ++ "âbotye") ;
|
||||
lin pot1to19 d = ss ("'tOmOn" ++ xo ++ d.s ) ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = ss ("atOmwana" ++ d.s ) ;
|
||||
lin pot1plus d e = ss ("atOmwana" ++ d.s ++ xo ++ e.s ) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (mkessixa d.size d.s) ;
|
||||
lin pot2plus d e = ss ((mkessixa d.size d.s) ++ "ikO" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = mktau n.size n.s } ;
|
||||
lin pot3plus n m = {s = (mktau n.size n.s) ++ "ikO" ++ m.s} ;
|
||||
|
||||
oper mkessixa : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => "EssIxa" ++ attr ;
|
||||
sg => variants {"EssIxa" ++ "âbotye"; "atOmwana" ++ "'tOmOn"}} ! sz ;
|
||||
oper mktau : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => "tausand" ++ attr ;
|
||||
sg => variants {"tausand" ++ "âbotye"; "EssIxa" ++ "'tOmOn"}} ! sz ;
|
||||
|
||||
}
|
||||
58
examples/numerals/maale.gf
Normal file
58
examples/numerals/maale.gf
Normal file
@@ -0,0 +1,58 @@
|
||||
concrete maale of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
param DForm = unit | ten ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = {s : Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO: Encoding
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \mbili -> \lama ->
|
||||
{s = table {unit => mbili ; ten => lama + "-támmi" }; size = pl };
|
||||
|
||||
-- b> is b with right bend
|
||||
-- ? without dot
|
||||
-- $ IPA [sh]
|
||||
|
||||
-- lin n1 = mkNum "pétte" ;
|
||||
lin n2 = mkNum "lam?ó" "lamá";
|
||||
lin n3 = mkNum "haitsó" "haytsí" ;
|
||||
lin n4 = mkNum "?oidó" "?oydí";
|
||||
lin n5 = mkNum "dóngo" "dóngi";
|
||||
lin n6 = mkNum "láhhó" "láhhi";
|
||||
lin n7 = mkNum "lánkayi" "lánkayi";
|
||||
lin n8 = mkNum "sálli" "sálli" ;
|
||||
lin n9 = mkNum "tásub>a" "tázub>i";
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {f => "pétte" }; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "táb>b>ó" ;
|
||||
lin pot111 = ss ("táb>b>ó" ++ "pétte") ;
|
||||
lin pot1to19 d = ss ("táb>b>ó" ++ (d.s ! unit)) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size } ;
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e = ss (d.s ! ten ++ e.s ! unit) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = mkseeta d.size (d.s ! unit) };
|
||||
lin pot2plus d e = {s = (mkseeta d.size (d.s ! unit)) ++ e.s} ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = n.s ++ "$íya"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "$íya" ++ m.s} ;
|
||||
|
||||
oper mkseeta : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => attr ++ "s'ééta" ;
|
||||
sg => "s'ééta" } ! sz ;
|
||||
|
||||
}
|
||||
74
examples/numerals/malay.gf
Normal file
74
examples/numerals/malay.gf
Normal file
@@ -0,0 +1,74 @@
|
||||
concrete malay of Numerals = {
|
||||
-- Malay Numerals (Indonesian)
|
||||
-- David Wahlstedt Sep 2002
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param
|
||||
Place = attr | indep ;
|
||||
Nm = sg | pl ;
|
||||
|
||||
oper Num = {inh : Nm ; s : Place => Str} ;
|
||||
|
||||
lincat
|
||||
Numeral = {s : Str} ;
|
||||
Digit = {s : Str} ;
|
||||
Sub10 = Num ;
|
||||
Sub100 = Num ;
|
||||
Sub1000 = Num ;
|
||||
Sub1000000 = {s : Str} ;
|
||||
|
||||
oper
|
||||
ratus : Nm => Str = -- 100
|
||||
table {{sg} => "seratus" ; {pl} => "ratus"} ;
|
||||
|
||||
ribu : Nm => Str = -- 1000
|
||||
table {{sg} => "seribu" ; {pl} => "ribu"} ;
|
||||
|
||||
mkTab : Str -> Place => Str = \s -> table { _ => s } ;
|
||||
|
||||
mkNum : Str -> Num = \s -> {inh = pl ; s = mkTab s} ;
|
||||
|
||||
ss : Str -> { s : Str } = \s -> { s = s } ;
|
||||
|
||||
lin
|
||||
num x0 = x0 ;
|
||||
|
||||
n2 = ss "dua" ;
|
||||
n3 = ss "tiga" ;
|
||||
n4 = ss "empat" ;
|
||||
n5 = ss "lima" ;
|
||||
n6 = ss "enam" ;
|
||||
n7 = ss "tujuh" ;
|
||||
n8 = ss "delapan" ;
|
||||
n9 = ss "sembilan" ;
|
||||
|
||||
pot01 = {inh = sg ; s = table {{attr} => [] ; {indep} => "satu"}} ;
|
||||
|
||||
pot0 d = mkNum d.s ;
|
||||
|
||||
pot110 = mkNum "sepuluh" ;
|
||||
|
||||
pot111 = mkNum "sebelas" ;
|
||||
|
||||
pot1to19 d = mkNum ( d.s ++ "belas" ) ;
|
||||
|
||||
pot0as1 n = n ;
|
||||
|
||||
pot1 d = mkNum ( d.s ++ "puluh" ) ;
|
||||
|
||||
pot1plus d e = mkNum ( d.s ++ "puluh" ++ e.s ! indep ) ;
|
||||
|
||||
pot1as2 n = n ;
|
||||
|
||||
pot2 d = mkNum ( d.s ! attr ++ ratus ! d.inh ) ;
|
||||
|
||||
pot2plus d e = mkNum ( d.s ! attr ++ ratus ! d.inh ++ e.s ! indep ) ;
|
||||
|
||||
pot2as3 n = ss ( n.s ! indep ) ;
|
||||
|
||||
pot3 n = ss ( n.s ! attr ++ ribu ! n.inh ) ;
|
||||
|
||||
pot3plus n m = ss ( n.s ! attr ++ ribu ! n.inh ++ m.s ! indep ) ;
|
||||
|
||||
}
|
||||
62
examples/numerals/maltese.gf
Normal file
62
examples/numerals/maltese.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
concrete maltese of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | teenil | ten | hund ;
|
||||
param Size = sg | pl | dual ;
|
||||
|
||||
oper LinDigit = {s: DForm => Str ; s2 : Str ; size : Size } ;
|
||||
oper Form = {s : Str ; s2 : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
lin num x = x ; -- TODO
|
||||
|
||||
oper mkN : Str -> Str -> Str -> Str -> Str -> LinDigit = \u -> \tn -> \t -> \h -> \e ->
|
||||
{s = table {unit => u ; teen => tn + "ax" ; teenil => tn + "ax" + "il" ;
|
||||
ten => t ; hund => h ++ "mija"} ; s2 = e ; size = pl };
|
||||
|
||||
lin n2 =
|
||||
{s = table {unit => "tnejn" ;
|
||||
teen => "tnax" ; teenil => "tnax-il" ;
|
||||
ten => "gh-oxrin" ;
|
||||
hund => "mitejn"} ; s2 = "tnejn" ; size = dual} ;
|
||||
lin n3 = mkN "tlieta" "tlett" "tletin" "tliet" "tlitt";
|
||||
lin n4 = mkN "erbgh-a" "erbat" "erbgh-in" "erba'" "erbat";
|
||||
lin n5 = mkN "h-amsa" "h-mist" "h-amsin" "h-ames" "h-amest" ;
|
||||
lin n6 = mkN "sitta" "sitt" "sitt" "sitt" "sitt";
|
||||
lin n7 = mkN "sebgh-a" "sbat" "sbebgh-in" "seba'" "sebat" ;
|
||||
lin n8 = mkN "tmienja" "tmint" "tmenin" "tmien" "tmint" ;
|
||||
lin n9 = mkN "disgh-a" "dsat" "disgh-in" "disa'" "disat";
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; s2 = s1 ; size = pl };
|
||||
oper ss2 : Str -> Str -> Form = \a -> \b -> {s = a ; s2 = b ; size = pl };
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "wieh-ed" ; teen => "h-dax" ; _ => "mija" } ;
|
||||
s2 = "wieh-ed" ;
|
||||
size = sg};
|
||||
lin pot0 d = d;
|
||||
lin pot110 = ss "gh-axra" ;
|
||||
lin pot111 = ss2 "h-dax" "h-dax-il";
|
||||
lin pot1to19 d = ss2 (d.s ! teen) (d.s ! teenil);
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = n.s2 ; size = n.size} ;
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e = ss ((e.s ! unit) ++ "u" ++ (d.s ! ten)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (d.s ! hund) ;
|
||||
lin pot2plus d e = ss2 ((d.s ! hund) ++ "u" ++ e.s)
|
||||
((d.s ! hund) ++ "u" ++ e.s2) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = { s = (elf n.s2) ! n.size } ;
|
||||
lin pot3plus n m = { s = (elf n.s2) ! n.size ++ m.s} ;
|
||||
|
||||
oper elf : Str -> Size => Str = \attr ->
|
||||
table {pl => attr ++ "elef" ; dual => "elfejn" ; sg => "elf"} ;
|
||||
|
||||
|
||||
}
|
||||
48
examples/numerals/mapuche.gf
Normal file
48
examples/numerals/mapuche.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
concrete mapuche of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper All = {s : Str ; size : Size};
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = All ;
|
||||
lincat Sub10 = All ;
|
||||
lincat Sub100 = All ;
|
||||
lincat Sub1000 = All ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> All = \tri ->
|
||||
{ s = tri ; size = pl};
|
||||
|
||||
lin num x = {s = x.s } ;
|
||||
|
||||
lin n2 = mkNum "epu" ;
|
||||
lin n3 = mkNum "külá" ;
|
||||
lin n4 = mkNum "meli" ;
|
||||
lin n5 = mkNum "kechu" ;
|
||||
lin n6 = mkNum "kayu" ;
|
||||
lin n7 = mkNum "reqle" ;
|
||||
lin n8 = mkNum "pura" ;
|
||||
lin n9 = mkNum "aylla" ;
|
||||
|
||||
oper ss : Str -> All = \s1 -> {s = s1 ; size = pl } ;
|
||||
|
||||
lin pot01 = { s = "kiñe" ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "mari" ;
|
||||
lin pot111 = ss ("mari" ++ "kiñe") ;
|
||||
lin pot1to19 d = ss ("mari" ++ d.s );
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = ss (d.s ++ "mari" );
|
||||
lin pot1plus d e = ss (d.s ++ "mari" ++ e.s ) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (((selsg d.s) ! d.size) ++ "pataka" ) ;
|
||||
lin pot2plus d e = ss (((selsg d.s) ! d.size) ++ "pataka" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = (selsg n.s) ! n.size ++ "warangka" } ;
|
||||
lin pot3plus n m = {s = (selsg n.s) ! n.size ++ "warangka" ++ m.s} ;
|
||||
|
||||
oper selsg : Str -> Size => Str = \s -> table {sg => [] ; pl => s } ;
|
||||
|
||||
}
|
||||
56
examples/numerals/margi.gf
Normal file
56
examples/numerals/margi.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
concrete margi of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | ten | oxy ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
oper LinS100 = {s : Str ; s2 : Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit = \u -> \o -> \t ->
|
||||
{s = table {unit => u ; ten => t + "kùmì" ; oxy => o} ; size = pl} ;
|
||||
|
||||
oper mkNum2 : Str -> Str -> LinDigit = \u -> \t ->
|
||||
{s = table {unit => u ; ten => t + "kùmì" ; oxy => u} ; size = pl} ;
|
||||
|
||||
lin num x0 = {s = x0.s } ; -- TODO
|
||||
|
||||
lin n2 = mkNum "s`&d>àN" "m'&tlú*" "m'&tl" ;
|
||||
lin n3 = mkNum2 "mák`&r" "már" ;
|
||||
lin n4 = mkNum (variants {"fòd>ù*" ; "fwàd>ù*"}) "fód>ú*" (variants {"fód>ú" ;"fód>"}) ;
|
||||
lin n5 = mkNum (variants {"nt`&fù*" ; "mt`&fù*"}) "nt'&fú*" "nt'&f";
|
||||
lin n6 = mkNum2 "Nkwà" "Nkwá";
|
||||
lin n7 = mkNum2 "m'&d>'&fù*" "m'&d>'&f" ;
|
||||
lin n8 = mkNum (variants {"ntsìsù*" ; "ncìsù*"}) "ntsísú*" "ntsís" ;
|
||||
lin n9 = mkNum "'&mdlù*" "mdlù*" "'&mdlù" ;
|
||||
|
||||
oper pwaser : Size => Str = table {sg => "s'&r" ; pl => "pwá"} ;
|
||||
oper selsg : Str -> Str -> Size => Str = \s1 -> \attr ->
|
||||
table {sg => s1 ; pl => s1 ++ attr} ;
|
||||
|
||||
oper ss : Str -> LinS100 = \s1 -> {s = s1 ; s2 = s1 ; size = pl } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "táN" ; oxy => "pátlú*" ; ten => "dummy" } ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss (variants { "kúmú*" ; "kúmù*" });
|
||||
lin pot111 = ss ("kúm" ++ "gà" ++ (variants {"s'&r" ; "s'&rnyá"}) ++ "táN") ;
|
||||
lin pot1to19 d = ss ("kúm" ++ "gà" ++ "pwá" ++ d.s ! oxy) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = n.s ! oxy ; size = n.size };
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e = ss (d.s ! ten ++ "gà" ++ (pwaser ! e.size) ++ e.s ! oxy) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss ((selsg "ghàrú" (d.s ! unit)) ! d.size) ;
|
||||
lin pot2plus d e = ss ((selsg "ghàrú" (d.s ! unit) ! d.size) ++ "agá" ++ e.s2);
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = selsg "dúbú" n.s ! n.size };
|
||||
lin pot3plus n m = {s = ((selsg "dúbú" n.s) ! n.size) ++ m.s2 };
|
||||
|
||||
}
|
||||
74
examples/numerals/maybrat.gf
Normal file
74
examples/numerals/maybrat.gf
Normal file
@@ -0,0 +1,74 @@
|
||||
concrete maybrat of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; even20 : Even20 } ;
|
||||
|
||||
oper mk20Ten : Str -> Str -> Str -> LinDigit = \tri -> \t -> \h ->
|
||||
{ s = table {unit => tri ; unit2 => t ; twenty => "rae" ++ h } ;
|
||||
even20 = ten};
|
||||
|
||||
oper mkEven20 : Str -> Str -> Str -> LinDigit = \se -> \t -> \h ->
|
||||
{ s = table {unit => se ; unit2 => t ; twenty => "rae" ++ h } ;
|
||||
even20 = even};
|
||||
|
||||
oper na = {s = "N/A"} ;
|
||||
|
||||
param Even20 = ten | even ;
|
||||
param DForm = unit | unit2 | twenty ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str } ;
|
||||
lincat Sub1000 = {s : Str } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 = mkEven20 (variants{"ewok"; "eok"})
|
||||
("krem" ++ "ewok")
|
||||
("sait" ++ "yhai") ;
|
||||
lin n3 = mk20Ten "tuf"
|
||||
("krem" ++ "tuf")
|
||||
("sait" ++ "yhai") ;
|
||||
lin n4 = mkEven20 "tiet"
|
||||
("krem" ++ "tiet")
|
||||
("ewok" ++ "mhai") ;
|
||||
lin n5 = mk20Ten (variants {"mat" ; "temsau"})
|
||||
("sau" ++ "muf")
|
||||
("ewok" ++ "mhai") ;
|
||||
lin n6 = mkEven20 ("krem" ++ "sau")
|
||||
("sau" ++ "krem" ++ "sau")
|
||||
("tuf" ++ "mhai") ;
|
||||
lin n7 = mk20Ten ("krem" ++ "ewok")
|
||||
("sau" ++ "krem" ++ "ewok")
|
||||
("tuf" ++ "mhai") ;
|
||||
lin n8 = mkEven20 ("krem" ++ "tuf")
|
||||
("sau" ++ "krem" ++ "tuf")
|
||||
("tiet" ++ "mhai") ;
|
||||
lin n9 = mk20Ten ("krem" ++ "tiet")
|
||||
("sau" ++ "krem" ++ "tiet")
|
||||
("tiet" ++ "mhai") ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "sau" ; unit2 => "krem" ++ "sau" ; twenty => "dummy" } ;
|
||||
even20 = ten };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "statem" } ;
|
||||
lin pot111 = {s = "oo" ++ "krem" ++ "sau" } ;
|
||||
lin pot1to19 d = {s = "oo" ++ d.s ! unit2 } ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ;
|
||||
lin pot1 d =
|
||||
{s = table {even => d.s ! twenty ;
|
||||
ten => (d.s ! twenty) ++ "statem"} ! d.even20} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {even => d.s ! twenty ++ e.s ! unit ;
|
||||
ten => (d.s ! twenty) ++ (e.s ! unit2)} ! d.even20} ;
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = na;
|
||||
lin pot2plus d e = na;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = na ;
|
||||
lin pot3plus n m = na ;
|
||||
|
||||
}
|
||||
56
examples/numerals/miya.gf
Normal file
56
examples/numerals/miya.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
concrete miya of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
param DForm = unit | acc ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO: Encoding
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \mbili -> \lama ->
|
||||
{s = table {unit => mbili ; acc => lama }; size = pl };
|
||||
|
||||
-- lin n1 = mkNum "wút`&" ;
|
||||
lin n2 = mkNum "ts`&r" "ts'&r";
|
||||
lin n3 = mkNum "kìdi" "kídì" ;
|
||||
lin n4 = mkNum "f`&d>&" "f'&d>&";
|
||||
lin n5 = mkNum "vàatl&" "vaatl&";
|
||||
lin n6 = mkNum "màaha" "máahà";
|
||||
lin n7 = mkNum "màats&r" "máats`&r";
|
||||
lin n8 = mkNum "f´&rf´&d>&" "f`&rf´&d>&" ;
|
||||
lin n9 = mkNum "kùciya" "kúcìya";
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; size = pl} ;
|
||||
oper behan = "bèh&n" ;
|
||||
oper enaa = "'`&náa" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "wút`&" ; acc => "wut'&"}; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "d'&rb>itim" ;
|
||||
lin pot111 = ss (variants {behan ++ "wut'&";"d'&rb>itim" ++ behan ++ "wut'&"});
|
||||
lin pot1to19 d = ss (variants {behan ++ (d.s ! acc); "d'&rb>itim" ++ behan ++ d.s ! acc}) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size } ;
|
||||
lin pot1 d = ss ("díb>i" ++ d.s ! unit) ;
|
||||
lin pot1plus d e = ss ("díb>i" ++ d.s ! unit ++ behan ++ e.s ! acc) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss ("d>àriy" ++ selsg d.size (d.s ! unit));
|
||||
lin pot2plus d e = ss ("d>àriy" ++ (selsg d.size (d.s ! unit)) ++ enaa ++ e.s);
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = "d'&bu" ++ (selsg n.size n.s)} ;
|
||||
lin pot3plus n m = {s = "d'&bu" ++ (selsg n.size n.s) ++ enaa ++ m.s} ;
|
||||
|
||||
oper selsg : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => attr ; sg => variants {[] ; attr} } ! sz ;
|
||||
|
||||
|
||||
}
|
||||
64
examples/numerals/mongolian.gf
Normal file
64
examples/numerals/mongolian.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
concrete mongolian of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param Size = sg | pl | tenplus ;
|
||||
param S100 = indep | tenpart | tenelfu | sihpart ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
oper LinSub100 = {s : S100 => Str ; size : Size} ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \hulatt -> \haya ->
|
||||
{s = table {unit => hulatt ; ten => haya} ; size = pl} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ;
|
||||
lin n2 = mkNum "qoyar" "qorin" ;
|
||||
lin n3 = mkNum "Gurban" "gučin" ;
|
||||
lin n4 = mkNum "dörbän" "döčin" ;
|
||||
lin n5 = mkNum "tabun" "tabin" ;
|
||||
lin n6 = mkNum "ĵirGu'an" "ĵirin" ;
|
||||
lin n7 = mkNum "dolo'an" "dalan" ;
|
||||
lin n8 = mkNum "naiman" "nayan" ;
|
||||
lin n9 = mkNum "yisün" "ĵarin" ;
|
||||
|
||||
oper ss1 : Str -> Str -> Str -> LinSub100 = \assir -> \ten -> \unitpart ->
|
||||
{s = table {indep => assir ; tenpart => ten ; tenelfu => [] ; sihpart => unitpart} ; size = tenplus } ;
|
||||
|
||||
oper ss : Str -> Str -> Str -> LinSub100 = \assir -> \ten -> \unitpart ->
|
||||
{s = table {indep => assir ; tenpart => ten ; tenelfu => ten ; sihpart => unitpart} ; size = tenplus } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "nigän" ; ten => "arban" }; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss1 "arban" "nigän" [] ;
|
||||
lin pot111 = ss1 ("arban" ++ "nigän") "nigän" "mingGan" ;
|
||||
lin pot1to19 d = ss1 ("arban" ++ d.s ! unit) "nigän" (mkmingGan d.size (d.s ! unit)) ;
|
||||
lin pot0as1 n = {s = table {indep => n.s ! unit ; sihpart => mkmingGan n.size (n.s ! unit) ; _ => [] } ; size = n.size} ;
|
||||
lin pot1 d = ss (d.s ! ten) (d.s ! unit) [] ;
|
||||
lin pot1plus d e = ss ((d.s ! ten) ++ (e.s ! unit))
|
||||
(d.s ! unit)
|
||||
(mkmingGan e.size (e.s ! unit));
|
||||
|
||||
lin pot1as2 n = {s = n.s ! indep ; s2 = n.s ! tenelfu ++ "tümän" ++ n.s ! sihpart ; size = n.size} ;
|
||||
|
||||
lin pot2 d = {s = (sel d.size [] (d.s ! unit)) ++ "ĵa'un" ;
|
||||
s2 = sel d.size "arban" (d.s ! ten) ; size = tenplus} ;
|
||||
lin pot2plus d e = {s = (sel d.size [] (d.s ! unit)) ++ "ĵa'un" ++ e.s ! indep ; s2 = d.s ! ten ++ e.s ! tenpart ++ "tümän" ++ e.s ! sihpart ; size = tenplus} ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = table {pl => n.s ++ "mingGan" ; sg => "mingGan" ; tenplus => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m = {s = table {pl => n.s ++ "mingGan" ; sg => "mingGan" ; tenplus => n.s2 } ! n.size ++ m.s} ;
|
||||
|
||||
oper mkmingGan : Size -> Str -> Str = \sz -> \attr -> (sel sz [] attr) ++ "mingGan" ;
|
||||
|
||||
oper sel : Size -> Str -> Str -> Str = \sz -> \a -> \b -> table {sg => a ; _ => b} ! sz ;
|
||||
|
||||
}
|
||||
70
examples/numerals/nenets.gf
Normal file
70
examples/numerals/nenets.gf
Normal file
@@ -0,0 +1,70 @@
|
||||
concrete nenets of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- #n-
|
||||
-- #t-
|
||||
-- #l-
|
||||
-- #s' with , ontop of s
|
||||
-- #N for n with a thing on the right leg i.e IPA [ng]
|
||||
-- #|~ a vertical tilde in thge top right corner
|
||||
|
||||
param DForm = unit | teen ;
|
||||
param Size = sg | nine | pl ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
oper LinS100 = {s : Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s } ; -- TODO Encoding
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit =
|
||||
\u -> \t -> {s = table {unit => u ; teen => t } ; size = pl} ;
|
||||
|
||||
lin n2 = mkNum (variants {"side"; "sidea"}) "sidejaNan-â|~" ;
|
||||
lin n3 = mkNum (variants {"n-ahar" ; "nâr"}) "n-aharaNan-â|~" ;
|
||||
lin n4 = mkNum (variants {"t-êt" ; "t-iet" ; "tiet"}) "t-êtaNan-â|~" ;
|
||||
lin n5 = mkNum (variants {"saml-aN" ; "sambl-aN" ; "sambel-ank" })
|
||||
"saml-an-aNan-â|~";
|
||||
lin n6 = mkNum "mat'" "mat-aNan-â|~";
|
||||
lin n7 = mkNum (variants {"siu" ; "s'eu"}) "siujaNan-â|~" ;
|
||||
lin n8 = mkNum "sidend-êt" "sidend-êtaNan-â|~" ;
|
||||
lin n9 = {s = table {unit => variants {"hâsawaju'" ; "habeiju'"} ;
|
||||
teen => "hâsawajujaNan-â|~" } ;
|
||||
size = nine} ;
|
||||
|
||||
oper ss : Str -> LinS100 = \s1 -> {s = s1 ; size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => variants {"~ob" ; "~opoi" } ; _ => "dummy" }; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss (variants {"ju'" ; "lûcaju'" ; "lûsaju'" }) ;
|
||||
lin pot111 = ss (variants {"~objaNan-â|~"; "~objaNn-â" ; "~objaNa"}) ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = ss (ifnine d.size (d.s ! unit)) ;
|
||||
lin pot1plus d e = ss ((ifnine d.size (d.s ! unit)) ++ (e.s ! unit)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (mkjur d.size (d.s ! unit)) ;
|
||||
lin pot2plus d e = ss ((mkjur d.size (d.s ! unit)) ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = mkjuonar n.size n.s } ;
|
||||
lin pot3plus n m = {s = (mkjuonar n.size n.s) ++ m.s } ;
|
||||
|
||||
oper mkjuonar : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {nine => attr ++ "juonar" ;
|
||||
sg => variants {"juonar" ; "jônar" ; "ju" ++ "jur"} ;
|
||||
pl => attr ++ "juonar" } ! sz ;
|
||||
|
||||
oper mkjur : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {sg => "jur" ; _ => attr ++ "jur" } ! sz ;
|
||||
|
||||
oper ifnine : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {nine => "hâsawajur" ; _ => attr ++ "ju'" } ! sz ;
|
||||
|
||||
}
|
||||
50
examples/numerals/norwegian_book.gf
Normal file
50
examples/numerals/norwegian_book.gf
Normal file
@@ -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) ;
|
||||
|
||||
|
||||
}
|
||||
65
examples/numerals/old_church_slavonic.gf
Normal file
65
examples/numerals/old_church_slavonic.gf
Normal file
@@ -0,0 +1,65 @@
|
||||
concrete old_church_slavonic of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- je, jo, ja for je, jo, ja etc
|
||||
-- U, I yers
|
||||
-- ä is jat'
|
||||
-- q is [ch]
|
||||
-- y for [bi]
|
||||
-- e~, o~
|
||||
-- w for [sh]
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=OCScyrillic ;
|
||||
|
||||
param Size = sg | dual | threefour | fiveup ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub10 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub100 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Size -> {s : Str ; s2 : Str ; size : Size} =
|
||||
\petI -> \sz -> { s = petI ; s2 = petI ; size = sz};
|
||||
|
||||
oper mkNum5 : Str -> {s : Str ; s2 : Str ; size : Size} = \s -> mkNum s fiveup ;
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ []} ; -- the Old Church Slavonic Cyrillic script ;
|
||||
|
||||
lin n2 = {s = "дъва" ; s2 = [] ; size = dual };
|
||||
lin n3 = mkNum (variants {"триѥ" ; "трьѥ" }) threefour ;
|
||||
lin n4 = mkNum "четыре" threefour ;
|
||||
lin n5 = mkNum5 "пѧть" ;
|
||||
lin n6 = mkNum5 "шесть" ;
|
||||
lin n7 = mkNum5 "седмь" ;
|
||||
lin n8 = mkNum5 "осмь" ;
|
||||
lin n9 = mkNum5 "девѧть" ;
|
||||
|
||||
lin pot01 = { s = "ѥдинъ" ; s2 = [] ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkNum5 "десѧть" ;
|
||||
lin pot111 = mkNum5 ("ѥдинъ" ++ "на" ++ "десѧте") ;
|
||||
lin pot1to19 d = mkNum5 (d.s ++ "на" ++ "десѧте") ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = {s = mkTen d.size d.s ; s2 = mkTen d.size d.s ; size = fiveup} ;
|
||||
lin pot1plus d e = {s = mkTen d.size d.s ++ variants {"и" ; "ти"} ++ e.s ; s2 =mkTen d.size d.s ++ variants {"и" ; "ти"} ++ mkattr e.size e.s ; size = e.size} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = mkHund d.size d.s ; s2 = mkHund d.size d.s ; size = fiveup} ;
|
||||
lin pot2plus d e = { s = mkHund d.size d.s ++ e.s ; s2 = mkHund d.size d.s ++ e.s2 ; size = e.size } ;
|
||||
lin pot2as3 n = {s = n.s };
|
||||
lin pot3 n = {s = n.s2 ++ mkThou n.size} ;
|
||||
lin pot3plus n m = {s = n.s2 ++ mkThou n.size ++ m.s} ;
|
||||
|
||||
oper mkThou : Size -> Str = \sz ->
|
||||
table {sg => (variants {"тысѭшти" ; "тысѩшти"}) ; dual => ("дъвѣ" ++ "тысѭшти") ; threefour => "тысѭштѧ" ; fiveup => "тысѭшть" } ! sz ;
|
||||
|
||||
oper mkHund : Size -> Str -> Str = \sz -> \s ->
|
||||
table {sg => "съто" ; dual => "дъвѣ" ++ "сътѣ" ; threefour => s ++ "съта" ; fiveup => s ++ "сътъ" } ! sz ;
|
||||
|
||||
oper mkTen : Size -> Str -> Str = \sz -> \s ->
|
||||
table {sg => "десѧть" ; dual => s ++ "десѧти" ; threefour => s ++ "десѧте" ; fiveup => s ++ "десѧтъ" } ! sz ;
|
||||
|
||||
oper mkattr : Size -> Str -> Str = \sz -> \s -> table {dual => [] ; _ => s} ! sz;
|
||||
|
||||
}
|
||||
55
examples/numerals/oromo.gf
Normal file
55
examples/numerals/oromo.gf
Normal file
@@ -0,0 +1,55 @@
|
||||
concrete oromo of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl ;
|
||||
param DForm = unit | teen | ten | ten2 ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 = {s = x0.s} ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \u ->
|
||||
{s = table {unit => u ; teen => "kudha" + u; ten => u + "tama" ; ten2 => u + "tamii"}; size = pl };
|
||||
|
||||
oper mkNum2 : Str -> Str -> LinDigit = \u -> \t ->
|
||||
{s = table {unit => u ; teen => "kudha" + u; ten => t + "a" ; ten2 => t + "ii"}; size = pl };
|
||||
|
||||
-- lin n1 = mkNum "tokko" ;
|
||||
lin n2 = mkNum2 "lama" "digdam";
|
||||
lin n3 = {s = table {unit => "sadii" ; teen => "kudhasadii" ; ten => "soddoma" ; ten2 => "soddomii"} ; size = pl};
|
||||
lin n4 = {s = table {unit => "afur" ; teen => variants {"kudha'afur" ; "kudhafur"} ; ten => "afur" + "tama" ; ten2 => "afur" + "tamii"} ; size = pl} ;
|
||||
lin n5 = mkNum "shan" ;
|
||||
lin n6 = mkNum2 (variants {"ja'a" ; "jaha"}) "jaatam" ;
|
||||
lin n7 = mkNum2 "torba" "torbaatam";
|
||||
lin n8 = mkNum "saddeet" ;
|
||||
lin n9 = mkNum "sagal" ;
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {f => "tokko" }; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "kudhan" ;
|
||||
lin pot111 = ss "kudhatokko" ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size } ;
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e = ss (d.s ! ten2 ++ e.s ! unit) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (selsg (d.s ! unit) "dhibba" ! d.size);
|
||||
lin pot2plus d e = ss (selsg (d.s ! unit) "dhibba" ! d.size ++ "fi" ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = (selsg n.s "kuma") ! n.size} ;
|
||||
lin pot3plus n m = {s = (selsg n.s "kuma") ! n.size ++ "fi" ++ m.s} ;
|
||||
|
||||
oper selsg : Str -> Str -> Size => Str = \attr -> \i ->
|
||||
table {pl => i ++ attr ; sg => variants {i ; i ++ attr }} ;
|
||||
|
||||
}
|
||||
97
examples/numerals/pashto.gf
Normal file
97
examples/numerals/pashto.gf
Normal file
@@ -0,0 +1,97 @@
|
||||
concrete pashto of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=extendedarabic ;
|
||||
|
||||
param DForm = unit | ten | teen | spctwo | twenties;
|
||||
param Size = sg | two | less100 | more100 ;
|
||||
|
||||
-- From Herbert Penzl's Pashto book. There's no standard orthography of
|
||||
-- Pashto so minor deviations may occur
|
||||
-- yaw can occur beforer zar and sal but usually doesn't
|
||||
-- [e] is yaw with two vertical under
|
||||
-- [$] is Ha with three dots above
|
||||
-- [X] is Sin with one dot below and one above
|
||||
-- [A] shouldnt have dots
|
||||
-- [p] is be with three dots below like Persian
|
||||
-- [G] is za/ra etc with one dot below and one above
|
||||
-- [a] should not have a hamza
|
||||
-- [P] is a Ha with a hamza above
|
||||
-- [R] is an r with a ring below
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Extented-Arabic environment
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit =
|
||||
\dwA -> \cl -> \dwwls ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; spctwo => dwA ; twenties => dwA + "وىشت"} ; size = less100 } ;
|
||||
|
||||
oper mkIrrNum : Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\dwA -> \cl -> \dwwls -> \dw -> \dr ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; spctwo => dw ; twenties
|
||||
=> dr + "وىشت"} ; size = less100 } ;
|
||||
|
||||
-- lin n1 mkNum "يو" "لس" ... ;
|
||||
lin n2 = {s = table {unit => "دوه" ; ten => "شل" ; teen => "دوولس" ;
|
||||
spctwo => "دو" ; twenties => "دوه" + "وىشت" } ;
|
||||
size = two };
|
||||
lin n3 = mkIrrNum "دري" "دۍرش" "ديارلس" "دري" "در" ;
|
||||
lin n4 = mkIrrNum "څلور" "څلوۍښت" "څورلس" "څلور" "څلۍر";
|
||||
lin n5 = mkNum "پنځه" "پنځوس" (variants { "پنځهلس"; "پنځلس"}) ;
|
||||
lin n6 = mkNum "شپږ" "شپۍته" "سپاړلس" ;
|
||||
lin n7 = mkNum "اوه" "اويا" (variants {"اوهلس"; "اولس"}) ;
|
||||
lin n8 = mkNum "اته" "اتيا" (variants {"اتهلس"; "اتلس"}) ;
|
||||
lin n9 = mkNum "نه" "نوي" (variants {"نولس"; "نونس"}) ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "يو" ;
|
||||
spctwo => "يو" ;
|
||||
twenties => "يو" + "وىشت" ;
|
||||
_ => "دuممي" } ; size = sg} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; size = less100} ;
|
||||
lin pot110 = {s = "لس" ; size = less100} ;
|
||||
lin pot111 = {s = "يوولس" ; size = less100} ;
|
||||
lin pot1to19 d = {s = d.s ! teen ; size = less100} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; size = less100} ;
|
||||
lin pot1plus d e = {s = table {two => e.s ! twenties ;
|
||||
_ => e.s ! spctwo ++ (d.s ! ten) } ! d.size ;
|
||||
size = less100} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = "دuممي" ; size = n.size } ;
|
||||
lin pot2 d = {s = (mkswA (d.s ! unit)) ! d.size ; s2 = (mklk (d.s ! unit)) ! d.size ; size = more100} ;
|
||||
lin pot2plus d e =
|
||||
{s = (mkvarswA (d.s ! unit)) ! d.size ++ "او" ++ e.s ;
|
||||
s2 = (mklk (d.s ! unit)) ! d.size ++ e.s ++ (mkzrA ! e.size) ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = table { sg => "زر" ;
|
||||
two => n.s ++ "زره" ;
|
||||
less100 => n.s ++ "زره" ;
|
||||
more100 => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table { sg => variants {"زر" ; "يو" ++ "زر"} ;
|
||||
two => n.s ++ "زره" ;
|
||||
less100 => n.s ++ "زره" ;
|
||||
more100 => n.s2 } ! n.size ++ maybeaw ! m.size ++ m.s} ;
|
||||
|
||||
|
||||
oper mklk : Str -> Size => Str = \s -> table {sg => "لك" ; _ => s ++ "لك"} ;
|
||||
oper maybeaw : Size => Str = table {more100 => [] ; _ => "او"} ;
|
||||
oper mkswA : Str -> Size => Str = \s -> table {sg => "سل" ; _ => s ++ "سوه"} ;
|
||||
oper mkvarswA : Str -> Size => Str =
|
||||
\s -> table {sg => (variants {"سل" ; "يو" ++ "سل"}) ; _ => s ++ "سوه"} ;
|
||||
oper mkzrA : Size => Str = table {sg => "زر" ; _ => "زره"} ;
|
||||
|
||||
|
||||
}
|
||||
100
examples/numerals/polish.gf
Normal file
100
examples/numerals/polish.gf
Normal file
@@ -0,0 +1,100 @@
|
||||
concrete polish of Numerals = {
|
||||
-- numerals in Polish, author Wojciech Mostowski, 20/9/2002
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- all different for unit digits, teens, tens and hundreds
|
||||
param DForm = unit | teen | ten | hund ;
|
||||
|
||||
-- cases for thousand in Polish
|
||||
-- 1000 - jeden TYSIAC
|
||||
-- 2000 - dwa TYSIACE
|
||||
-- 3000 - trzy TYSIACE
|
||||
-- 4000 - cztery TYSIACE
|
||||
-- 5000 - piec TYSIECY
|
||||
-- 104000 - sto cztery TYSIECE
|
||||
-- 105000 - sto piec TYSIECY
|
||||
-- 24000 - dwadziescia cztery TYSIACE
|
||||
-- 25000 - dwadziescia piec TYSIACY
|
||||
-- BUT e.g.
|
||||
-- 21000 - dwadziescia jeden TYSIECY (not TYSIAC)
|
||||
-- 11000 - jedenascie TYSIECY
|
||||
-- (12..19)000 - TYSIECY
|
||||
|
||||
param ThForm = onlyone | lastone | twoorthreeorfour | fiveup ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
lincat Sub100 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> ThForm -> LinDigit =
|
||||
\dwa -> \dwanascie -> \dwadziescia -> \dwiescie -> \thform ->
|
||||
{ s = table {unit => dwa ; teen => dwanascie ; ten => dwadziescia ; hund =>
|
||||
dwiescie };
|
||||
o = thform ; t = thform
|
||||
};
|
||||
|
||||
oper mkRegNum1 : Str -> LinDigit =
|
||||
\siedem ->
|
||||
{ s = table { unit => siedem ; teen => siedem + "nascie" ;
|
||||
ten => siedem + "dziesiat" ; hund => siedem + "set"
|
||||
};
|
||||
o = fiveup ; t = fiveup
|
||||
};
|
||||
oper mkRegNum2 : Str -> LinDigit =
|
||||
\pie ->
|
||||
{ s = table { unit => pie + "c" ; teen => pie + "tnascie" ;
|
||||
ten => pie + "cdziesiat" ; hund => pie + "cset"
|
||||
};
|
||||
o = fiveup ; t = fiveup
|
||||
};
|
||||
|
||||
oper mkTh : ThForm => Str =
|
||||
table { onlyone => "tysiac" ; lastone => "tysiecy" ;
|
||||
twoorthreeorfour => "tysiace" ; fiveup => "tysiecy"
|
||||
};
|
||||
|
||||
oper ss : Str -> ThForm -> {s : Str ; t : ThForm} = \str -> \th -> {s = str; t = th}
|
||||
;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkNum "dwa" "dwanascie" "dwadziescia" "dwiescie"
|
||||
twoorthreeorfour ;
|
||||
lin n3 = mkNum "trzy" "trzynascie" "trzydziesci" "trzysta"
|
||||
twoorthreeorfour ;
|
||||
lin n4 = mkNum "cztery" "czternascie" "czterdziesci" "czterysta"
|
||||
twoorthreeorfour ;
|
||||
lin n5 = mkRegNum2 "pie" ;
|
||||
lin n6 = mkNum "szesc" "szesnascie" "szescdziesiat" "szescset" fiveup;
|
||||
lin n7 = mkRegNum1 "siedem" ;
|
||||
lin n8 = mkRegNum1 "osiem" ;
|
||||
lin n9 = mkRegNum2 "dziewie" ;
|
||||
|
||||
lin pot01 = { s = table {hund => "sto"; f => "jeden" };
|
||||
o = onlyone ; t = lastone
|
||||
};
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; o = d.o ; t = d.t} ;
|
||||
lin pot110 = ss "dziesiec" fiveup ;
|
||||
lin pot111 = ss "jedenascie" fiveup ;
|
||||
lin pot1to19 d = {s = d.s ! teen ; t = fiveup} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; t = n.o} ;
|
||||
lin pot1 d = {s = d.s ! ten ; t = fiveup} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ e.s ! unit; t = e.t} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! hund ; t = fiveup} ;
|
||||
lin pot2plus d e = { s = d.s ! hund ++ e.s ;
|
||||
t = table { onlyone => lastone ; f => f } ! e.t
|
||||
} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = n.s ++ mkTh ! n.t} ;
|
||||
lin pot3plus n m = {s = n.s ++ mkTh ! n.t ++ m.s} ;
|
||||
|
||||
|
||||
}
|
||||
63
examples/numerals/portuguese.gf
Normal file
63
examples/numerals/portuguese.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
concrete portuguese of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
param Size = sg | less10 | pl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size } ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\dois -> \doze -> \vinte -> \duzentos ->
|
||||
{s = table {unit => dois ; teen => doze ; ten => vinte ; hundred => duzentos} ; size = less10} ;
|
||||
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
|
||||
lin n2 = mkNum "dois" "doze" "vinte" "duzentos" ;
|
||||
lin n3 = mkNum "três" "treze" "trinta" "trezentos" ;
|
||||
lin n4 = mkNum "cuatro" (variants {"catorze" ; "quatorze"}) "quarenta" "cuatrocentos" ;
|
||||
lin n5 = mkNum "cinco" "quinze" "cinqüenta" "quinhentos" ;
|
||||
lin n6 = mkNum "seis" (variants {"dezasseis" ; "dezesseis"}) "sessenta" "seiscentos" ;
|
||||
lin n7 = mkNum "sete" (variants {"dezassete" ; "dezessete"}) "setenta" "setecentos" ;
|
||||
lin n8 = mkNum "oito" "dezoito" "oitenta" "oitocentos" ;
|
||||
lin n9 = mkNum "nove" (variants {"dezanove" ; "dezenove"}) "noventa" "novecentos" ;
|
||||
|
||||
lin pot01 = {s = table {unit => "um" ; hundred => "cem" ; _ => "dummy"} ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 =
|
||||
{s = "dez" ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = "onze" ; 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 = d.s ! ten ; size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = d.s ! ten ++ "e" ++ e.s ! unit ; size = pl} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = d.s ! hundred ; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {sg => "cento" ;
|
||||
_ => d.s ! hundred } ! d.size ++ (add e.s) ! e.size ; size = pl} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s} ;
|
||||
lin pot3 n =
|
||||
{s = table {sg => "mil" ; _ => n.s ++ "mil"} ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {sg => "mil" ; _ => n.s ++ "mil"} ! n.size ++ (add m.s) ! m.size } ;
|
||||
|
||||
oper add : Str -> Size => Str = \s -> table {pl => s ; _ => "e" ++ s};
|
||||
|
||||
}
|
||||
56
examples/numerals/quechua.gf
Normal file
56
examples/numerals/quechua.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
concrete quechua of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | havingunit ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
-- Quechua har no standard orthography so there are numerous spelling variants
|
||||
-- not considered here.
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkRegNum1 : Str -> LinDigit =
|
||||
\juk ->
|
||||
{ s = table { unit => juk ; havingunit => juk + "niyuq" } ; size = pl};
|
||||
|
||||
oper mkRegNum2 : Str -> LinDigit =
|
||||
\kinsa ->
|
||||
{ s = table { unit => kinsa ; havingunit => kinsa + "yuq" } ; size = pl};
|
||||
|
||||
lin num x = x ;
|
||||
-- lin n1 mkRegNum1 "juk";
|
||||
lin n2 = mkRegNum1 "iskay";
|
||||
lin n3 = mkRegNum2 "kinsa";
|
||||
lin n4 = mkRegNum2 "tawa";
|
||||
lin n5 = mkRegNum2 "pishq'a" ;
|
||||
lin n6 = mkRegNum2 "suqta";
|
||||
lin n7 = mkRegNum1 "k'anchis" ;
|
||||
lin n8 = mkRegNum1 "pusaq" ;
|
||||
lin n9 = mkRegNum1 "isk'un" ;
|
||||
|
||||
lin pot01 = {s = table { unit => "juk" ; havingunit => "juk" + "niyuq" } ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "chunka" ; size = pl } ;
|
||||
lin pot111 = {s = "chunka" ++ "jukniyuq" ; size = pl } ;
|
||||
lin pot1to19 d = {s = "chunka" ++ d.s ! havingunit ; size = pl } ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! unit ++ "chunka" ; size = pl} ;
|
||||
lin pot1plus d e = {s = (d.s ! unit ++ "chunka") ++ e.s ! havingunit ; size = pl } ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = (drop (d.s ! unit)) ! d.size ++ "pachak" ; size = pl} ;
|
||||
lin pot2plus d e = {s = (drop (d.s ! unit)) ! d.size ++ "pachak" ++ e.s ; size = pl} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = (drop n.s) ! n.size ++ "warank'a"} ;
|
||||
lin pot3plus n m = {s = (drop n.s) ! n.size ++ "warank'a" ++ m.s} ;
|
||||
|
||||
oper drop : Str -> Size => Str = \s -> table {sg => [] ; pl => s } ;
|
||||
|
||||
}
|
||||
70
examples/numerals/romanian.gf
Normal file
70
examples/numerals/romanian.gf
Normal file
@@ -0,0 +1,70 @@
|
||||
concrete romanian of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
-- Note [s,], [a%] for Romanian s, and a with up bow ontop (not â)
|
||||
|
||||
param DForm = unit | teen | ten | attr ;
|
||||
param MidForm = indep | det ;
|
||||
param Size = sg | less20 | pl ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : MidForm => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : MidForm => Str ; size : Size} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit =
|
||||
\two -> \twelve -> \twenty -> mkNumSpc two twelve twenty two ;
|
||||
|
||||
oper mkNumSpc : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\two -> \twelve -> \twenty -> \doua ->
|
||||
{s = table {unit => two ; teen => twelve ; ten => twenty ; attr => doua} ; size = less20} ;
|
||||
|
||||
oper regNum : Str -> LinDigit =
|
||||
\trei -> mkNum trei (trei + variants { "sprezece" ; "şpe" }) (trei + "zeci") ;
|
||||
|
||||
oper ss : Str -> {s : MidForm => Str ; size : Size} = \st -> {s = table {_ => st} ; size = less20} ;
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ [] }; -- Latin A Supplement chars
|
||||
lin n2 = mkNumSpc "doi" (variants { "doisprezece" ; "douăsprezece" }) "douăzeci" "două" ;
|
||||
lin n3 = regNum "trei" ;
|
||||
lin n4 = mkNum "patru" (variants{"paisprezece" ; "paişpe"}) "patruzeci" ;
|
||||
lin n5 = mkNumSpc "cinci" (variants{"cinsprezece" ; "cinşpe"}) "cinzeci" (variants { "cinci" ; "cin" });
|
||||
lin n6 = mkNum "şase" (variants{"şaisprezece" ; "şaispe"}) "şaizeci" ;
|
||||
lin n7 = mkNum "şapte" (variants{"şaptesprezece" ; "şapspe"}) "şaptezeci" ;
|
||||
lin n8 = mkNum "opt" (variants{"optsprezece" ; "opspe"}) "optzeci" ;
|
||||
lin n9 = regNum "nouă" ;
|
||||
|
||||
lin pot01 = {s = table {attr => "o" ; f => "unu"} ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "zece" ;
|
||||
lin pot111 = ss (variants { "unsprezece" ; "unşpe"}) ;
|
||||
lin pot1to19 d = {s = table {_ => d.s ! teen } ; size = less20} ;
|
||||
lin pot0as1 n = {s = table {indep => n.s ! unit ; det => n.s ! attr } ; size = n.size} ;
|
||||
lin pot1 d = {s = table {_ => d.s ! ten } ; size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep => d.s ! ten ++ "şi" ++ e.s ! unit ;
|
||||
det => d.s ! ten ++ "şi" ++ e.s ! attr } ;
|
||||
size = pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = table {_ => d.s ! attr ++ (mksute d.size) }; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => d.s ! attr ++ (mksute d.size) ++ e.s ! indep;
|
||||
det => d.s ! attr ++ (mksute d.size) ++ e.s ! det };
|
||||
size = pl} ;
|
||||
lin pot2as3 n = {s = n.s ! indep };
|
||||
lin pot3 n = {s = (mkmie n.size (n.s ! det) (n.s ! indep))} ;
|
||||
lin pot3plus n m = {s = (mkmie n.size (n.s ! det) (n.s ! indep)) ++ m.s ! indep} ;
|
||||
|
||||
oper mksute : Size -> Str = \sz -> table {sg => "suta" ; _ => "sute" } ! sz ;
|
||||
oper mkmie : Size -> Str -> Str -> Str = \sz -> \attr -> \indep ->
|
||||
table {sg => "o" ++ "mie" ;
|
||||
less20 => attr ++ "mii" ;
|
||||
pl => indep ++ "de" ++ "mii"} ! sz ;
|
||||
|
||||
}
|
||||
116
examples/numerals/russian.gf
Normal file
116
examples/numerals/russian.gf
Normal file
@@ -0,0 +1,116 @@
|
||||
concrete russian of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=russian ;
|
||||
|
||||
-- Toiska, 13/8/2000, AR with Arto Mustajoki.
|
||||
|
||||
param DForm = unit | teen | ten | hund ;
|
||||
param Place = attr | indep ;
|
||||
param Size = nom | sgg | plg ;
|
||||
param Gen = masc | fem | neut ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Gen => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : Place => DForm => Gen => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Place => Gen => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Place => Gen => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Gen => Str} ;
|
||||
|
||||
oper mille : Size => Str = table {
|
||||
{nom} => "тысяча" ;
|
||||
{sgg} => "тысячи" ;
|
||||
_ => "тысяч"} ;
|
||||
|
||||
oper gg : Str -> Gen => Str = \s -> table {_ => s} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ! masc ++ []} ; -- Russian environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {{unit} => table {{fem} => "две" ; _ => "два"} ;
|
||||
{teen} => gg "двенадцать" ;
|
||||
{ten} => gg "двадцать" ;
|
||||
{hund} => gg "двести"} ;
|
||||
size = sgg} ;
|
||||
lin n3 =
|
||||
{s = table {{unit} => gg "три" ;
|
||||
{teen} => gg "тринадцать" ;
|
||||
{ten} => gg "тридцать" ;
|
||||
{hund} => gg "триста"} ;
|
||||
size = sgg} ;
|
||||
lin n4 =
|
||||
{s = table {{unit} => gg "четыре" ;
|
||||
{teen} => gg "четырнадцать" ;
|
||||
{ten} => gg "сорок" ;
|
||||
{hund} => gg "четыреста"} ;
|
||||
size = sgg} ;
|
||||
lin n5 =
|
||||
{s = table {{unit} => gg "пять" ;
|
||||
{teen} => gg "пятнадцать" ;
|
||||
{ten} => gg "пятьдесят" ;
|
||||
{hund} => gg "пятьсот"} ;
|
||||
size = plg} ;
|
||||
lin n6 =
|
||||
{s = table {{unit} => gg "шесть" ;
|
||||
{teen} => gg "шестнадцать" ;
|
||||
{ten} => gg "шестьдесят" ;
|
||||
{hund} => gg "шестьсот"} ;
|
||||
size = plg} ;
|
||||
lin n7 =
|
||||
{s = table {{unit} => gg "семь" ;
|
||||
{teen} => gg "семнадцать" ;
|
||||
{ten} => gg "семьдесят" ;
|
||||
{hund} => gg "семьсот"} ;
|
||||
size = plg} ;
|
||||
lin n8 =
|
||||
{s = table {{unit} => gg "восемь" ;
|
||||
{teen} => gg "восемнадцать" ;
|
||||
{ten} => gg "восемьдесят" ;
|
||||
{hund} => gg "восемьсот"} ;
|
||||
size = plg} ;
|
||||
lin n9 =
|
||||
{s = table {{unit} => gg "девять" ;
|
||||
{teen} => gg "девятнадцать" ;
|
||||
{ten} => gg "девяносто" ;
|
||||
{hund} => gg "девятьсот"} ;
|
||||
size = plg} ;
|
||||
|
||||
|
||||
lin pot01 =
|
||||
{s = table {{attr} => table {{hund} => gg "сто" ; _ => gg []} ;
|
||||
_ => table {{hund} => gg "сто" ;
|
||||
_ => table {{masc} => "один" ; {fem} => "одна" ; _ => "одно"}}} ;
|
||||
size = nom} ;
|
||||
lin pot0 d =
|
||||
{s = table {_ => d.s} ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => gg "десять"} ; size = plg} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => gg "одиннадцать"} ; size = plg} ; --- 11
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen} ; size = plg} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! p ! unit} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten} ; size = plg} ; ---
|
||||
lin pot1plus d e =
|
||||
{s = table {_ =>
|
||||
table {g => d.s ! ten ! g ++ e.s ! indep ! unit ! g}} ; size = e.size} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {p => d.s ! p ! hund} ; size = plg} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {p => table {g => d.s ! p ! hund ! g ++ e.s ! indep ! g}} ; size = e.size} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = gg (n.s ! attr ! fem ++ mille ! n.size)} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {g => n.s ! attr ! fem ++ mille ! n.size ++ m.s ! indep ! g}} ;
|
||||
|
||||
--- TODO
|
||||
--- raz/odin
|
||||
|
||||
|
||||
}
|
||||
66
examples/numerals/sango.gf
Normal file
66
examples/numerals/sango.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
concrete sango of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | pl | over10;
|
||||
|
||||
oper Form = {s : Str ; size : Size } ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = Form ;
|
||||
lincat Sub10 = Form ;
|
||||
lincat Sub100 = Form ;
|
||||
lincat Sub1000 = Form ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO: Encoding
|
||||
|
||||
oper mkNum : Str -> Form = \mbili ->
|
||||
{s = mbili ; size = pl };
|
||||
|
||||
-- O IPA for o in cod
|
||||
-- Ó
|
||||
|
||||
-- lin n1 = mkNum "ÓkO" ;
|
||||
lin n2 = mkNum "óse" ;
|
||||
lin n3 = mkNum "otá" ;
|
||||
lin n4 = mkNum "osió" ;
|
||||
lin n5 = mkNum "ukú" ;
|
||||
lin n6 = mkNum "omaná" ;
|
||||
lin n7 = mkNum "mbásámbárá" ;
|
||||
lin n8 = mkNum "miombe" ;
|
||||
lin n9 = mkNum "ngombáyá" ;
|
||||
|
||||
oper nandoni : Str = ("na" ++ variants {"ndó" ++ "ní" ; []}) ;
|
||||
|
||||
oper ss : Str -> Form = \s1 -> {s = s1 ; size = over10} ;
|
||||
|
||||
lin pot01 = {s = "ÓkO" ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss ("bale" ++ "ÓkO");
|
||||
lin pot111 = ss ("bale" ++ "ÓkO" ++ nandoni ++ "ÓkO");
|
||||
lin pot1to19 d = ss ("bale" ++ "ÓkO" ++ nandoni ++ d.s);
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = ss ("bale" ++ d.s ) ;
|
||||
lin pot1plus d e = ss ("bale" ++ d.s ++ nandoni ++ e.s ) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (mkng d.size d.s) ;
|
||||
lin pot2plus d e = ss ((mkng d.size d.s) ++ nandoni ++ e.s) ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = mktau n.size n.s } ;
|
||||
lin pot3plus n m = {s = mktau n.size (n.s ++ nandoni ++ m.s) } ;
|
||||
|
||||
oper mkng : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => "ngbangbu" ++ attr ;
|
||||
over10 => "dummy" ;
|
||||
sg => variants {"ngbangbu" ++ "ÓkO"; "ngbangbu" }} ! sz ;
|
||||
|
||||
oper mktau : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {pl => "ngbangbu" ++ "bale" ++ attr ;
|
||||
over10 => "N/A" ;
|
||||
sg => variants {"ngbangbu" ++ "bale"; "kutu"} ++ attr} ! sz ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
63
examples/numerals/slovak.gf
Normal file
63
examples/numerals/slovak.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
concrete slovak of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- by Karol Ostrovsky, Chalmers
|
||||
-- mechanically translated to new GF notation by AR
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
param Place = indep | prae ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : {p1 : DForm ; p2 : Place} => Str} ;
|
||||
lincat Sub10 = {s : {p1 : DForm ; p2 : Place} => Str} ;
|
||||
lincat Sub100 = {s : Place => Str} ;
|
||||
lincat Sub1000 = {s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "dva" ; {p1 = unit ; p2 = prae} => "dve" ; {p1 = teen ; p2 = indep} => "dvanast" ; {p1 = teen ; p2 = prae} => "dvanast" ; {p1 = ten ; p2 = indep} => "dvadsat" ; {p1 = ten ; p2 = prae} => "dvadsat"}} ;
|
||||
lin n3 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "tri" ; {p1 = unit ; p2 = prae} => "tri" ; {p1 = teen ; p2 = indep} => "trinast" ; {p1 = teen ; p2 = prae} => "trinast" ; {p1 = ten ; p2 = indep} => "tridsat" ; {p1 = ten ; p2 = prae} => "tridsat"}} ;
|
||||
lin n4 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "styri" ; {p1 = unit ; p2 = prae} => "styri" ; {p1 = teen ; p2 = indep} => "strnast" ; {p1 = teen ; p2 = prae} => "strnast" ; {p1 = ten ; p2 = indep} => "styridsat" ; {p1 = ten ; p2 = prae} => "styridsat"}} ;
|
||||
lin n5 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "pat" ; {p1 = unit ; p2 = prae} => "pat" ; {p1 = teen ; p2 = indep} => "patnast" ; {p1 = teen ; p2 = prae} => "patnast" ; {p1 = ten ; p2 = indep} => "patdesiat" ; {p1 = ten ; p2 = prae} => "patdesiat"}} ;
|
||||
lin n6 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "sest" ; {p1 = unit ; p2 = prae} => "sest" ; {p1 = teen ; p2 = indep} => "sestnast" ; {p1 = teen ; p2 = prae} => "sestnast" ; {p1 = ten ; p2 = indep} => "sestdesiat" ; {p1 = ten ; p2 = prae} => "sestdesiat"}} ;
|
||||
lin n7 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "sedem" ; {p1 = unit ; p2 = prae} => "sedem" ; {p1 = teen ; p2 = indep} => "sedemnast" ; {p1 = teen ; p2 = prae} => "sedemnast" ; {p1 = ten ; p2 = indep} => "sedemdesiat" ; {p1 = ten ; p2 = prae} => "sedemdesiat"}} ;
|
||||
lin n8 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "osem" ; {p1 = unit ; p2 = prae} => "osem" ; {p1 = teen ; p2 = indep} => "osemnast" ; {p1 = teen ; p2 = prae} => "osemnast" ; {p1 = ten ; p2 = indep} => "osemdesiat" ; {p1 = ten ; p2 = prae} => "osemdesiat"}} ;
|
||||
lin n9 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "devat" ; {p1 = unit ; p2 = prae} => "devat" ; {p1 = teen ; p2 = indep} => "devatnast" ; {p1 = teen ; p2 = prae} => "devatnast" ; {p1 = ten ; p2 = indep} => "devatdesiat" ; {p1 = ten ; p2 = prae} => "devatdesiat"}} ;
|
||||
lin pot01 =
|
||||
{s = table {{p1 = unit ; p2 = indep} => "jedna" ; {p1 = unit ; p2 = prae} => [] ; {p1 = teen ; p2 = indep} => "jedna" ; {p1 = teen ; p2 = prae} => [] ; {p1 = ten ; p2 = indep} => "jedna" ; {p1 = ten ; p2 = prae} => []}} ;
|
||||
lin pot0 d =
|
||||
{s = table {{p1 = unit ; p2 = indep} => d.s ! {p1 = unit ; p2 = indep} ; {p1 = unit ; p2 = prae} => d.s ! {p1 = unit ; p2 = prae} ; {p1 = teen ; p2 = indep} => d.s ! {p1 = teen ; p2 = indep} ; {p1 = teen ; p2 = prae} => d.s ! {p1 = teen ; p2 = prae} ; {p1 = ten ; p2 = indep} => d.s ! {p1 = ten ; p2 = indep} ; {p1 = ten ; p2 = prae} => d.s ! {p1 = ten ; p2 = prae}}} ;
|
||||
lin pot110 =
|
||||
{s = table {indep => "desat" ; prae => "desat"}} ;
|
||||
lin pot111 =
|
||||
{s = table {indep => "jedenast" ; prae => "jedenast"}} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {indep => d.s ! {p1 = teen ; p2 = indep} ; prae => d.s ! {p1 = teen ; p2 = prae}}} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {indep => n.s ! {p1 = unit ; p2 = indep} ; prae => n.s ! {p1 = unit ; p2 = indep}}} ;
|
||||
lin pot1 d =
|
||||
{s = table {indep => d.s ! {p1 = ten ; p2 = indep} ; prae => d.s ! {p1 = ten ; p2 = prae}}} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep => (d.s ! {p1 = ten ; p2 = indep}) ++ e.s ! {p1 = unit ; p2 = indep} ; prae => (d.s ! {p1 = ten ; p2 = prae}) ++ e.s ! {p1 = unit ; p2 = indep}}} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {indep => n.s ! indep ; prae => n.s ! indep}} ;
|
||||
lin pot2 d =
|
||||
{s = table {indep => (d.s ! {p1 = unit ; p2 = prae}) ++ "sto" ; prae => (d.s ! {p1 = unit ; p2 = prae}) ++ "sto"}} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => (d.s ! {p1 = unit ; p2 = prae}) ++ "sto" ++ e.s ! indep ; prae => (d.s ! {p1 = unit ; p2 = prae}) ++ "sto" ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = (n.s ! prae) ++ "tisic"} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! prae) ++ "tisic" ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
99
examples/numerals/sorani.gf
Normal file
99
examples/numerals/sorani.gf
Normal file
@@ -0,0 +1,99 @@
|
||||
concrete sorani of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=extendedarabic ;
|
||||
|
||||
param DForm = unit | ten | teen | hund | kilurrest | kilurresthAzar ;
|
||||
param Size = sg | less500 | fiveup | more500 ;
|
||||
|
||||
-- From Manuel de Kurde (dialecte Sorani).
|
||||
--
|
||||
-- [W] is waw with a horizontal line above
|
||||
-- [E] is a ye with a horizonytal line above
|
||||
-- [A] shouldnt have dots (= ta marbuta; also inside a word)
|
||||
-- [p] is be with three dots below like Persian
|
||||
-- [j] is djim like normal, like arabic (not ye)
|
||||
-- [O] is a waw with a hacek above
|
||||
-- [F] is a fa with three dots above (i.e v)
|
||||
-- [Z] is a zain with three dots above (i.e zh)
|
||||
-- [I] is a ye with a horizontal line above
|
||||
-- [C] is a djim with three dots below like Persian (i.e ch)
|
||||
-- [c] is shin (i.e sh)
|
||||
-- [H] is Arabic Ha (= djim without dots)
|
||||
|
||||
-- [P] is a Ha with a hamza above
|
||||
-- [R] is an r with a ring below
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Arabic environment
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> LinDigit =
|
||||
\dwA -> \cl -> \dwwls ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; hund => dwA + "سهد" ;
|
||||
kilurrest => "دuممي" ; kilurresthAzar => "دuممي" } ; size = less500};
|
||||
|
||||
oper mkNum6 : Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\dwA -> \cl -> \dwwls -> \pEn -> \rest ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; hund => pEn + "سهد" ;
|
||||
kilurrest => rest + "سهد" ; kilurresthAzar => rest + "سهد" ++ "ههزار"} ; size = fiveup} ;
|
||||
|
||||
-- lin n1 mkNum "يهك" "ده" variants { "يازده" ; "يانزه"} [] ;
|
||||
lin n2 = mkNum "دۇ" "بىست" (variants { "دووازده" ; "دووانزه" }) ;
|
||||
lin n3 = mkNum "سى" "سى" (variants { "سىزده" ; "سيانزه" }) ;
|
||||
lin n4 = mkNum "چووار" "ځل" "چووارده" ;
|
||||
lin n5 = {s = table {unit => "پىنج" ;
|
||||
ten => "پهنجا" ;
|
||||
teen => (variants { "پازده" ; "پانزه" }) ;
|
||||
hund => "پىن" + "سهد";
|
||||
kilurrest => [] ;
|
||||
kilurresthAzar => [] } ;
|
||||
size = fiveup } ;
|
||||
|
||||
lin n6 = mkNum6 "شهش" "شهست" (variants { "شازده"; "شانزه"}) "شهش" [] ;
|
||||
lin n7 = mkNum6 "حهوت" "حهفتا" "حهڤده" "حهو" "دۇ" ;
|
||||
lin n8 = mkNum6 "ههشت" "ههشتا" "ههژده" "ههش" "سى" ;
|
||||
lin n9 = mkNum6 "نۃ" "نهوهد" "نۃزده" "نۃ" "چووار" ;
|
||||
|
||||
oper ss : Str -> {s : Str ; size : Size} = \s -> {s = s ; size = less500} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "يهك" ; hund => "سهد" ; _ => "دuممي" } ; size = sg } ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; size = d.size} ;
|
||||
lin pot110 = ss "ده" ;
|
||||
lin pot111 = ss (variants { "يازده" ; "يانزه"});
|
||||
lin pot1to19 d = {s = d.s ! teen ; size = less500 } ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; size = less500} ;
|
||||
lin pot1plus d e = {s = (d.s ! ten) ++ "و" ++ (e.s ! unit); size = less500} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = "دuممي" ; size = n.size } ;
|
||||
lin pot2 d = {s = d.s ! hund ; s2 = "كلۇر" ++ d.s ! kilurresthAzar ; size = isover500 d.size} ;
|
||||
lin pot2plus d e =
|
||||
{s = d.s ! hund ++ e.s ;
|
||||
s2 = "كلۇر" ++ d.s ! kilurrest ++ (mkhAzar e.s "دuممي") ! e.size ;
|
||||
size = isover500 d.size} ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = (mkhAzar n.s n.s2) ! n.size } ;
|
||||
lin pot3plus n m = {s =(mkhAzar n.s n.s2) ! n.size ++ m.s} ;
|
||||
|
||||
oper isover500 : Size -> Size = \sz ->
|
||||
table {fiveup => more500 ; _ => less500} ! sz ;
|
||||
|
||||
oper mkhAzar : Str -> Str -> Size => Str = \attr -> \kilur ->
|
||||
table {sg => "ههزار" ;
|
||||
fiveup => attr ++ "ههزار" ;
|
||||
less500 => attr ++ "ههزار" ;
|
||||
more500 => kilur} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
64
examples/numerals/spanish.gf
Normal file
64
examples/numerals/spanish.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
concrete spanish of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- by Carlos Gonzalia, Chalmers, 1999
|
||||
-- original source automatically translated to new GF by AR
|
||||
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
param Modif = mod | unmod | conj ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {inh : Modif ; s : {p1 : DForm ; p2 : Modif} => Str} ;
|
||||
lincat Sub10 = {s : {p1 : DForm ; p2 : Modif} => Str} ;
|
||||
lincat Sub100 = {s : Str} ;
|
||||
lincat Sub1000 = {s : Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{inh = mod ; s = table {{p1 = unit ; p2 = mod} => "dos" ; {p1 = unit ; p2 = unmod} => "dos" ; {p1 = unit ; p2 = conj} => "y" ++ "dos" ; {p1 = teen ; p2 = mod} => "doce" ; {p1 = teen ; p2 = unmod} => "doce" ; {p1 = teen ; p2 = conj} => "doce" ; {p1 = ten ; p2 = mod} => "veinti" ; {p1 = ten ; p2 = unmod} => "veinte" ; {p1 = ten ; p2 = conj} => "veinte" ; {p1 = hundred ; p2 = mod} => "doscientos" ; {p1 = hundred ; p2 = unmod} => "doscientos" ; {p1 = hundred ; p2 = conj} => "doscientos"}} ;
|
||||
lin n3 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "tres" ; {p1 = unit ; p2 = unmod} => "tres" ; {p1 = unit ; p2 = conj} => "y" ++ "tres" ; {p1 = teen ; p2 = mod} => "trece" ; {p1 = teen ; p2 = unmod} => "trece" ; {p1 = teen ; p2 = conj} => "trece" ; {p1 = ten ; p2 = mod} => "treinta" ; {p1 = ten ; p2 = unmod} => "treinta" ; {p1 = ten ; p2 = conj} => "treinta" ; {p1 = hundred ; p2 = mod} => "trescientos" ; {p1 = hundred ; p2 = unmod} => "trescientos" ; {p1 = hundred ; p2 = conj} => "trescientos"}} ;
|
||||
lin n4 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "cuatro" ; {p1 = unit ; p2 = unmod} => "cuatro" ; {p1 = unit ; p2 = conj} => "y" ++ "cuatro" ; {p1 = teen ; p2 = mod} => "catorce" ; {p1 = teen ; p2 = unmod} => "catorce" ; {p1 = teen ; p2 = conj} => "catorce" ; {p1 = ten ; p2 = mod} => "cuarenta" ; {p1 = ten ; p2 = unmod} => "cuarenta" ; {p1 = ten ; p2 = conj} => "cuarenta" ; {p1 = hundred ; p2 = mod} => "cuatrocientos" ; {p1 = hundred ; p2 = unmod} => "cuatrocientos" ; {p1 = hundred ; p2 = conj} => "cuatrocientos"}} ;
|
||||
lin n5 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "cinco" ; {p1 = unit ; p2 = unmod} => "cinco" ; {p1 = unit ; p2 = conj} => "y" ++ "cinco" ; {p1 = teen ; p2 = mod} => "quince" ; {p1 = teen ; p2 = unmod} => "quince" ; {p1 = teen ; p2 = conj} => "quince" ; {p1 = ten ; p2 = mod} => "cincuenta" ; {p1 = ten ; p2 = unmod} => "cincuenta" ; {p1 = ten ; p2 = conj} => "cincuenta" ; {p1 = hundred ; p2 = mod} => "quinientos" ; {p1 = hundred ; p2 = unmod} => "quinientos" ; {p1 = hundred ; p2 = conj} => "quinientos"}} ;
|
||||
lin n6 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "seis" ; {p1 = unit ; p2 = unmod} => "seis" ; {p1 = unit ; p2 = conj} => "y" ++ "seis" ; {p1 = teen ; p2 = mod} => "dieciseis" ; {p1 = teen ; p2 = unmod} => "dieciseis" ; {p1 = teen ; p2 = conj} => "dieciseis" ; {p1 = ten ; p2 = mod} => "sesenta" ; {p1 = ten ; p2 = unmod} => "sesenta" ; {p1 = ten ; p2 = conj} => "sesenta" ; {p1 = hundred ; p2 = mod} => "seiscientos" ; {p1 = hundred ; p2 = unmod} => "seiscientos" ; {p1 = hundred ; p2 = conj} => "seiscientos"}} ;
|
||||
lin n7 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "siete" ; {p1 = unit ; p2 = unmod} => "siete" ; {p1 = unit ; p2 = conj} => "y" ++ "siete" ; {p1 = teen ; p2 = mod} => "diecisiete" ; {p1 = teen ; p2 = unmod} => "diecisiete" ; {p1 = teen ; p2 = conj} => "diecisiete" ; {p1 = ten ; p2 = mod} => "setenta" ; {p1 = ten ; p2 = unmod} => "setenta" ; {p1 = ten ; p2 = conj} => "setenta" ; {p1 = hundred ; p2 = mod} => "setecientos" ; {p1 = hundred ; p2 = unmod} => "setecientos" ; {p1 = hundred ; p2 = conj} => "setecientos"}} ;
|
||||
lin n8 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "ocho" ; {p1 = unit ; p2 = unmod} => "ocho" ; {p1 = unit ; p2 = conj} => "y" ++ "ocho" ; {p1 = teen ; p2 = mod} => "dieciocho" ; {p1 = teen ; p2 = unmod} => "dieciocho" ; {p1 = teen ; p2 = conj} => "dieciocho" ; {p1 = ten ; p2 = mod} => "ochenta" ; {p1 = ten ; p2 = unmod} => "ochenta" ; {p1 = ten ; p2 = conj} => "ochenta" ; {p1 = hundred ; p2 = mod} => "ochocientos" ; {p1 = hundred ; p2 = unmod} => "ochocientos" ; {p1 = hundred ; p2 = conj} => "ochocientos"}} ;
|
||||
lin n9 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "nueve" ; {p1 = unit ; p2 = unmod} => "nueve" ; {p1 = unit ; p2 = conj} => "y" ++ "nueve" ; {p1 = teen ; p2 = mod} => "diecinueve" ; {p1 = teen ; p2 = unmod} => "diecinueve" ; {p1 = teen ; p2 = conj} => "diecinueve" ; {p1 = ten ; p2 = mod} => "noventa" ; {p1 = ten ; p2 = unmod} => "noventa" ; {p1 = ten ; p2 = conj} => "noventa" ; {p1 = hundred ; p2 = mod} => "novecientos" ; {p1 = hundred ; p2 = unmod} => "novecientos" ; {p1 = hundred ; p2 = conj} => "novecientos"}} ;
|
||||
lin pot01 =
|
||||
{s = table {{p1 = unit ; p2 = mod} => "uno" ; {p1 = unit ; p2 = unmod} => "uno" ; {p1 = unit ; p2 = conj} => "y" ++ "uno" ; {p1 = teen ; p2 = mod} => "uno" ; {p1 = teen ; p2 = unmod} => "uno" ; {p1 = teen ; p2 = conj} => "y" ++ "uno" ; {p1 = ten ; p2 = mod} => "uno" ; {p1 = ten ; p2 = unmod} => "uno" ; {p1 = ten ; p2 = conj} => "y" ++ "uno" ; {p1 = hundred ; p2 = mod} => "ciento" ; {p1 = hundred ; p2 = unmod} => "cien" ; {p1 = hundred ; p2 = conj} => "y" ++ "uno"}} ;
|
||||
lin pot0 d =
|
||||
{s = table {{p1 = unit ; p2 = mod} => d.s ! {p1 = unit ; p2 = mod} ; {p1 = unit ; p2 = unmod} => d.s ! {p1 = unit ; p2 = unmod} ; {p1 = unit ; p2 = conj} => d.s ! {p1 = unit ; p2 = conj} ; {p1 = teen ; p2 = mod} => d.s ! {p1 = teen ; p2 = mod} ; {p1 = teen ; p2 = unmod} => d.s ! {p1 = teen ; p2 = unmod} ; {p1 = teen ; p2 = conj} => d.s ! {p1 = teen ; p2 = conj} ; {p1 = ten ; p2 = mod} => d.s ! {p1 = ten ; p2 = mod} ; {p1 = ten ; p2 = unmod} => d.s ! {p1 = ten ; p2 = unmod} ; {p1 = ten ; p2 = conj} => d.s ! {p1 = ten ; p2 = conj} ; {p1 = hundred ; p2 = mod} => d.s ! {p1 = hundred ; p2 = mod} ; {p1 = hundred ; p2 = unmod} => d.s ! {p1 = hundred ; p2 = unmod} ; {p1 = hundred ; p2 = conj} => d.s ! {p1 = hundred ; p2 = conj}}} ;
|
||||
lin pot110 =
|
||||
{s = "diez"} ;
|
||||
lin pot111 =
|
||||
{s = "once"} ;
|
||||
lin pot1to19 d =
|
||||
{s = d.s ! {p1 = teen ; p2 = unmod}} ;
|
||||
lin pot0as1 n =
|
||||
{s = n.s ! {p1 = unit ; p2 = unmod}} ;
|
||||
lin pot1 d =
|
||||
{s = d.s ! {p1 = ten ; p2 = unmod}} ;
|
||||
lin pot1plus d e =
|
||||
{s = (d.s ! {p1 = ten ; p2 = mod}) ++ e.s ! {p1 = unit ; p2 = d.inh}} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s} ;
|
||||
lin pot2 d =
|
||||
{s = d.s ! {p1 = hundred ; p2 = unmod}} ;
|
||||
lin pot2plus d e =
|
||||
{s = (d.s ! {p1 = hundred ; p2 = mod}) ++ e.s} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ++ "mil"} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ++ "mil" ++ m.s} ;
|
||||
|
||||
}
|
||||
59
examples/numerals/stieng.gf
Normal file
59
examples/numerals/stieng.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
concrete stieng of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Size = sg | belowten | moreten ;
|
||||
|
||||
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 = belowten} ;
|
||||
|
||||
lin n2 = mkNum "baar" ;
|
||||
lin n3 = mkNum "pê" ;
|
||||
lin n4 = mkNum "puôn" ;
|
||||
lin n5 = mkNum "pram" ;
|
||||
lin n6 = mkNum "prau" ;
|
||||
lin n7 = mkNum "poh" ;
|
||||
lin n8 = mkNum "phaam" ;
|
||||
lin n9 = mkNum "sên" ;
|
||||
|
||||
oper ban : Str = (variants {"ban" ; "rabu"} ) ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin pot01 = {s = variants {"muôi" ; "du" ; "di"} ; size = sg } ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "jo'mo't" ; s2 = variants {"mu'n" ; "jo'm'ot" ++ "ban"} ; size = moreten} ;
|
||||
lin pot111 = {s = "jo'mo't" ++ "muôi" ; s2 = variants {"mu'n" ++ ban ; "jo'm'ot" ++ "muôi" ++ ban} ; size = moreten} ;
|
||||
lin pot1to19 d = {s = "jo'mo't" ++ d.s ; s2 = variants {"mu'n" ++ d.s ++ "ban"; "jo'm'ot" ++ d.s ++ "ban"} ; size = moreten };
|
||||
lin pot0as1 n = {s = n.s ; s2 = xsg n.size ban (n.s ++ "ban") ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ++ "jo't" ; s2 = variants {d.s ++ "mu'n" ; d.s ++ "jo't" ++ "ban"} ; size = moreten} ;
|
||||
lin pot1plus d e = {s = d.s ++ "jo't" ++ e.s ; s2 = variants {d.s ++ "mu'n" ; d.s ++ "jo't" } ++ xsg e.size ban (e.s ++ "ban") ; size = moreten} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = xsg d.size (variants { "riêng" ; "rhiêng" }) (d.s ++ "riêng") ;
|
||||
s2 = xsg d.size "seen" (d.s ++ "seen") ;
|
||||
size = moreten} ;
|
||||
lin pot2plus d e = {s = xsg d.size (variants { "riêng" ; "rhiêng" }) (d.s ++ "riêng") ++ maybeo e.size ++ e.s ;
|
||||
s2 = xsg d.size "seen" (d.s ++ "seen") ++ e.s2 ;
|
||||
size = moreten} ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = table {sg => (variants {"ban" ; "rabu"}) ;
|
||||
belowten => n.s ++ "ban" ;
|
||||
tenover => n.s2} ! n.size } ;
|
||||
lin pot3plus n m = {s = table {sg => (variants {"ban" ; "rabu"}) ;
|
||||
belowten => n.s ++ "ban" ;
|
||||
tenover => n.s2} ! n.size ++ maybeo m.size ++ m.s } ;
|
||||
|
||||
oper maybeo : Size -> Str = \sz -> table {moreten => [] ; _ => "ô"} ! sz;
|
||||
oper xsg : Size -> Str -> Str -> Str = \sz -> \s1 -> \s2 -> table {sg => s1 ; _ => s2} ! sz ;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
59
examples/numerals/swahili.gf
Normal file
59
examples/numerals/swahili.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
concrete swahili of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param Size = sg | pl | pl_end | more100;
|
||||
param S1000 = reg | lakh ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; size : Size } ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size } ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : S1000 => Str ; size : Size } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \mbili -> \ishirini ->
|
||||
{s = table {unit => mbili ; ten => ishirini } ; size = pl_end };
|
||||
|
||||
-- lin n1 = mkNum "moja" ;
|
||||
lin n2 = mkNum "mbili" "ishirini" ;
|
||||
lin n3 = mkNum "tatu" "thelathini" ;
|
||||
lin n4 = mkNum "nne" "arobaini" ;
|
||||
lin n5 = mkNum "tano" "hamsini" ;
|
||||
lin n6 = mkNum "sita" "sitini" ;
|
||||
lin n7 = mkNum "saba" "sabini" ;
|
||||
lin n8 = mkNum "nane" "themanini" ;
|
||||
lin n9 = mkNum "tisa" "tisini" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "moja" ; _ => "dummy" } ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "kumi" ; size = pl_end} ;
|
||||
lin pot111 = {s = "kumi" ++ "na" ++ "moja" ; size = pl} ;
|
||||
lin pot1to19 d = {s = "kumi" ++ "na" ++ d.s ! unit ; size = pl} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; size = pl_end} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "na" ++ e.s ! unit ; size = pl} ;
|
||||
lin pot1as2 n = {s = table {_ => n.s } ; size = n.size} ;
|
||||
lin pot2 d = {s = table {reg => mkmia d.size (d.s ! unit) ; lakh => mklakh d.size (d.s ! unit) []} ; size = more100};
|
||||
lin pot2plus d e =
|
||||
{s = table {lakh => mklakh d.size (d.s ! unit) ("elfu" ++ e.s) ;
|
||||
reg => mkmia d.size (d.s ! unit) ++ maybena e.size ++ e.s } ;
|
||||
size = more100} ;
|
||||
lin pot2as3 n = {s = n.s ! reg } ;
|
||||
lin pot3 n = {s = table {sg => variants {"elfu" ; "elfu" ++ "moja"} ; more100 => n.s ! lakh ; _ => n.s ! reg ++ "elfu"} ! n.size} ; -- invert order in 1 < x < 100 * 1000 if nothing follows the elfu
|
||||
lin pot3plus n m = {s = table {more100 => n.s ! lakh ; _ => "elfu" ++ n.s ! reg} ! n.size ++ maybena m.size ++ m.s ! reg} ;
|
||||
|
||||
oper lakhi : Str = (variants {"lakh" ; "lakhi" }) ;
|
||||
oper mia : Str = (variants { "mia" ; "mia" ++ "moja" }) ;
|
||||
oper maybena : Size -> Str = \sz -> table {sg => "na" ; pl_end => "na" ; _ => []} ! sz ;
|
||||
oper mklakh : Size -> Str -> Str -> Str = \sz -> \attr -> \elfu ->
|
||||
table {sg => lakhi ; _ => lakhi ++ attr} ! sz ++ elfu ;
|
||||
oper mkmia : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {sg => mia; _ => "mia" ++ attr } ! sz ;
|
||||
|
||||
}
|
||||
52
examples/numerals/swedish.gf
Normal file
52
examples/numerals/swedish.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
concrete swedish of Numerals = {
|
||||
-- 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}} ;
|
||||
|
||||
regTal : Str -> LinDigit = \fem ->
|
||||
mkTal fem (fem + "ton") (fem + "tio") ;
|
||||
|
||||
ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
|
||||
n2 = mkTal "två" "tolv" "tjugo" ;
|
||||
n3 = mkTal "tre" "tretton" "trettio" ;
|
||||
n4 = mkTal "fyra" "fjorton" "fyrtio" ;
|
||||
n5 = regTal "fem" ;
|
||||
n6 = regTal "sex" ;
|
||||
n7 = mkTal "sju" "sjutton" "sjuttio" ;
|
||||
n8 = mkTal "åtta" "arton" "åttio" ;
|
||||
n9 = mkTal "nio" "nitton" "nittio" ;
|
||||
|
||||
pot01 = {s = table {f => "ett"}} ;
|
||||
pot0 d = {s = table {f => d.s ! f}} ;
|
||||
pot110 = ss "tio" ;
|
||||
pot111 = ss "elva" ;
|
||||
pot1to19 d = ss (d.s ! ton) ;
|
||||
pot0as1 n = ss (n.s ! ental) ;
|
||||
pot1 d = ss (d.s ! tiotal) ;
|
||||
pot1plus d e = ss (d.s ! tiotal ++ e.s ! ental) ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = ss (d.s ! ental ++ "hundra") ;
|
||||
pot2plus d e = ss (d.s ! ental ++ "hundra" ++ e.s) ;
|
||||
pot2as3 n = n ;
|
||||
pot3 n = ss (n.s ++ "tusen") ;
|
||||
pot3plus n m = ss (n.s ++ "tusen" ++ m.s) ;
|
||||
|
||||
|
||||
}
|
||||
171
examples/numerals/tamil.gf
Normal file
171
examples/numerals/tamil.gf
Normal file
@@ -0,0 +1,171 @@
|
||||
concrete tamil of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- Tamil
|
||||
-- Ad hoc transcr.
|
||||
-- when there is something bigger maybe a:yiram should be preceded
|
||||
-- by an o:ru
|
||||
|
||||
-- c is sh/ch etc
|
||||
-- s is sanskr. s'
|
||||
-- S is sanskr. s.
|
||||
-- G is velar n i.e [ng]
|
||||
-- V regular n in e.g [na:ru]
|
||||
-- n one ring n
|
||||
-- N two ring n
|
||||
-- ñ
|
||||
-- l
|
||||
-- L (like N but without the middle ring)
|
||||
-- M is retroflex l with the char that looks a bit like m (e.g l in Tamil)
|
||||
|
||||
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=tamil ;
|
||||
|
||||
oper
|
||||
vowel : Strs = strs {"ஒ" ; "எ" ; "அ" ; "இ" ; "உ"} ;
|
||||
labial : Strs = strs {"மௌ" ; "பௌ"} ;
|
||||
retroflex : Strs = strs {"ணௌ" ; "டௌ"} ;
|
||||
sandhi_u : Str = pre {"உ" ; [] / vowel} ;
|
||||
sandhi_n : Str = pre {"னௌ" ; "மௌ" / labial} ;
|
||||
sandhi_spc_n : Str = pre {"னௌ" ; "பௌ" / labial} ;
|
||||
-- sandhi_N : Str = post {"னௌ" ; "ணௌ" / retroflex } ;
|
||||
|
||||
param DForm = unit | attr1 | attr2 | teen ;
|
||||
param Size = sg | four | five | eight | nine | more100 | less100 ;
|
||||
param Place = attr | indep ;
|
||||
param Sub1000Data = attrtwo | indeptwo | preceded | lakhs | lakhs2 ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Place => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Sub1000Data => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Tamil environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {teen => "பனௌனாரணௌடீ" ;
|
||||
unit => "இரணௌடௌ" + sandhi_u ;
|
||||
attr1 => "இரீ" ;
|
||||
attr2 => variants {"இரணௌடௌ" + sandhi_u ; "ஈரௌ"} } ; size = less100} ;
|
||||
lin n3 =
|
||||
{s = table {teen => "பதானௌ" + "முனௌரீ" ;
|
||||
unit => "முனௌரௌ" + sandhi_u ;
|
||||
attr1 => "மீ" + sandhi_spc_n ;
|
||||
attr2 => "முறௌ"} ; size = less100} ;
|
||||
lin n4 =
|
||||
{s = table {teen => "பதா" + variants { "நறீ" ; "நனௌகீ" } ;
|
||||
unit => variants { "நறௌ" + sandhi_u ; "நனௌகௌ" + sandhi_u } ;
|
||||
attr1 => "நரௌ" ;
|
||||
attr2 => "நறௌ"} ; size = four} ;
|
||||
lin n5 =
|
||||
{s = table {teen => "பதானௌ" + "ஐனௌdீ" ;
|
||||
unit => "ஐனௌதௌ" + sandhi_u ;
|
||||
attr1 => "ஐ" + sandhi_n ;
|
||||
attr2 => "ஐயௌ"} ; size = five} ;
|
||||
lin n6 =
|
||||
{s = table {teen => "பதானௌ" + "ஆரீ" ;
|
||||
unit => "ஆரௌ" + sandhi_u ;
|
||||
attr1 => "அரீ" ;
|
||||
attr2 => "ஆரௌ"} ; size = less100} ;
|
||||
lin n7 =
|
||||
{s = table {teen => "பதானௌ" + "ஏலீ" ;
|
||||
unit => "ஏலௌ" + sandhi_u ;
|
||||
attr1 => "எலீ" ;
|
||||
attr2 => "எலௌ"} ; size = less100} ;
|
||||
lin n8 =
|
||||
{s = table {teen => "பதானௌ" + "எடௌடீ" ;
|
||||
unit => "எடௌடௌ" + sandhi_u ;
|
||||
attr1 => "எணௌ" ;
|
||||
attr2 => "எணௌணௌ"} ; size = eight} ;
|
||||
lin n9 =
|
||||
{s = table {teen => "பதௌதௌ" + "ஓனௌபதீ" ;
|
||||
unit => "ஓனௌபதௌ" + sandhi_u ;
|
||||
attr1 => "தணௌ" ;
|
||||
attr2 => "ஓனௌபதானௌ"} ; size = nine} ;
|
||||
|
||||
oper fiveh : Str = variants { "ஐனௌனரீ" ; "அஞௌஞரீ"} ;
|
||||
oper fiveh_sandhi : Str = variants { "ஐனௌனரௌ" + sandhi_u ; "அஞௌஞரௌ" + sandhi_u } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "ஓனௌரீ"; teen => "பதானௌ" + "ஓனௌரீ" ; attr1 => "ஓரௌ" + sandhi_u ; attr2 => []} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "பதௌதீ"} ; size = less100} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "பதானௌ" + "ஓனௌரௌ" + sandhi_u} ; size = less100} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen} ; size = less100} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {attr => n.s ! attr2 ; indep => n.s ! unit} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => table {nine => "தணௌணரௌ" + sandhi_u ; _ => d.s ! attr1 ++ "பதீ"} ! d.size} ; size = less100} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => table {nine => ("தணௌணரௌ" + sandhi_u) ++ e.s ! unit; _ => d.s ! attr1 ++ "பதௌ" + sandhi_u } ! d.size ++ e.s ! unit }; size = less100} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {indeptwo => n.s ! indep ; attrtwo => n.s ! attr ; preceded => n.s ! indep ; _ => "dீமௌமௌயௌ"}; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {indeptwo =>
|
||||
table {nine => "தலௌலயாரமௌ" ;
|
||||
eight => "எணௌணரீ" ;
|
||||
four => "நநரீ" ;
|
||||
five => fiveh ;
|
||||
sg => "நரீ" ;
|
||||
_ => d.s ! attr1 ++ "நரீ"} ! d.size ;
|
||||
attrtwo =>
|
||||
table {nine => "தலௌலயாரதௌதௌ" + sandhi_u ;
|
||||
eight => "எணௌணரௌ" + sandhi_u ;
|
||||
four => "நநரௌ" + sandhi_u;
|
||||
five => fiveh_sandhi ;
|
||||
_ => d.s ! attr1 ++ "நரௌ" + sandhi_u} ! d.size ;
|
||||
preceded =>
|
||||
table {nine => "தலௌலயாரமௌ" ;
|
||||
eight => "எணௌணரீ" ;
|
||||
four => "நநரீ" ;
|
||||
five => fiveh ;
|
||||
_ => d.s ! attr1 ++ "நரீ"} ! d.size ;
|
||||
lakhs => d.s ! unit ++ "இறடௌசமௌ" ;
|
||||
lakhs2 => d.s ! unit ++ "இறடௌசதௌதீ" } ;
|
||||
size = more100} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indeptwo =>
|
||||
table {nine => ("தலௌலயாரதௌதௌ" + sandhi_u) ;
|
||||
eight => ("எணௌணரௌ" + sandhi_u) ;
|
||||
four => ("நநரௌ" + sandhi_u) ;
|
||||
five => fiveh_sandhi ;
|
||||
sg => ("நரௌ" + sandhi_u) ;
|
||||
_ => d.s ! attr1 ++ ("நரௌ" + sandhi_u) } ! d.size ++ e.s ! indep ;
|
||||
attrtwo =>
|
||||
table {nine => ("தலௌலயாரதௌதௌ" + sandhi_u) ;
|
||||
eight => ("எணௌணரௌ" + sandhi_u) ;
|
||||
four => ("நநரௌ" + sandhi_u) ;
|
||||
five => fiveh_sandhi ;
|
||||
sg => ("நரௌ" + sandhi_u) ;
|
||||
_ => d.s ! attr1 ++ ("நரௌ" + sandhi_u) } ! d.size ++ e.s ! indep ;
|
||||
preceded =>
|
||||
table {nine => ("தலௌலயாரதௌதௌ" + sandhi_u) ;
|
||||
eight => ("எணௌணரௌ" + sandhi_u) ;
|
||||
four => ("நநரௌ" + sandhi_u) ;
|
||||
five => fiveh_sandhi ;
|
||||
_ => d.s ! attr1 ++ ("நரௌ" + sandhi_u) } ! d.size ++ e.s ! indep ;
|
||||
lakhs => d.s ! unit ++ ("இறடௌசதௌதௌ" + sandhi_u) ++
|
||||
table {sg => "ஆயாரமௌ" ; _ => e.s ! attr ++ "ஆயாரமௌ" } ! e.size ;
|
||||
lakhs2 => d.s ! unit ++ ("இறடௌசதௌதௌ" + sandhi_u) ++
|
||||
table {sg => "ஆயாரதௌதௌ" + sandhi_u ; _ => e.s ! attr ++ ("ஆயாரதௌதௌ" + sandhi_u) } ! e.size} ; size = more100} ;
|
||||
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indeptwo} ;
|
||||
lin pot3 n =
|
||||
{s = table {sg => "ஆயாரமௌ" ;
|
||||
more100 => n.s ! lakhs ;
|
||||
_ => n.s ! attrtwo ++ "ஆயாரமௌ" } ! n.size } ;
|
||||
|
||||
lin pot3plus n m =
|
||||
{s = table {sg => "ஆயாரதௌதௌ" + sandhi_u;
|
||||
more100 => n.s ! lakhs2 ;
|
||||
_ => n.s ! attrtwo ++ "ஆயாரதௌதௌ" + sandhi_u } ! n.size ++ m.s ! preceded} ;
|
||||
|
||||
|
||||
}
|
||||
63
examples/numerals/tampere.gf
Normal file
63
examples/numerals/tampere.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
concrete tampere of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param Place = attr | indep ;
|
||||
param Nm = sg | pl ;
|
||||
oper sata : Nm => Str =
|
||||
table {{sg} => "sata" ; {pl} => "sataa"} ;
|
||||
oper tuhat : Nm => Str =
|
||||
table {{sg} => "tuhat" ; {pl} => "tuhatta"} ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : Place => Str} ;
|
||||
lincat Sub10 = {inh : Nm ; s : Place => Str} ;
|
||||
lincat Sub100 = {inh : Nm ; s : Place => Str} ;
|
||||
lincat Sub1000 = {inh : Nm ; s : Place => Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 =
|
||||
{s = table {p => "kaks"}} ;
|
||||
lin n3 =
|
||||
{s = table {{attr} => "kol" ; {indep} => "kolme"}} ;
|
||||
lin n4 =
|
||||
{s = table {{attr} => "nel" ; {indep} => "neliä"}} ;
|
||||
lin n5 =
|
||||
{s = table {p => "viis"}} ;
|
||||
lin n6 =
|
||||
{s = table {p => "kuus"}} ;
|
||||
lin n7 =
|
||||
{s = table {{attr} => "seit" ; {indep} => "seittämän"}} ;
|
||||
lin n8 =
|
||||
{s = table {p => "kahreksan"}} ;
|
||||
lin n9 =
|
||||
{s = table {p => "yhreksän"}} ;
|
||||
lin pot01 =
|
||||
{inh = sg ; s = table {{attr} => [] ; {indep} => "yks"}} ;
|
||||
lin pot0 d =
|
||||
{inh = pl ; s = table {p => d.s ! indep}} ;
|
||||
lin pot110 =
|
||||
{inh = pl ; s = table {p => "kymmenen"}} ;
|
||||
lin pot111 =
|
||||
{inh = pl ; s = table {p => "yks"++"toista"}} ;
|
||||
lin pot1to19 d =
|
||||
{inh = pl ; s = table {p => (d.s ! indep) ++ "toista"}} ;
|
||||
lin pot0as1 n =
|
||||
{inh = n.inh ; s = table {p => n.s ! p}} ;
|
||||
lin pot1 d =
|
||||
{inh = pl ; s = table {p => (d.s ! attr) ++ "kytä"}} ;
|
||||
lin pot1plus d e =
|
||||
{inh = pl ; s = table {p => (d.s ! attr) ++ "kyt" ++ e.s ! indep}} ;
|
||||
lin pot1as2 n =
|
||||
{inh = n.inh ; s = table {p => n.s ! p}} ;
|
||||
lin pot2 d =
|
||||
{inh = pl ; s = table {p => (d.s ! attr) ++ sata ! (d.inh)}} ;
|
||||
lin pot2plus d e =
|
||||
{inh = pl ; s = table {p => (d.s ! attr) ++ (sata ! (d.inh)) ++ e.s ! indep}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = (n.s ! attr) ++ tuhat ! (n.inh)} ;
|
||||
lin pot3plus n m =
|
||||
{s = (n.s ! attr) ++ (tuhat ! (n.inh)) ++ m.s ! indep} ;
|
||||
|
||||
}
|
||||
72
examples/numerals/thai.gf
Normal file
72
examples/numerals/thai.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
concrete thai of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- Thai transliteration, produces thaiU.gf by GF/Text/Thai.hs
|
||||
-- AR 28/12/2006
|
||||
|
||||
flags coding=utf8 ;
|
||||
|
||||
lincat
|
||||
Numeral = {s : Str} ;
|
||||
Digit = {s : DForm => Str} ;
|
||||
Sub10 = {s : DForm => Str} ;
|
||||
Sub100 = {s : NForm => Str} ;
|
||||
Sub1000 = {s : NForm => Str} ;
|
||||
Sub1000000 = {s : Str} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
|
||||
pot01 = mkNum "หนึง" "หนึง" "เอ็ด" ;
|
||||
|
||||
n2 = mkNum "สอง" "ยี่" "สอง" ;
|
||||
n3 = regNum "สาม" ;
|
||||
n4 = regNum "สี่" ; -- T1 = E48 '
|
||||
n5 = regNum "ห้า" ; -- T2 = E49 9
|
||||
n6 = regNum "หก" ;
|
||||
n7 = regNum "เจ็ด" ; -- S = E47 w
|
||||
n8 = regNum "แปด" ;
|
||||
n9 = regNum "เกา" ;
|
||||
|
||||
|
||||
pot0 d = d ;
|
||||
|
||||
pot110 = {s = sip} ;
|
||||
pot111 = {s = table {
|
||||
Unit => ["สิบเอ็ด"] ;
|
||||
Thousand => ["หนึงหมื่นหนึงพะน"]
|
||||
}
|
||||
} ;
|
||||
pot1to19 d = {s = table {
|
||||
Unit => "สิบ" ++ d.s ! After ;
|
||||
Thousand => ["หนึงหมื่น"] ++ d.s ! Indep ++ "พะน"
|
||||
}
|
||||
} ;
|
||||
pot0as1 d = {s = \\n => d.s ! Indep ++ phan ! n} ;
|
||||
pot1 d = {s = \\n => d.s ! ModTen ++ sip ! n} ;
|
||||
pot1plus d e = {
|
||||
s = \\n => d.s ! ModTen ++ sip ! n ++ e.s ! After ++ phan ! n
|
||||
} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = {s = \\n => d.s ! Indep ++ roy ! n} ;
|
||||
pot2plus d e = {s = \\n => d.s ! Indep ++ roy ! n ++ e.s ! n} ;
|
||||
pot2as3 n = {s = n.s ! Unit} ;
|
||||
pot3 n = {s = n.s ! Thousand} ;
|
||||
pot3plus n m = {s = n.s ! Thousand ++ m.s ! Unit} ;
|
||||
|
||||
param
|
||||
DForm = Indep | ModTen | After ;
|
||||
NForm = Unit | Thousand ;
|
||||
|
||||
oper
|
||||
mkNum : Str -> Str -> Str -> {s : DForm => Str} = \x,y,z ->
|
||||
{s = table {Indep => x ; ModTen => y ; After => z}} ;
|
||||
regNum : Str -> {s : DForm => Str} = \x ->
|
||||
mkNum x x x ;
|
||||
|
||||
|
||||
sip = table {Unit => "สิบ" ; Thousand => "หมื่น"} ;
|
||||
roy = table {Unit => "ร้อย" ; Thousand => "แสน"} ;
|
||||
phan = table {Unit => [] ; Thousand => "พะน"} ;
|
||||
|
||||
}
|
||||
72
examples/numerals/tibetan.gf
Normal file
72
examples/numerals/tibetan.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
concrete tibetan of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=extradiacritics ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \s1 -> \s2 -> s1 ++ s2;
|
||||
|
||||
param DForm = unit | teen | bform | ten | hundred | agg ;
|
||||
|
||||
-- Sorry no tibetan script but the adhoc transliteration should be phonematic
|
||||
-- 21 has an extra variant namely nyerchi'
|
||||
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str ; s2 : Str} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str} ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\u -> \tn -> \b -> \t ->
|
||||
{s = table {unit => u ; teen => tn ; bform => b + "chu" ; ten => t ; hundred => b + "ğya" ; agg => "ṭ'a'" ++ u}} ;
|
||||
|
||||
-- lin n1 mkNum "chi'" "chuǵchi'" ;
|
||||
lin n2 =
|
||||
{s = table {unit => "n̆yī" ; teen => "chuǵn̆yī" ; ten => "tsaǵ" ;
|
||||
bform => "nyishu" ; hundred => (variants {"nyibğya"; "nyībğya"}) ;
|
||||
agg => "ṭ'a'" ++ "n̆yī" } };
|
||||
lin n3 = mkNum "sum" "chuǵsum" "sum" "soǵ" ;
|
||||
lin n4 = mkNum "z̆hyi" "chubz̆hyi" (variants {"z̆hyib" ; "z̆hib"}) "źhye" ;
|
||||
lin n5 = mkNum "n̆ga" "chȫn̆ga" "n̆gab" "nga" ;
|
||||
lin n6 = mkNum "ḍu'" "chuḍu'" "ḍuǵ" "re";
|
||||
lin n7 = mkNum "d̆ün" "chubd̆ün" "d̆ün" "d́ön";
|
||||
lin n8 = mkNum "ğyä'" "chobğyä'" "ğyä'" "ǵya";
|
||||
lin n9 = mkNum "ğu" "chuğu" "ğub" "ǵo";
|
||||
|
||||
oper dang : Str = "d́ang" ;
|
||||
oper tampa : Str -> Str = \s -> (variants {s; s ++ "t'ampa"});
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ [] }; -- extra diacritics translation
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hundred => "ğya" ; agg => (variants {[] ; "t'a'"}) ; _ => "chi'"}} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = tampa "chu" ; s2 = variants {"ṭ'i" ; "ṭ'iṭ'a'"}} ;
|
||||
lin pot111 =
|
||||
{s = "chuǵchi'" ;
|
||||
s2 = variants {"ṭ'i" ; "ṭ'iṭ'a'"} ++ dang ++ variants {"t̆ong'i" ; "t̆ongṭ'a'"}} ;
|
||||
lin pot1to19 d = {s = d.s ! teen ; s2 = variants {"ṭ'i" ; "ṭ'iṭ'a'"} ++ mkagg (d.s ! agg) "t̆ong"} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = mkagg (n.s ! agg) "t̆ong"} ;
|
||||
lin pot1 d = {s = tampa (d.s ! bform) ; s2 = mkagg (d.s ! agg) "ṭ'i"} ;
|
||||
lin pot1plus d e =
|
||||
{s = variants { d.s ! bform ++ (bind (d.s ! ten) (e.s ! unit)) ;
|
||||
(bind (d.s ! ten) (e.s ! unit))} ;
|
||||
s2 = mkagg (d.s ! agg) "ṭ'i" ++ dang ++ mkagg (e.s ! agg) "t̆ong"} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = n.s2 } ;
|
||||
lin pot2 d = {s = d.s ! hundred ; s2 = mkagg (d.s ! agg) "b̆um" } ;
|
||||
lin pot2plus d e = {s = d.s ! hundred ++ dang ++ e.s ;
|
||||
s2 = mkagg (d.s ! agg) "b̆um" ++ dang ++ e.s2} ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = n.s2 } ;
|
||||
lin pot3plus n m = {s = n.s2 ++ dang ++ m.s} ;
|
||||
|
||||
oper mkagg : Str -> Str -> Str = \attr -> \s -> bind s attr ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
80
examples/numerals/todo/irula.gf
Normal file
80
examples/numerals/todo/irula.gf
Normal file
@@ -0,0 +1,80 @@
|
||||
concrete irula of Numerals = {
|
||||
-- Irula
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
oper
|
||||
vowel : Strs = strs {"o" ; "e" ; "a" ; "i" ; "u" ; "ä" ; "ö"} ;
|
||||
cons : Strs =
|
||||
strs {"b" ; "g" ; "d" ; "p" ; "t" ; "k" ; "l" ; "r" ; "m" ; "n" ; "s" ; "c"};
|
||||
oper adu : Str = "a" + pre {"du" ; "tt" / vowel} ;
|
||||
oper uru : Str = "u:" + pre {"r_u" ; "tti" / cons ; "tt"/ vowel} ;
|
||||
laks : Str = "lacca" + T ;
|
||||
ayira : Str = "a:yira" + T ;
|
||||
---- cavira : Str = variants {ayira ; "ca:vira" + T} ; ----BUG in Compute (AR 9/5/2005)
|
||||
cavira : Str = variants {"a:yira" + T ; "ca:vira" + T} ;
|
||||
|
||||
T : Str = pre {[] ; "tt" / vowel ; "tti" / cons} ;
|
||||
U : Str = pre {"u" ; [] / vowel } ;-- ; "ï" / cons} ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str };
|
||||
oper LinS100 = {s : Place => Str };
|
||||
|
||||
param DForm = unit | ten | teen | hund | thou | thou2;
|
||||
param Place = p | lak ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO
|
||||
|
||||
oper mkN : Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\u -> \tn -> \t -> \h -> \a ->
|
||||
{s = table {unit => u ; teen => tn ; ten => t+adu ; hund => h+uru ; thou => a+ayira ; thou2 => a+ayira} };
|
||||
|
||||
lin n2 = mkN (variants {"ren.d.u" ; "ran.d.u"}) ("pannen.d."+U) "iruv" "eran" "ren.d." ;
|
||||
lin n3 = mkN "mu:nr_u" ("padimu:nr_"+U) "mupp" "munn" "mu:nr_" ;
|
||||
lin n4 = mkN "nä:lu" ("padanä:l"+U) "na:pp" "nä:n" "nä:l" ;
|
||||
lin n5 = mkN (variants {"anju" ; "anji"}) ("padananj"+U) "amb" "ayin" "anj" ;
|
||||
lin n6 = mkN "a:ru" ("padana:r_"+U) "ar_uv" "ar_a" "a:r_" ;
|
||||
lin n7 = mkN "e:l.u" ("padane:l."+U) "el.uv" "el.a" "e:l." ;
|
||||
lin n8 = mkN "et.t.u" ("padanet.t."+U) "emb" "et.t.un" "et.t." ;
|
||||
lin n9 = {s = table {unit => "ombadu" ; teen => "pattombad"+U ;
|
||||
ten => "ton.n."+uru ; hund => "tol.l."+ayira ;
|
||||
thou => "ombadan" + ayira ; thou2 => "ombadan" + ayira }};
|
||||
|
||||
oper ss : Str -> LinS100 = \s1 -> {s = table {p => s1 ; lak => bind s1 cavira }} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "önr_u" ; ---- pre {[] ; "önr_u" / strs {[]}} ;
|
||||
---- equivalent by the sem. of pre. AR
|
||||
|
||||
thou => cavira ;
|
||||
thou2 => "or" + ayira ;
|
||||
hund => "n" + uru ;
|
||||
_ => "dummy"} };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss ("patt"+U) ;
|
||||
lin pot111 = ss ("padanon.n."+U) ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = table {p => n.s ! unit ; lak => n.s ! thou } };
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e =
|
||||
{s = table {p => bind (d.s ! ten) (e.s ! unit) ;
|
||||
lak => bind (d.s ! ten) (e.s ! thou2)}} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d =
|
||||
{s = table {p => d.s ! hund ; lak => bind (d.s ! unit) laks }};
|
||||
lin pot2plus d e =
|
||||
{s = table {p => bind (d.s ! hund) (e.s ! p) ;
|
||||
lak => bind (bind (d.s ! unit) laks) (e.s ! lak)}} ;
|
||||
lin pot2as3 n = {s = n.s ! p} ;
|
||||
lin pot3 n = {s = n.s ! lak } ;
|
||||
lin pot3plus n m = {s = bind (n.s ! lak) (m.s ! p) } ;
|
||||
|
||||
}
|
||||
75
examples/numerals/todo/kodagu.gf
Normal file
75
examples/numerals/todo/kodagu.gf
Normal file
@@ -0,0 +1,75 @@
|
||||
concrete kodagu of Numerals = {
|
||||
-- Kodagu
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
oper
|
||||
vowel : Strs = strs {"o" ; "e" ; "a" ; "i" ; "u" ; "ï" ; "ë"} ;
|
||||
cons : Strs =
|
||||
strs {"b" ; "g" ; "d" ; "p" ; "t" ; "k" ; "l" ; "r" ; "m" ; "n" ; "s" ; "ñ"} ;
|
||||
|
||||
oper adi : Str = "a" + pre {"dï" ; "tt" / vowel} ;
|
||||
oper uri : Str = "u:" + pre {"rï" ; "yt.a" / cons ; "yt."/ vowel} ;
|
||||
laks : Str = "laks.a" + T ;
|
||||
ayra : Str = "a:yra" + T ;
|
||||
|
||||
T : Str = pre {[] ; "t" / vowel ; "t" / cons} ;
|
||||
I : Str = pre {"ï" ; [] / vowel } ;-- ; "ï" / cons} ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str };
|
||||
oper LinS100 = {s : Place => Str };
|
||||
|
||||
param DForm = unit | ten | teen | hund | thou;
|
||||
param Place = p | lak ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO
|
||||
|
||||
oper mkN : Str -> Str -> Str -> Str -> Str -> LinDigit =
|
||||
\u -> \tn -> \t -> \h -> \a ->
|
||||
{s = table {unit => u ; teen => tn ; ten => t+adi ; hund => h+uri ; thou => a+ayra} };
|
||||
|
||||
lin n2 = mkN "dan.d.ï" ("panneran.d."+I) "iruv" "inn" "i:r" ;
|
||||
lin n3 = mkN "mu:ndï" ("padïmu:nd"+I) "nupp" "mu:n" "mu:v" ;
|
||||
lin n4 = mkN "na:lï" ("padïna:l"+I) "na:p" "na:n" "na:l" ;
|
||||
lin n5 = mkN "an~ji" "padïnan~ji" "aymb" "aññ" "ay" ;
|
||||
lin n6 = mkN "a:rï" ("padïna:r"+I) "arup" "a:rïn" "a:r" ;
|
||||
lin n7 = mkN "ë:lï" ("padïnë:l"+I) "ël.up" "ë:l.n" "ë:l." ;
|
||||
lin n8 = mkN "ët.t.ï" ("padïnët.t."+I) "ëmb" "et.n" "et.t." ;
|
||||
lin n9 = mkN "oymbadï" ("pattoymbad"+I) "tomb" "oymbayn" "oymbad" ;
|
||||
|
||||
oper ss : Str -> LinS100 = \s1 -> {s = table {p => s1 ; lak => bind s1 ayra }} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "ondï" ; ---- pre {[] ; "ondï" / strs {[]}} ;
|
||||
---- equivalent by the sem. of pre. AR
|
||||
thou => variants {ayra ; "o:r" + ayra} ;
|
||||
hund => "n" + uri ;
|
||||
_ => "dummy"} };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss ("patt"+I) ;
|
||||
lin pot111 = ss ("pannond"+I) ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = table {p => n.s ! unit ; lak => n.s ! thou } };
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e =
|
||||
{s = table {p => bind (d.s ! ten) (e.s ! unit) ;
|
||||
lak => bind (d.s ! ten) (e.s ! thou)}} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d =
|
||||
{s = table {p => d.s ! hund ; lak => bind (d.s ! unit) laks }};
|
||||
lin pot2plus d e =
|
||||
{s = table {p => bind (d.s ! hund) (e.s ! p) ;
|
||||
lak => bind (bind (d.s ! unit) laks) (e.s ! lak)}} ;
|
||||
lin pot2as3 n = {s = n.s ! p} ;
|
||||
lin pot3 n = {s = n.s ! lak } ;
|
||||
lin pot3plus n m = {s = bind (n.s ! lak) (m.s ! p) } ;
|
||||
|
||||
}
|
||||
205
examples/numerals/todo/sanskrit.gf
Normal file
205
examples/numerals/todo/sanskrit.gf
Normal file
@@ -0,0 +1,205 @@
|
||||
concrete sanskrit of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=devanagari ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ;
|
||||
param Size = sing | dual | less10 | more100 | more10 ;
|
||||
|
||||
|
||||
oper
|
||||
vowel : Strs = strs {"अ" ; "ए" ; "इ" ; "उ" ; "ओ"} ;
|
||||
dental : Strs = strs {"न"; "त"; "द"} ;
|
||||
labial : Strs = strs {"म"; "प"; "ब"} ;
|
||||
velar : Strs = strs {"ग़"; "क"; "ग"} ;
|
||||
affricate : Strs = strs {"ञ" ; "च"; "ज" } ;
|
||||
retroflex : Strs = strs {"ण" ; "ट" ; "ड"; "ष"} ;
|
||||
sibilant : Strs = strs {"श" ; "स"; "ह"; "र"} ; -- r also
|
||||
unvoiced : Strs = strs {"क"; "प"; "च"; "त"} ;
|
||||
|
||||
oper
|
||||
S : Str = pre {"ष" ; "ट" / unvoiced ; "ड" / vowel } ;
|
||||
as : Str = pre {"ओ" ; "अस" / unvoiced ; "अः" / sibilant } ;
|
||||
i : Str = pre {"इ" ; "य" / vowel } ;
|
||||
am : Str = "अ" + (pre {"म" ; "न" / dental ; "ग़" / velar ; "ञ" / affricate ; "ण" / retroflex ; "ं" / sibilant}) ;
|
||||
a_ : Str = pre { "आ" ; "अ" / vowel } ; -- shortened if a follows (no other vowel occur initally)
|
||||
r : Str = pre {"र" ; "स" / unvoiced ; "च" / affricate ; "ः" / sibilant } ;
|
||||
t : Str = pre {"त" ; "च" / affricate ; "ट" / retroflex } ;
|
||||
|
||||
|
||||
LinDigit = {s : DForm => Str ; size : DSize} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : DSize} ;
|
||||
lincat Sub100 = {s : Str ; s2 : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = [] ++ x0.s ++ []} ; -- the Devanagari environment
|
||||
|
||||
oper mkNum : Str -> Str -> DSize -> LinDigit =
|
||||
\u -> \t -> \sz ->
|
||||
{s = table {unit => u ; ten => t } ; size = sz } ;
|
||||
|
||||
-- lin n1 mkNum "एक" daca ... ;
|
||||
lin n2 = mkNum "द्व" viMcati r2 ;
|
||||
lin n3 = mkNum ("त्र" + i) triMcat r3 ;
|
||||
lin n4 = mkNum ("चतु" + r) catvariMcat r4 ;
|
||||
lin n5 = mkNum "पञ्च" pancacat r5 ;
|
||||
lin n6 = mkNum ("ष" + S) SaSTi r6 ;
|
||||
lin n7 = mkNum "सप्त" saptati r7 ;
|
||||
lin n8 = mkNum "अष्ट" aciti r8;
|
||||
lin n9 = mkNum "नव" navati r9 ;
|
||||
|
||||
oper daca : Str = "दश" ;
|
||||
oper viMcati : Str = "विंशत" + i;
|
||||
oper triMcat : Str = "त्रिंश" + t;
|
||||
oper catvariMcat : Str = "चत्वारिंश" + t ;
|
||||
oper pancacat : Str = "पञ्चाश" + t;
|
||||
oper SaSTi : Str = "षष्ट" + i;
|
||||
oper saptati : Str = "सप्तत" + i ;
|
||||
oper aciti : Str = "अशीत" + i ;
|
||||
oper navati : Str = "नवत" + i ;
|
||||
|
||||
oper mkR1 : Str -> Str -> DSize => Str = \a1 -> \a2 -> table {
|
||||
sg => a1 + daca ;
|
||||
r2 => a2 + viMcati ;
|
||||
r3 => a2 + triMcat ;
|
||||
r4 => a2 + catvariMcat ;
|
||||
r5 => a2 + pancacat ;
|
||||
r6 => a2 + SaSTi ;
|
||||
r7 => a2 + saptati ;
|
||||
r8 => a2 + aciti ;
|
||||
r9 => a2 + navati
|
||||
} ;
|
||||
|
||||
oper mkR : Str -> DSize => Str = \a1 -> table {
|
||||
sg => a1 + daca ;
|
||||
r2 => a1 + viMcati ;
|
||||
r3 => a1 + triMcat ;
|
||||
r4 => a1 + catvariMcat ;
|
||||
r5 => a1 + pancacat ;
|
||||
r6 => a1 + SaSTi ;
|
||||
r7 => a1 + saptati ;
|
||||
r8 => a1 + aciti ;
|
||||
r9 => a1 + navati
|
||||
} ;
|
||||
|
||||
oper mkR9 : Str -> DSize => Str = \a1 -> table {
|
||||
sg => variants {a1 + daca ; "ऊना" + viMcati} ;
|
||||
r2 => variants {a1 + viMcati ; "ऊना" + triMcat } ;
|
||||
r3 => variants {a1 + triMcat ; "ऊना" + catvariMcat } ;
|
||||
r4 => variants {a1 + catvariMcat ; "ऊना" + pancacat } ;
|
||||
r5 => variants {a1 + pancacat ; "ऊना" + SaSTi } ;
|
||||
r6 => variants {a1 + SaSTi ; "ऊना" + saptati } ;
|
||||
r7 => variants {a1 + saptati ; "ऊना" + aciti } ;
|
||||
r8 => variants {a1 + aciti ; "ऊना" + navati } ;
|
||||
r9 => variants {a1 + navati ; "ऊना" + cata }
|
||||
} ;
|
||||
|
||||
oper mkR3 : Str -> Str -> DSize => Str = \a1 -> \a2 -> table {
|
||||
sg => a1 + daca ;
|
||||
r2 => a1 + viMcati ;
|
||||
r3 => a1 + triMcat ;
|
||||
r4 => variants { a2 + catvariMcat ; a1 + catvariMcat } ;
|
||||
r5 => variants { a2 + pancacat ; a1 + pancacat } ;
|
||||
r6 => variants { a2 + SaSTi ; a1 + SaSTi } ;
|
||||
r7 => variants { a2 + saptati ; a1 + saptati } ;
|
||||
r8 => a2 + aciti ;
|
||||
r9 => variants { a2 + navati ; a1 + navati }
|
||||
} ;
|
||||
|
||||
oper mkR6 : Str -> DSize => Str = \a1 -> table {
|
||||
sg => "षोडश" ;
|
||||
r2 => a1 + viMcati ;
|
||||
r3 => a1 + triMcat ;
|
||||
r4 => a1 + catvariMcat ;
|
||||
r5 => a1 + pancacat ;
|
||||
r6 => a1 + SaSTi ;
|
||||
r7 => a1 + saptati ;
|
||||
r8 => a1 + aciti ;
|
||||
r9 => "षोण्णवत" + i
|
||||
} ;
|
||||
|
||||
oper rows : DSize => DSize => Str = table {
|
||||
sg => mkR1 ("एक" + a_) eka ;
|
||||
r2 => mkR3 ("द्व" + a_) ("द्व" + i) ;
|
||||
r3 => mkR3 ("त्रय" + as) ("त्र" + i) ;
|
||||
r4 => mkR ("चतु" + r) ;
|
||||
r5 => mkR "पञ्च" ;
|
||||
r6 => mkR6 ("ष" + S) ;
|
||||
r7 => mkR "सप्त" ;
|
||||
r8 => mkR3 ("अष्ट" + a_) "अष्ट" ;
|
||||
r9 => mkR9 "नव"
|
||||
} ;
|
||||
|
||||
oper eka : Str = "एक" ;
|
||||
|
||||
lin pot01 = {s = table {unit => eka ; ten => daca } ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = daca ; s2 = variants { ayuta ; mksahasra2 more10 daca }; size = more10} ;
|
||||
lin pot111 = {s = rows ! sg ! sg ;
|
||||
s2 = mkayutamore eka sg eka sg ;
|
||||
size = more10} ;
|
||||
lin pot1to19 d =
|
||||
{s = rows ! d.size ! sg ;
|
||||
s2 = mkayutamore eka sg (d.s ! unit) d.size;
|
||||
size = more10} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ;
|
||||
s2 = mksahasra n.size (n.s ! unit) ;
|
||||
size = table {sg => sing ; r2 => dual ; _ => less10} ! n.size };
|
||||
lin pot1 d = {s = d.s ! ten ;
|
||||
s2 = variants {mkayuta d.size (d.s ! unit) ; mksahasra2 more10 (d.s ! ten) } ;
|
||||
size = more10} ;
|
||||
lin pot1plus d e = {s = rows ! e.size ! d.size ;
|
||||
s2 = mkayutamore (d.s ! unit) d.size (e.s ! unit) e.size ;
|
||||
size = more10} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = n.s2 ; size = n.size } ;
|
||||
lin pot2 d =
|
||||
{s = mkcata d.size (d.s ! unit);
|
||||
s2 = mklakh d.size (d.s ! unit) ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2plus d e =
|
||||
{s = hundredplusunit (mkcata d.size (d.s ! unit)) e.s ;
|
||||
s2 = lakhplus (mklakh d.size (d.s ! unit)) e.s2 ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = table {more10 => n.s2 ;
|
||||
_ => mksahasra2 n.size n.s } ! n.size} ;
|
||||
|
||||
lin pot3plus n m =
|
||||
{s = p3plus (table {more10 => n.s2 ; _ => mksahasra2 n.size n.s } ! n.size) n.size m.s m.size} ;
|
||||
|
||||
oper mksahasra2 : Size -> Str -> Str = \sz -> \s -> table {sing => "सहस्र" + am ; dual => "द्वे" ++ "सहस्रे" ; _ => s ++ ("सहस्राण" + i)} ! sz ;
|
||||
oper mksahasra : DSize -> Str -> Str = \sz -> \s -> table {sg => "सहस्र" + am ; r2 => "द्वे" ++ "सहस्रे" ; _ => s ++ ("सहस्राण" + i)} ! sz ;
|
||||
oper mkcata : DSize -> Str -> Str = \sz -> \s -> table {sg => cata ; r2 => variants {"द्वे" ++ "शते" ; "द्वी" + cata }; _ => s ++ ("शतान" + i)} ! sz ;
|
||||
oper mklakh : DSize -> Str -> Str = \sz -> \s -> table {sg => "लक्ष" + am ; r2 => "द्वे" ++ "लक्षे" ; _ => s ++ ("लक्षाण" + i) } ! sz ;
|
||||
oper mklakh2 : Size -> Str -> Str = \sz -> \s -> table {sing => "लक्ष" + am ; dual => "द्वे" ++ "लक्षे" ; _ => s ++ ("लक्षाण" + i) } ! sz ;
|
||||
|
||||
oper mkayuta : DSize -> Str -> Str = \sz -> \s -> table {sg => "अयुत" + am ; r2 => "द्वे" ++ "अयुते" ; _ => s ++ ("अयुतान" + i)} ! sz ;
|
||||
|
||||
oper adhikam : Str = "अधिक" + am ;
|
||||
oper ca : Str = "च" ;
|
||||
oper ayuta : Str = "अयुत" + am ;
|
||||
oper cata : Str = "शत" + am ;
|
||||
|
||||
oper hundredplusunit : Str -> Str -> Str = \hun -> \unit ->
|
||||
variants {hun ++ unit ++ "च" ; unit ++ adhikam ++ hun};
|
||||
|
||||
oper lakhplus : Str -> Str -> Str = \lakh -> \low -> lakh ++ low ++ ca ;
|
||||
|
||||
oper p3plus : Str -> Size -> Str -> Size -> Str = \b -> \bs -> \s -> \ss -> table {more10 => table {more10 => b ++ ca ++ s ++ ca ; _ => s ++ adhikam ++ b} ! ss;
|
||||
_ => table {more10 => b ++ s ++ ca ; _ => s ++ b} ! ss } ! bs;
|
||||
|
||||
mkayutamore : Str -> DSize -> Str -> DSize -> Str = \d -> \ds -> \e -> \es ->
|
||||
variants {(mkayuta ds d) ++ (mksahasra es e) ;
|
||||
mklakh2 more10 (rows ! es ! ds) } ;
|
||||
|
||||
|
||||
}
|
||||
204
examples/numerals/todo/sanskritTranslit.gf
Normal file
204
examples/numerals/todo/sanskritTranslit.gf
Normal file
@@ -0,0 +1,204 @@
|
||||
concrete sanskrit of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=devanagari ;
|
||||
|
||||
param DForm = unit | ten ;
|
||||
param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ;
|
||||
param Size = sing | dual | less10 | more100 | more10 ;
|
||||
|
||||
|
||||
oper
|
||||
vowel : Strs = strs {"a" ; "e" ; "i" ; "u" ; "o"} ;
|
||||
dental : Strs = strs {"n"; "t"; "d"} ;
|
||||
labial : Strs = strs {"m"; "p"; "b"} ;
|
||||
velar : Strs = strs {"G"; "k"; "g"} ;
|
||||
affricate : Strs = strs {"ñ" ; "c"; "j" } ;
|
||||
retroflex : Strs = strs {"N" ; "T" ; "D"; "S"} ;
|
||||
sibilant : Strs = strs {"ç" ; "s"; "h"; "r"} ; -- r also
|
||||
unvoiced : Strs = strs {"k"; "p"; "c"; "t"} ;
|
||||
|
||||
oper
|
||||
S : Str = pre {"S" ; "T" / unvoiced ; "D" / vowel } ;
|
||||
as : Str = pre {"o" ; "as" / unvoiced ; "a;" / sibilant } ;
|
||||
i : Str = pre {"i" ; "y" / vowel } ;
|
||||
am : Str = "a" + (pre {"m" ; "n" / dental ; "G" / velar ; "ñ" / affricate ; "N" / retroflex ; "M" / sibilant}) ;
|
||||
a_ : Str = pre { "a:" ; "a" / vowel } ; -- shortened if a follows (no other vowel occur initally)
|
||||
r : Str = pre {"r" ; "s" / unvoiced ; "c" / affricate ; ";" / sibilant } ;
|
||||
t : Str = pre {"t" ; "c" / affricate ; "T" / retroflex } ;
|
||||
|
||||
|
||||
LinDigit = {s : DForm => Str ; size : DSize} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : DSize} ;
|
||||
lincat Sub100 = {s : Str ; s2 : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = "/&" ++ x0.s ++ "&/"} ; -- the Devanagari environment
|
||||
|
||||
oper mkNum : Str -> Str -> DSize -> LinDigit =
|
||||
\u -> \t -> \sz ->
|
||||
{s = table {unit => u ; ten => t } ; size = sz } ;
|
||||
|
||||
-- lin n1 mkNum "eka" daca ... ;
|
||||
lin n2 = mkNum "dva" viMcati r2 ;
|
||||
lin n3 = mkNum ("tr" + i) triMcat r3 ;
|
||||
lin n4 = mkNum ("catu" + r) catvariMcat r4 ;
|
||||
lin n5 = mkNum "pañca" pancacat r5 ;
|
||||
lin n6 = mkNum ("Sa" + S) SaSTi r6 ;
|
||||
lin n7 = mkNum "sapta" saptati r7 ;
|
||||
lin n8 = mkNum "aSTa" aciti r8;
|
||||
lin n9 = mkNum "nava" navati r9 ;
|
||||
|
||||
oper daca : Str = "daça" ;
|
||||
oper viMcati : Str = "viMçat" + i;
|
||||
oper triMcat : Str = "triMça" + t;
|
||||
oper catvariMcat : Str = "catva:riMça" + t ;
|
||||
oper pancacat : Str = "pañca:ça" + t;
|
||||
oper SaSTi : Str = "SaST" + i;
|
||||
oper saptati : Str = "saptat" + i ;
|
||||
oper aciti : Str = "açi:t" + i ;
|
||||
oper navati : Str = "navat" + i ;
|
||||
|
||||
oper mkR1 : Str -> Str -> DSize => Str = \a1 -> \a2 -> table {
|
||||
sg => a1 + daca ;
|
||||
r2 => a2 + viMcati ;
|
||||
r3 => a2 + triMcat ;
|
||||
r4 => a2 + catvariMcat ;
|
||||
r5 => a2 + pancacat ;
|
||||
r6 => a2 + SaSTi ;
|
||||
r7 => a2 + saptati ;
|
||||
r8 => a2 + aciti ;
|
||||
r9 => a2 + navati
|
||||
} ;
|
||||
|
||||
oper mkR : Str -> DSize => Str = \a1 -> table {
|
||||
sg => a1 + daca ;
|
||||
r2 => a1 + viMcati ;
|
||||
r3 => a1 + triMcat ;
|
||||
r4 => a1 + catvariMcat ;
|
||||
r5 => a1 + pancacat ;
|
||||
r6 => a1 + SaSTi ;
|
||||
r7 => a1 + saptati ;
|
||||
r8 => a1 + aciti ;
|
||||
r9 => a1 + navati
|
||||
} ;
|
||||
|
||||
oper mkR9 : Str -> DSize => Str = \a1 -> table {
|
||||
sg => variants {a1 + daca ; "u:na:" + viMcati} ;
|
||||
r2 => variants {a1 + viMcati ; "u:na:" + triMcat } ;
|
||||
r3 => variants {a1 + triMcat ; "u:na:" + catvariMcat } ;
|
||||
r4 => variants {a1 + catvariMcat ; "u:na:" + pancacat } ;
|
||||
r5 => variants {a1 + pancacat ; "u:na:" + SaSTi } ;
|
||||
r6 => variants {a1 + SaSTi ; "u:na:" + saptati } ;
|
||||
r7 => variants {a1 + saptati ; "u:na:" + aciti } ;
|
||||
r8 => variants {a1 + aciti ; "u:na:" + navati } ;
|
||||
r9 => variants {a1 + navati ; "u:na:" + cata }
|
||||
} ;
|
||||
|
||||
oper mkR3 : Str -> Str -> DSize => Str = \a1 -> \a2 -> table {
|
||||
sg => a1 + daca ;
|
||||
r2 => a1 + viMcati ;
|
||||
r3 => a1 + triMcat ;
|
||||
r4 => variants { a2 + catvariMcat ; a1 + catvariMcat } ;
|
||||
r5 => variants { a2 + pancacat ; a1 + pancacat } ;
|
||||
r6 => variants { a2 + SaSTi ; a1 + SaSTi } ;
|
||||
r7 => variants { a2 + saptati ; a1 + saptati } ;
|
||||
r8 => a2 + aciti ;
|
||||
r9 => variants { a2 + navati ; a1 + navati }
|
||||
} ;
|
||||
|
||||
oper mkR6 : Str -> DSize => Str = \a1 -> table {
|
||||
sg => "SoDaça" ;
|
||||
r2 => a1 + viMcati ;
|
||||
r3 => a1 + triMcat ;
|
||||
r4 => a1 + catvariMcat ;
|
||||
r5 => a1 + pancacat ;
|
||||
r6 => a1 + SaSTi ;
|
||||
r7 => a1 + saptati ;
|
||||
r8 => a1 + aciti ;
|
||||
r9 => "SoNNavat" + i
|
||||
} ;
|
||||
|
||||
oper rows : DSize => DSize => Str = table {
|
||||
sg => mkR1 ("ek" + a_) eka ;
|
||||
r2 => mkR3 ("dv" + a_) ("dv" + i) ;
|
||||
r3 => mkR3 ("tray" + as) ("tr" + i) ;
|
||||
r4 => mkR ("catu" + r) ;
|
||||
r5 => mkR "pañca" ;
|
||||
r6 => mkR6 ("Sa" + S) ;
|
||||
r7 => mkR "sapta" ;
|
||||
r8 => mkR3 ("aST" + a_) "aSTa" ;
|
||||
r9 => mkR9 "nava"
|
||||
} ;
|
||||
|
||||
oper eka : Str = "eka" ;
|
||||
|
||||
lin pot01 = {s = table {unit => eka ; ten => daca } ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = daca ; s2 = variants { ayuta ; mksahasra2 more10 daca }; size = more10} ;
|
||||
lin pot111 = {s = rows ! sg ! sg ;
|
||||
s2 = mkayutamore eka sg eka sg ;
|
||||
size = more10} ;
|
||||
lin pot1to19 d =
|
||||
{s = rows ! d.size ! sg ;
|
||||
s2 = mkayutamore eka sg (d.s ! unit) d.size;
|
||||
size = more10} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ;
|
||||
s2 = mksahasra n.size (n.s ! unit) ;
|
||||
size = table {sg => sing ; r2 => dual ; _ => less10} ! n.size };
|
||||
lin pot1 d = {s = d.s ! ten ;
|
||||
s2 = variants {mkayuta d.size (d.s ! unit) ; mksahasra2 more10 (d.s ! ten) } ;
|
||||
size = more10} ;
|
||||
lin pot1plus d e = {s = rows ! e.size ! d.size ;
|
||||
s2 = mkayutamore (d.s ! unit) d.size (e.s ! unit) e.size ;
|
||||
size = more10} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = n.s2 ; size = n.size } ;
|
||||
lin pot2 d =
|
||||
{s = mkcata d.size (d.s ! unit);
|
||||
s2 = mklakh d.size (d.s ! unit) ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2plus d e =
|
||||
{s = hundredplusunit (mkcata d.size (d.s ! unit)) e.s ;
|
||||
s2 = lakhplus (mklakh d.size (d.s ! unit)) e.s2 ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = table {more10 => n.s2 ;
|
||||
_ => mksahasra2 n.size n.s } ! n.size} ;
|
||||
|
||||
lin pot3plus n m =
|
||||
{s = p3plus (table {more10 => n.s2 ; _ => mksahasra2 n.size n.s } ! n.size) n.size m.s m.size} ;
|
||||
|
||||
oper mksahasra2 : Size -> Str -> Str = \sz -> \s -> table {sing => "sahasr" + am ; dual => "dve" ++ "sahasre" ; _ => s ++ ("sahasra:N" + i)} ! sz ;
|
||||
oper mksahasra : DSize -> Str -> Str = \sz -> \s -> table {sg => "sahasr" + am ; r2 => "dve" ++ "sahasre" ; _ => s ++ ("sahasra:N" + i)} ! sz ;
|
||||
oper mkcata : DSize -> Str -> Str = \sz -> \s -> table {sg => cata ; r2 => variants {"dve" ++ "çate" ; "dvi:" + cata }; _ => s ++ ("çata:n" + i)} ! sz ;
|
||||
oper mklakh : DSize -> Str -> Str = \sz -> \s -> table {sg => "lakS" + am ; r2 => "dve" ++ "lakSe" ; _ => s ++ ("lakSa:N" + i) } ! sz ;
|
||||
oper mklakh2 : Size -> Str -> Str = \sz -> \s -> table {sing => "lakS" + am ; dual => "dve" ++ "lakSe" ; _ => s ++ ("lakSa:N" + i) } ! sz ;
|
||||
|
||||
oper mkayuta : DSize -> Str -> Str = \sz -> \s -> table {sg => "ayut" + am ; r2 => "dve" ++ "ayute" ; _ => s ++ ("ayuta:n" + i)} ! sz ;
|
||||
|
||||
oper adhikam : Str = "adHik" + am ;
|
||||
oper ca : Str = "ca" ;
|
||||
oper ayuta : Str = "ayut" + am ;
|
||||
oper cata : Str = "çat" + am ;
|
||||
|
||||
oper hundredplusunit : Str -> Str -> Str = \hun -> \unit ->
|
||||
variants {hun ++ unit ++ "ca" ; unit ++ adhikam ++ hun};
|
||||
|
||||
oper lakhplus : Str -> Str -> Str = \lakh -> \low -> lakh ++ low ++ ca ;
|
||||
|
||||
oper p3plus : Str -> Size -> Str -> Size -> Str = \b -> \bs -> \s -> \ss -> table {more10 => table {more10 => b ++ ca ++ s ++ ca ; _ => s ++ adhikam ++ b} ! ss;
|
||||
_ => table {more10 => b ++ s ++ ca ; _ => s ++ b} ! ss } ! bs;
|
||||
|
||||
mkayutamore : Str -> DSize -> Str -> DSize -> Str = \d -> \ds -> \e -> \es ->
|
||||
variants {(mkayuta ds d) ++ (mksahasra es e) ;
|
||||
mklakh2 more10 (rows ! es ! ds) } ;
|
||||
|
||||
|
||||
}
|
||||
72
examples/numerals/todo/thai.gf
Normal file
72
examples/numerals/todo/thai.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
concrete thai of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- Thai transliteration, produces thaiU.gf by GF/Text/Thai.hs
|
||||
-- AR 28/12/2006
|
||||
|
||||
-- flags coding=utf8 ;
|
||||
|
||||
lincat
|
||||
Numeral = {s : Str} ;
|
||||
Digit = {s : DForm => Str} ;
|
||||
Sub10 = {s : DForm => Str} ;
|
||||
Sub100 = {s : NForm => Str} ;
|
||||
Sub1000 = {s : NForm => Str} ;
|
||||
Sub1000000 = {s : Str} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
|
||||
pot01 = mkNum "hnvg" "hnvg" "eOSd" ;
|
||||
|
||||
n2 = mkNum "sOg" "yi:T1" "sOg" ;
|
||||
n3 = regNum "sa:m" ;
|
||||
n4 = regNum "si:T1" ; -- T1 = E48 '
|
||||
n5 = regNum "hT2a:" ; -- T2 = E49 9
|
||||
n6 = regNum "ho?k" ;
|
||||
n7 = regNum "ecSd" ; -- S = E47 w
|
||||
n8 = regNum "e'pd" ;
|
||||
n9 = regNum "eka:" ;
|
||||
|
||||
|
||||
pot0 d = d ;
|
||||
|
||||
pot110 = {s = sip} ;
|
||||
pot111 = {s = table {
|
||||
Unit => ["sib eOSd"] ;
|
||||
Thousand => ["hnvg hmv:T1n hnvg p2an"]
|
||||
}
|
||||
} ;
|
||||
pot1to19 d = {s = table {
|
||||
Unit => "sib" ++ d.s ! After ;
|
||||
Thousand => ["hnvg hmv:T1n"] ++ d.s ! Indep ++ "p2an"
|
||||
}
|
||||
} ;
|
||||
pot0as1 d = {s = \\n => d.s ! Indep ++ phan ! n} ;
|
||||
pot1 d = {s = \\n => d.s ! ModTen ++ sip ! n} ;
|
||||
pot1plus d e = {
|
||||
s = \\n => d.s ! ModTen ++ sip ! n ++ e.s ! After ++ phan ! n
|
||||
} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = {s = \\n => d.s ! Indep ++ roy ! n} ;
|
||||
pot2plus d e = {s = \\n => d.s ! Indep ++ roy ! n ++ e.s ! n} ;
|
||||
pot2as3 n = {s = n.s ! Unit} ;
|
||||
pot3 n = {s = n.s ! Thousand} ;
|
||||
pot3plus n m = {s = n.s ! Thousand ++ m.s ! Unit} ;
|
||||
|
||||
param
|
||||
DForm = Indep | ModTen | After ;
|
||||
NForm = Unit | Thousand ;
|
||||
|
||||
oper
|
||||
mkNum : Str -> Str -> Str -> {s : DForm => Str} = \x,y,z ->
|
||||
{s = table {Indep => x ; ModTen => y ; After => z}} ;
|
||||
regNum : Str -> {s : DForm => Str} = \x ->
|
||||
mkNum x x x ;
|
||||
|
||||
|
||||
sip = table {Unit => "sib" ; Thousand => "hmv:T1n"} ;
|
||||
roy = table {Unit => "rT2Oy" ; Thousand => "e'sn"} ;
|
||||
phan = table {Unit => [] ; Thousand => "p2an"} ;
|
||||
|
||||
}
|
||||
51
examples/numerals/todo/thaiDU.gf
Normal file
51
examples/numerals/todo/thaiDU.gf
Normal file
@@ -0,0 +1,51 @@
|
||||
concrete thaiDU of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- Thai digits. AR 28/12/2006
|
||||
|
||||
flags lexer=chars ; unlexer=concat ; flags coding=utf8 ;
|
||||
|
||||
param Zeros = noz | zz ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = { s : Str } ;
|
||||
lincat Sub10 = { s : Str } ;
|
||||
lincat Sub100 = {s : Zeros => Str} ;
|
||||
lincat Sub1000 = {s : Zeros => Str} ;
|
||||
lincat Sub1000000 = {s : Zeros => Str} ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
oper mkz : Str -> {s : Zeros => Str} = \s -> {s = table {_ => s}} ;
|
||||
|
||||
lin num n = {s = n.s ! noz} ;
|
||||
lin n2 = ss "๒" ;
|
||||
lin n3 = ss "๓" ;
|
||||
lin n4 = ss "๔" ;
|
||||
lin n5 = ss "๕" ;
|
||||
lin n6 = ss "๖" ;
|
||||
lin n7 = ss "๗" ;
|
||||
lin n8 = ss "๘" ;
|
||||
lin n9 = ss "๙" ;
|
||||
|
||||
lin pot01 = ss "๑" ;
|
||||
lin pot0 d = d ;
|
||||
|
||||
lin pot110 = mkz ("๑" ++ "๐") ;
|
||||
lin pot111 = mkz ("๑" ++ "๑") ;
|
||||
lin pot1to19 d = mkz ("๑" ++ d.s) ;
|
||||
|
||||
lin pot0as1 n = {s = table {noz => n.s ; zz => "๐" ++ n.s}} ;
|
||||
|
||||
lin pot1 d = mkz (d.s ++ "๐") ;
|
||||
lin pot1plus d e = mkz (d.s ++ e.s) ;
|
||||
|
||||
lin pot1as2 n = {s = table {noz => n.s ! noz ; zz => "๐" ++ n.s ! zz}} ;
|
||||
lin pot2 d = mkz (d.s ++ "๐" ++ "๐") ;
|
||||
lin pot2plus d e = mkz (d.s ++ e.s ! zz) ;
|
||||
|
||||
lin pot2as3 n = {s = table {noz => n.s ! noz ; zz => "๐" ++ n.s ! zz}} ;
|
||||
|
||||
lin pot3 n = mkz (n.s ! noz ++ "๐" ++ "๐" ++ "๐") ;
|
||||
lin pot3plus n m = {s = table {z => n.s ! z ++ m.s ! zz}} ;
|
||||
|
||||
}
|
||||
72
examples/numerals/todo/thaiP.gf
Normal file
72
examples/numerals/todo/thaiP.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
concrete thaiP of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- Thai pronunciation (mostly following Smyth's Essential Grammar)
|
||||
-- AR 28/12/2006
|
||||
|
||||
-- flags coding=utf8 ;
|
||||
|
||||
lincat
|
||||
Numeral = {s : Str} ;
|
||||
Digit = {s : DForm => Str} ;
|
||||
Sub10 = {s : DForm => Str} ;
|
||||
Sub100 = {s : NForm => Str} ;
|
||||
Sub1000 = {s : NForm => Str} ;
|
||||
Sub1000000 = {s : Str} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
|
||||
pot01 = mkNum "nỳng" "nỳng" "èt" ;
|
||||
|
||||
n2 = mkNum "söong" "yîi" "söong" ;
|
||||
n3 = regNum "säam" ;
|
||||
n4 = regNum "sìi" ;
|
||||
n5 = regNum "hâa" ;
|
||||
n6 = regNum "hòk" ;
|
||||
n7 = regNum "cèt" ;
|
||||
n8 = regNum "pèet" ;
|
||||
n9 = regNum "kâaw" ;
|
||||
|
||||
|
||||
pot0 d = d ;
|
||||
|
||||
pot110 = {s = sip} ;
|
||||
pot111 = {s = table {
|
||||
Unit => ["sìp èt"] ;
|
||||
Thousand => ["nỳng mỳyn nỳng phan"]
|
||||
}
|
||||
} ;
|
||||
pot1to19 d = {s = table {
|
||||
Unit => "sìp" ++ d.s ! After ;
|
||||
Thousand => ["nỳng mỳyn"] ++ d.s ! Indep ++ "phan"
|
||||
}
|
||||
} ;
|
||||
pot0as1 d = {s = \\n => d.s ! Indep ++ phan ! n} ;
|
||||
pot1 d = {s = \\n => d.s ! ModTen ++ sip ! n} ;
|
||||
pot1plus d e = {
|
||||
s = \\n => d.s ! ModTen ++ sip ! n ++ e.s ! After ++ phan ! n
|
||||
} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = {s = \\n => d.s ! Indep ++ roy ! n} ;
|
||||
pot2plus d e = {s = \\n => d.s ! Indep ++ roy ! n ++ e.s ! n} ;
|
||||
pot2as3 n = {s = n.s ! Unit} ;
|
||||
pot3 n = {s = n.s ! Thousand} ;
|
||||
pot3plus n m = {s = n.s ! Thousand ++ m.s ! Unit} ;
|
||||
|
||||
param
|
||||
DForm = Indep | ModTen | After ;
|
||||
NForm = Unit | Thousand ;
|
||||
|
||||
oper
|
||||
mkNum : Str -> Str -> Str -> {s : DForm => Str} = \x,y,z ->
|
||||
{s = table {Indep => x ; ModTen => y ; After => z}} ;
|
||||
regNum : Str -> {s : DForm => Str} = \x ->
|
||||
mkNum x x x ;
|
||||
|
||||
|
||||
sip = table {Unit => "sìp" ; Thousand => "mỳyn"} ;
|
||||
roy = table {Unit => "róoy" ; Thousand => "sëen"} ;
|
||||
phan = table {Unit => [] ; Thousand => "phan"} ;
|
||||
|
||||
}
|
||||
74
examples/numerals/todo/welsh.gf
Normal file
74
examples/numerals/todo/welsh.gf
Normal file
@@ -0,0 +1,74 @@
|
||||
concrete welsh of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
-- The neo-base-10 system dauddeg, trideg, pedwardeg, pumdeg/hanner cant, chwedeg, saithdeg, wythdeg, nawdeg is
|
||||
-- implemented as the second variant as it should be
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; even20 : Even20 ; size : Size} ;
|
||||
oper LinSub100 = {s : Str ; size : Size} ;
|
||||
|
||||
oper mk20Ten : Str -> Str -> Str -> Str -> Size -> LinDigit =
|
||||
\tri -> \trideg -> \fiche -> \triarddeg -> \sz ->
|
||||
{ s = table {unit => tri ; twenty => fiche ; teen => triarddeg ; ten => trideg} ; even20 = odd ; size = sz} ;
|
||||
|
||||
oper mkEven20 : Str -> Str -> Str -> Str -> Size -> LinDigit =
|
||||
\tri -> \trideg -> \fiche -> \triarddeg -> \sz ->
|
||||
{ s = table {unit => tri ; twenty => fiche ; teen => triarddeg ; ten => trideg} ; even20 = even ; size = sz} ;
|
||||
|
||||
param Even20 = odd | even ;
|
||||
param DForm = unit | ten | twenty | teen ;
|
||||
param Size = sg | mutation | am | pl | five | overten;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinSub100 ;
|
||||
lincat Sub1000 = LinSub100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 = mkEven20 "dau" "dauddeg" "hugain" "deuddeg" mutation ;
|
||||
lin n3 = mk20Ten "tri" "trideg" "hugain" ("tri" ++ "ar" ++ "deg") am ;
|
||||
lin n4 = mkEven20 "pedwar" "pedwardeg" "deugain" ("pedwar" ++ "ar" ++ "ddeg") pl ;
|
||||
lin n5 = mk20Ten ("pum" + p) "pumdeg" "deugain" "pymtheg" five ;
|
||||
lin n6 = mkEven20 ("chwe" + ch) "chwedeg" "trigain" ("un" ++ "ar" ++ "bymtheg") am ;
|
||||
lin n7 = mk20Ten "saith" "saithdeg" "trigain" ("dau" ++ "ar" ++ "bymtheg") pl ;
|
||||
lin n8 = mkEven20 "wyth" "wythdeg" ("pedwar" ++ "ugain") "deunaw" pl ;
|
||||
lin n9 = mk20Ten "naw" "nawdeg" ("pedwar" ++ "ugain") ("pedwar" ++ "ar" ++ "bymtheg") pl ;
|
||||
oper AR : Str = pre {"ar" ; "a" / strs {"d"} } ;
|
||||
oper AG : Str = pre {"a" ; "ag" / strs {"a" ; "u" ; "i" ; "e" ; "o" ; "w"} } ; -- before vowel
|
||||
oper ng : Str = pre {"g" ; "ng" / strs {"m"} } ;
|
||||
oper t : Str = pre {[] ; "t" / strs {[]}} ;
|
||||
oper ch : Str = pre {[] ; "ch" / strs{[]}} ;
|
||||
oper p : Str = pre {[] ; "p" / strs{[]}} ;
|
||||
|
||||
oper mkR : Str -> LinSub100 = \s1 -> {s = s1 ; size = overten } ;
|
||||
oper mkR2 : Str -> Size -> LinSub100 = \s1 -> \sz -> {s = s1 ; size = table {mutation => mutation ; am => am ; _ => overten} ! sz } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "un" ; _ => "dummy"} ; even20 = odd ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "de" + ng ; size = pl} ;
|
||||
lin pot111 = mkR (variants {"un" ++ "ar" ++ "ddeg" ; "undeg" ++ "un"}) ;
|
||||
lin pot1to19 d = mkR (variants {d.s ! teen ; "undeg" ++ d.s ! unit}) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = table {mutation => mkR (variants {"ugain" ; "dauddeg" }) ;
|
||||
five => mkR (variants {"hanner" ++ "cant" ; "deg" ++ "a" + "deugain" ; "pumdeg"}) ;
|
||||
_ => mkR (variants { table {even => d.s ! twenty ; odd => "deg" ++ AR ++ d.s ! twenty} ! d.even20 ; d.s ! ten}) } ! d.size ;
|
||||
lin pot1plus d e = mkR2 (variants { table {even => e.s ! unit ++ AR ++ d.s ! twenty ; odd => e.s ! teen ++ AR ++ d.s ! twenty} ! d.even20 ; d.s ! ten}) e.size ; -- hugain
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = mkR ((CANT (d.s ! unit)) ! d.size) ;
|
||||
lin pot2plus d e = mkR2 (((CANT (d.s ! unit)) ! d.size) ++ (maybeAG ! e.size) ++ e.s) e.size;
|
||||
lin pot2as3 n =
|
||||
{s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = (MIL n.s) ! n.size } ;
|
||||
lin pot3plus n m =
|
||||
{s = (MIL n.s) ! n.size ++ m.s } ;
|
||||
|
||||
oper maybeAG : Size => Str = (table {overten => [] ; _ => AG} );
|
||||
oper CANT : Str -> Size => Str = \s1 -> table {sg => "can" + t ; mutation => s1 ++ "gan" + t; am => s1 ++ "chan" + t ; _ => s1 ++ "can" + t} ;
|
||||
oper MIL : Str -> Size => Str = \s1 -> table {sg => "mil" ; mutation => s1 ++ "fil" ; _ => s1 ++ "mil" } ;
|
||||
|
||||
|
||||
}
|
||||
111
examples/numerals/totonac.gf
Normal file
111
examples/numerals/totonac.gf
Normal file
@@ -0,0 +1,111 @@
|
||||
concrete totonac of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper mk20Ten : Str -> Str -> Str -> Size -> LinDigit =
|
||||
\tri -> \fiche -> \ext -> \sz ->
|
||||
{ s = table {unit => tri ; maaunit => "maa" ++ tri ; twenty => fiche ; extra => ext } ; even20 = ten ; size = sz} ;
|
||||
|
||||
oper mkEven20 : Str -> Str -> Str -> Size -> LinDigit =
|
||||
\se -> \trifichid -> \ext -> \sz ->
|
||||
{ s = table {unit => se ; maaunit => "maa" ++ se ; twenty => trifichid ; extra => ext } ; even20 = even ; size = sz} ;
|
||||
|
||||
param Even20 = ten | even ;
|
||||
param DForm = unit | maaunit | extra | twenty ;
|
||||
param Size = one | two | three | four | five | pl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
oper LinDigit = {s : DForm => Str ; even20 : Even20 ; size : Size} ;
|
||||
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str ; tenpsize : Size ; s2 : Str} ;
|
||||
lincat Sub1000 = {s : Str } ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
lin n2 = mkEven20 "t~u3" "pus^um" [] two;
|
||||
lin n3 = mk20Ten "itun" ("pus^um" ++ "maa" ++ "kaawi") [] two;
|
||||
lin n4 = mkEven20 "t~a~at" (variants {"pus^um" ++ "pus^um" ; "tiy~u~u" ++ "pus^um"}) [] three;
|
||||
lin n5 = mk20Ten (variants {"kitis" ; "kic/is"})
|
||||
(variants {("paha" ++ "sye<ntu" ++ "~a") ;
|
||||
"pus^um" ++ "pus^um" ++ "maa" ++ "kaawi" ;
|
||||
"tiy~u~u" ++ "pus^um" ++ "maa" ++ "kaawi" }) [] three;
|
||||
lin n6 = mkEven20 "c^aas^an"
|
||||
(variants {("pus^um" ++ "pus^um" ++ "pus^um") ;
|
||||
"tutun" ++ "pus^um" }) "~a" four;
|
||||
lin n7 = mk20Ten "tuhun" (variants {("pus^um" ++ "pus^um" ++ "pus^um" ++ "lii" ++ "~a" ++ "kaawi" ) ; ("tutun" ++ "pus^um" ++ "maa" ++ "kaawi")}) [] four ;
|
||||
lin n8 = mkEven20 "c/iyan" (variants {("t~a~ati" ++ "pus^um") ; ("maa" ++ "t~a~ati" ++ "pus^um")}) ("lii" ++ "~a") five ;
|
||||
lin n9 = mk20Ten "nahaac/a" ("t~a~ati" ++ "pus^um" ++ "maa" ++ "kaawi") [] five;
|
||||
|
||||
oper addkaawi : Size => Str = table {sz => "maa" ++ "kaawi" ++ mk5twenty ! sz };
|
||||
|
||||
oper mk5twenty : Size => Str = table {
|
||||
one => variants {("maa" ++ "kic/is") ; "kic/is"} ++ "pus^um";
|
||||
two => "c^aas^an" ++ "pus^um";
|
||||
three => "tuhun" ++ "pus^um";
|
||||
four => "c/iyan" ++ "pus^um";
|
||||
_ => "nahaac/a" ++ "pus^um"
|
||||
} ;
|
||||
|
||||
oper mktwenty : Str -> Str -> Str -> Str -> Str -> Size => Str =
|
||||
\a1 -> \a2 -> \a3 -> \a4 -> \a5 -> table {
|
||||
one => a1 ++ "pus^um" ;
|
||||
two => a2 ++ "pus^um" ;
|
||||
three => a3 ++ "pus^um" ;
|
||||
four => a4 ++ "pus^um" ;
|
||||
_ => a5 ++ "pus^um"
|
||||
} ;
|
||||
|
||||
oper get20 : Str -> Size -> Size -> Str = \df -> \sz1 -> \sz2 ->
|
||||
table {one => mk5twenty ;
|
||||
two => mktwenty ("maa" ++ "kaawi")
|
||||
("maa" ++ "kaawi" ++ "tun")
|
||||
("maa" ++ "kaawi" ++ "t~u3")
|
||||
("maa" ++ "kaawi" ++ "itun")
|
||||
("maa" ++ "kaawi" ++ "t~a~at") ;
|
||||
three => addkaawi ;
|
||||
_ => table {_ => df } } ! sz1 ! sz2 ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "tun" ; maaunit => "tun" ; tfive => "kic/is" ++ "pus^um" } ; even20 = ten ; size = one};
|
||||
lin pot0 d =
|
||||
{s = d.s ; even20 = d.even20 ; size = one} ;
|
||||
lin pot110 =
|
||||
{s = "kaawi" ; tenpsize = one ; s2 = "tun"} ;
|
||||
lin pot111 =
|
||||
{s = "kaawi" ++ "tun" ; tenpsize = one ; s2 = "tun" } ;
|
||||
lin pot1to19 d =
|
||||
{s = "kaawi" ++ d.s ! unit ; tenpsize = one ; s2 = d.s ! unit } ;
|
||||
lin pot0as1 n =
|
||||
{s = n.s ! maaunit ; tenpsize = one ; s2 = n.s ! maaunit} ;
|
||||
lin pot1 d =
|
||||
{s = d.s ! twenty ;
|
||||
tenpsize = d.size ;
|
||||
s2 = [] } ;
|
||||
|
||||
lin pot1plus d e =
|
||||
{s = table {even => d.s ! twenty ++ d.s ! extra ++ e.s ! maaunit;
|
||||
ten => d.s ! twenty ++ e.s ! unit} ! (d.even20) ;
|
||||
tenpsize = d.size ;
|
||||
s2 = table {even => e.s ! maaunit ; ten => e.s ! unit} ! d.even20} ;
|
||||
|
||||
lin pot1as2 n = {s = n.s} ;
|
||||
|
||||
lin pot2 d =
|
||||
{s = variants {get20 (d.s ! maaunit ++ "sye<ntu") d.size one ;
|
||||
d.s ! maaunit ++ "sye<ntu" }};
|
||||
lin pot2plus d e =
|
||||
{s = variants {(get20 (d.s ! maaunit ++ "sye<ntu") d.size e.tenpsize) ++ e.s2;
|
||||
d.s ! maaunit ++ "sye<ntu" ++ e.s}} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = n.s ++ "mil" } ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ++ "mil" ++ "lii" ++ "~a" ++ m.s } ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
examples/numerals/tuda_daza.gf
Normal file
65
examples/numerals/tuda_daza.gf
Normal file
@@ -0,0 +1,65 @@
|
||||
concrete tuda_daza of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = ten | unit ;
|
||||
param Size = sg | sub10 | pl | e10;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; s2 : Str ; size : Size} ;
|
||||
oper LinS100 = {s : Str ; s2 : Str ; size : Size} ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \kunun ->
|
||||
{s = table {unit => kunun ; ten => "mOrta" ++ kunun } ;
|
||||
s2 = "dubu" ++ kunun ;
|
||||
size = sub10} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ; -- TODO
|
||||
|
||||
-- o.
|
||||
-- O for IPA o in Eng. Cod
|
||||
|
||||
lin n2 = {s = table {unit => "cu" ; ten => "digidem" } ; s2 = "dubu" ++ "cu"; size = sub10} ;
|
||||
lin n3 = mkNum "ago.zo." ;
|
||||
lin n4 = mkNum "tozo" ;
|
||||
lin n5 = mkNum "fo";
|
||||
lin n6 = mkNum "dissi" ;
|
||||
lin n7 = mkNum (variants {"tuduzu" ; "tudusu"}) ;
|
||||
lin n8 = mkNum (variants {"osso" ; "yosso"}) ;
|
||||
lin n9 = mkNum "issi";
|
||||
|
||||
oper olufu : Str = variants {"oluou" ; "olufu"} ;
|
||||
oper ss : Str -> Str -> LinS100 = \a -> \b -> {s = a ; s2 = b ; size = pl} ;
|
||||
oper ss2 : Str -> Str -> LinS100 = \a -> \b -> {s = a ; s2 = b ; size = e10} ;
|
||||
|
||||
lin pot01 = {s = table {_ => "tro" }; s2 = "dubu" ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss2 "mOrdOm" [];
|
||||
lin pot111 = ss2 ("mOrdOm" ++ "sao" ++ "tro") ("dubu");
|
||||
lin pot1to19 d = ss2 ("mOrdOm" ++ "sao" ++ d.s ! unit) ("dubu" ++ d.s ! unit);
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = n.s2 ; size = n.size} ;
|
||||
lin pot1 d = ss (d.s ! ten) (d.s ! unit) ;
|
||||
lin pot1plus d e = ss (d.s ! ten ++ "sao" ++ e.s ! unit) (d.s ! unit ++ e.s2) ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = ifsub10 n.s2 ! n.size ; size = n.size };
|
||||
lin pot2 d = ss (selsg "kidri" ("kidra" ++ d.s ! unit) ! d.size)
|
||||
(olufu ++ d.s ! ten) ;
|
||||
lin pot2plus d e =
|
||||
ss (selsg "kidri" ("kidra" ++ d.s ! unit) ! d.size ++ "sao" ++ e.s)
|
||||
(olufu ++ d.s ! ten ++ "sao" ++ ifs10 ! e.size ++ e.s2) ;
|
||||
lin pot2as3 n = {s = n.s} ;
|
||||
lin pot3 n = {s = n.s2};
|
||||
lin pot3plus n m = {s = n.s2 ++ "sao" ++ m.s};
|
||||
|
||||
oper ifs10 : Size => Str = table {e10 => "tro" ; _ => []} ;
|
||||
oper ifsub10 : Str -> Size => Str = \a ->
|
||||
table {pl => olufu ++ a; e10 => olufu ++ a ; _ => a } ;
|
||||
oper selsg : Str -> Str -> Size => Str = \a -> \b ->
|
||||
table {sg => a ; _ => b} ;
|
||||
|
||||
}
|
||||
46
examples/numerals/tukang_besi.gf
Normal file
46
examples/numerals/tukang_besi.gf
Normal file
@@ -0,0 +1,46 @@
|
||||
concrete tukang_besi of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = u | v ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str } ;
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinDigit ;
|
||||
lincat Sub1000 = LinDigit ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \a -> {s = table {_ => a}} ;
|
||||
oper mkNum2 : Str -> Str -> LinDigit = \a -> \b -> {s = table {u => a ; v => b}} ;
|
||||
|
||||
lin num x = x ;
|
||||
-- lin n1 mkNum "sa'asa" ;
|
||||
lin n2 = mkNum "dua" ;
|
||||
lin n3 = mkNum "tolu" ;
|
||||
lin n4 = mkNum2 "gana" "hato";
|
||||
lin n5 = mkNum "lima" ;
|
||||
lin n6 = mkNum2 "no'o" "nomo" ;
|
||||
lin n7 = mkNum2 "pitu" "hitu" ;
|
||||
lin n8 = mkNum "alu" ;
|
||||
lin n9 = mkNum "sia" ;
|
||||
|
||||
lin pot01 = mkNum2 "sa'asa" "sa" ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = table {_ => "ompulu" }};
|
||||
lin pot111 = {s = table {u => "ompulu" ++ "sa'asa" ; v => "ompulu" ++ "sa"}} ;
|
||||
lin pot1to19 d = {s = table {f => "ompulu" ++ d.s ! f}} ;
|
||||
lin pot0as1 n = n ;
|
||||
lin pot1 d = {s = table {_ => bind (d.s ! v) "hulu" }} ;
|
||||
lin pot1plus d e = {s = table {f => (bind (d.s ! v) "hulu") ++ e.s ! f}} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = table {_ => bind (d.s ! v) "hatu" }} ;
|
||||
lin pot2plus d e = {s = table {f => (bind (d.s ! v) "hatu") ++ e.s ! f}} ;
|
||||
lin pot2as3 n = {s = n.s ! u};
|
||||
lin pot3 n = {s = bind (n.s ! v) "riwu" } ;
|
||||
lin pot3plus n m = {s = (bind (n.s ! v) "riwu") ++ m.s ! u } ;
|
||||
|
||||
}
|
||||
65
examples/numerals/turkish.gf
Normal file
65
examples/numerals/turkish.gf
Normal file
@@ -0,0 +1,65 @@
|
||||
concrete turkish of Numerals = {
|
||||
flags coding = utf8 ;
|
||||
-- include numerals.Abs.gf ;
|
||||
-- flags coding=latinasupplement ;
|
||||
|
||||
param DForm = unit | ten | teen ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
-- ç is c with a cedille (obviously)
|
||||
-- s, is s with a cedille
|
||||
-- I is i without a dot
|
||||
-- g% is yumus,ak ge (i.e a g with a breve)
|
||||
|
||||
-- The hundreds and trheir qualif can be written together e.g ikiyüz
|
||||
-- aswelll as ten + unit e.g yirmibir
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
oper LinDigit = {s : DForm => Str } ;
|
||||
lincat Digit = LinDigit ;
|
||||
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size } ;
|
||||
lincat Sub1000 = {s : Str ; size : Size } ;
|
||||
lincat Sub1000000 = { s : Str } ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit =
|
||||
\iki -> \yirmi ->
|
||||
{s = table {unit => iki ; teen => (variants {"on" + iki ; "on" ++ iki}) ; ten => yirmi } } ;
|
||||
|
||||
lin num x = {s = [] ++ x.s ++ [] } ;
|
||||
|
||||
-- lin n1 mkNum "bir" "dA" ;
|
||||
lin n2 = mkNum "iki" "yirmi" ;
|
||||
lin n3 = mkNum "üç" "otuz" ;
|
||||
lin n4 = mkNum "dört" "kırk" ;
|
||||
lin n5 = mkNum "beş" "elli" ;
|
||||
lin n6 = mkNum "altı" "altmış" ;
|
||||
lin n7 = mkNum "yedi" "yetmiş" ;
|
||||
lin n8 = mkNum "sekiz" "seksen" ;
|
||||
lin n9 = mkNum "dokuz" "doksan" ;
|
||||
|
||||
oper ss : Str -> {s : Str ; size : Size} = \s -> {s = s ; size = pl} ;
|
||||
|
||||
lin pot01 = {s = table {f => "bir"} ; size = sg} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; size = pl} ;
|
||||
lin pot110 = ss "on" ;
|
||||
lin pot111 = ss (variants { "on" ++ "bir" ; "onbir"});
|
||||
lin pot1to19 d = {s = d.s ! teen ; size = pl} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
lin pot1 d = {s = d.s ! ten ; size = pl} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ e.s ! unit; size = pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = table {sg => [] ; _ => d.s ! unit} ! d.size ++ "yüz" ; size = pl} ;
|
||||
lin pot2plus d e = {s = table {sg => [] ; _ => d.s ! unit} ! d.size ++ "yüz" ++ e.s ; size = pl} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = table {sg => [] ; _ => n.s } ! n.size ++ "bin"} ;
|
||||
lin pot3plus n m = {s = table {sg => [] ; _ => n.s } ! n.size ++ "bin" ++ m.s} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
64
examples/numerals/votic.gf
Normal file
64
examples/numerals/votic.gf
Normal file
@@ -0,0 +1,64 @@
|
||||
concrete votic of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | attr | teen | ten | ten2 ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; size : Size };
|
||||
oper LinS100 = {s : Str ; size : Size} ;
|
||||
|
||||
oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = LinS100 ;
|
||||
lincat Sub1000 = LinS100 ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lin num x0 = {s = x0.s} ; -- TODO
|
||||
|
||||
oper mkN2 : Str -> LinDigit = \u ->
|
||||
mkN u u (u + "ts^ümmettä") (u + "ts^ümmet") ;
|
||||
|
||||
oper mkN : Str -> Str -> Str -> Str -> LinDigit = \u -> \a -> \t -> \t2 ->
|
||||
{s = table {unit => u ; attr => a + "sata:"; ten => t ; ten2 => t2 ;
|
||||
teen => a + tess} ; size = pl} ;
|
||||
|
||||
lin n2 = mkN "kahsi" "kahs"
|
||||
(variants {"kahs^'t's^'ümmettä" ; "kahts^ümmettä"})
|
||||
(variants {"kahs^'t's^'ümmet" ; "kahts^ümmet"});
|
||||
lin n3 = mkN "keVLmeV" "keVm" "keVmts^ümmettä" "keVmts^ümmet";
|
||||
lin n4 = mkN2 "nellä" ;
|
||||
lin n5 = mkN "vi:si" "vi:s" "vi:s^'t's^'ümmettä" "vi:s^'t's^'ümmet";
|
||||
lin n6 = mkN "ku:si" "ku:s" "ku:s^'t's^'ümmettä" "ku:s^'t's^'ümmet";
|
||||
lin n7 = mkN2 "seitse:" ;
|
||||
lin n8 = mkN2 "kaheVsa:" ;
|
||||
lin n9 = mkN2 "ühesä:" ;
|
||||
|
||||
oper tess : Str = (variants {"teV*s^s^eVmeVtta" ; "teV*is^'t's^'ümmeD"} ) ;
|
||||
|
||||
lin pot01 = {s = table {unit => "ühsi" ; attr => "sata" ; _ => "dummy" }; size = sg } ;
|
||||
|
||||
oper ss : Str -> LinS100 = \s1 -> {s = s1 ; size = pl } ;
|
||||
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "ts^ümme:" ;
|
||||
lin pot111 = ss ("ühs" + tess) ;
|
||||
lin pot1to19 d = ss (d.s ! teen) ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; size = n.size } ;
|
||||
lin pot1 d = ss (d.s ! ten) ;
|
||||
lin pot1plus d e = ss ((d.s ! ten2) ++ (e.s ! unit)) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (d.s ! attr) ;
|
||||
lin pot2plus d e = ss ((d.s ! attr) ++ e.s) ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = selsg (variants {"tuhatta" ; "tuhaD" }) (bind n.s "tuhatta") ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = selsg (variants {"tuhatta" ; "tuhaD" }) (bind n.s "tuhatta") ! n.size ++ m.s };
|
||||
|
||||
oper selsg : Str -> Str -> Size => Str = \a -> \b ->
|
||||
table {sg => a ; pl => b} ;
|
||||
|
||||
}
|
||||
65
examples/numerals/yasin_burushaski.gf
Normal file
65
examples/numerals/yasin_burushaski.gf
Normal file
@@ -0,0 +1,65 @@
|
||||
concrete yasin_burushaski of Numerals = {
|
||||
-- include numerals.Abs.gf ;
|
||||
|
||||
oper LinDigit = {s : DForm => Str ; even20 : Even20 ; size : Size} ;
|
||||
|
||||
oper mk20Ten : Str -> Str -> LinDigit = \tri -> \tw ->
|
||||
{s = table {unit => tri ; teen => "turma-" + tri ; twenty => tw+"-áltar"} ;
|
||||
even20 = ten ; size = pl} ;
|
||||
|
||||
oper mkEven20 : Str -> Str -> LinDigit = \tri -> \tw ->
|
||||
{s = table {unit => tri ; teen => "turma-" + tri ; twenty => tw+"-áltar"} ;
|
||||
even20 = even ; size = pl} ;
|
||||
|
||||
param Even20 = ten | even ;
|
||||
param DForm = unit | teen | twenty ;
|
||||
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 = {s = table {unit => "altó" ; teen => "turma-" + "altó" ; twenty => "áltar" } ; even20 = even ; size = pl} ;
|
||||
lin n3 = {s = table {unit => "iskí" ; teen => "turma-" + "iskí" ; twenty => "áltar" } ; even20 = ten ; size = pl} ;
|
||||
lin n4 = mkEven20 "wálte" "altó";
|
||||
lin n5 = mk20Ten "cendí" "altó";
|
||||
lin n6 = mkEven20 "bis'índe" "iskí" ;
|
||||
lin n7 = mk20Ten "thalé" "iskí";
|
||||
lin n8 = mkEven20 "altámbe" "wálte";
|
||||
lin n9 = mk20Ten "hutí" "wálte";
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "hek" ; teen => "turma-" + "hék" ; twenty => []} ; even20 = ten ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "tórum" ; size = pl} ;
|
||||
lin pot111 = {s = "turma-" + "hék" ; 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 ++ "tórum"} ! d.even20 ;
|
||||
size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {even => d.s ! twenty ++ e.s ! unit;
|
||||
ten => d.s ! twenty ++ e.s ! teen} ! (d.even20) ;
|
||||
size = pl} ;
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = (selsg d.size (d.s ! unit)) ++ "tha" ; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = (selsg d.size (d.s ! unit)) ++ "tha" ++ e.s ; size = pl} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s } ;
|
||||
lin pot3 n =
|
||||
{s = selsg n.size n.s ++ "hazár"} ;
|
||||
lin pot3plus n m =
|
||||
{s = selsg n.size n.s ++ "hazár" ++ m.s } ;
|
||||
|
||||
oper selsg : Size -> Str -> Str = \sz -> \attr ->
|
||||
table {sg => [] ; _ => attr} ! sz ;
|
||||
|
||||
}
|
||||
61
examples/numerals/zaiwa.gf
Normal file
61
examples/numerals/zaiwa.gf
Normal file
@@ -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} ;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user