mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-06 17:52:51 -06:00
Harald's new grammars.
This commit is contained in:
@@ -1,47 +1,64 @@
|
||||
include numerals.Abs.gf ;
|
||||
|
||||
param DForm = unit | ten | teen ;
|
||||
oper bind : Str -> Str -> Str = \s1 -> \s2 -> s1 ++ s2;
|
||||
|
||||
-- Have no idea about the orthography, taken from Univ. History of Numbers
|
||||
-- Georges Ifrah p. 26
|
||||
param DForm = unit | teen | bform | ten | hundred | agg ;
|
||||
|
||||
-- Sorry no tibetan script but the adhoc transliteration should be phonematic
|
||||
-- 21 has an extra variant namely nyerchi'
|
||||
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
oper LinDigit = {s : DForm => Str} ;
|
||||
|
||||
oper mkNum : Str -> Lin Digit =
|
||||
\gnyis ->
|
||||
{s = table {unit => gnyis ; teen => "bcu" ++ gnyis ; ten => gnyis ++ "bcu" }} ;
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
lincat Sub100 = {s : Str ; s2 : Str} ;
|
||||
lincat Sub1000 = {s : Str ; s2 : Str} ;
|
||||
|
||||
-- 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 mkNum : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\u -> \tn -> \b -> \t ->
|
||||
{s = table {unit => u ; teen => tn ; bform => b + "chu" ; ten => t ; hundred => b + "g~ya" ; agg => "t.'a'" ++ u}} ;
|
||||
|
||||
oper ss : Str -> {s : Str} = \s -> {s = s} ;
|
||||
-- lin n1 mkNum "chi'" "chug/chi'" ;
|
||||
lin n2 =
|
||||
{s = table {unit => "n~yi:" ; teen => "chug/n~yi:" ; ten => "tsag/" ;
|
||||
bform => "nyishu" ; hundred => (variants {"nyibg~ya"; "nyi:bg~ya"}) ;
|
||||
agg => "t.'a'" ++ "n~yi:" } };
|
||||
lin n3 = mkNum "sum" "chug/sum" "sum" "sog/" ;
|
||||
lin n4 = mkNum "z~hyi" "chubz~hyi" (variants {"z~hyib" ; "z~hib"}) "z/hye" ;
|
||||
lin n5 = mkNum "n~ga" "chö:n~ga" "n~gab" "nga" ;
|
||||
lin n6 = mkNum "d.u'" "chud.u'" "d.ug/" "re";
|
||||
lin n7 = mkNum "d~ün" "chubd~ün" "d~ün" "d/ön";
|
||||
lin n8 = mkNum "g~yä'" "chobg~yä'" "g~yä'" "g/ya";
|
||||
lin n9 = mkNum "g~u" "chug~u" "g~ub" "g/o";
|
||||
|
||||
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} ;
|
||||
oper dang : Str = "d/ang" ;
|
||||
oper tampa : Str -> Str = \s -> (variants {s; s ++ "t'ampa"});
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = n.s ++ "thousand"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ;
|
||||
lin num x = {s = "/X" ++ x.s ++ "X/" }; -- extra diacritics translation
|
||||
|
||||
-- Don't know the word for thousand
|
||||
lin pot01 =
|
||||
{s = table {hundred => "g~ya" ; agg => (variants {[] ; "t'a'"}) ; _ => "chi'"}} ;
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = tampa "chu" ; s2 = variants {"t.'i" ; "t.'it.'a'"}} ;
|
||||
lin pot111 =
|
||||
{s = "chug/chi'" ;
|
||||
s2 = variants {"t.'i" ; "t.'it.'a'"} ++ dang ++ variants {"t~ong'i" ; "t~ongt.'a'"}} ;
|
||||
lin pot1to19 d = {s = d.s ! teen ; s2 = variants {"t.'i" ; "t.'it.'a'"} ++ mkagg (d.s ! agg) "t~ong"} ;
|
||||
lin pot0as1 n = {s = n.s ! unit ; s2 = mkagg (n.s ! agg) "t~ong"} ;
|
||||
lin pot1 d = {s = tampa (d.s ! bform) ; s2 = mkagg (d.s ! agg) "t.'i"} ;
|
||||
lin pot1plus d e =
|
||||
{s = variants { d.s ! bform ++ (bind (d.s ! ten) (e.s ! unit)) ;
|
||||
(bind (d.s ! ten) (e.s ! unit))} ;
|
||||
s2 = mkagg (d.s ! agg) "t.'i" ++ dang ++ mkagg (e.s ! agg) "t~ong"} ;
|
||||
lin pot1as2 n = {s = n.s ; s2 = n.s2 } ;
|
||||
lin pot2 d = {s = d.s ! hundred ; s2 = mkagg (d.s ! agg) "b~um" } ;
|
||||
lin pot2plus d e = {s = d.s ! hundred ++ dang ++ e.s ;
|
||||
s2 = mkagg (d.s ! agg) "b~um" ++ dang ++ e.s2} ;
|
||||
lin pot2as3 n = {s = n.s } ;
|
||||
lin pot3 n = {s = n.s2 } ;
|
||||
lin pot3plus n m = {s = n.s2 ++ dang ++ m.s} ;
|
||||
|
||||
oper mkagg : Str -> Str -> Str = \attr -> \s -> bind s attr ;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user