diff --git a/lib/resource/arabic/CatAra.gf b/lib/resource/arabic/CatAra.gf index c298ffe01..89d9ef5e1 100644 --- a/lib/resource/arabic/CatAra.gf +++ b/lib/resource/arabic/CatAra.gf @@ -49,9 +49,9 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { Num, Ord = {s : Gender => State => Case => Str ; n : Size }; Predet = ResAra.Predet ; - QuantSg, QuantPl = - {s : Species => Gender => Case => Str; - n : ResAra.Number; d : State; isNum : Bool} ; +--- DEPREC QuantSg, QuantPl = +--- {s : Species => Gender => Case => Str; +--- n : ResAra.Number; d : State; isNum : Bool} ; Det = ResAra.Det ; -- {s : Species => Gender => Case => Str ; d : State; n : Size; isNum : Bool } ; Quant = {s : ResAra.Number => Species => Gender => Case => Str; d : State} ; @@ -62,7 +62,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { -- Numeral - Numeral = {s : Gender => State => Case => Str ; + Numeral,Digits = {s : Gender => State => Case => Str ; n : Size } ; diff --git a/lib/resource/arabic/NounAra.gf b/lib/resource/arabic/NounAra.gf index a238b673c..69a6b35e7 100644 --- a/lib/resource/arabic/NounAra.gf +++ b/lib/resource/arabic/NounAra.gf @@ -38,16 +38,19 @@ concrete NounAra of Noun = CatAra ** open ResAra, Prelude in { } ; DetSg quant ord = { - s = quant.s ; --++ ord.s + s = \\h,g,c => + quant.s ! Sg ! h ! g ! c ; + ---- s = quant.s ; --++ ord.s -- AR 18/12/2007 n = One; d = quant.d; - isNum = quant.isNum + isNum = False ---- quant.isNum } ; DetPl quant num ord = { s = \\h,g,c => - quant.s ! h ! g ! c ++ num.s ! g ! (toDef quant.d num.n) ! c ; + quant.s ! Pl ! h ! g ! c ++ -- AR 18/12/2007 ?? + num.s ! g ! (toDef quant.d num.n) ! c ; n = num.n; d = quant.d; isNum = @@ -57,8 +60,9 @@ concrete NounAra of Noun = CatAra ** open ResAra, Prelude in { }; } ; - SgQuant quant = {s = quant.s ! Sg ; n = Sg; d = quant.d; isNum = False} ; - PlQuant quant = {s = quant.s ! Pl ; n = Pl; d = quant.d; isNum = False} ; +--- DEPREC +--- SgQuant quant = {s = quant.s ! Sg ; n = Sg; d = quant.d; isNum = False} ; +--- PlQuant quant = {s = quant.s ! Pl ; n = Pl; d = quant.d; isNum = False} ; -- PossPron p = {s = \\_ => p.s ! Gen} ; @@ -80,7 +84,7 @@ concrete NounAra of Noun = CatAra ** open ResAra, Prelude in { IndefArt = {s = \\_,_,_,_ => []; d = Indef} ; - MassDet = {s = \\_,_,_ => [] ; n = Sg; d = Indef; isNum = False} ; + MassDet = {s = \\_,_,_,_ => [] ; n = Sg; d = Indef; isNum = False} ; UseN n = n ; -- UseN2 n = n ; diff --git a/lib/resource/arabic/StructuralAra.gf b/lib/resource/arabic/StructuralAra.gf index 18fd36cbd..5b6ac1db4 100644 --- a/lib/resource/arabic/StructuralAra.gf +++ b/lib/resource/arabic/StructuralAra.gf @@ -56,7 +56,7 @@ concrete StructuralAra of Structural = CatAra ** -- } ; no_Phr = ss "لا" ; on_Prep = ss "عَلى" ; - one_Quant = mkQuantNum "واحِد" Sg Indef ; +--- DEPREC one_Quant = mkQuantNum "واحِد" Sg Indef ; only_Predet = mkPredet "فَقَط" False; -- or_Conj = ss "ْر" ** {n = Sg} ; -- otherwise_PConj = ss "ْتهروِسي" ; diff --git a/lib/resource/catalan/NumeralCat.gf b/lib/resource/catalan/NumeralCat.gf index 38ff23eb4..7a2dcb289 100644 --- a/lib/resource/catalan/NumeralCat.gf +++ b/lib/resource/catalan/NumeralCat.gf @@ -128,4 +128,42 @@ lin param DForm = unit | teen | ten | tenplus | Aunit | OrdF ; +-- numerals as sequences of digits + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard Masc ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1:o" Sg ; ---- gender + D_2 = mk2Dig "2" "2:o" ; + D_3 = mk2Dig "3" "3:o" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ _ => o} ; ---- gender + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + } diff --git a/lib/resource/catalan/StructuralCat.gf b/lib/resource/catalan/StructuralCat.gf index 296989ec7..c2f65a079 100644 --- a/lib/resource/catalan/StructuralCat.gf +++ b/lib/resource/catalan/StructuralCat.gf @@ -32,7 +32,7 @@ lin everything_NP = pn2np (mkPN ["tot"] Masc) ; everywhere_Adv = ss ["a tot arreu"] ; few_Det = {s = \\g,c => prepCase c ++ genForms "pocs" "poques" ! g ; n = Pl} ; - first_Ord = {s = \\ag => (regA "primer").s ! Posit ! AF ag.g ag.n} ; +--- first_Ord = {s = \\ag => (regA "primer").s ! Posit ! AF ag.g ag.n} ; from_Prep = complGen ; --- he_Pron = mkPronoun @@ -66,7 +66,7 @@ lin -- must_VV = mkVV (verbV (deber_6 "deber")) ; no_Phr = ss "no" ; on_Prep = mkPreposition "sobre" ; - one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "una" ! g} ; +--- one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "una" ! g} ; only_Predet = {s = \\_,c => prepCase c ++ "noms" ; c = Nom} ; or_Conj = {s = "o" ; n = Sg} ; otherwise_PConj = ss "altrament" ; diff --git a/lib/resource/danish/NumeralDan.gf b/lib/resource/danish/NumeralDan.gf index 93433d8e5..b8846c8ef 100644 --- a/lib/resource/danish/NumeralDan.gf +++ b/lib/resource/danish/NumeralDan.gf @@ -51,13 +51,13 @@ lin n9 = mkTal "ni" "nitten" "halvfems" "niende" "halvfemsindstyvende" ; IDig d = d ; IIDig d i = { - s = \\o => d.s ! o ++ i.s ! o ; + s = \\o => d.s ! NCard neutrum ++ i.s ! o ; n = Pl } ; D_0 = mkDig "0" ; - D_1 = mk3Dig "1" "1e" Sg ; - D_2 = mk2Dig "2" "2e" ; + D_1 = mk3Dig "1" "1:e" Sg ; + D_2 = mk2Dig "2" "2:e" ; D_3 = mkDig "3" ; D_4 = mkDig "4" ; D_5 = mkDig "5" ; @@ -68,7 +68,7 @@ lin n9 = mkTal "ni" "nitten" "halvfems" "niende" "halvfemsindstyvende" ; oper mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; - mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":e") ; mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { s = table {NCard _ => c ; NOrd _ => o} ; diff --git a/lib/resource/english/NumeralEng.gf b/lib/resource/english/NumeralEng.gf index 0af833c56..2f7c8e553 100644 --- a/lib/resource/english/NumeralEng.gf +++ b/lib/resource/english/NumeralEng.gf @@ -51,7 +51,7 @@ lin pot3plus n m = { IDig d = d ** {tail = T1} ; IIDig d i = { - s = \\o => d.s ! o ++ commaIf i.tail ++ i.s ! o ; + s = \\o => d.s ! NCard ++ commaIf i.tail ++ i.s ! o ; n = Pl ; tail = inc i.tail } ; diff --git a/lib/resource/finnish/NumeralFin.gf b/lib/resource/finnish/NumeralFin.gf index 417ba74d4..6b20fe7a7 100644 --- a/lib/resource/finnish/NumeralFin.gf +++ b/lib/resource/finnish/NumeralFin.gf @@ -146,7 +146,7 @@ oper IDig d = d ; IIDig d i = { - s = \\o => d.s ! o ++ i.s ! o ; + s = \\o => d.s ! NCard (NCase Sg Nom) ++ i.s ! o ; n = Pl } ; diff --git a/lib/resource/french/NumeralFre.gf b/lib/resource/french/NumeralFre.gf index 0f9b57f3a..23a8ab43d 100644 --- a/lib/resource/french/NumeralFre.gf +++ b/lib/resource/french/NumeralFre.gf @@ -7,8 +7,8 @@ concrete NumeralFre of Numeral = CatFre ** -- Auxiliaries oper - digitPl : {s : DForm => Str; inh : DForm ; inh1 : Number} -> - {s : CardOrd => DForm => Str ; inh : DForm ; inh1 : Number} = \d -> { + digitPl : {s : DForm => Str; inh : DForm ; n : Number} -> + {s : CardOrd => DForm => Str ; inh : DForm ; n : Number} = \d -> { s = \\co,df => let ds = d.s ! df in case co of { NCard _ => ds ; @@ -18,7 +18,7 @@ oper _ => ds + "ime" } } ; - inh = d.inh ; inh1 = d.inh1 + inh = d.inh ; n = d.n } ; cardOrd : CardOrd -> Str -> Str -> Str = \co, x,y -> case co of { @@ -27,30 +27,30 @@ oper } ; lincat - Digit = {s : CardOrd => DForm => Str ; inh : DForm ; inh1 : Number} ; + Digit = {s : CardOrd => DForm => Str ; inh : DForm ; n : Number} ; Sub10 = {s : CardOrd => {p1 : DForm ; p2 : Place} => Str ; inh : Number} ; - Sub100 = {s : CardOrd => Place => Str} ; - Sub1000 = {s : CardOrd => Place => Str} ; - Sub1000000 = {s : CardOrd => Str} ; + Sub100 = {s : CardOrd => Place => Str ; n : Number} ; + Sub1000 = {s : CardOrd => Place => Str ; n : Number} ; + Sub1000000 = {s : CardOrd => Str ; n : Number} ; lin num x0 = x0 ; lin n2 = - digitPl {inh = unit ; inh1 = Sg ; s = table {unit => "deux" ; teen => "douze" ; jten => "vingt" ; ten => "vingt" ; tenplus => "vingt"}} ; + digitPl {inh = unit ; n = Sg ; s = table {unit => "deux" ; teen => "douze" ; jten => "vingt" ; ten => "vingt" ; tenplus => "vingt"}} ; lin n3 = - digitPl {inh = unit ; inh1 = Sg ; s = table {unit => "trois" ; teen => "treize" ; jten => "trente" ; ten => "trente" ; tenplus => "trente"}} ; + digitPl {inh = unit ; n = Sg ; s = table {unit => "trois" ; teen => "treize" ; jten => "trente" ; ten => "trente" ; tenplus => "trente"}} ; lin n4 = - digitPl {inh = unit ; inh1 = Sg ; s = table {unit => "quatre" ; teen => "quatorze" ; jten => "quarante" ; ten => "quarante" ; tenplus => "quarante"}} ; + digitPl {inh = unit ; n = Sg ; s = table {unit => "quatre" ; teen => "quatorze" ; jten => "quarante" ; ten => "quarante" ; tenplus => "quarante"}} ; lin n5 = - digitPl {inh = unit ; inh1 = Sg ; s = table {unit => "cinq" ; teen => "quinze" ; jten => "cinquante" ; ten => "cinquante" ; tenplus => "cinquante"}} ; + digitPl {inh = unit ; n = Sg ; s = table {unit => "cinq" ; teen => "quinze" ; jten => "cinquante" ; ten => "cinquante" ; tenplus => "cinquante"}} ; lin n6 = - digitPl {inh = unit ; inh1 = Sg ; s = table {unit => "six" ; teen => "seize" ; jten => "soixante" ; ten => "soixante" ; tenplus => "soixante"}} ; + digitPl {inh = unit ; n = Sg ; s = table {unit => "six" ; teen => "seize" ; jten => "soixante" ; ten => "soixante" ; tenplus => "soixante"}} ; lin n7 = - digitPl {inh = teen ; inh1 = Sg ; s = table {unit => "sept" ; teen => "dix-sept" ; jten => "soixante-dix" ; ten => "soixante-dix" ; tenplus => "soixante"}} ; + digitPl {inh = teen ; n = Sg ; s = table {unit => "sept" ; teen => "dix-sept" ; jten => "soixante-dix" ; ten => "soixante-dix" ; tenplus => "soixante"}} ; lin n8 = - digitPl {inh = unit ; inh1 = Pl ; s = table {unit => "huit" ; teen => "dix-huit" ; jten => "quatre-vingts" ; ten => "quatre-vingt" ; tenplus => "quatre-vingt"}} ; + digitPl {inh = unit ; n = Pl ; s = table {unit => "huit" ; teen => "dix-huit" ; jten => "quatre-vingts" ; ten => "quatre-vingt" ; tenplus => "quatre-vingt"}} ; lin n9 = - digitPl {inh = teen ; inh1 = Pl ; s = table {unit => "neuf" ; teen => "dix-neuf" ; jten => "quatre-vingt-dix" ; ten => "quatre-vingt-dix" ; tenplus => "quatre-vingt"}} ; + digitPl {inh = teen ; n = Pl ; s = table {unit => "neuf" ; teen => "dix-neuf" ; jten => "quatre-vingt-dix" ; ten => "quatre-vingt-dix" ; tenplus => "quatre-vingt"}} ; lin pot01 = {inh = Sg ; s = \\g => let dix = cardOrd g "dix" "dixime" in table { @@ -76,18 +76,18 @@ lin pot1to19 d = {s = \\g => table {indep => d.s ! g ! teen ; attr => d.s ! g ! teen} ; n = Pl} ; lin pot0as1 n = {s = \\g => table {indep => n.s ! g ! {p1 = unit ; p2 = indep} ; - attr => n.s ! g ! {p1 = unit ; p2 = attr}} ; n = n.n} ; + attr => n.s ! g ! {p1 = unit ; p2 = attr}} ; n = n.inh} ; lin pot1 d = {s = \\g => table {indep => d.s ! g ! jten ; attr => d.s ! g ! ten} ; n = Pl} ; lin pot1plus d e = {s = \\g => table {indep => (d.s ! (NCard Masc) ! tenplus) ++ (table {{p1 = Sg ; p2 = Sg} => "et" ; {p1 = Sg ; p2 = pl} => "-" ; {p1 = Pl ; p2 = - Sg} => "-" ; {p1 = Pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = + Sg} => "-" ; {p1 = Pl ; p2 = pl} => "-"} ! {p1 = d.n ; p2 = e.inh}) ++ e.s ! g ! {p1 = d.inh ; p2 = indep} ; attr => (d.s ! (NCard Masc) ! 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 ! g ! {p1 = d.inh ; p2 = + "-"} ! {p1 = d.n ; p2 = e.inh}) ++ e.s ! g ! {p1 = d.inh ; p2 = indep}} ; n = Pl} ; lin pot1as2 n = n ; lin pot2 d = @@ -106,4 +106,43 @@ lin pot3plus n m = {s = \\g => (n.s ! NCard Masc ! attr) ++ "mille" ++ m.s ! g ! indep ; n = Pl} ; -} \ No newline at end of file + +-- numerals as sequences of digits + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard Masc ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1er" Sg ; ---- gender + D_2 = mk2Dig "2" "2me" ; + D_3 = mk2Dig "3" "3me" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + "me") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ _ => o} ; ---- gender + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + +} diff --git a/lib/resource/french/StructuralFre.gf b/lib/resource/french/StructuralFre.gf index a4cd65654..0ed11ac39 100644 --- a/lib/resource/french/StructuralFre.gf +++ b/lib/resource/french/StructuralFre.gf @@ -34,7 +34,7 @@ lin everything_NP = pn2np (mkPN ["tout"] Masc) ; everywhere_Adv = ss "partout" ; few_Det = {s = \\g,c => prepCase c ++ "peu" ++ elisDe ; n = Pl} ; - first_Ord = {s = \\ag => (regA "premier").s ! Posit ! AF ag.g ag.n} ; +--- DEPREC first_Ord = {s = \\ag => (regA "premier").s ! Posit ! AF ag.g ag.n} ; for_Prep = mkPreposition "pour" ; from_Prep = complGen ; --- he_Pron = @@ -65,7 +65,7 @@ lin must_VV = mkVV (devoir_V2 ** {lock_V = <>}) ; no_Phr = ss "non" ; on_Prep = mkPreposition "sur" ; - one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "une" ! g} ; +--- DEPREC one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "une" ! g} ; only_Predet = {s = \\_,c => prepCase c ++ "seulement" ; c = Nom} ; --- seul(e)(s) or_Conj = {s = "ou" ; n = Sg} ; otherwise_PConj = ss "autrement" ; diff --git a/lib/resource/german/NumeralGer.gf b/lib/resource/german/NumeralGer.gf index a6429bbcc..3cf608f64 100644 --- a/lib/resource/german/NumeralGer.gf +++ b/lib/resource/german/NumeralGer.gf @@ -53,7 +53,7 @@ lin IDig d = d ; IIDig d i = { - s = \\o => d.s ! o ++ i.s ! o ; + s = \\o => d.s ! NCard ++ i.s ! o ; n = Pl } ; @@ -83,4 +83,4 @@ lin s : CardOrd => Str } ; -} \ No newline at end of file +} diff --git a/lib/resource/italian/NumeralIta.gf b/lib/resource/italian/NumeralIta.gf index 2759bec36..88ccd7e69 100644 --- a/lib/resource/italian/NumeralIta.gf +++ b/lib/resource/italian/NumeralIta.gf @@ -69,4 +69,43 @@ oper mille : Number => Str = table {Sg => "mille" ; Pl => "mila"} ; param DForm = ental Pred | ton | tiotal ; param Pred = pred | indip ; + +-- numerals as sequences of digits + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard Masc ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1:o" Sg ; ---- gender + D_2 = mk2Dig "2" "2:o" ; + D_3 = mk2Dig "3" "3:o" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ _ => o} ; ---- gender + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + } diff --git a/lib/resource/italian/StructuralIta.gf b/lib/resource/italian/StructuralIta.gf index efa6c4170..4c84b0794 100644 --- a/lib/resource/italian/StructuralIta.gf +++ b/lib/resource/italian/StructuralIta.gf @@ -32,7 +32,7 @@ lin everything_NP = pn2np (mkPN ["tutto"] Masc) ; everywhere_Adv = ss "dappertutto" ; few_Det = {s = \\g,c => prepCase c ++ genForms "pochi" "poche" ! g ; n = Pl} ; - first_Ord = {s = \\ag => (regA "primo").s ! Posit ! AF ag.g ag.n} ; +---- first_Ord = {s = \\ag => (regA "primo").s ! Posit ! AF ag.g ag.n} ; for_Prep = mkPrep "per" ; from_Prep = complGen ; --- he_Pron = @@ -63,7 +63,7 @@ lin must_VV = mkVV (verboV (dovere_47 "dovere")) ; no_Phr = ss "no" ; on_Prep = {s = [] ; c = CPrep P_su ; isDir = False} ; - one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ; +---- one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ; only_Predet = {s = \\_,c => prepCase c ++ "soltanto" ; c = Nom} ; --- solo|a|i|e or_Conj = {s = "o" ; n = Sg} ; otherwise_PConj = ss "altramente" ; diff --git a/lib/resource/norwegian/NumeralNor.gf b/lib/resource/norwegian/NumeralNor.gf index adf240c82..0d0a6e907 100644 --- a/lib/resource/norwegian/NumeralNor.gf +++ b/lib/resource/norwegian/NumeralNor.gf @@ -52,13 +52,13 @@ lin IDig d = d ; IIDig d i = { - s = \\o => d.s ! o ++ i.s ! o ; + s = \\o => d.s ! NCard neutrum ++ i.s ! o ; n = Pl } ; D_0 = mkDig "0" ; - D_1 = mk3Dig "1" "1e" Sg ; - D_2 = mk2Dig "2" "2e" ; + D_1 = mk3Dig "1" "1:e" Sg ; + D_2 = mk2Dig "2" "2:e" ; D_3 = mkDig "3" ; D_4 = mkDig "4" ; D_5 = mkDig "5" ; @@ -69,7 +69,7 @@ lin oper mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; - mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":e") ; mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { s = table {NCard _ => c ; NOrd _ => o} ; diff --git a/lib/resource/romance/CatRomance.gf b/lib/resource/romance/CatRomance.gf index 33bf560a0..ba58b675a 100644 --- a/lib/resource/romance/CatRomance.gf +++ b/lib/resource/romance/CatRomance.gf @@ -55,16 +55,17 @@ incomplete concrete CatRomance of Cat = CN = {s : Number => Str ; g : Gender} ; NP,Pron = Pronoun ; Det = {s : Gender => Case => Str ; n : Number} ; - QuantSg = {s : Gender => Case => Str} ; - QuantPl = {s : Bool => Gender => Case => Str} ; +--- QuantSg = {s : Gender => Case => Str} ; +--- QuantPl = {s : Bool => Gender => Case => Str} ; Quant = {s : Bool => Number => Gender => Case => Str} ; Predet = {s : AAgr => Case => Str ; c : Case} ; -- c : la plupart de - Num = {s : Gender => Str ; isNum : Bool} ; + Num = {s : Gender => Str ; isNum : Bool ; n : Number} ; Ord = {s : AAgr => Str} ; -- Numeral - Numeral = {s : CardOrd => Str} ; + Numeral = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str ; n : Number} ; -- Structural diff --git a/lib/resource/romance/NounRomance.gf b/lib/resource/romance/NounRomance.gf index 4300b699a..8b2526610 100644 --- a/lib/resource/romance/NounRomance.gf +++ b/lib/resource/romance/NounRomance.gf @@ -39,32 +39,36 @@ incomplete concrete NounRomance of Noun = } ; DetSg quant ord = { - s = \\g,c => quant.s ! g ! c ++ ord.s ! aagr g Sg ; + s = \\g,c => quant.s ! False ! Sg ! g ! c ++ ord.s ! aagr g Sg ; n = Sg } ; DetPl quant num ord = { - s = \\g,c => quant.s ! num.isNum ! g ! c ++ num.s ! g ++ ord.s ! aagr g Pl ; - n = Pl + s = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++ + ord.s ! aagr g Pl ; + n = num.n } ; - SgQuant q = {s = q.s ! False ! Sg} ; - PlQuant q = {s = \\b,g,c => q.s ! b ! Pl ! g ! c} ; +--- DEPREC SgQuant q = {s = q.s ! False ! Sg} ; +--- DEPREC PlQuant q = {s = \\b,g,c => q.s ! b ! Pl ! g ! c} ; --- part app: cf NounScand. AR 8/7/2007 PossPron p = { s = \\_,n,g,c => possCase g n c ++ p.s ! Poss (aagr g n) ---- il mio! } ; - NoNum = {s = \\_ => [] ; isNum = False} ; + NoNum = {s = \\_ => [] ; isNum = False ; n = Pl} ; NoOrd = {s = \\_ => []} ; - NumInt n = {s = \\_ => n.s ; isNum = True} ; + NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; OrdInt n = {s = \\_ => n.s ++ "."} ; --- - NumNumeral numeral = {s = \\g => numeral.s ! NCard g ; isNum = True} ; - OrdNumeral numeral = {s = \\a => numeral.s ! NOrd a.g a.n} ; + NumDigits nu = {s = \\g => nu.s ! NCard g ; isNum = True ; n = nu.n} ; + OrdDigits nu = {s = \\a => nu.s ! NOrd a.g a.n} ; - AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum} ; + NumNumeral nu = {s = \\g => nu.s ! NCard g ; isNum = True ; n = nu.n} ; + OrdNumeral nu = {s = \\a => nu.s ! NOrd a.g a.n} ; + + AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum ; n = num.n} ; OrdSuperl adj = {s = \\a => adj.s ! Superl ! AF a.g a.n} ; @@ -77,8 +81,10 @@ incomplete concrete NounRomance of Noun = } ; MassDet = { - s = \\g,c => partitive g c ; - n = Sg + s = \\b,n,g,c => case of { + => partitive g c ; + _ => prepCase genitive ---- + } } ; -- This is based on record subtyping. diff --git a/lib/resource/russian/CatRus.gf b/lib/resource/russian/CatRus.gf index a02d99564..697b4c35d 100644 --- a/lib/resource/russian/CatRus.gf +++ b/lib/resource/russian/CatRus.gf @@ -58,12 +58,14 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in { -- Gender parameter is due to multiple determiners (Numerals in Russian) -- like "mnogo" -- The determined noun has the case parameter specific for the determiner - QuantSg, QuantPl , Det = {s : AdjForm => Str; n: Number; g: PronGen; c: Case} ; +--- DEPREC QuantSg, QuantPl , + Det = {s : AdjForm => Str; n: Number; g: PronGen; c: Case} ; Predet, Quant= {s : AdjForm => Str; g: PronGen; c: Case} ; -- Numeral - Num, Numeral = {s : Case => Gender => Str} ; + Num, Numeral = {s : Case => Gender => Str ; n : Number} ; + Digits = {s : Str ; n : Number} ; ---- -- Structural -- The conjunction has an inherent number, which is used when conjoining diff --git a/lib/resource/russian/NounRus.gf b/lib/resource/russian/NounRus.gf index a8675dfe5..8d9f5ba3f 100644 --- a/lib/resource/russian/NounRus.gf +++ b/lib/resource/russian/NounRus.gf @@ -58,29 +58,29 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { DetSg quant ord = { s = \\af => quant.s!af ++ ord.s!af ; - n = quant.n; + n = Sg ; g = quant.g; c = quant.c } ; DetPl quant num ord = { s = \\af => quant.s !af ++ num.s! (caseAF af) ! (genAF af) ++ ord.s!af ; - n = Pl; + n = num.n; ---- ?? AR 18/12/2007 g = quant.g; c = quant.c } ; - SgQuant quant = {s = quant.s; c=quant.c; g=quant.g; n= Sg} ; - PlQuant quant = {s = quant.s ; c=quant.c; g=quant.g; n= Pl} ; +--- DEPREC SgQuant quant = {s = quant.s; c=quant.c; g=quant.g; n= Sg} ; +--- DEPREC PlQuant quant = {s = quant.s ; c=quant.c; g=quant.g; n= Pl} ; PossPron p = {s = \\af => p.s ! mkPronForm (caseAF af) No (Poss (gNum (genAF af) (numAF af) )); c=Nom; g = PNoGen} ; - NoNum = {s = \\_,_ => []} ; -- cardinal numeral + NoNum = {s = \\_,_ => [] ; n = Pl} ; -- cardinal numeral NoOrd = {s = \\_ => []} ; -- adjective -- unclear how to tell apart the numbers from their string representation, -- so just leave a decimal representation, without case-suffixes: - NumInt i = {s = table { _ => table {_ => i.s } } } ; + NumInt i = {s = table { _ => table {_ => i.s } } ; n = Pl} ; OrdInt n = variants {} ; ---- TODO -- case n of { @@ -88,12 +88,14 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { -- 3 => (ti_j_EndDecl n.s) ; -- _ => uy_j_EndDecl n.s } ; - OrdNumeral numeral = variants {} ; ---- TODO +---- OrdNumeral numeral = variants {} ; ---- TODO +---- OrdDigits TODO -- {s = \\ af => (uy_j_EndDecl (numeral.s ! caseAF af ! genAF af)).s!af} ; NumNumeral n = n ; + NumDigits n = {s = \\_,_ => n.s ; n = n.n} ; - AdNum adn num = {s = \\c,n => adn.s ++ num.s!c!n} ; + AdNum adn num = {s = \\c,n => adn.s ++ num.s!c!n ; n = num.n} ; OrdSuperl a = {s = a.s!Posit}; diff --git a/lib/resource/russian/NumeralRus.gf b/lib/resource/russian/NumeralRus.gf index 1f7de26e3..ce2647a8f 100644 --- a/lib/resource/russian/NumeralRus.gf +++ b/lib/resource/russian/NumeralRus.gf @@ -12,7 +12,7 @@ lincat Sub100 = {s : Place => Gender => Str ; size : Size} ; lincat Sub1000 = {s : Place => Gender => Str ; size : Size} ; lincat Sub1000000 = {s : Gender => Str} ; -lin num x = {s = table{ _ => x.s }}; +lin num x = {s = table{ _ => x.s } ; n = Pl}; ---- n TODO ; Size? AR 18/12/2007 lin n2 = {s = table {{unit} => table {{Fem} => "две" ; _ => "два"} ; @@ -99,5 +99,44 @@ lin pot3plus n m = --- TODO --- raz/odin + +-- numerals as sequences of digits + + lincat + Dig = TDigit ; + + lin + IDig d = {s = d.s ; n = d.n} ; + + IIDig d i = { + s = d.s ++ i.s ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1" Sg ; ---- + D_2 = mkDig "2" ; + D_3 = mkDig "3" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + "o") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = c ; ---- gender + n = n + } ; + + TDigit = { + n : Number ; + s : Str + } ; + } diff --git a/lib/resource/russian/StructuralRus.gf b/lib/resource/russian/StructuralRus.gf index 743057b91..5f4b8ace8 100644 --- a/lib/resource/russian/StructuralRus.gf +++ b/lib/resource/russian/StructuralRus.gf @@ -38,7 +38,7 @@ lin everything_NP = UsePron (pronVseInanimate ** {lock_Pron=<>}) ; everywhere_Adv = ss "везде" ; few_Det = (ij_EndK_G_KH_Decl "немног") **{lock_Det= <>; n= Sg; g = PNoGen; c = Nom}; -- AMalenkij - first_Ord = (uy_j_EndDecl "перв" ) ** {lock_A = <>}; --AStaruyj +--- DEPREC first_Ord = (uy_j_EndDecl "перв" ) ** {lock_A = <>}; --AStaruyj from_Prep = { s = "от" ; c = Gen }; he_Pron = pronOn ; here_Adv = ss "здесь" ; @@ -64,7 +64,7 @@ lin no_Phr = ss ["Нет ."] ; --on_Prep = { s = "на" ; c = Prepos }; on_Prep = { s = "на" ; c = Prepos2 }; -- +++ MG_UR: new case Prepos2 introduced! +++ - one_Quant = odinDet ** {lock_QuantSg = <>; n= Sg; g = PNoGen; c = Nom }; +--- DEPREC one_Quant = odinDet ** {lock_QuantSg = <>; n= Sg; g = PNoGen; c = Nom }; --AStaruyj : only_Predet = (uy_j_EndDecl "единственн" ) ** {lock_Predet = <>; n= Sg; g = PNoGen; c = Nom }; or_Conj = ss "или" ** {n = Sg} ; diff --git a/lib/resource/spanish/NumeralSpa.gf b/lib/resource/spanish/NumeralSpa.gf index 5e4c5f447..7775c105b 100644 --- a/lib/resource/spanish/NumeralSpa.gf +++ b/lib/resource/spanish/NumeralSpa.gf @@ -100,4 +100,43 @@ param DForm = ental Pred | ton | tiotal | hundra Bool ; Pred = pred | indip ; + +-- numerals as sequences of digits + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard Masc ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1:o" Sg ; ---- gender + D_2 = mk2Dig "2" "2:o" ; + D_3 = mk2Dig "3" "3:o" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ _ => o} ; ---- gender + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + } diff --git a/lib/resource/spanish/StructuralSpa.gf b/lib/resource/spanish/StructuralSpa.gf index c049b69ee..a5d5b7544 100644 --- a/lib/resource/spanish/StructuralSpa.gf +++ b/lib/resource/spanish/StructuralSpa.gf @@ -32,7 +32,7 @@ lin everything_NP = pn2np (mkPN ["todo"] Masc) ; everywhere_Adv = ss ["en todas partes"] ; few_Det = {s = \\g,c => prepCase c ++ genForms "pocos" "pocas" ! g ; n = Pl} ; - first_Ord = {s = \\ag => (regA "primero").s ! Posit ! AF ag.g ag.n} ; +--- first_Ord = {s = \\ag => (regA "primero").s ! Posit ! AF ag.g ag.n} ; for_Prep = mkPrep "por" ; from_Prep = complGen ; --- he_Pron = @@ -67,7 +67,7 @@ lin must_VV = mkVV (verboV (deber_6 "deber")) ; no_Phr = ss "no" ; on_Prep = mkPrep "sobre" ; - one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ; +--- one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ; only_Predet = {s = \\_,c => prepCase c ++ "solamente" ; c = Nom} ; or_Conj = {s = "o" ; n = Sg} ; otherwise_PConj = ss "otramente" ; diff --git a/lib/resource/swedish/NumeralSwe.gf b/lib/resource/swedish/NumeralSwe.gf index c44cb4b22..bf4186be2 100644 --- a/lib/resource/swedish/NumeralSwe.gf +++ b/lib/resource/swedish/NumeralSwe.gf @@ -50,13 +50,13 @@ lin IDig d = d ; IIDig d i = { - s = \\o => d.s ! o ++ i.s ! o ; + s = \\o => d.s ! NCard neutrum ++ i.s ! o ; n = Pl } ; D_0 = mkDig "0" ; - D_1 = mk3Dig "1" "1a" Sg ; - D_2 = mk2Dig "2" "2a" ; + D_1 = mk3Dig "1" "1:a" Sg ; + D_2 = mk2Dig "2" "2:a" ; D_3 = mkDig "3" ; D_4 = mkDig "4" ; D_5 = mkDig "5" ; @@ -67,7 +67,7 @@ lin oper mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; - mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":e") ; mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { s = table {NCard _ => c ; NOrd _ => o} ;