mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-17 00:39:32 -06:00
All old numeral grammars and a script for gf2.
This commit is contained in:
81
grammars/numerals/old/amharic.gf
Normal file
81
grammars/numerals/old/amharic.gf
Normal file
@@ -0,0 +1,81 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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" (6th row)
|
||||
-- A is a" (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 = "/E" ++ x0.s ++ "E/"} ;
|
||||
lin n2 = mkNum "hulAt" (variants {"haya" ; "Haya" ; "xaya" ; "kaya" }) ;
|
||||
lin n3 = mkNum "Lost" "LAlasa" ;
|
||||
lin n4 = mkNum "arat" "arba" ;
|
||||
lin n5 = mkNum "amIst" (variants { "amsa" ; "xamsa" }) ;
|
||||
lin n6 = mkNum "sIdIst" (variants { "sIdsa" ; "sIlsa" }) ;
|
||||
lin n7 = mkNum "sAbat" "sAba" ;
|
||||
lin n8 = mkNum "sImInt" "sAmanya" ;
|
||||
lin n9 = mkNum "zATAN" "zATAna" ;
|
||||
|
||||
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 => "and" ; ten => "asra" }; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss1 "asIr" "and" [] ;
|
||||
lin pot111 = ss1 (variants {"asrand" ; "asra" ++ "and" }) "and" Sih ;
|
||||
lin pot1to19 d = ss1 ("asra" ++ d.s ! unit) "and" (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 ++ "Ilef" ++ n.s ! sihpart ; size = n.size} ;
|
||||
|
||||
lin pot2 d = {s = (sel d.size [] (d.s ! unit)) ++ "mAto" ;
|
||||
s2 = sel d.size "asIr" (d.s ! ten) ; size = tenplus} ;
|
||||
lin pot2plus d e = {s = (sel d.size [] (d.s ! unit)) ++ "mAto" ++ e.s ! indep ; s2 = d.s ! ten ++ e.s ! tenpart ++ "Ilef" ++ 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 {"$ih" ; "$i"} ;
|
||||
|
||||
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 ;
|
||||
59
grammars/numerals/old/basque.gf
Normal file
59
grammars/numerals/old/basque.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
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 } ;
|
||||
88
grammars/numerals/old/biblical_hebrew.gf
Normal file
88
grammars/numerals/old/biblical_hebrew.gf
Normal file
@@ -0,0 +1,88 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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) => "snyM" ;
|
||||
cons => "sny" ;
|
||||
ten => "osryM" ;
|
||||
hund => "matyM"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "slsh" ;
|
||||
cons => "slst" ;
|
||||
ten => "slsyM" ;
|
||||
hund => "sls" ++ "mawt"} ; size = small} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "arboh" ;
|
||||
cons => "arbot" ;
|
||||
ten => "arboyM" ;
|
||||
hund => "arbo" ++ "mawt"} ; size = small} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "Hmsh" ;
|
||||
cons => "Hmst" ;
|
||||
ten => "HmsyM" ;
|
||||
hund => "Hms" ++ "mawt"} ; size = small} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "ssh" ;
|
||||
cons => "sst" ;
|
||||
ten => "ssyM" ;
|
||||
hund => "ss" ++ "mawt"} ; size = small} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "sboh" ;
|
||||
cons => "sbot" ;
|
||||
ten => "sboyM" ;
|
||||
hund => "sbo" ++ "mawt"} ; size = small} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "smnh" ;
|
||||
cons => "smnt" ;
|
||||
ten => "smnyM" ;
|
||||
hund => "smnh" ++ "mawt"} ; size = small} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "tsoh" ;
|
||||
cons => "tsot" ;
|
||||
ten => "tsoyM" ;
|
||||
hund => "tso" ++ "mawt"} ; size = small} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "mah"; (unit attr) => [] ; f => "aHd"} ; size = large} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "osr"} ; size = small} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => variants {"aHd" ++ "osr" ; "osty" ++ "osr"} } ; size = large} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! unit indep ++ "osr"} ; 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 ++ "w" ++ 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 ++ "w" ++ 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 ++ "w" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{small} => "alpyM" ; {dual} => "alpyM" ; _ => "alP"} ;
|
||||
|
||||
96
grammars/numerals/old/classical_arabic.gf
Normal file
96
grammars/numerals/old/classical_arabic.gf
Normal file
@@ -0,0 +1,96 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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 Arabic environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {(unit attr) => [] ;
|
||||
(unit indep) => "avnan" ;
|
||||
teen => "avna" ;
|
||||
ten => "ocrwn" ;
|
||||
hund => "maOtan"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "vlavA" ;
|
||||
teen => "vlavA" ;
|
||||
ten => "vlavwn" ;
|
||||
hund => variants {"vlav" ++ "maOA" ; "vlavmaOA"}} ;
|
||||
size = pl} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "urboA" ;
|
||||
teen => "urboA" ;
|
||||
ten => "urbown" ;
|
||||
hund => variants {"urbo" ++ "maOA" ; "urbomaOA"}} ;
|
||||
size = pl} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "CmsA" ;
|
||||
teen => "CmsA" ;
|
||||
ten => "Cmswn" ;
|
||||
hund => variants {"Cms" ++ "maOA" ; "CmsmaOA"}} ; size = pl} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "stA" ;
|
||||
teen => "stA" ;
|
||||
ten => "stwn" ;
|
||||
hund => variants {"st" ++ "maOA" ; "stmaOA"}} ; size = pl} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "sboA" ;
|
||||
teen => "sboA" ;
|
||||
ten => "sbown" ;
|
||||
hund => variants {"sbo" ++ "maOA" ; "sbomaOA"}} ; size = pl} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "vmanyA" ;
|
||||
teen => "vmanyA" ;
|
||||
ten => "vmanwn" ;
|
||||
hund => variants {"vman" ++ "maOA" ; "vmanmaOA"}} ;
|
||||
size = pl} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "tsoA" ;
|
||||
teen => "tsoA" ;
|
||||
ten => "tsown" ;
|
||||
hund => variants {"tso" ++ "maOA" ; "tsomaOA"}} ;
|
||||
size = pl} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => (variants {"maOA" ; "m0A"} ) ; (unit attr) => [] ; f => "waHd"} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "ocrA"} ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "aHd" ++ "ocr"} ; size = eleventonineteen} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen ++ "ocr"} ; size = eleventonineteen} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! unit p} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten} ; size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => e.s ! unit indep ++ "w" ++ 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 ++ "w" ++ 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 ++ "w" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{pl} => "Ulaf" ; {dual} => "alfan" ; {eleventonineteen} => "alfa" ; sg => "alf"} ;
|
||||
|
||||
197
grammars/numerals/old/classical_greek.gf
Normal file
197
grammars/numerals/old/classical_greek.gf
Normal file
@@ -0,0 +1,197 @@
|
||||
include numerals.Abs.gf ;
|
||||
-- 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 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 + "m'yrioi" ;
|
||||
teen => dwdeka ;
|
||||
ten => eikosi ;
|
||||
hund => diakosioi ;
|
||||
kisxil => dis + "c'ilioi" ;
|
||||
kismyr => dis + "m'yrioi" ;
|
||||
tenkis => eikosakis ;
|
||||
tenkismyr => eikosakis + "m'yrioi"} };
|
||||
|
||||
lin n2 = mkNum
|
||||
"d'yo"
|
||||
"dis"
|
||||
"dwdekakis"
|
||||
"d'wdeka"
|
||||
"e)'ikosi"
|
||||
"diak'osioi"
|
||||
"e)ikos'akis" ;
|
||||
|
||||
lin n3 = mkNum
|
||||
"tre~ij"
|
||||
"tris"
|
||||
"treiskaidekakis"
|
||||
(variants {"tre~ij" ++ "ka`i" ++ "d'eka" ; "treiska'ideka"} )
|
||||
"tri'akonta"
|
||||
"triak'osioi"
|
||||
"triakont'akis" ;
|
||||
|
||||
lin n4 = mkNum
|
||||
"t'ettarej"
|
||||
"tetrakis"
|
||||
"tettareskaidekakis"
|
||||
(variants {"t'ettarej" ++ "ka`i" ++ "d'eka" ; "tettareska'ideka"})
|
||||
"tettar'akonta"
|
||||
"tetrak'osioi"
|
||||
"tettarakont'akis" ;
|
||||
|
||||
lin n5 = mkNum
|
||||
"p'ente"
|
||||
"pentakis"
|
||||
"pentekaidekakis"
|
||||
"penteka'ideka"
|
||||
"pent'hkonta"
|
||||
"pentak'osioi"
|
||||
"penthkont'akis" ;
|
||||
|
||||
lin n6 = mkNum
|
||||
"('ex"
|
||||
"(exakis"
|
||||
"(ekkaidekakis"
|
||||
"(ekka'ideka"
|
||||
"(ex'hkonta"
|
||||
"(exak'osioi"
|
||||
"(exhkont'akis" ;
|
||||
|
||||
lin n7 = mkNum
|
||||
"(ept'a"
|
||||
"(eptakis"
|
||||
"(eptakaidekakis"
|
||||
"(eptaka'ideka"
|
||||
"(ebdom'hkonta"
|
||||
"(eptak'osioi"
|
||||
"(ebdomhkont'akis" ;
|
||||
|
||||
lin n8 = mkNum
|
||||
")okt'w"
|
||||
")oktakis"
|
||||
")oktwkaidekakis"
|
||||
")oktwka'ideka"
|
||||
")ogdo'hkonta"
|
||||
")oktak'osioi"
|
||||
")ogdohkont'akis" ;
|
||||
|
||||
lin n9 = mkNum
|
||||
")enn'ea"
|
||||
")enakis"
|
||||
")enneakaidekakis"
|
||||
")enneaka'ideka"
|
||||
")enen'hkonta"
|
||||
")enak'osioi"
|
||||
")enenhkont'akis" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "(ekat'on" ;
|
||||
kisxil => "c'ilioi" ;
|
||||
kismyr => "('apax" + "m'yrioi" ;
|
||||
_ => "e('ij" } ;
|
||||
size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = pl} ;
|
||||
lin pot110 =
|
||||
{s = table {xiliad => "dummy" ;
|
||||
(myriad _) => "m'yrioi" ;
|
||||
(indep _) => "d'eka" };
|
||||
s1 = table {kis1 => "('apax" + "m'yrioi" ; tkis1 => "(endek'akis" + "m'yrioi"} ;
|
||||
s2 = [] ;
|
||||
size = tenoverpl} ;
|
||||
lin pot111 =
|
||||
{s = table {xiliad => "dummy" ;
|
||||
(myriad des) => "m'yrioi" ++ "c'ilioi" ;
|
||||
(myriad asc) => "c'ilioi" ++ "ka`i" ++ "m'yrioi" ;
|
||||
(indep _) => "('endeka" } ;
|
||||
s1 = table {kis1 => "('apax" + "m'yrioi" ; tkis1 => "(endek'akis" + "m'yrioi"} ;
|
||||
s2 = "c'ilioi" ;
|
||||
size = tenoverpl} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {xiliad => "dummy" ;
|
||||
(myriad des) => "m'yrioi" ++ d.s ! kisxil ;
|
||||
(myriad asc) => d.s ! kisxil ++ "ka`i" ++ "m'yrioi" ;
|
||||
(indep _) => d.s ! teen } ;
|
||||
s1 = table {kis1 => "('apax" + "m'yrioi" ; tkis1 => "(endek'akis" + "m'yrioi" } ;
|
||||
s2 = d.s ! kisxil ;
|
||||
size = tenoverpl} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {xiliad => n.s ! kisxil ;
|
||||
(indep _) => n.s ! unit ;
|
||||
(myriad _) => "dummy" } ;
|
||||
s1 = table {_ => []} ;
|
||||
s2 = n.s ! kisxil ;
|
||||
size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {xiliad => "dummy" ;
|
||||
(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 => "dummy" ;
|
||||
(myriad des) => d.s ! kismyr ++ e.s ! kisxil ;
|
||||
(myriad asc) => e.s ! kisxil ++ "ka`i" ++ d.s ! kismyr ;
|
||||
(indep des) => d.s ! ten ++ e.s ! unit ;
|
||||
(indep asc) => e.s ! unit ++ "ka`i" ++ 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 => "dummy"} ;
|
||||
size = tenoverpl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {(myriad _) => table {sg => e.s1 ! tkis1 ;
|
||||
pl => d.s ! tenkis ++ e.s1 ! kis1 ;
|
||||
tenoverpl => "dummy" } ! d.size ++ e.s2 ;
|
||||
(indep des) => d.s ! hund ++ e.s ! indep des ;
|
||||
(indep asc) => (e.s ! indep asc) ++ "ka`i" ++ d.s ! hund ;
|
||||
xiliad => "dummy" } ;
|
||||
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 ++ "ka`i" ++ (Myr n asc) ! n.size }} ;
|
||||
|
||||
oper Myr : LinSub1000 -> Order -> Size => Str = \n -> \order ->
|
||||
table {sg => "c'ilioi" ;
|
||||
pl => n.s ! xiliad ;
|
||||
tenoverpl => n.s ! myriad order} ;
|
||||
|
||||
69
grammars/numerals/old/croatian.gf
Normal file
69
grammars/numerals/old/croatian.gf
Normal file
@@ -0,0 +1,69 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
lincat Sub100 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000 = {s : Str; t : ThForm } ;
|
||||
|
||||
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" ; "tisuc'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 = "/L" ++ x.s ++ "L/"} ; -- 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 "c^etiri" "c^etrnaest" "c^etrdeset" ("c^etiri" ++ "stotine") twoorthreeorfour ;
|
||||
lin n5 = mkNum "pet" "petnaest" "pedeset" ("pet" ++ "stotina") fiveup ;
|
||||
lin n6 = mkNum "s^est" "s^esnaest" "s^ezdeset" ("s^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} ;
|
||||
|
||||
|
||||
121
grammars/numerals/old/geez.gf
Normal file
121
grammars/numerals/old/geez.gf
Normal file
@@ -0,0 +1,121 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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 = "/E" ++ x0.s ++ "E/"} ; -- The Ethiopic script environment
|
||||
lin n2 = mkNum "kïl)etu" "(ï$ra" ;
|
||||
lin n3 = mkNum "Lälastu" "Lälasa" ;
|
||||
lin n4 = mkNum ")ärba(tu" ")ärbï(a" ;
|
||||
lin n5 = mkNum "xämïstu" "xämsa" ;
|
||||
lin n6 = mkNum "sïdïstu" "sïssa" ;
|
||||
lin n7 = mkNum (variants { "säb(ätu" ; "säb(atu" }) "säb(a" ;
|
||||
lin n8 = mkNum (variants { "sämantu" ; "sämanitu" }) "sämanya" ;
|
||||
lin n9 = mkNum (variants { "tïs(ätu" ; "täs(ätu" ; "täsa(tu" }) (variants {"täs(a" ; "tïs(a"}) ;
|
||||
|
||||
oper mkNum : Str -> Str -> LinDigit = \tva -> \tjugo ->
|
||||
{s = table {unit => tva ; ten => tjugo} ; size = less100 } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => ")äHädu" ; ten => "(ä$ärtu" } ; size = sg};
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "(ä$ärtu" ;
|
||||
s2 = table {tenp => "wä" ++ ")äHädu" ;
|
||||
tenpalf => ")ïlf" ;
|
||||
unitp => [] } ;
|
||||
unitp_ending = zero ;
|
||||
size = less100} ;
|
||||
lin pot111 = {s = "(ä$ärtu" ++ "wä" ++ ")äHädu" ;
|
||||
s2 = table {tenp => "wä" ++ ")äHädu" ;
|
||||
tenpalf => ")ïlf" ;
|
||||
unitp => "(ä$ärtu" } ;
|
||||
unitp_ending = nonzero ;
|
||||
size = less100} ;
|
||||
lin pot1to19 d =
|
||||
{s = "(ä$ärtu" ++ "wä" ++ d.s ! unit ;
|
||||
s2 = table {tenp => "wä" ++ ")äHädu" ;
|
||||
tenpalf => ")ïlf" ;
|
||||
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 => "wä" ++ d.s ! unit ;
|
||||
tenpalf => d.s ! unit ++ ")ïlf" ;
|
||||
unitp => [] } ;
|
||||
unitp_ending = tenzero ;
|
||||
size = less100} ;
|
||||
lin pot1plus d e =
|
||||
{s = d.s ! ten ++ "wä" ++ e.s ! unit ;
|
||||
s2 = table {tenp => "wä" ++ d.s ! unit ;
|
||||
tenpalf => d.s ! unit ++ ")ïlf" ;
|
||||
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 => "mï)t" ; _ => d.s ! unit ++ "mï)t" } ! d.size ;
|
||||
tenm => "dummy" ;
|
||||
alf => d.s ! ten ++ ")ïlf" ;
|
||||
tailform => d.s ! unit ++ "mï)t" } ;
|
||||
size = more100 ;
|
||||
ending = zero} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indep => table {sg => "mï)t" ; _ => d.s ! unit ++ "mï)t" } ! d.size ++ e.s ;
|
||||
tenm => "dummy";
|
||||
alf => d.s ! ten ++ e.s2 ! tenp ++ ")ïlf" ++ e.s2 ! unitp ;
|
||||
tailform => d.s ! unit ++ "mï)t" ++ 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 ++ "mï)t"} ! 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 => "wä" ++ m.s ! tailform } ! n.ending;
|
||||
_ => table {more100 => mkmit n.ending (n.s ! alf) ;
|
||||
less100 => n.s ! alf ++ table {nonzero => "mï)t" ; _ => []} ! n.ending ;
|
||||
_ => n.s ! tenm ++ "mï)t"} ! n.size ++ m.s ! indep} ! m.size } ;
|
||||
|
||||
oper mkmit : Ending -> Str -> Str = \e -> \s -> table {zero => [] ; _ => s ++"mï)t" } ! e;
|
||||
99
grammars/numerals/old/hindi.gf
Normal file
99
grammars/numerals/old/hindi.gf
Normal file
@@ -0,0 +1,99 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : DSize} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
|
||||
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 "ek" "gya:rah" "das"
|
||||
lin n2 = mkNum "do" "bi:s" r2 ;
|
||||
lin n3 = mkNum "ti:n" "ti:s" r3 ;
|
||||
lin n4 = mkNum "ca:r" "ca:li:s" r4 ;
|
||||
lin n5 = mkNum "pa:~nc" "paca:s" r5 ;
|
||||
lin n6 = mkNum (variants {"cHah" ; "cHa;" ; "cHai"}) "sa:TH" r6 ;
|
||||
lin n7 = mkNum "sa:t" "sattar" r7;
|
||||
lin n8 = mkNum "a:TH" "assi:" r8;
|
||||
lin n9 = mkNum "nau" (variants {"navve" ; "nabbe" }) 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 + "ah" ;
|
||||
r2 => a2 + "i:s" ;
|
||||
r3 => a3 + "ti:s" ;
|
||||
r4 => a4 + "a:li:s" ;
|
||||
r5 => a5 + "an" ;
|
||||
r6 => a6 + "saTH" ;
|
||||
r7 => a7 + "hattar" ;
|
||||
r8 => a8 + "a:si:" ;
|
||||
r9 => a9 + "a:nave"
|
||||
} ;
|
||||
|
||||
oper rows : DSize => DSize => Str = table {
|
||||
sg => mkR "gya:r" "ikk" "ikat" "ekt" "ikya:v" "ik" "ik" "iky" "iky" ;
|
||||
r2 => mkR "ba:r" "ba:" "bat" "bay" "ba:v" "ba:" "ba" "bay" "b" ;
|
||||
r3 => mkR "ter" "te" "taiM" "taiMt" "tirp" "tir" "ti" "tir" "tir" ;
|
||||
r4 => mkR "caud" "caub" "cauM" "cav" "caup" "cauM" "cau" "caur" "caur" ;
|
||||
r5 => mkR "paMdr" "pacc" "paiM" "paiMt" "pacp" "paiM" "pac" "pac" "pac" ;
|
||||
r6 => mkR "sol" "cHabb" "cHat" "cHiy" "cHapp" "cHiya:" "cHi" "cHiy" "cHiy" ;
|
||||
r7 => mkR (variants { "sattr" ; "satr"}) "satta:v" "saiM" "saiMt" "satta:" "sar" "sat" (variants {"satt" ; "sat" }) "satt" ;
|
||||
r8 => mkR "aTHa:r" "aTTHa:" "aR" "aRt" "aTTHa:v" "aR" "aTH" (variants { "aTTH" ; "aTH" }) "aTTH" ;
|
||||
r9 => table {sg => "unni:s" ; r2 => "unati:s" ; r3 => "unata:li:s" ;
|
||||
r4 => "unaca:s" ; r5 => "unasaTH" ; r6 => "unahattar" ;
|
||||
r7 => (variants{"unna:si:" ; "unya:si:"}) ;
|
||||
r8 => "nava:si:" ; r9 => "ninya:nave" }
|
||||
} ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "ek" ; _ => "dummy" } ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "das" ; 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 = "dummy" ; size = n.size } ;
|
||||
lin pot2 d = {s = (mksau (d.s ! unit) d.size) ;
|
||||
s2 = d.s ! unit ++ "la:kH" ; size = more100} ;
|
||||
lin pot2plus d e =
|
||||
{s = (mksau (d.s ! unit) d.size) ++ e.s ;
|
||||
s2 = (d.s ! unit) ++ "la:kH" ++ (mkhazar e.s e.size) ;
|
||||
size = more100} ;
|
||||
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = table { sing => ekhazar ;
|
||||
less100 => n.s ++ "haza:r" ;
|
||||
more100 => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {sing => ekhazar ;
|
||||
less100 => n.s ++ "haza:r" ;
|
||||
more100 => n.s2 } ! n.size ++ m.s} ;
|
||||
|
||||
|
||||
oper ekhazar : Str = variants {"haza:r" ; "ek" ++ "haza:r"} ;
|
||||
oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "haza:r"} ! sz ;
|
||||
oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "sau" ; _ => s ++ "sau"} ! sz ;
|
||||
63
grammars/numerals/old/hungarian.gf
Normal file
63
grammars/numerals/old/hungarian.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- by Patrik Jansson, Chalmers
|
||||
-- Small change by HH i.e
|
||||
-- ö in kettö should be ö with tilted long Hungarian dots ad-hoc written o%
|
||||
|
||||
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 = "/L" ++ x0.s ++ "L/"} ; -- the Latin-A-Supplement environment} ;
|
||||
lin n2 =
|
||||
{s = table {<ental,indep> => "ketto%" ;
|
||||
<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>}} ; -- Glue!
|
||||
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>}} ; -- Glue!
|
||||
lin pot1as2 n =
|
||||
{s = table {p => n.s ! p}} ;
|
||||
lin pot2 d =
|
||||
{s = table {p => (d.s ! <ental,attr>) ++ "száz"}} ; -- Glue!
|
||||
lin pot2plus d e =
|
||||
{s = table {p => (d.s ! <ental,attr>) ++ "száz" ++ e.s ! indep}} ; -- Glue!
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ "ezer"} ; -- Glue!
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ "ezer" ++ m.s ! indep} ; -- Glue!
|
||||
51
grammars/numerals/old/icelandic.gf
Normal file
51
grammars/numerals/old/icelandic.gf
Normal file
@@ -0,0 +1,51 @@
|
||||
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 Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Gen => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Gen => Str ; size : Size} ;
|
||||
|
||||
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 ;
|
||||
79
grammars/numerals/old/irish.gf
Normal file
79
grammars/numerals/old/irish.gf
Normal file
@@ -0,0 +1,79 @@
|
||||
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" } ;
|
||||
|
||||
52
grammars/numerals/old/italian.gf
Normal file
52
grammars/numerals/old/italian.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- unit + hundreds | mille are written together more often that not.
|
||||
-- ten + unit are written together!
|
||||
|
||||
param DForm = ental Pred | ton | tiotal | spctre;
|
||||
param Num = sg | pl ;
|
||||
param Pred = pred | indip ;
|
||||
|
||||
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 vowel : Strs = strs {"u" ; "o"} ; -- uno e otto
|
||||
|
||||
oper mkTal : Str -> Str -> Str -> LinDigit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {ental _ => två ; ton => tolv ; tiotal => tjugo ; spctre => två}} ;
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
oper spl : Str -> {s : Str ; n : Num} = \s -> {s = s ; n = pl} ;
|
||||
oper mille : Str -> Num => Str = \s -> table {sg => "mille" ; pl => s ++ "mila"} ; -- Glue s + "mila"!
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkTal "due" "dodici" ("vent" + pre {"i" ; [] / vowel}) ;
|
||||
lin n3 = {s = table {ental _ => "tre" ; ton => "tredici" ; tiotal => ("trent" + pre {"a" ; [] / vowel}) ; spctre => "tré" } };
|
||||
lin n4 = mkTal "quattro" "quattordici" ("quarant" + pre {"a" ; [] / vowel}) ;
|
||||
lin n5 = mkTal "cinque" "quindici" ("cinquant" + pre {"a" ; [] / vowel}) ;
|
||||
lin n6 = mkTal "sei" "sedici" ("sessant" + pre {"a" ; [] / vowel}) ;
|
||||
lin n7 = mkTal "sette" "diciassette" ("settant" + pre {"a" ; [] / vowel}) ;
|
||||
lin n8 = mkTal "otto" "diciotto" ("ottant" + pre {"a" ; [] / vowel}) ;
|
||||
lin n9 = mkTal "nove" "diciannove" ("novant" + pre {"a" ; [] / vowel});
|
||||
|
||||
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 ! spctre) ; -- Glue!
|
||||
lin pot1as2 n = {s = n.s ; n = n.n} ;
|
||||
lin pot2 d = spl (d.s ! ental pred ++ "cento") ; -- Glue!
|
||||
lin pot2plus d e = spl (d.s ! ental pred ++ "cento" ++ e.s) ; -- Glue!
|
||||
lin pot2as3 n = {s = n.s ; n = n.n} ;
|
||||
lin pot3 n = ss ((mille n.s) ! n.n) ;
|
||||
lin pot3plus n m = ss ((mille n.s) ! n.n ++ m.s) ;
|
||||
|
||||
59
grammars/numerals/old/japanese.gf
Normal file
59
grammars/numerals/old/japanese.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 = "/J" ++ x0.s ++ "J/"} ;
|
||||
|
||||
oper mkNum : Str -> LinDigit = \base ->
|
||||
{s = table {unit => base ; attr => base ; ten => base + "juu" ; hundred => base + "hyaku" ; thousand => base + "sen" } ; size = pl} ;
|
||||
|
||||
oper mkNum4 : Str -> Str -> Str -> Str -> LinDigit = \ni -> \base -> \nihyaku -> \nisen ->
|
||||
{s = table {unit => ni ; attr => base ; ten => base + "juu" ; hundred => nihyaku ; thousand => nisen } ; size = pl} ;
|
||||
|
||||
oper mkNum2 : Str -> Str -> LinDigit = \yon -> \base ->
|
||||
{s = table {unit => yon ; attr => base ; ten => base + "juu" ; hundred => base + "hyaku" ; thousand => base + "sen" } ; size = pl} ;
|
||||
|
||||
-- lin n1 = mkNum "ichi" ;
|
||||
lin n2 = mkNum "ni" ;
|
||||
lin n3 = mkNum4 "san" "san" "sanbyaku" "sanzen" ;
|
||||
lin n4 = mkNum2 (variants { "shi" ; "yon" }) "yon" ;
|
||||
lin n5 = mkNum "go" ;
|
||||
lin n6 = mkNum4 "roku" "roku" "roppyaku" "rokusen" ;
|
||||
lin n7 = mkNum2 (variants {"nana" ; "shichi" }) "nana" ;
|
||||
lin n8 = mkNum4 "hachi" "hachi" "happyaku" "hassen" ;
|
||||
lin n9 = mkNum2 (variants {"kyuu" ; "ku" }) "kyuu" ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "ichi" ; attr => [] ; ten => "juu" ; hundred => "hyaku" ; thousand => "sen"} ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "juu" ; s2 = table {tenp => "ichi" + "man" ; senp => []} ; size = more10} ;
|
||||
lin pot111 = {s = "juu" + "ichi" ; s2 = table {tenp => "ichi" + "man" ; senp => "sen"} ; size = more10} ;
|
||||
lin pot1to19 d = {s = "juu" ++ d.s ! unit ; s2 = table {tenp => "ichi" + "man" ; 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 ++ "man" ; senp => []} ; size = more10} ;
|
||||
lin pot1plus d e =
|
||||
{s = d.s ! ten ++ e.s ! unit ;
|
||||
s2 = table {tenp => d.s ! unit ++ "man" ; 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 ++ "man" ; sen => "dummy"} ; 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 => "dummy" } ; 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} ;
|
||||
|
||||
57
grammars/numerals/old/khowar.gf
Normal file
57
grammars/numerals/old/khowar.gf
Normal file
@@ -0,0 +1,57 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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 = "/L" ++ x0.s ++ "L/"} ; -- Latin A Supplement
|
||||
|
||||
oper mkNum : Str -> Str -> Par20 -> LinDigit = \s -> \tw -> \p20 ->
|
||||
{s = table {unit => s ; teen => "jo.sh" + "-" + s ; ten _ => tw ++ "bîsher"} ; size = pl ; par20 = p20} ;
|
||||
|
||||
-- lin n1 = mkNum variants {"î" ; "îwáloo"} ;
|
||||
lin n2 =
|
||||
{s = table {unit => "joo" ; teen => "jo.sh" + "-" + "joo" ; ten attr => "bîsher" ; ten preceded => "î" ++ "bîsher" } ; size = pl ; par20 = even };
|
||||
lin n3 =
|
||||
{s = table {unit => "troi" ; teen => "jo.sh" + "-" + "troi" ; ten attr => "bîsher" ; ten preceded => "î" ++ "bîsher" } ; size = pl ; par20 = odd };
|
||||
lin n4 = mkNum "cho.r" "joo" even ;
|
||||
lin n5 = mkNum "po.nj" "joo" odd ;
|
||||
lin n6 = mkNum "chöi" "troi" even ;
|
||||
lin n7 = mkNum "so.t" "troi" odd ;
|
||||
lin n8 = mkNum "o.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 {_ => "jo.sh" } ; size = pl} ;
|
||||
lin pot111 = {s = table {_ => "jo.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 ++ "jo.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 => "sho.r" ; _ => d.s ! unit ++ "sho.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 => "sho.r" ; _ => d.s ! unit ++ "sho.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} ;
|
||||
109
grammars/numerals/old/korean.gf
Normal file
109
grammars/numerals/old/korean.gf
Normal file
@@ -0,0 +1,109 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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} ;
|
||||
lin num x0 =
|
||||
{s = "/L" ++ x0.s ++ "L/" } ; -- just makes colons into length bar ontop of char
|
||||
|
||||
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 n1 = mkNum variants{"hana" ; "han } ; variants {"yelhana" ; "yelhan" }
|
||||
lin n2 = mkNumq (variants {"twu:l" ; "twu" })
|
||||
(variants {"yelqtwul" ; "yelqtwu" })
|
||||
(variants {"sumul" ; "sumu" })
|
||||
"i:" ;
|
||||
lin n3 = mkNum (variants {"se:ys" ; "se:y" ; "se:k" ; "se:" })
|
||||
(variants {"yelqseys" ; "yelqsey" ; "yelqsek" ; "yelqse" })
|
||||
(variants {"seun" ; "sehun" })
|
||||
"sam" ;
|
||||
lin n4 = mkNum (variants {"ne:ys" ; "ne:y" ; "ne:k" ; "ne:" })
|
||||
(variants {"yelneys" ; "yelney" ; "yelnek" ; "yelne" })
|
||||
"mahun" "sa:" ;
|
||||
lin n5 = mkNum "tases" "yelqtases" "swi:n" "o:";
|
||||
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 {"ma: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 ;
|
||||
|
||||
|
||||
55
grammars/numerals/old/kulung.gf
Normal file
55
grammars/numerals/old/kulung.gf
Normal file
@@ -0,0 +1,55 @@
|
||||
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 Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Scale => Str ; size : Size} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> Lin Digit =
|
||||
\two -> \two2 -> \twenty -> \twenty2 ->
|
||||
{s = table {basic => two ; belowtenform => two2 ; tenindep => twenty ; ten => twenty2}} ;
|
||||
|
||||
oper mkRegNum : Str -> Lin Digit =
|
||||
\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 ;
|
||||
69
grammars/numerals/old/modern_greek.gf
Normal file
69
grammars/numerals/old/modern_greek.gf
Normal file
@@ -0,0 +1,69 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- Free variation on accents on m'ia and d'yo
|
||||
|
||||
oper vowel : Strs = strs {"e" ; "o" ; "a" ; "'e" ; "'o" ; "'a"} ;
|
||||
|
||||
param DForm = unit | fem | femteen | teen | ten | hundredneut | hundredfem ;
|
||||
param Use = indep | femattr ;
|
||||
param Size = sg | pl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str } ;
|
||||
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 -> Lin Digit =
|
||||
\dyo -> \dwdeka -> \eikosi -> \diakosi -> \dyofem -> \dwdekafem ->
|
||||
{s = table {unit => dyo ; teen => dwdeka ; ten => eikosi ;
|
||||
hundredneut => diakosi + "a" ; hundredfem => diakosi + "ej" ;
|
||||
fem => dyofem ; femteen => dwdekafem}} ;
|
||||
|
||||
oper mkIndeclNum : Str -> Str -> Str -> Str -> Lin Digit =
|
||||
\dyo -> \dwdeka -> \eikosi -> \diakosi ->
|
||||
{s = table {unit => dyo ; teen => dwdeka ; ten => eikosi ;
|
||||
hundredneut => diakosi + "a" ; hundredfem => diakosi + "ej" ;
|
||||
fem => dyo ; femteen => dwdeka}} ;
|
||||
|
||||
lin n2 = mkIndeclNum "d'yo" "d'wdeka" "e'ikosi" "diak'osi" ;
|
||||
lin n3 = mkNum "tr'ia" "dekatr'ia" "tri'anta" "triak'osi" "tre'ij" "dekatre'is" ;
|
||||
lin n4 = mkNum "t'essera" "dekat'essera" "sar'anta" "tetrak'osi" "t'esserij" "dekat'esserij" ;
|
||||
lin n5 = mkIndeclNum "p'ente" "dekap'ente" "pen'hnta" "pentak'osi" ;
|
||||
lin n6 = mkIndeclNum "'exi" (variants { "deka'exi" ; "deka'exi" }) "ex'hnta" "exak'osi" ;
|
||||
lin n7 = mkIndeclNum (variants {"ept'a" ; "eft'a" }) "dekaeft'a" "ebdom'hnta" "eftak'osi" ;
|
||||
lin n8 = mkIndeclNum "oct'w" "dekaoct'w" "ogd'onta" "octak'osi" ;
|
||||
lin n9 = mkIndeclNum (variants {"enn'ea" ; "enn'ia" }) "dekaenn'ea" "enen'hnta" "enniak'osi" ;
|
||||
lin pot01 =
|
||||
{s = table {unit => "'ena" ; fem => "m'ia" ; _ => "ekat'o" + pre {[] ; "n" / vowel}} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = pl} ;
|
||||
lin pot110 =
|
||||
{s = table {indep => "d'eka" ; femattr => "d'eka"} ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = table {indep => "'enteka" ; femattr => "'enteka" } ; 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 => "c'ilia" ; pl => s ++ "cili'adej" } ;
|
||||
59
grammars/numerals/old/mongolian.gf
Normal file
59
grammars/numerals/old/mongolian.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
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 = "/L" ++ x0.s ++ "L/"} ;
|
||||
lin n2 = mkNum "qoyar" "qorin" ;
|
||||
lin n3 = mkNum "Gurban" "guc^in" ;
|
||||
lin n4 = mkNum "dörbän" "döc^in" ;
|
||||
lin n5 = mkNum "tabun" "tabin" ;
|
||||
lin n6 = mkNum "j^irGu'an" "j^irin" ;
|
||||
lin n7 = mkNum "dolo'an" "dalan" ;
|
||||
lin n8 = mkNum "naiman" "nayan" ;
|
||||
lin n9 = mkNum "yisün" "j^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)) ++ "j^a'un" ;
|
||||
s2 = sel d.size "arban" (d.s ! ten) ; size = tenplus} ;
|
||||
lin pot2plus d e = {s = (sel d.size [] (d.s ! unit)) ++ "j^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 ;
|
||||
32
grammars/numerals/old/numerals.Abs.gf
Normal file
32
grammars/numerals/old/numerals.Abs.gf
Normal file
@@ -0,0 +1,32 @@
|
||||
-- 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
|
||||
|
||||
88
grammars/numerals/old/numerals.Ara.gf
Normal file
88
grammars/numerals/old/numerals.Ara.gf
Normal file
@@ -0,0 +1,88 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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) => "avnyn" ;
|
||||
teen => "avnj" ;
|
||||
ten => "ocryn" ;
|
||||
hund => "maOtyn"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "vlavA" ;
|
||||
teen => "vlavA" ;
|
||||
ten => "vlavyn" ;
|
||||
hund => "vlavmaOA"} ; size = small} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "urboA" ;
|
||||
teen => "urboA" ;
|
||||
ten => "urboyn" ;
|
||||
hund => "urbomaOA"} ; size = small} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "CmsA" ;
|
||||
teen => "CmsA" ;
|
||||
ten => "Cmsyn" ;
|
||||
hund => "CmsmaOA"} ; size = small} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "stA" ;
|
||||
teen => "stA" ;
|
||||
ten => "styn" ;
|
||||
hund => "stmaOA"} ; size = small} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "sboA" ;
|
||||
teen => "sboA" ;
|
||||
ten => "sboyn" ;
|
||||
hund => "sbomaOA"} ; size = small} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "vmanyA" ;
|
||||
teen => "vmanyA" ;
|
||||
ten => "vmanyn" ;
|
||||
hund => "vmanmaOA"} ; size = small} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "tsoA" ;
|
||||
teen => "tsoA" ;
|
||||
ten => "tsoyn" ;
|
||||
hund => "tsomaOA"} ; size = small} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "maOA"; (unit attr) => [] ; f => "waHd"} ; size = large} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "ocrA"} ; size = small} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "aHd" ++ "ocr"} ; size = large} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen ++ "ocr"} ; 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 ++ "w" ++ 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 ++ "w" ++ 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 ++ "w" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{small} => "Ulaf" ; {dual} => "alfyn" ; _ => "alf"} ;
|
||||
|
||||
110
grammars/numerals/old/numerals.Chi.gf
Normal file
110
grammars/numerals/old/numerals.Chi.gf
Normal file
@@ -0,0 +1,110 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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} ;
|
||||
|
||||
110
grammars/numerals/old/numerals.ChiU.gf
Normal file
110
grammars/numerals/old/numerals.ChiU.gf
Normal file
@@ -0,0 +1,110 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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} ;
|
||||
|
||||
44
grammars/numerals/old/numerals.Dan.gf
Normal file
44
grammars/numerals/old/numerals.Dan.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
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} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
lincat Sub100 = {s : Str} ;
|
||||
lincat Sub1000 = {s : Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkTal : Str -> Str -> Str -> Lin Digit =
|
||||
\to, tolv, tyve ->
|
||||
{s = table {ental => to ; ton => tolv ; tiotal => tyve}} ;
|
||||
oper regTal : Str -> Lin Digit = \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) ; ---
|
||||
43
grammars/numerals/old/numerals.Dec.gf
Normal file
43
grammars/numerals/old/numerals.Dec.gf
Normal file
@@ -0,0 +1,43 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
flags lexer=chars ; unlexer=concat ;
|
||||
|
||||
param Zeros = noz | zz ;
|
||||
|
||||
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}} ;
|
||||
47
grammars/numerals/old/numerals.Deu.gf
Normal file
47
grammars/numerals/old/numerals.Deu.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
param Place = indep | prae | attr ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
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 -> Lin Digit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {unit => två ; teen => tolv ; ten => tjugo}} ;
|
||||
oper regZahl : Str -> Lin Digit =
|
||||
\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 = regZahl "sechs" ;
|
||||
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) ;
|
||||
|
||||
39
grammars/numerals/old/numerals.Eng.gf
Normal file
39
grammars/numerals/old/numerals.Eng.gf
Normal file
@@ -0,0 +1,39 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Lin Digit =
|
||||
\two -> \twelve -> \twenty ->
|
||||
{s = table {unit => two ; teen => twelve ; ten => twenty}} ;
|
||||
oper regNum : Str -> Lin Digit =
|
||||
\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} ;
|
||||
|
||||
60
grammars/numerals/old/numerals.Fra.gf
Normal file
60
grammars/numerals/old/numerals.Fra.gf
Normal file
@@ -0,0 +1,60 @@
|
||||
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} ;
|
||||
92
grammars/numerals/old/numerals.Gre.gf
Normal file
92
grammars/numerals/old/numerals.Gre.gf
Normal file
@@ -0,0 +1,92 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten | hund ;
|
||||
param Place = attr | indep ;
|
||||
param Size = sg | pl ;
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : Place => 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 ++ "//"} ; -- Greek environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {{unit} => "d'yo" ;
|
||||
{teen} => "d'wdeka" ;
|
||||
{ten} => "e)'ikosi" ;
|
||||
{hund} => "diak'osioi"}} ;
|
||||
lin n3 =
|
||||
{s = table {{unit} => "tre~ij" ;
|
||||
{teen} => "tre~ij" ++ "ka`i" ++ "d'eka" ;
|
||||
{ten} => "tri'akonta" ;
|
||||
{hund} => "triak'osioi"}} ;
|
||||
lin n4 =
|
||||
{s = table {{unit} => "t'ettarej" ;
|
||||
{teen} => "t'ettarej" ++ "ka`i" ++ "d'eka" ;
|
||||
{ten} => "tettar'akonta" ;
|
||||
{hund} => "tetrak'osioi"}} ;
|
||||
lin n5 =
|
||||
{s = table {{unit} => "p'ente" ;
|
||||
{teen} => "penteka'ideka" ;
|
||||
{ten} => "pent'hkonta" ;
|
||||
{hund} => "pentak'osioi"}} ;
|
||||
lin n6 =
|
||||
{s = table {{unit} => "('ex" ;
|
||||
{teen} => "(ekka'ideka" ;
|
||||
{ten} => "(ex'hkonta" ;
|
||||
{hund} => "(exak'osioi"}} ;
|
||||
lin n7 =
|
||||
{s = table {{unit} => "(ept'a" ;
|
||||
{teen} => "(eptaka'ideka" ;
|
||||
{ten} => "(ebdom'hkonta" ;
|
||||
{hund} => "(eptak'osioi"}} ;
|
||||
lin n8 =
|
||||
{s = table {{unit} => ")okt'w" ;
|
||||
{teen} => ")oktwka'ideka" ;
|
||||
{ten} => ")ogdo'hkonta" ;
|
||||
{hund} => ")oktako'sioi"}} ;
|
||||
lin n9 =
|
||||
{s = table {{unit} => ")enn'ea" ;
|
||||
{teen} => ")enneaka'ideka" ;
|
||||
{ten} => ")enen'hkonta" ;
|
||||
{hund} => ")enak'osioi"}} ;
|
||||
|
||||
|
||||
lin pot01 =
|
||||
{s = table {{attr} => table {{hund} => "(ekat'on" ; _ => []} ;
|
||||
_ => table {{hund} => "(ekat'on" ; f => "e('ij"}} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = table {_ => d.s} ; size = pl} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "d'eka"} ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "('endeka"} ; size = pl} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen} ; size = pl} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {p => n.s ! p ! unit} ; size = n.size} ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten} ; size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => d.s ! ten ++ e.s ! indep ! unit} ; size = pl} ;
|
||||
lin pot1as2 n =
|
||||
{s = n.s ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {p => d.s ! p ! hund} ; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {p => d.s ! p ! hund ++ e.s ! indep} ; size = pl} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep} ;
|
||||
lin pot3 n =
|
||||
{s = n.s ! attr ++ "c'ilioi"} ;
|
||||
lin pot3plus n m =
|
||||
{s = n.s ! attr ++ "c'ilioi" ++ m.s ! indep} ;
|
||||
|
||||
--- TODO
|
||||
--- 2000 discilioi-3
|
||||
--- 10000 myrioi-3
|
||||
--- 20000 dismyrioi-3
|
||||
|
||||
|
||||
88
grammars/numerals/old/numerals.Heb.gf
Normal file
88
grammars/numerals/old/numerals.Heb.gf
Normal file
@@ -0,0 +1,88 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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) => "snyM" ;
|
||||
cons => "sny" ;
|
||||
ten => "osryM" ;
|
||||
hund => "matyM"} ; size = dual} ;
|
||||
lin n3 =
|
||||
{s = table {(unit _) => "slsh" ;
|
||||
cons => "slst" ;
|
||||
ten => "slsyM" ;
|
||||
hund => "sls-mawt"} ; size = small} ;
|
||||
lin n4 =
|
||||
{s = table {(unit _) => "arboh" ;
|
||||
cons => "arbot" ;
|
||||
ten => "arboyM" ;
|
||||
hund => "arbo-mawt"} ; size = small} ;
|
||||
lin n5 =
|
||||
{s = table {(unit _) => "Hmsh" ;
|
||||
cons => "Hmst" ;
|
||||
ten => "HmsyM" ;
|
||||
hund => "Hms-mawt"} ; size = small} ;
|
||||
lin n6 =
|
||||
{s = table {(unit _) => "ssh" ;
|
||||
cons => "sst" ;
|
||||
ten => "ssyM" ;
|
||||
hund => "ss-mawt"} ; size = small} ;
|
||||
lin n7 =
|
||||
{s = table {(unit _) => "sboh" ;
|
||||
cons => "sbot" ;
|
||||
ten => "sboyM" ;
|
||||
hund => "sbo-mawt"} ; size = small} ;
|
||||
lin n8 =
|
||||
{s = table {(unit _) => "smwnh" ;
|
||||
cons => "smwnt" ;
|
||||
ten => "smwnyM" ;
|
||||
hund => "smwnh-mawt"} ; size = small} ;
|
||||
lin n9 =
|
||||
{s = table {(unit _) => "tsoh" ;
|
||||
cons => "tsot" ;
|
||||
ten => "tsoyM" ;
|
||||
hund => "tso-mawt"} ; size = small} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {hund => "mah"; (unit attr) => [] ; f => "aHd"} ; size = large} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "osr"} ; size = small} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "aHd" ++ "-" ++ "osr"} ; size = large} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! unit indep ++ "-" ++ "osr"} ; 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 ++ "w" ++ 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 ++ "w" ++ 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 ++ "w" ++ m.s ! indep} ;
|
||||
|
||||
oper Alf : Size => Str =
|
||||
table {{small} => "alpyM" ; {dual} => "alpyM" ; _ => "alP"} ;
|
||||
|
||||
45
grammars/numerals/old/numerals.Ita.gf
Normal file
45
grammars/numerals/old/numerals.Ita.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = ental Pred | ton | tiotal ;
|
||||
param Num = sg | pl ;
|
||||
param Pred = pred | indip ;
|
||||
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
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 -> Lin Digit =
|
||||
\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) ;
|
||||
|
||||
61
grammars/numerals/old/numerals.Mag.gf
Normal file
61
grammars/numerals/old/numerals.Mag.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
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} ;
|
||||
71
grammars/numerals/old/numerals.Malay.gf
Normal file
71
grammars/numerals/old/numerals.Malay.gf
Normal file
@@ -0,0 +1,71 @@
|
||||
-- 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 ) ;
|
||||
48
grammars/numerals/old/numerals.Ned.gf
Normal file
48
grammars/numerals/old/numerals.Ned.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
-- 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} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
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 -> Lin Digit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {unit => två ; teen => tolv ; ten => tjugo}} ;
|
||||
oper regGetal : Str -> Lin Digit =
|
||||
\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) ;
|
||||
|
||||
45
grammars/numerals/old/numerals.NorB.gf
Normal file
45
grammars/numerals/old/numerals.NorB.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
-- 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} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
lincat Sub100 = {s : Str} ;
|
||||
lincat Sub1000 = {s : Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkTal : Str -> Str -> Str -> Lin Digit =
|
||||
\två -> \tolv -> \tjugo ->
|
||||
{s = table {ental => två ; ton => tolv ; tiotal => tjugo}} ;
|
||||
oper regTal : Str -> Lin Digit = \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 => "et"}} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f}} ;
|
||||
lin pot110 = ss "ti" ;
|
||||
lin pot111 = ss "elve" ;
|
||||
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" ++ "og" ++ m.s) ;
|
||||
|
||||
94
grammars/numerals/old/numerals.Pol.gf
Normal file
94
grammars/numerals/old/numerals.Pol.gf
Normal file
@@ -0,0 +1,94 @@
|
||||
-- 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 Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
lincat Sub100 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000 = {s : Str; t : ThForm } ;
|
||||
|
||||
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} ;
|
||||
|
||||
111
grammars/numerals/old/numerals.Rus.gf
Normal file
111
grammars/numerals/old/numerals.Rus.gf
Normal file
@@ -0,0 +1,111 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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} => "t1säqa" ;
|
||||
{sgg} => "t1säqi" ;
|
||||
_ => "t1säq"} ;
|
||||
|
||||
oper gg : Str -> Gen => Str = \s -> table {_ => s} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = "/_" ++ x0.s ! masc ++ "_/"} ; -- Russian environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {{unit} => table {{fem} => "dve" ; _ => "dva"} ;
|
||||
{teen} => gg "dvenadcat'" ;
|
||||
{ten} => gg "dvadcat'" ;
|
||||
{hund} => gg "dvesti"} ;
|
||||
size = sgg} ;
|
||||
lin n3 =
|
||||
{s = table {{unit} => gg "tri" ;
|
||||
{teen} => gg "trinadcat'" ;
|
||||
{ten} => gg "tridcat'" ;
|
||||
{hund} => gg "trista"} ;
|
||||
size = sgg} ;
|
||||
lin n4 =
|
||||
{s = table {{unit} => gg "qet1re" ;
|
||||
{teen} => gg "qet1rnadcat'" ;
|
||||
{ten} => gg "sorok" ;
|
||||
{hund} => gg "qet1resta"} ;
|
||||
size = sgg} ;
|
||||
lin n5 =
|
||||
{s = table {{unit} => gg "pät'" ;
|
||||
{teen} => gg "pätnadcat'" ;
|
||||
{ten} => gg "pät'desät" ;
|
||||
{hund} => gg "pät'sot"} ;
|
||||
size = plg} ;
|
||||
lin n6 =
|
||||
{s = table {{unit} => gg "west'" ;
|
||||
{teen} => gg "westnadcat'" ;
|
||||
{ten} => gg "west'desät" ;
|
||||
{hund} => gg "west'sot"} ;
|
||||
size = plg} ;
|
||||
lin n7 =
|
||||
{s = table {{unit} => gg "sem'" ;
|
||||
{teen} => gg "semnadcat'" ;
|
||||
{ten} => gg "sem'desät" ;
|
||||
{hund} => gg "sem'sot"} ;
|
||||
size = plg} ;
|
||||
lin n8 =
|
||||
{s = table {{unit} => gg "vosem'" ;
|
||||
{teen} => gg "vosemnadcat'" ;
|
||||
{ten} => gg "vosem'desät" ;
|
||||
{hund} => gg "vosem'sot"} ;
|
||||
size = plg} ;
|
||||
lin n9 =
|
||||
{s = table {{unit} => gg "devät'" ;
|
||||
{teen} => gg "devätnadcat'" ;
|
||||
{ten} => gg "devänosto" ;
|
||||
{hund} => gg "devät'sot"} ;
|
||||
size = plg} ;
|
||||
|
||||
|
||||
lin pot01 =
|
||||
{s = table {{attr} => table {{hund} => gg "sto" ; _ => gg []} ;
|
||||
_ => table {{hund} => gg "sto" ;
|
||||
_ => table {{masc} => "odin" ; {fem} => "odna" ; _ => "odno"}}} ;
|
||||
size = nom} ;
|
||||
lin pot0 d =
|
||||
{s = table {_ => d.s} ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => gg "desät'"} ; size = plg} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => gg "odinnadcat'"} ; 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
|
||||
|
||||
111
grammars/numerals/old/numerals.RusU.gf
Normal file
111
grammars/numerals/old/numerals.RusU.gf
Normal file
@@ -0,0 +1,111 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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} => "t1säqa" ;
|
||||
{sgg} => "t1säqi" ;
|
||||
_ => "t1säq"} ;
|
||||
|
||||
oper gg : Str -> Gen => Str = \s -> table {_ => s} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = "/_" ++ x0.s ! masc ++ "_/"} ; -- Russian environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {{unit} => table {{fem} => "dve" ; _ => "dva"} ;
|
||||
{teen} => gg "dvenadcat'" ;
|
||||
{ten} => gg "dvadcat'" ;
|
||||
{hund} => gg "dvesti"} ;
|
||||
size = sgg} ;
|
||||
lin n3 =
|
||||
{s = table {{unit} => gg "tri" ;
|
||||
{teen} => gg "trinadcat'" ;
|
||||
{ten} => gg "tridcat'" ;
|
||||
{hund} => gg "trista"} ;
|
||||
size = sgg} ;
|
||||
lin n4 =
|
||||
{s = table {{unit} => gg "qet1re" ;
|
||||
{teen} => gg "qet1rnadcat'" ;
|
||||
{ten} => gg "sorok" ;
|
||||
{hund} => gg "qet1resta"} ;
|
||||
size = sgg} ;
|
||||
lin n5 =
|
||||
{s = table {{unit} => gg "pät'" ;
|
||||
{teen} => gg "pätnadcat'" ;
|
||||
{ten} => gg "pät'desät" ;
|
||||
{hund} => gg "pät'sot"} ;
|
||||
size = plg} ;
|
||||
lin n6 =
|
||||
{s = table {{unit} => gg "west'" ;
|
||||
{teen} => gg "westnadcat'" ;
|
||||
{ten} => gg "west'desät" ;
|
||||
{hund} => gg "west'sot"} ;
|
||||
size = plg} ;
|
||||
lin n7 =
|
||||
{s = table {{unit} => gg "sem'" ;
|
||||
{teen} => gg "semnadcat'" ;
|
||||
{ten} => gg "sem'desät" ;
|
||||
{hund} => gg "sem'sot"} ;
|
||||
size = plg} ;
|
||||
lin n8 =
|
||||
{s = table {{unit} => gg "vosem'" ;
|
||||
{teen} => gg "vosemnadcat'" ;
|
||||
{ten} => gg "vosem'desät" ;
|
||||
{hund} => gg "vosem'sot"} ;
|
||||
size = plg} ;
|
||||
lin n9 =
|
||||
{s = table {{unit} => gg "devät'" ;
|
||||
{teen} => gg "devätnadcat'" ;
|
||||
{ten} => gg "devänosto" ;
|
||||
{hund} => gg "devät'sot"} ;
|
||||
size = plg} ;
|
||||
|
||||
|
||||
lin pot01 =
|
||||
{s = table {{attr} => table {{hund} => gg "sto" ; _ => gg []} ;
|
||||
_ => table {{hund} => gg "sto" ;
|
||||
_ => table {{masc} => "odin" ; {fem} => "odna" ; _ => "odno"}}} ;
|
||||
size = nom} ;
|
||||
lin pot0 d =
|
||||
{s = table {_ => d.s} ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => gg "desät'"} ; size = plg} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => gg "odinnadcat'"} ; 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
|
||||
|
||||
60
grammars/numerals/old/numerals.Slo.gf
Normal file
60
grammars/numerals/old/numerals.Slo.gf
Normal file
@@ -0,0 +1,60 @@
|
||||
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} ;
|
||||
61
grammars/numerals/old/numerals.Spa.gf
Normal file
61
grammars/numerals/old/numerals.Spa.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
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} ;
|
||||
60
grammars/numerals/old/numerals.Suo.gf
Normal file
60
grammars/numerals/old/numerals.Suo.gf
Normal file
@@ -0,0 +1,60 @@
|
||||
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 : 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} ;
|
||||
44
grammars/numerals/old/numerals.Swe.gf
Normal file
44
grammars/numerals/old/numerals.Swe.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = ental | ton | tiotal ;
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => Str} ;
|
||||
Sub10 = {s : DForm => Str} ;
|
||||
|
||||
oper
|
||||
mkTal : Str -> Str -> Str -> Lin Digit = \två, tolv, tjugo ->
|
||||
{s = table {ental => två ; ton => tolv ; tiotal => tjugo}} ;
|
||||
|
||||
regTal : Str -> Lin Digit = \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) ;
|
||||
|
||||
60
grammars/numerals/old/numerals.Tam.gf
Normal file
60
grammars/numerals/old/numerals.Tam.gf
Normal file
@@ -0,0 +1,60 @@
|
||||
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} ;
|
||||
58
grammars/numerals/old/old_church_slavonic.gf
Normal file
58
grammars/numerals/old/old_church_slavonic.gf
Normal file
@@ -0,0 +1,58 @@
|
||||
-- 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 ;
|
||||
|
||||
param Size = sg | dual | threefour | fiveup ;
|
||||
|
||||
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 } ;
|
||||
|
||||
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 = "/C" ++ x.s ++ "C/"} ; -- the Old Church Slavonic Cyrillic script ;
|
||||
|
||||
lin n2 = {s = "dUva" ; s2 = [] ; size = dual };
|
||||
lin n3 = mkNum (variants {"trije" ; "trIje" }) threefour ;
|
||||
lin n4 = mkNum "qetyre" threefour ;
|
||||
lin n5 = mkNum5 "pe~tI" ;
|
||||
lin n6 = mkNum5 "westI" ;
|
||||
lin n7 = mkNum5 "sedmI" ;
|
||||
lin n8 = mkNum5 "osmI" ;
|
||||
lin n9 = mkNum5 "deve~tI" ;
|
||||
|
||||
lin pot01 = { s = "jedinU" ; s2 = [] ; size = sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = mkNum5 "dese~tI" ;
|
||||
lin pot111 = mkNum5 ("jedinU" ++ "na" ++ "dese~te") ;
|
||||
lin pot1to19 d = mkNum5 (d.s ++ "na" ++ "dese~te") ;
|
||||
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 {"i" ; "ti"} ++ e.s ; s2 =mkTen d.size d.s ++ variants {"i" ; "ti"} ++ 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 {"tysjo~wti" ; "tysje~wti"}) ; dual => ("dUvä" ++ "tysjo~wti") ; threefour => "tysjo~wte~" ; fiveup => "tysjo~wtI" } ! sz ;
|
||||
|
||||
oper mkHund : Size -> Str -> Str = \sz -> \s ->
|
||||
table {sg => "sUto" ; dual => "dUvä" ++ "sUtä" ; threefour => s ++ "sUta" ; fiveup => s ++ "sUtU" } ! sz ;
|
||||
|
||||
oper mkTen : Size -> Str -> Str = \sz -> \s ->
|
||||
table {sg => "dese~tI" ; dual => s ++ "dese~ti" ; threefour => s ++ "dese~te" ; fiveup => s ++ "dese~tU" } ! sz ;
|
||||
|
||||
oper mkattr : Size -> Str -> Str = \sz -> \s -> table {dual => [] ; _ => s} ! sz;
|
||||
88
grammars/numerals/old/pashto.gf
Normal file
88
grammars/numerals/old/pashto.gf
Normal file
@@ -0,0 +1,88 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ;
|
||||
|
||||
lin num x0 =
|
||||
{s = "/A" ++ x0.s ++ "A/"} ; -- the Extented-Arabic environment
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Lin Digit =
|
||||
\dwA -> \cl -> \dwwls ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; spctwo => dwA ; twenties => dwA + "wict"} ; size = less100 } ;
|
||||
|
||||
oper mkIrrNum : Str -> Str -> Str -> Str -> Str -> Lin Digit =
|
||||
\dwA -> \cl -> \dwwls -> \dw -> \dr ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; spctwo => dw ; twenties
|
||||
=> dr + "wict"} ; size = less100 } ;
|
||||
|
||||
-- lin n1 mkNum "yw" "ls" ... ;
|
||||
lin n2 = {s = table {unit => "dwA" ; ten => "cl" ; teen => "dwwls" ;
|
||||
spctwo => "dw" ; twenties => "dwA" + "wict" } ;
|
||||
size = two };
|
||||
lin n3 = mkIrrNum "dry" "derc" "dyarls" "dry" "dr" ;
|
||||
lin n4 = mkIrrNum "$lwr" "$lweXt" "$wrls" "$lwr" "$ler";
|
||||
lin n5 = mkNum "pnPA" "pnPws" (variants { "pnPAls"; "pnPls"}) ;
|
||||
lin n6 = mkNum "cpG" "cpetA" "spaRls" ;
|
||||
lin n7 = mkNum "awA" "awya" (variants {"awAls"; "awls"}) ;
|
||||
lin n8 = mkNum "atA" "atya" (variants {"atAls"; "atls"}) ;
|
||||
lin n9 = mkNum "nA" "nwy" (variants {"nwls"; "nwns"}) ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "yw" ;
|
||||
spctwo => "yw" ;
|
||||
twenties => "yw" + "wict" ;
|
||||
_ => "dummy" } ; size = sg} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; size = less100} ;
|
||||
lin pot110 = {s = "ls" ; size = less100} ;
|
||||
lin pot111 = {s = "ywwls" ; 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 = "dummy" ; 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 ++ "aw" ++ 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 => "zr" ;
|
||||
two => n.s ++ "zrA" ;
|
||||
less100 => n.s ++ "zrA" ;
|
||||
more100 => n.s2 } ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table { sg => variants {"zr" ; "yw" ++ "zr"} ;
|
||||
two => n.s ++ "zrA" ;
|
||||
less100 => n.s ++ "zrA" ;
|
||||
more100 => n.s2 } ! n.size ++ maybeaw ! m.size ++ m.s} ;
|
||||
|
||||
|
||||
oper mklk : Str -> Size => Str = \s -> table {sg => "lk" ; _ => s ++ "lk"} ;
|
||||
oper maybeaw : Size => Str = table {more100 => [] ; _ => "aw"} ;
|
||||
oper mkswA : Str -> Size => Str = \s -> table {sg => "sl" ; _ => s ++ "swA"} ;
|
||||
oper mkvarswA : Str -> Size => Str =
|
||||
\s -> table {sg => (variants {"sl" ; "yw" ++ "sl"}) ; _ => s ++ "swA"} ;
|
||||
oper mkzrA : Size => Str = table {sg => "zr" ; _ => "zrA"} ;
|
||||
|
||||
104
grammars/numerals/old/polish.gf
Normal file
104
grammars/numerals/old/polish.gf
Normal file
@@ -0,0 +1,104 @@
|
||||
-- numerals in Polish, author Wojciech Mostowski, 20/9/2002
|
||||
|
||||
-- Did special Polish characters Harald Hammarstrom October 2003
|
||||
-- e, for e,
|
||||
-- c' for c'
|
||||
-- s' for s'
|
||||
-- a, for a,
|
||||
-- l/ for l/
|
||||
-- n' for n'
|
||||
-- z. for z.
|
||||
|
||||
|
||||
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 Digit = LinDigit ;
|
||||
lincat Sub10 = {s : DForm => Str; o : ThForm ; t : ThForm } ;
|
||||
lincat Sub100 = {s : Str; t : ThForm } ;
|
||||
lincat Sub1000 = {s : Str; t : ThForm } ;
|
||||
|
||||
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 + "nas'cie" ;
|
||||
ten => siedem + "dziesia,t" ; hund => siedem + "set"
|
||||
};
|
||||
o = fiveup ; t = fiveup
|
||||
};
|
||||
oper mkRegNum2 : Str -> LinDigit =
|
||||
\pie ->
|
||||
{ s = table { unit => pie + "c'" ; teen => pie + "tnas'cie" ;
|
||||
ten => pie + "c'dziesia,t" ; hund => pie + "c'set"
|
||||
};
|
||||
o = fiveup ; t = fiveup
|
||||
};
|
||||
|
||||
oper mkTh : Str -> ThForm => Str = \s ->
|
||||
table { onlyone => "tysia,c" ; lastone => s ++ "tysie,cy" ;
|
||||
twoorthreeorfour => s ++ "tysia,ce" ; fiveup => s ++ "tysie,cy"
|
||||
};
|
||||
|
||||
oper ss : Str -> ThForm -> {s : Str ; t : ThForm} = \str -> \th -> {s = str; t = th}
|
||||
;
|
||||
|
||||
lin num x = {s = "/L" ++ x.s ++ "L/"} ; -- the Polish in Latin A supplement ;
|
||||
|
||||
lin n2 = mkNum "dwa" "dwanas'cie" "dwadzies'cia" "dwies'cie"
|
||||
twoorthreeorfour ;
|
||||
lin n3 = mkNum "trzy" "trzynas'cie" "trzydzies'ci" "trzysta"
|
||||
twoorthreeorfour ;
|
||||
lin n4 = mkNum "cztery" "czternas'cie" (variants {"czterydzies'ci" ; "czterdzies'ci"}) "czterysta"
|
||||
twoorthreeorfour ;
|
||||
lin n5 = mkRegNum2 "pie," ;
|
||||
lin n6 = mkNum "szes'c'" "szesnas'cie" "szes'c'dziesia,t" "szes'c'set" 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 "dziesie,c'" fiveup ;
|
||||
lin pot111 = ss "jedenas'cie" 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 = (mkTh n.s) ! n.t} ;
|
||||
lin pot3plus n m = {s = (mkTh n.s) ! n.t ++ m.s} ;
|
||||
|
||||
58
grammars/numerals/old/portuguese.gf
Normal file
58
grammars/numerals/old/portuguese.gf
Normal file
@@ -0,0 +1,58 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
param Size = sg | less10 | pl ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str ; size : Size } ;
|
||||
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 -> Lin Digit =
|
||||
\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};
|
||||
50
grammars/numerals/old/quechua.gf
Normal file
50
grammars/numerals/old/quechua.gf
Normal file
@@ -0,0 +1,50 @@
|
||||
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 Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; size : Size} ;
|
||||
|
||||
oper mkRegNum1 : Str -> Lin Digit =
|
||||
\juk ->
|
||||
{ s = table { unit => juk ; havingunit => juk + "niyuq" } ; size = pl};
|
||||
|
||||
oper mkRegNum2 : Str -> Lin Digit =
|
||||
\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 } ;
|
||||
61
grammars/numerals/old/romanian.gf
Normal file
61
grammars/numerals/old/romanian.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- 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 Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : MidForm => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : MidForm => Str ; size : Size} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Lin Digit =
|
||||
\two -> \twelve -> \twenty -> mkNumSpc two twelve twenty two ;
|
||||
|
||||
oper mkNumSpc : Str -> Str -> Str -> Str -> Lin Digit =
|
||||
\two -> \twelve -> \twenty -> \doua ->
|
||||
{s = table {unit => two ; teen => twelve ; ten => twenty ; attr => doua} ; size = less20} ;
|
||||
|
||||
oper regNum : Str -> Lin Digit =
|
||||
\trei -> mkNum trei (trei + variants { "sprezece" ; "s,pe" }) (trei + "zeci") ;
|
||||
|
||||
oper ss : Str -> {s : MidForm => Str ; size : Size} = \st -> {s = table {_ => st} ; size = less20} ;
|
||||
|
||||
lin num x = {s = "/L" ++ x.s ++ "L/" }; -- Latin A Supplement chars
|
||||
lin n2 = mkNumSpc "doi" (variants { "doisprezece" ; "doua%sprezece" }) "doua%zeci" "doua%" ;
|
||||
lin n3 = regNum "trei" ;
|
||||
lin n4 = mkNum "patru" (variants{"paisprezece" ; "pais,pe"}) "patruzeci" ;
|
||||
lin n5 = mkNumSpc "cinci" (variants{"cinsprezece" ; "cins,pe"}) "cinzeci" (variants { "cinci" ; "cin" });
|
||||
lin n6 = mkNum "s,ase" (variants{"s,aisprezece" ; "s,aispe"}) "s,aizeci" ;
|
||||
lin n7 = mkNum "s,apte" (variants{"s,aptesprezece" ; "s,apspe"}) "s,aptezeci" ;
|
||||
lin n8 = mkNum "opt" (variants{"optsprezece" ; "opspe"}) "optzeci" ;
|
||||
lin n9 = regNum "noua%" ;
|
||||
|
||||
lin pot01 = {s = table {attr => "o" ; f => "unu"} ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = ss "zece" ;
|
||||
lin pot111 = ss (variants { "unsprezece" ; "uns,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 ++ "s,i" ++ e.s ! unit ;
|
||||
det => d.s ! ten ++ "s,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 ;
|
||||
197
grammars/numerals/old/sanskrit.gf
Normal file
197
grammars/numerals/old/sanskrit.gf
Normal file
@@ -0,0 +1,197 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 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 } ;
|
||||
|
||||
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) } ;
|
||||
|
||||
56
grammars/numerals/old/slovak.gf
Normal file
56
grammars/numerals/old/slovak.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
-- [c^], [s^], [c']
|
||||
|
||||
param Size = sg | twothreefour | fiveup ;
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
|
||||
lincat Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str; size : Size } ;
|
||||
lincat Sub1000 = {s : Str; size : Size } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Size -> Lin Digit =
|
||||
\dva -> \dvanast -> \dvadsat -> \sz ->
|
||||
{ s = table {unit => dva ; teen => dvanast ; ten => dvadsat ; hund =>
|
||||
dva + "sto" };
|
||||
size = sz
|
||||
};
|
||||
|
||||
oper mkRegNum : Str -> Lin Digit = \unit ->
|
||||
mkNum unit (unit + "nást'") (unit + "desiat") fiveup ;
|
||||
|
||||
lin num x = {s = "/L" ++ x.s ++ "L/" } ; -- Latin A supplement encoding
|
||||
|
||||
lin n2 = mkNum "dva" "dvanást'" "dvadsat'" twothreefour ;
|
||||
lin n3 = mkNum "tri" "trinást'" "tridsat'" twothreefour ;
|
||||
lin n4 = mkNum "s^tyri" "s^trnást'" "s^tyridsat'" twothreefour ;
|
||||
lin n5 = mkNum "pät'" "pätnást'" "pädesiat" fiveup ;
|
||||
lin n6 = mkNum "s^est'" "s^estnást'" "s^estdesiat" fiveup ;
|
||||
lin n7 = mkRegNum "sedem" ;
|
||||
lin n8 = mkRegNum "osem" ;
|
||||
lin n9 = mkNum "devät'" "devätnást'" "devätdesiat" fiveup ;
|
||||
|
||||
lin pot01 = {s = table {unit => "jeden" ; hundred => "sto" ; _ => "dummy" } ;
|
||||
size = sg } ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "desät'" ; size = fiveup } ;
|
||||
lin pot111 = {s = "jedenást'" ; 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 ; 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" } ;
|
||||
90
grammars/numerals/old/sorani.gf
Normal file
90
grammars/numerals/old/sorani.gf
Normal file
@@ -0,0 +1,90 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 Digit = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str ; size : Size} ;
|
||||
|
||||
lin num x0 =
|
||||
{s = "/A" ++ x0.s ++ "A/"} ; -- the Arabic environment
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Lin Digit =
|
||||
\dwA -> \cl -> \dwwls ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; hund => dwA + "sAd" ;
|
||||
kilurrest => "dummy" ; kilurresthAzar => "dummy" } ; size = less500};
|
||||
|
||||
oper mkNum6 : Str -> Str -> Str -> Str -> Str -> Lin Digit =
|
||||
\dwA -> \cl -> \dwwls -> \pEn -> \rest ->
|
||||
{s = table {unit => dwA ; ten => cl ; teen => dwwls ; hund => pEn + "sAd" ;
|
||||
kilurrest => rest + "sAd" ; kilurresthAzar => rest + "sAd" ++ "hAzar"} ; size = fiveup} ;
|
||||
|
||||
-- lin n1 mkNum "yAk" "dA" variants { "yazdA" ; "yanzA"} [] ;
|
||||
lin n2 = mkNum "dW" "bIst" (variants { "dwwazdA" ; "dwwanzA" }) ;
|
||||
lin n3 = mkNum "sE" "sI" (variants { "sEzdA" ; "syanzA" }) ;
|
||||
lin n4 = mkNum "Cwwar" "Pl" "CwwardA" ;
|
||||
lin n5 = {s = table {unit => "pEnj" ;
|
||||
ten => "pAnja" ;
|
||||
teen => (variants { "pazdA" ; "panzA" }) ;
|
||||
hund => "pEn" + "sAd";
|
||||
kilurrest => [] ;
|
||||
kilurresthAzar => [] } ;
|
||||
size = fiveup } ;
|
||||
|
||||
lin n6 = mkNum6 "cAc" "cAst" (variants { "cazdA"; "canzA"}) "cAc" [] ;
|
||||
lin n7 = mkNum6 "HAwt" "HAfta" "HAFdA" "HAw" "dW" ;
|
||||
lin n8 = mkNum6 "hAct" "hActa" "hAZdA" "hAc" "sE" ;
|
||||
lin n9 = mkNum6 "nO" "nAwAd" "nOzdA" "nO" "Cwwar" ;
|
||||
|
||||
oper ss : Str -> {s : Str ; size : Size} = \s -> {s = s ; size = less500} ;
|
||||
|
||||
lin pot01 = {s = table {unit => "yAk" ; hund => "sAd" ; _ => "dummy" } ; size = sg } ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; size = d.size} ;
|
||||
lin pot110 = ss "dA" ;
|
||||
lin pot111 = ss (variants { "yazdA" ; "yanzA"});
|
||||
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) ++ "w" ++ (e.s ! unit); size = less500} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = "dummy" ; size = n.size } ;
|
||||
lin pot2 d = {s = d.s ! hund ; s2 = "klWr" ++ d.s ! kilurresthAzar ; size = isover500 d.size} ;
|
||||
lin pot2plus d e =
|
||||
{s = d.s ! hund ++ e.s ;
|
||||
s2 = "klWr" ++ d.s ! kilurrest ++ (mkhAzar e.s "dummy") ! 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 => "hAzar" ;
|
||||
fiveup => attr ++ "hAzar" ;
|
||||
less500 => attr ++ "hAzar" ;
|
||||
more500 => kilur} ;
|
||||
|
||||
|
||||
|
||||
|
||||
63
grammars/numerals/old/spanish.gf
Normal file
63
grammars/numerals/old/spanish.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten | hundred | veinti ;
|
||||
param Size = sg | two | pl ;
|
||||
param Uso = indep | attr ;
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str ; size : Size } ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size } ;
|
||||
lincat Sub100 = {s : Uso => Str ; size : Size} ;
|
||||
lincat Sub1000 = {s : Uso => Str ; size : Size} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
|
||||
oper mkNum : Str -> Str -> Str -> Str -> Lin Digit =
|
||||
\dois -> \doze -> \vinte -> \duzentos ->
|
||||
{s = table {unit => dois ; teen => doze ; ten => vinte ; hundred => duzentos ;veinti => "veinti" + dois } ; size = pl} ;
|
||||
|
||||
|
||||
lin num x0 =
|
||||
{s = x0.s} ;
|
||||
|
||||
lin n2 = {s = table {unit => "dos" ; teen => "doce" ; ten => "veinte" ; hundred => "doscientos" ; veinti => "veinti" + "dos" } ; size = two } ;
|
||||
lin n3 = mkNum "tres" "trece" "treinta" "trescientos" ;
|
||||
lin n4 = mkNum "cuatro" "catorce" "cuarenta" "cuatrocientos" ;
|
||||
lin n5 = mkNum "cinco" "quince" "cincuenta" "quinientos" ;
|
||||
lin n6 = {s = table {unit => "seis" ; teen => "dieciseís" ; ten => "sesenta" ; hundred => "seiscientos" ; veinti => "veinti" + "seís" } ; size = pl } ;
|
||||
lin n7 = mkNum "siete" "diecisiete" "setenta" "setecientos" ;
|
||||
lin n8 = mkNum "ocho" "dieciocho" "ochenta" "ochocientos" ;
|
||||
lin n9 = mkNum "nueve" "diecinueve" "noventa" "novecientos" ;
|
||||
|
||||
lin pot01 = {s = table {unit => "uno" ; hundred => "cien" ; veinti => "veinti" + "uno" ; _ => "dummy"} ; size = sg} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "diez" } ; size = pl} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "once" } ; size = pl} ;
|
||||
lin pot1to19 d =
|
||||
{s = table {_ => d.s ! teen } ; size = pl} ;
|
||||
lin pot0as1 n =
|
||||
{s = table {indep => n.s ! unit ; attr => shorten (n.s ! unit) n.size }; size = n.size } ;
|
||||
lin pot1 d =
|
||||
{s = table {_ => d.s ! ten } ; size = pl} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {indep => table {two => e.s ! veinti ; _ => d.s ! ten ++ "y" ++ e.s ! unit} ! d.size ; attr => table {two => accent (e.s ! veinti) e.size ; _ => d.s ! ten ++ "y" ++ (shorten (e.s ! unit) e.size)} ! d.size } ; size = pl} ;
|
||||
lin pot1as2 n =
|
||||
{s = table {f => n.s ! f } ; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {_ => d.s ! hundred } ; size = pl} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {f => table {sg => "ciento" ;
|
||||
_ => d.s ! hundred } ! d.size ++ e.s ! f} ; size = pl} ;
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indep } ;
|
||||
lin pot3 n =
|
||||
{s = table {sg => "mil" ; _ => n.s ! attr ++ "mil"} ! n.size} ;
|
||||
lin pot3plus n m =
|
||||
{s = table {sg => "mil" ; _ => n.s ! attr ++ "mil"} ! n.size ++ m.s ! indep} ;
|
||||
|
||||
oper accent : Str -> Size -> Str = \s -> \sz ->
|
||||
table {sg => "veintiún" ; _ => s} ! sz ;
|
||||
|
||||
oper shorten : Str -> Size -> Str = \s -> \sz ->
|
||||
table {sg => "un" ; _ => s} ! sz ;
|
||||
72
grammars/numerals/old/swiss_french.gf
Normal file
72
grammars/numerals/old/swiss_french.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | teen | ten ;
|
||||
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" ; ten => "vingt" }} ;
|
||||
lin n3 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "trois" ; teen => "treize" ; ten => "trente" }} ;
|
||||
lin n4 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "quatre" ; teen => "quatorze" ; ten => "quarante" }} ;
|
||||
lin n5 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "cinq" ; teen => "quinze" ; ten => "cinquante" }} ;
|
||||
lin n6 =
|
||||
{inh = unit ; inh1 = sg ; s = table {unit => "six" ; teen => "seize" ; ten => "soixante" }} ;
|
||||
lin n7 =
|
||||
{inh = teen ; inh1 = sg ; s = table {unit => "sept" ; teen => "dix" ++ "-" ++ "sept" ; ten => "septante" }} ;
|
||||
lin n8 =
|
||||
{inh = unit ; inh1 = pl ; s = table {unit => "huit" ; teen => "dix" ++ "-" ++ "huit" ; ten => "huitante" }} ;
|
||||
lin n9 =
|
||||
{inh = teen ; inh1 = pl ; s = table {unit => "neuf" ; teen => "dix" ++ "-" ++ "neuf" ; ten => "nonante" }} ;
|
||||
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 = ten ; p2 = indep} => "dix" ;
|
||||
{p1 = ten ; 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 = ten ; p2 = indep} => d.s ! ten ;
|
||||
{p1 = ten ; p2 = attr} => d.s ! ten }} ;
|
||||
|
||||
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 ! {p1 = d.inh ; 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 ! {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} ;
|
||||
166
grammars/numerals/old/tamil.gf
Normal file
166
grammars/numerals/old/tamil.gf
Normal file
@@ -0,0 +1,166 @@
|
||||
-- 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 ;
|
||||
|
||||
oper
|
||||
vowel : Strs = strs {"o" ; "e" ; "a" ; "i" ; "u"} ;
|
||||
labial : Strs = strs {"m" ; "p"} ;
|
||||
retroflex : Strs = strs {"N" ; "T"} ;
|
||||
sandhi_u : Str = pre {"u" ; [] / vowel} ;
|
||||
sandhi_n : Str = pre {"n" ; "m" / labial} ;
|
||||
sandhi_spc_n : Str = pre {"n" ; "p" / labial} ;
|
||||
-- sandhi_N : Str = post {"n" ; "N" / 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 = "/T" ++ x0.s ++ "T/"} ; -- the Tamil environment
|
||||
|
||||
lin n2 =
|
||||
{s = table {teen => "panniraNTu" ;
|
||||
unit => "iraNT" + sandhi_u ;
|
||||
attr1 => "iru" ;
|
||||
attr2 => variants {"iraNT" + sandhi_u ; "i:r"} } ; size = less100} ;
|
||||
lin n3 =
|
||||
{s = table {teen => "patin" + "mu:nru" ;
|
||||
unit => "mu:nr" + sandhi_u ;
|
||||
attr1 => "mu" + sandhi_spc_n ;
|
||||
attr2 => "mu:l"} ; size = less100} ;
|
||||
lin n4 =
|
||||
{s = table {teen => "pati" + variants { "Va:lu" ; "Va:nku" } ;
|
||||
unit => variants { "Va:l" + sandhi_u ; "Va:nk" + sandhi_u } ;
|
||||
attr1 => "Va:r" ;
|
||||
attr2 => "Va:l"} ; size = four} ;
|
||||
lin n5 =
|
||||
{s = table {teen => "patin" + "aindu" ;
|
||||
unit => "aint" + sandhi_u ;
|
||||
attr1 => "ai" + sandhi_n ;
|
||||
attr2 => "aiy"} ; size = five} ;
|
||||
lin n6 =
|
||||
{s = table {teen => "patin" + "a:ru" ;
|
||||
unit => "a:r" + sandhi_u ;
|
||||
attr1 => "aru" ;
|
||||
attr2 => "a:r"} ; size = less100} ;
|
||||
lin n7 =
|
||||
{s = table {teen => "patin" + "e:Lu" ;
|
||||
unit => "e:L" + sandhi_u ;
|
||||
attr1 => "eLu" ;
|
||||
attr2 => "eL"} ; size = less100} ;
|
||||
lin n8 =
|
||||
{s = table {teen => "patin" + "eTTu" ;
|
||||
unit => "eTT" + sandhi_u ;
|
||||
attr1 => "eN" ;
|
||||
attr2 => "eNN"} ; size = eight} ;
|
||||
lin n9 =
|
||||
{s = table {teen => "patt" + "o:npatu" ;
|
||||
unit => "o:npat" + sandhi_u ;
|
||||
attr1 => "toN" ;
|
||||
attr2 => "o:npatin"} ; size = nine} ;
|
||||
|
||||
oper fiveh : Str = variants { "ainna:ru" ; "añña:ru"} ;
|
||||
oper fiveh_sandhi : Str = variants { "ainna:r" + sandhi_u ; "añña:r" + sandhi_u } ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {unit => "o:nru"; teen => "patin" + "o:nru" ; attr1 => "o:r" + sandhi_u ; attr2 => []} ; size = sg} ;
|
||||
lin pot0 d =
|
||||
{s = d.s ; size = d.size} ;
|
||||
lin pot110 =
|
||||
{s = table {_ => "pattu"} ; size = less100} ;
|
||||
lin pot111 =
|
||||
{s = table {_ => "patin" + "o:nr" + 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 => "toNNa:r" + sandhi_u ; _ => d.s ! attr1 ++ "patu"} ! d.size} ; size = less100} ;
|
||||
lin pot1plus d e =
|
||||
{s = table {_ => table {nine => ("toNNa:r" + sandhi_u) ++ e.s ! unit; _ => d.s ! attr1 ++ "pat" + 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 ; _ => "dummy"}; size = n.size} ;
|
||||
lin pot2 d =
|
||||
{s = table {indeptwo =>
|
||||
table {nine => "toLLa:yiram" ;
|
||||
eight => "eNNa:ru" ;
|
||||
four => "Va:Va:ru" ;
|
||||
five => fiveh ;
|
||||
sg => "Va:ru" ;
|
||||
_ => d.s ! attr1 ++ "Va:ru"} ! d.size ;
|
||||
attrtwo =>
|
||||
table {nine => "toLLa:yiratt" + sandhi_u ;
|
||||
eight => "eNNa:r" + sandhi_u ;
|
||||
four => "Va:Va:r" + sandhi_u;
|
||||
five => fiveh_sandhi ;
|
||||
_ => d.s ! attr1 ++ "Va:r" + sandhi_u} ! d.size ;
|
||||
preceded =>
|
||||
table {nine => "toLLa:yiram" ;
|
||||
eight => "eNNa:ru" ;
|
||||
four => "Va:Va:ru" ;
|
||||
five => fiveh ;
|
||||
_ => d.s ! attr1 ++ "Va:ru"} ! d.size ;
|
||||
lakhs => d.s ! unit ++ "ilaTcam" ;
|
||||
lakhs2 => d.s ! unit ++ "ilaTcattu" } ;
|
||||
size = more100} ;
|
||||
lin pot2plus d e =
|
||||
{s = table {indeptwo =>
|
||||
table {nine => ("toLLa:yiratt" + sandhi_u) ;
|
||||
eight => ("eNNa:r" + sandhi_u) ;
|
||||
four => ("Va:Va:r" + sandhi_u) ;
|
||||
five => fiveh_sandhi ;
|
||||
sg => ("Va:r" + sandhi_u) ;
|
||||
_ => d.s ! attr1 ++ ("Va:r" + sandhi_u) } ! d.size ++ e.s ! indep ;
|
||||
attrtwo =>
|
||||
table {nine => ("toLLa:yiratt" + sandhi_u) ;
|
||||
eight => ("eNNa:r" + sandhi_u) ;
|
||||
four => ("Va:Va:r" + sandhi_u) ;
|
||||
five => fiveh_sandhi ;
|
||||
sg => ("Va:r" + sandhi_u) ;
|
||||
_ => d.s ! attr1 ++ ("Va:r" + sandhi_u) } ! d.size ++ e.s ! indep ;
|
||||
preceded =>
|
||||
table {nine => ("toLLa:yiratt" + sandhi_u) ;
|
||||
eight => ("eNNa:r" + sandhi_u) ;
|
||||
four => ("Va:Va:r" + sandhi_u) ;
|
||||
five => fiveh_sandhi ;
|
||||
_ => d.s ! attr1 ++ ("Va:r" + sandhi_u) } ! d.size ++ e.s ! indep ;
|
||||
lakhs => d.s ! unit ++ ("ilaTcatt" + sandhi_u) ++
|
||||
table {sg => "a:yiram" ; _ => e.s ! attr ++ "a:yiram" } ! e.size ;
|
||||
lakhs2 => d.s ! unit ++ ("ilaTcatt" + sandhi_u) ++
|
||||
table {sg => "a:yiratt" + sandhi_u ; _ => e.s ! attr ++ ("a:yiratt" + sandhi_u) } ! e.size} ; size = more100} ;
|
||||
|
||||
lin pot2as3 n =
|
||||
{s = n.s ! indeptwo} ;
|
||||
lin pot3 n =
|
||||
{s = table {sg => "a:yiram" ;
|
||||
more100 => n.s ! lakhs ;
|
||||
_ => n.s ! attrtwo ++ "a:yiram" } ! n.size } ;
|
||||
|
||||
lin pot3plus n m =
|
||||
{s = table {sg => "a:yiratt" + sandhi_u;
|
||||
more100 => n.s ! lakhs2 ;
|
||||
_ => n.s ! attrtwo ++ "a:yiratt" + sandhi_u } ! n.size ++ m.s ! preceded} ;
|
||||
|
||||
48
grammars/numerals/old/tibetan.gf
Normal file
48
grammars/numerals/old/tibetan.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | ten | teen ;
|
||||
|
||||
-- Have no idea about the orthography, taken from Univ. History of Numbers
|
||||
-- Georges Ifrah p. 26
|
||||
|
||||
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
|
||||
oper mkNum : Str -> Lin Digit =
|
||||
\gnyis ->
|
||||
{s = table {unit => gnyis ; teen => "bcu" ++ gnyis ; ten => gnyis ++ "bcu" }} ;
|
||||
|
||||
-- lin n1 mkNum "gcig" ;
|
||||
lin n2 = mkNum "gnyis" ;
|
||||
lin n3 = mkNum "gsum" ;
|
||||
lin n4 = mkNum "bzhi" ;
|
||||
lin n5 = mkNum "lnga" ;
|
||||
lin n6 = mkNum "drug" ;
|
||||
lin n7 = mkNum "bdun" ;
|
||||
lin n8 = mkNum "brgyad" ;
|
||||
lin n9 = mkNum "dgu" ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
|
||||
lin pot01 = {s = table {f => "gcig"}} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f}} ;
|
||||
lin pot110 = ss "bcu" ;
|
||||
lin pot111 = ss ("bcu" ++ "gcig");
|
||||
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 ++ "brgya"} ;
|
||||
lin pot2plus d e = {s = d.s ! unit ++ "brgya" ++ e.s} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = n.s ++ "thousand"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ;
|
||||
|
||||
-- Don't know the word for thousand
|
||||
|
||||
|
||||
|
||||
|
||||
108
grammars/numerals/old/totonac.gf
Normal file
108
grammars/numerals/old/totonac.gf
Normal file
@@ -0,0 +1,108 @@
|
||||
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 } ;
|
||||
|
||||
|
||||
|
||||
|
||||
48
grammars/numerals/old/transNum.gfs
Normal file
48
grammars/numerals/old/transNum.gfs
Normal file
@@ -0,0 +1,48 @@
|
||||
i -old -abs=Nums numerals.Dec.gf
|
||||
i -old -abs=Nums amharic.gf
|
||||
i -old -abs=Nums basque.gf
|
||||
i -old -abs=Nums biblical_hebrew.gf
|
||||
i -old -abs=Nums classical_arabic.gf
|
||||
i -old -abs=Nums classical_greek.gf
|
||||
i -old -abs=Nums croatian.gf
|
||||
i -old -abs=Nums geez.gf
|
||||
i -old -abs=Nums hindi.gf
|
||||
i -old -abs=Nums hungarian.gf
|
||||
i -old -abs=Nums icelandic.gf
|
||||
i -old -abs=Nums irish.gf
|
||||
i -old -abs=Nums italian.gf
|
||||
i -old -abs=Nums japanese.gf
|
||||
i -old -abs=Nums khowar.gf
|
||||
i -old -abs=Nums korean.gf
|
||||
i -old -abs=Nums kulung.gf
|
||||
i -old -abs=Nums modern_greek.gf
|
||||
i -old -abs=Nums mongolian.gf
|
||||
i -old -abs=Nums numerals.Ara.gf
|
||||
i -old -abs=Nums numerals.ChiU.gf
|
||||
i -old -abs=Nums numerals.Dan.gf
|
||||
i -old -abs=Nums numerals.Deu.gf
|
||||
i -old -abs=Nums numerals.Eng.gf
|
||||
i -old -abs=Nums numerals.Fra.gf
|
||||
i -old -abs=Nums numerals.Malay.gf
|
||||
i -old -abs=Nums numerals.Ned.gf
|
||||
i -old -abs=Nums numerals.NorB.gf
|
||||
i -old -abs=Nums numerals.Rus.gf
|
||||
i -old -abs=Nums numerals.Suo.gf
|
||||
i -old -abs=Nums numerals.Swe.gf
|
||||
i -old -abs=Nums numerals.Tam.gf
|
||||
i -old -abs=Nums old_church_slavonic.gf
|
||||
i -old -abs=Nums pashto.gf
|
||||
i -old -abs=Nums polish.gf
|
||||
i -old -abs=Nums portuguese.gf
|
||||
i -old -abs=Nums quechua.gf
|
||||
i -old -abs=Nums romanian.gf
|
||||
i -old -abs=Nums sanskrit.gf
|
||||
i -old -abs=Nums slovak.gf
|
||||
i -old -abs=Nums sorani.gf
|
||||
i -old -abs=Nums spanish.gf
|
||||
i -old -abs=Nums swiss_french.gf
|
||||
i -old -abs=Nums tamil.gf
|
||||
i -old -abs=Nums tibetan.gf
|
||||
i -old -abs=Nums totonac.gf
|
||||
i -old -abs=Nums turkish.gf
|
||||
ts -f
|
||||
56
grammars/numerals/old/turkish.gf
Normal file
56
grammars/numerals/old/turkish.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
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 Digit = {s : DForm => Str } ;
|
||||
lincat Sub10 = {s : DForm => Str ; size : Size} ;
|
||||
lincat Sub100 = {s : Str ; size : Size } ;
|
||||
lincat Sub1000 = {s : Str ; size : Size } ;
|
||||
|
||||
oper mkNum : Str -> Str -> Lin Digit =
|
||||
\iki -> \yirmi ->
|
||||
{s = table {unit => iki ; teen => (variants {"on" + iki ; "on" ++ iki}) ; ten => yirmi } } ;
|
||||
|
||||
lin num x = {s = "/L" ++ x.s ++ "L/" } ;
|
||||
|
||||
-- lin n1 mkNum "bir" "dA" ;
|
||||
lin n2 = mkNum "iki" "yirmi" ;
|
||||
lin n3 = mkNum "üç" "otuz" ;
|
||||
lin n4 = mkNum "dört" "kIrk" ;
|
||||
lin n5 = mkNum "bes," "elli" ;
|
||||
lin n6 = mkNum "altI" "altmIs," ;
|
||||
lin n7 = mkNum "yedi" "yetmis," ;
|
||||
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} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user