From 8c3375b67b4c44b7722e31bf0b73334ac921d9ca Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Fri, 20 Jan 2023 18:53:41 +0100 Subject: [PATCH] minimal extension to the Numeral API --- src/chinese/NumeralChi.gf | 4 +++- src/russian/NumeralRus.gf | 5 ++++- src/thai/NumeralTha.gf | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/chinese/NumeralChi.gf b/src/chinese/NumeralChi.gf index 4ac534b92..52bb9076f 100644 --- a/src/chinese/NumeralChi.gf +++ b/src/chinese/NumeralChi.gf @@ -20,7 +20,7 @@ lincat Digit = {s,p : Str} ; -- s/p: without/with classifier (er/liang) lincat Sub10 = {s,p,t : Str} ; -- t: with "shi wan" lincat Sub100 = {end0,beg0 : Zero ; s,p : Bform => Str} ; -- end0: ends with zeros, e.g. 20 ; beg0: begins with zeros, e.g. 02 lincat Sub1000 = {end0,beg0 : Zero ; s,p : Qform => Str} ; -- end0: ends with zeros, e.g. 210 ; beg0: begins with zeros, e.g. 021 -lincat Sub1000000 = {s,p : Str} ; +lincat Sub1000000, Sub1000000000, Sub1000000000000 = {s,p : Str} ; lin num x0 = x0 ; -- 一二三四五六七八九十一百千 @@ -137,7 +137,9 @@ lin pot3 n = {s,p = n.s ! shiwan} ; lin pot3plus n m = {s,p = (n.s ! shiwan0) ++ (ling ! ) ++ m.s ! bai0} ; +lin pot3as4 n = n ; +lin pot4as5 n = n ; -- numerals as sequences of digits diff --git a/src/russian/NumeralRus.gf b/src/russian/NumeralRus.gf index 8a9e04d0f..889212e3a 100644 --- a/src/russian/NumeralRus.gf +++ b/src/russian/NumeralRus.gf @@ -11,7 +11,7 @@ lincat Digit = {s : DForm => DetTable ; size : NumSize ; o : DForm => PronForms} lincat Sub10 = {s : Place => DForm => DetTable ; size : NumSize ; o : Place => DForm => PronForms ; just1 : Bool} ; lincat Sub100 = {s : Place => DetTable ; size : NumSize ; o : Place => PronForms; just1 : Bool} ; lincat Sub1000 = {s : Place => DetTable ; size : NumSize ; o : Place => PronForms; just1 : Bool} ; -lincat Sub1000000 = {s : DetTable ; size : NumSize ; o : PronForms; just1 : Bool} ; +lincat Sub1000000, Sub1000000000, Sub1000000000000 = {s : DetTable ; size : NumSize ; o : PronForms; just1 : Bool} ; -- just1 to correctly generate exactly 1000 -- : Sub1000000 -> Numeral ; -- 123456 [coercion to top category] @@ -403,6 +403,9 @@ lin pot3plus n m = { just1 = False ; size = Num5 } ; +lin pot3as4 n = n ; + +lin pot4as5 n = n ; -- numerals as sequences of digits diff --git a/src/thai/NumeralTha.gf b/src/thai/NumeralTha.gf index 945110684..347006a14 100644 --- a/src/thai/NumeralTha.gf +++ b/src/thai/NumeralTha.gf @@ -8,7 +8,7 @@ lincat Sub10 = {s : DForm => Str} ; Sub100 = {s : NForm => Str} ; Sub1000 = {s : NForm => Str} ; - Sub1000000 = {s : Str} ; + Sub1000000, Sub1000000000, Sub1000000000000 = {s : Str} ; lin num x = x ; @@ -49,6 +49,9 @@ lin pot2as3 n = {s = n.s ! Unit} ; pot3 n = {s = n.s ! Thousand} ; pot3plus n m = {s = thbind (n.s ! Thousand) (m.s ! Unit)} ; + pot3as4 n = n ; + + pot4as5 n = n ; param DForm = Indep | ModTen | After ;