From 4ee07b156e85b78b0d2c0da820703a6a3ed24fae Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 14 Mar 2005 09:46:22 +0000 Subject: [PATCH] fixed numeral agreement and some French verbs --- lib/resource/french/BasicFre.gf | 4 +- lib/resource/french/MorphoFre.gf | 17 +++- lib/resource/french/NumeralsFre.gf | 87 +++++++++++++------- lib/resource/french/ParadigmsFre.gf | 8 ++ lib/resource/french/StructuralFre.gf | 2 +- lib/resource/french/SwadeshLexFre.gf | 12 +-- lib/resource/norwegian/MorphoNor.gf | 2 + lib/resource/norwegian/NumeralsNor.gf | 36 ++++---- lib/resource/norwegian/StructuralNor.gf | 2 +- lib/resource/romance/CategoriesRomance.gf | 2 +- lib/resource/romance/RulesRomance.gf | 2 +- lib/resource/romance/SyntaxRomance.gf | 22 ++--- lib/resource/scandinavian/CategoriesScand.gf | 2 +- lib/resource/scandinavian/RulesScand.gf | 2 +- lib/resource/scandinavian/SyntaxScand.gf | 20 ++--- lib/resource/swedish/MorphoSwe.gf | 3 + lib/resource/swedish/NumeralsSwe.gf | 33 ++++---- lib/resource/swedish/StructuralSwe.gf | 3 +- 18 files changed, 157 insertions(+), 102 deletions(-) diff --git a/lib/resource/french/BasicFre.gf b/lib/resource/french/BasicFre.gf index 3b90946eb..7abfc5840 100644 --- a/lib/resource/french/BasicFre.gf +++ b/lib/resource/french/BasicFre.gf @@ -37,7 +37,7 @@ lin brother_N2 = deN2 (regN "frère" masculine) ; brown_ADeg = regADeg "brun" ; butter_N = regN "beurre" masculine ; - buy_V2 = dirV2 (regV "acheter") ; + buy_V2 = dirV2 (reg3V "acheter" "achète" "achètera") ; camera_N = compN (regN "appareil" masculine) ["de photo"] ; cap_N = regN "casquette" feminine ; car_N = regN "voiture" feminine ; @@ -93,7 +93,7 @@ lin have_V2 = avoir_V2 ; hear_V2 = entendre_V2 ; hill_N = regN "colline" feminine ; - hope_VS = mkVS (regV "espérer") ; + hope_VS = mkVS (reg3V "espérer" "espère" "espérera") ; horse_N = regN "cheval" masculine ; hot_ADeg = regADeg "chaud" ; house_N = regN "maison" feminine ; diff --git a/lib/resource/french/MorphoFre.gf b/lib/resource/french/MorphoFre.gf index b466e3ea8..e6daedfed 100644 --- a/lib/resource/french/MorphoFre.gf +++ b/lib/resource/french/MorphoFre.gf @@ -603,8 +603,8 @@ oper _ => case verb_é of { True => conj1céder parler ; _ => case verb_e of { - True => conj1peser parler ; - _ => case Predef.dp 3 parler of { +---- True => conj1peser parler ; + False | _ => case Predef.dp 3 parler of { "cer" => conj1placer parler ; "ger" => conj1manger parler ; "yer" => conj1payer parler ; @@ -617,6 +617,13 @@ oper } } ; +-- The following can be more reliable. + + mkVerb3Reg : Str -> Str -> Str -> Verbe = \jeter,jette,jettera -> + auxConj1 + (Predef.tk 2 jeter) + (Predef.tk 1 jette) + (Predef.tk 1 jettera) ; --3 The second conjugation -- @@ -1343,4 +1350,10 @@ oper param DForm = unit | teen | jten | ten | tenplus ; param Place = indep | attr ; +oper + digitPl : + {inh : DForm ; inh1 : Number ; s : DForm => Str} -> + {inh : DForm ; inh1 : Number ; s : Gender => DForm => Str ; n : Number} = \d -> + {inh = d.inh ; inh1 = d.inh1 ; s = \\_ => d.s ; n = Pl} ; + } diff --git a/lib/resource/french/NumeralsFre.gf b/lib/resource/french/NumeralsFre.gf index 4212c2662..27e4b4264 100644 --- a/lib/resource/french/NumeralsFre.gf +++ b/lib/resource/french/NumeralsFre.gf @@ -1,56 +1,81 @@ concrete NumeralsFre of Numerals = open TypesFre, MorphoFre in { -lincat Numeral = {s : Str} ; -lincat Digit = {inh : DForm ; inh1 : Number ; s : DForm => Str} ; -lincat Sub10 = {inh : Number ; s : {p1 : DForm ; p2 : Place} => Str} ; -lincat Sub100 = {s : Place => Str} ; -lincat Sub1000 = {s : Place => Str} ; -lincat Sub1000000 = {s : Str} ; +lincat Numeral = {s : Gender => Str ; n : Number} ; +lincat Digit = {inh : DForm ; inh1 : Number ; s : Gender => DForm => Str ; n : Number} ; +lincat Sub10 = {inh : Number ; s : Gender => {p1 : DForm ; p2 : Place} => Str ; n : Number} ; +lincat Sub100 = {s : Gender => Place => Str ; n : Number} ; +lincat Sub1000 = {s : Gender => Place => Str ; n : Number} ; +lincat Sub1000000 = {s : Gender => Str ; n : Number} ; + +lin num x0 = x0 ; -lin num x0 = - {s = x0.s} ; lin n2 = - {inh = unit ; inh1 = Sg ; s = table {unit => "deux" ; teen => "douze" ; jten => "vingt" ; ten => "vingt" ; tenplus => "vingt"}} ; + digitPl {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"}} ; + digitPl {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"}} ; + digitPl {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"}} ; + digitPl {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"}} ; + digitPl {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"}} ; + digitPl {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"}} ; + digitPl {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"}} ; + digitPl {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} => []}} ; + {inh = Sg ; s = \\g => table {{p1 = unit ; p2 = indep} => case g of {Masc => + "un" ; Fem => "une"} ; {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} => []} ; n = Sg} ; 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}} ; + {inh = Pl ; s = \\g => table {{p1 = unit ; p2 = indep} => d.s ! g ! unit + ; {p1 = unit ; p2 = attr} => d.s ! g ! unit ; {p1 = teen ; p2 = indep} + => d.s ! g ! teen ; {p1 = teen ; p2 = attr} => d.s ! g ! teen ; {p1 = jten ; + p2 = indep} => d.s ! g ! jten ; {p1 = jten ; p2 = attr} => d.s ! g ! jten ; + {p1 = ten ; p2 = indep} => d.s ! g ! ten ; {p1 = ten ; p2 = attr} => d.s + ! g ! ten ; {p1 = tenplus ; p2 = indep} => d.s ! g ! tenplus ; {p1 = tenplus + ; p2 = attr} => d.s ! g ! tenplus} ; n = Pl} ; lin pot110 = - {s = table {indep => "dix" ; attr => "dix"}} ; + {s = \\_ => table {indep => "dix" ; attr => "dix"} ; n = Pl} ; lin pot111 = - {s = table {indep => "onze" ; attr => "onze"}} ; + {s = \\_ => table {indep => "onze" ; attr => "onze"} ; n = Pl} ; lin pot1to19 d = - {s = table {indep => d.s ! teen ; attr => d.s ! teen}} ; + {s = \\g => table {indep => d.s ! g ! teen ; attr => d.s ! g ! teen} ; n = Pl} ; lin pot0as1 n = - {s = table {indep => n.s ! {p1 = unit ; p2 = indep} ; attr => n.s ! {p1 = unit ; p2 = attr}}} ; + {s = \\g => table {indep => n.s ! g ! {p1 = unit ; p2 = indep} ; + attr => n.s ! g ! {p1 = unit ; p2 = attr}} ; n = n.n} ; lin pot1 d = - {s = table {indep => d.s ! jten ; attr => d.s ! ten}} ; + {s = \\g => table {indep => d.s ! g ! jten ; attr => d.s ! g ! ten} + ; n = Pl} ; 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}} ; + {s = \\g => table {indep => (d.s ! g ! 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 = indep} ; attr => (d.s ! g ! + 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 = + indep}} ; n = Pl} ; +lin pot1as2 n = n ; +---- {s = \\g,d => 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"}} ; + {s = \\g => table {indep => (d.s ! Masc ! {p1 = unit ; p2 = attr}) + ++ table {Sg => "cent" ; Pl => "cents"} ! (d.inh) ; attr => (d.s ! + Masc ! {p1 = unit ; p2 = attr}) ++ "cent"} ; n = Pl} ; 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}} ; + {s = \\g => table {indep => (d.s ! Masc ! {p1 = unit ; p2 = attr}) + ++ "cent" ++ e.s ! g ! indep ; attr => (d.s ! Masc ! {p1 = unit ; p2 + = attr}) ++ "cent" ++ e.s ! g ! indep} ; n = Pl} ; lin pot2as3 n = - {s = n.s ! indep} ; + {s = \\g => n.s ! g ! indep ; n = n.n} ; lin pot3 n = - {s = (n.s ! attr) ++ "mille"} ; + {s = \\_ => (n.s ! Masc ! attr) ++ "mille" ; n = Pl} ; lin pot3plus n m = - {s = (n.s ! attr) ++ "mille" ++ m.s ! indep} ; + {s = \\g => (n.s ! Masc ! attr) ++ "mille" ++ m.s ! g ! indep ; n = + Pl} ; } \ No newline at end of file diff --git a/lib/resource/french/ParadigmsFre.gf b/lib/resource/french/ParadigmsFre.gf index d0379dd03..8ab7f0b61 100644 --- a/lib/resource/french/ParadigmsFre.gf +++ b/lib/resource/french/ParadigmsFre.gf @@ -205,6 +205,13 @@ oper regV : Str -> V ; +-- Sometimes, however, it is not predictable which variant of the "er" +-- conjugation is to be selected. Then it is better to use the function +-- that gives the third person singular present indicative and future +-- (("il") "jette", "jettera") as second argument. + + reg3V : (jeter,jette,jettera : Str) -> V ; + -- The function $regV$ gives all verbs the compound auxiliary "avoir". -- To change it to "être", use the following function. @@ -307,6 +314,7 @@ oper mkAdA x = ss x ** {lock_AdA = <>} ; regV x = let v = (mkVerbReg x) in verbPres v AHabere ** {aux = AHabere ; lock_V = <>} ; + reg3V x y z = let v = (mkVerb3Reg x y z) in verbPres v AHabere ** {aux = AHabere ; lock_V = <>} ; etreV v = {s = v.s ; aux = AEsse ; lock_V = <>} ; mkV2 v p = {s = v.s ; aux = v.aux ; s2 = p.p2 ; c = p.p1 ; lock_V2 = <>} ; diff --git a/lib/resource/french/StructuralFre.gf b/lib/resource/french/StructuralFre.gf index 8a9d70cb3..2665b3607 100644 --- a/lib/resource/french/StructuralFre.gf +++ b/lib/resource/french/StructuralFre.gf @@ -6,7 +6,7 @@ concrete StructuralFre of Structural = lin - UseNumeral n = {s = \\_ => n.s} ; ---- gender + UseNumeral n = {s = \\g => n.s !g ; n = n.n} ; above_Prep = {s = ["au dessus"] ; c = genitive} ; after_Prep = justPrep "après" ; diff --git a/lib/resource/french/SwadeshLexFre.gf b/lib/resource/french/SwadeshLexFre.gf index 23da9a627..547ab0b3b 100644 --- a/lib/resource/french/SwadeshLexFre.gf +++ b/lib/resource/french/SwadeshLexFre.gf @@ -162,7 +162,7 @@ concrete SwadeshLexFre of SwadeshLex = CategoriesFre salt_N = regN "sel" masculine ; sand_N = regN "sable" masculine ; sea_N = sea_N ; - seed_N = regN "graine" masculine ; + seed_N = regN "graine" feminine ; skin_N = regN "peau" masculine ; sky_N = mkN "ciel" "cieux" masculine ; smoke_N = regN "fumée" feminine ; @@ -203,7 +203,7 @@ concrete SwadeshLexFre of SwadeshLex = CategoriesFre float_V = regV "flotter" ; flow_V = regV "couler" ; fly_V = regV "voler" ; - freeze_V = regV "geler" ; ---- check conjugation + freeze_V = reg3V "geler" "gèle" "gèlera" ; give_V = regV "donner" ; hear_V = UseV2 entendre_V2 ; hit_V = regV "frapper" ; @@ -221,16 +221,16 @@ concrete SwadeshLexFre of SwadeshLex = CategoriesFre say_V = UseV2 dire_V2 ; scratch_V = regV "gratter" ; see_V = UseV2 voir_V2 ; - sew_V = regV "semer"; ---- conjug + sew_V = reg3V "semer" "sème" "sèmera" ; sing_V = regV "chanter" ; sit_V = UseV2 asseoir_V2 ; --- refl sleep_V = UseV2 dormir_V2 ; smell_V = UseV2 sentir_V2 ; spit_V = regV "cracher" ; split_V = UseV2 fendre_V2 ; - squeeze_V = regV "squeeze" ; - stab_V = regV "serrer" ; - stand_V = regV "lever" ; ---- refl ---- + squeeze_V = regV "serrer" ; + stab_V = regV "poignarder" ; + stand_V = reg3V "lever" "lève" "lèvera" ; ---- refl ---- suck_V = regV "sucer" ; swell_V = regV "gonfler" ; swim_V = regV "nager" ; diff --git a/lib/resource/norwegian/MorphoNor.gf b/lib/resource/norwegian/MorphoNor.gf index c3acb9196..68f5fb68c 100644 --- a/lib/resource/norwegian/MorphoNor.gf +++ b/lib/resource/norwegian/MorphoNor.gf @@ -289,4 +289,6 @@ oper mkTal : Str -> Str -> Str -> {s : DForm => Str} = {s = table {ental => två ; ton => tolv ; tiotal => tjugo}} ; oper regTal : Str -> {s : DForm => Str} = \fem -> mkTal fem (fem + "ten") (fem + "ti") ; + numPl : Str -> {s : Gender => Str ; n : Number} = \n -> + {s = \\_ => n ; n = Pl} ; } diff --git a/lib/resource/norwegian/NumeralsNor.gf b/lib/resource/norwegian/NumeralsNor.gf index 4ebb11dc9..eddb78256 100644 --- a/lib/resource/norwegian/NumeralsNor.gf +++ b/lib/resource/norwegian/NumeralsNor.gf @@ -1,15 +1,15 @@ -- norsk bokmol, by Herman R Jervell herman.jervell@ilf.uio.no, -- 6/3/2001 -concrete NumeralsNor of Numerals = open Prelude, MorphoNor in { +concrete NumeralsNor of Numerals = open Prelude, TypesNor, MorphoNor in { -lincat Numeral = {s : Str} ; +lincat Numeral = {s : Gender => Str ; n : Number} ; lincat Digit = {s : DForm => Str} ; -lincat Sub10 = {s : DForm => Str} ; -lincat Sub100 = {s : Str} ; -lincat Sub1000 = {s : Str} ; -lincat Sub1000000 = {s : Str} ; +lincat Sub10 = {s : DForm => Gender => Str ; n : Number} ; +lincat Sub100 = {s : Gender => Str ; n : Number} ; +lincat Sub1000 = {s : Gender => Str ; n : Number} ; +lincat Sub1000000 = {s : Gender => Str ; n : Number} ; lin num x = x ; @@ -22,20 +22,20 @@ 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 pot01 = {s = table {f => table {Neutr => "ett" ; _ => "én"}} ; n = Sg} ; +lin pot0 d = {s = \\f,g => d.s ! f ; n = Pl} ; +lin pot110 = numPl "ti" ; +lin pot111 = numPl "elve" ; +lin pot1to19 d = numPl (d.s ! ton) ; +lin pot0as1 n = {s = n.s ! ental ; n = n.n} ; +lin pot1 d = numPl (d.s ! tiotal) ; +lin pot1plus d e = {s = \\g => d.s ! tiotal ++ e.s ! ental ! g ; n = Pl} ; 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 pot2 d = numPl (d.s ! ental ! Neutr ++ "hundre") ; +lin pot2plus d e = {s = \\g => d.s ! ental ! Neutr ++ "hundre" ++ "og" ++ e.s ! g ; n = Pl} ; lin pot2as3 n = n ; -lin pot3 n = ss (n.s ++ "tusen") ; -lin pot3plus n m = ss (n.s ++ "tusen" ++ "og" ++ m.s) ; +lin pot3 n = numPl (n.s ! Neutr ++ "tusen") ; +lin pot3plus n m = {s = \\g => n.s ! Neutr ++ "tusen" ++ "og" ++ m.s ! g ; n = Pl} ; } \ No newline at end of file diff --git a/lib/resource/norwegian/StructuralNor.gf b/lib/resource/norwegian/StructuralNor.gf index d208e8b97..56a3092e0 100644 --- a/lib/resource/norwegian/StructuralNor.gf +++ b/lib/resource/norwegian/StructuralNor.gf @@ -8,7 +8,7 @@ concrete StructuralNor of Structural = CategoriesNor, NumeralsNor ** open Prelude, MorphoNor, SyntaxNor in { lin - UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; --- + UseNumeral i = {s = \\g => table {Nom => i.s ! g ; Gen => i.s ! g ++ "s"} ; n = i.n} ; above_Prep = ss "ovenfor" ; after_Prep = ss "etter" ; diff --git a/lib/resource/romance/CategoriesRomance.gf b/lib/resource/romance/CategoriesRomance.gf index 6a47ce830..007ae0a1b 100644 --- a/lib/resource/romance/CategoriesRomance.gf +++ b/lib/resource/romance/CategoriesRomance.gf @@ -40,7 +40,7 @@ lincat -- = CommNoun ** {s2 : Preposition ; c : CaseA} ; N3 = Function ** {s3 : Preposition ; c3 : CaseA} ; Prep = {s : Preposition ; c : CaseA} ; - Num = {s : Gender => Str} ; + Num = {s : Gender => Str ; n : Number} ; A = Adjective ; -- = {s : AForm => Str ; p : Bool} ; diff --git a/lib/resource/romance/RulesRomance.gf b/lib/resource/romance/RulesRomance.gf index 3557016af..9e6bca5b9 100644 --- a/lib/resource/romance/RulesRomance.gf +++ b/lib/resource/romance/RulesRomance.gf @@ -35,7 +35,7 @@ lin ModGenOne = npGenDet singular ; ModGenNum = npGenDetNum ; - UseInt i = {s = \\_ => i.s} ; + UseInt i = {s = \\_ => i.s ; n = Pl} ; ---- n NoNum = noNum ; UseA = adj2adjPhrase ; diff --git a/lib/resource/romance/SyntaxRomance.gf b/lib/resource/romance/SyntaxRomance.gf index 7f1f209a4..f49d677e6 100644 --- a/lib/resource/romance/SyntaxRomance.gf +++ b/lib/resource/romance/SyntaxRomance.gf @@ -62,7 +62,7 @@ oper -- Many determiners can be modified with numerals, which may be inflected in -- gender. - Numeral : Type = {s : Gender => Str} ; + Numeral : Type = {s : Gender => Str ; n : Number} ; pronWithNum : Pronoun -> Numeral -> Pronoun = \nous,deux -> {s = \\c => nous.s ! c ++ deux.s ! pgen2gen nous.g ; @@ -72,7 +72,7 @@ oper c = nous.c } ; - noNum : Numeral = {s = \\_ => []} ; + noNum : Numeral = {s = \\_ => [] ; n = Pl} ; -- The existence construction "il y a", "c'è / ci sono" is defined separately, -- and ad hoc, in each language. @@ -98,9 +98,9 @@ oper numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase = \tous, six, homme -> normalNounPhrase - (\\c => prepCase c ++ tous.s ! homme.g ++ six.s ! homme.g ++ homme.s ! Pl) + (\\c => prepCase c ++ tous.s ! homme.g ++ six.s ! homme.g ++ homme.s ! six.n) homme.g - Pl ; + six.n ; --- Here one would like to provide a feminine variant as well. @@ -109,7 +109,7 @@ oper normalNounPhrase (\\c => prepCase c ++ tous.s ! Masc ++ six.s ! Masc) Masc - Pl ; + six.n ; -- The following macros are sufficient to define most determiners, -- as shown by the examples that follow. @@ -138,9 +138,9 @@ oper indefNounPhraseNum : Numeral -> CommNounPhrase -> NounPhrase = \nu,mec -> normalNounPhrase - (\\c => nu.s ! mec.g ++ mec.s ! Pl) + (\\c => prepCase c ++ nu.s ! mec.g ++ mec.s ! nu.n) mec.g - Pl ; + nu.n ; defNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n,mec -> normalNounPhrase @@ -150,9 +150,9 @@ oper defNounPhraseNum : Numeral -> CommNounPhrase -> NounPhrase = \nu,mec -> normalNounPhrase - (\\c => artDef mec.g Pl c ++ nu.s !mec.g ++ mec.s ! Pl) + (\\c => artDef mec.g nu.n c ++ nu.s !mec.g ++ mec.s ! nu.n) mec.g - Pl ; + nu.n ; -- We often need indefinite noun phrases synacategorematically. @@ -179,7 +179,7 @@ oper _ => npGenPossNum nu jeanne mec } } in - normalNounPhrase str mec.g Pl ; + normalNounPhrase str mec.g nu.n ; -- These auxiliary rules define the genitive with "de" and with the possessive. -- Here there is a difference between French and Italian: Italian has a definite @@ -191,7 +191,7 @@ oper npGenDeNum : Numeral -> NounPhrase -> CommNounPhrase -> CaseA => Str = \nu,jeanne,mec -> - \\c => artDef mec.g Pl c ++ nu.s ! mec.g ++ mec.s ! Pl ++ + \\c => artDef mec.g nu.n c ++ nu.s ! mec.g ++ mec.s ! nu.n ++ jeanne.s ! case2pform genitive ; npGenPoss : Number -> NounPhrase -> CommNounPhrase -> CaseA => Str ; diff --git a/lib/resource/scandinavian/CategoriesScand.gf b/lib/resource/scandinavian/CategoriesScand.gf index 77f2bebec..0bec531c2 100644 --- a/lib/resource/scandinavian/CategoriesScand.gf +++ b/lib/resource/scandinavian/CategoriesScand.gf @@ -19,7 +19,7 @@ lincat N2 = Function ; -- = CommNoun ** {s2 : Preposition} ; N3 = Function ** {s3 : Preposition} ; - Num = {s : Case => Str} ; + Num = {s : Gender => Case => Str ; n : Number} ; Prep = {s : Str} ; A = Adjective ; diff --git a/lib/resource/scandinavian/RulesScand.gf b/lib/resource/scandinavian/RulesScand.gf index 71420aed8..9b89cc0cb 100644 --- a/lib/resource/scandinavian/RulesScand.gf +++ b/lib/resource/scandinavian/RulesScand.gf @@ -41,7 +41,7 @@ lin ModGenOne = npGenDet singular noNum ; ModGenNum = npGenDet plural ; - UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; --- + UseInt i = {s = \\_ => table {Nom => i.s ; Gen => i.s ++ "s"} ; n = Pl} ; --- NoNum = noNum ; UseA = adj2adjPhrase ; diff --git a/lib/resource/scandinavian/SyntaxScand.gf b/lib/resource/scandinavian/SyntaxScand.gf index bd1409342..433c38d45 100644 --- a/lib/resource/scandinavian/SyntaxScand.gf +++ b/lib/resource/scandinavian/SyntaxScand.gf @@ -98,16 +98,16 @@ oper -- The following construction has to be refined for genitive forms: -- "vi tre", "oss tre" are OK, but "vår tres" is not. - Numeral : Type = {s : Case => Str} ; + Numeral : Type = {s : Gender => Case => Str ; n : Number} ; pronWithNum : ProPN -> Numeral -> ProPN = \we,two -> - {s = \\c => we.s ! c ++ two.s ! npCase c ; + {s = \\c => we.s ! c ++ two.s ! utrum ! npCase c ; h1 = we.h1 ; h2 = we.h2 ; h3 = we.h3 } ; - noNum : Numeral = {s = \\_ => []} ; + noNum : Numeral = {s = \\_,_ => [] ; n = Pl} ; -- Formal subjects @@ -142,13 +142,13 @@ oper numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase = \alla,sex, man -> - {s = \\c => alla.s ! man.g ++ sex.s ! Nom ++ man.s ! Pl ! alla.b ! npCase c ; - g = genNoun man.g ; n = Pl ; p = P3} ; + {s = \\c => alla.s ! man.g ++ sex.s ! genNoun man.g ! Nom ++ man.s ! sex.n ! alla.b ! npCase c ; + g = genNoun man.g ; n = sex.n ; p = P3} ; justNumDetNounPhrase : DeterminerNum -> Numeral -> NounPhrase = \alla,sex -> - {s = \\c => alla.s ! NNeutr ++ sex.s ! npCase c ; - g = Neutr ; n = Pl ; p = P3} ; + {s = \\c => alla.s ! NNeutr ++ sex.s ! utrum ! npCase c ; + g = Neutr ; n = sex.n ; p = P3} ; -- The following macros are sufficient to define most determiners. @@ -216,7 +216,7 @@ oper s = \\c => case n of { Sg => huset.s ! PGen (ASg (genNoun vin.g)) ++ vin.s ! Sg ! DefP Indef ! npCase c ; - Pl => huset.s ! PGen APl ++ tre.s ! Nom ++ + Pl => huset.s ! PGen APl ++ tre.s ! genNoun vin.g ! Nom ++ vin.s ! Pl ! DefP Indef ! npCase c } ; g = genNoun vin.g ; @@ -230,9 +230,9 @@ oper plurDet : CommNounPhrase -> NounPhrase = plurDetNum noNum ; plurDetNum : Numeral -> CommNounPhrase -> NounPhrase = \num,cn -> - {s = \\c => num.s ! Nom ++ cn.s ! Pl ! IndefP ! npCase c ; + {s = \\c => num.s ! genNoun cn.g ! Nom ++ cn.s ! num.n ! IndefP ! npCase c ; g = genNoun cn.g ; - n = Pl ; + n = num.n ; p = P3 } ; diff --git a/lib/resource/swedish/MorphoSwe.gf b/lib/resource/swedish/MorphoSwe.gf index 111cfd8d0..f79043d1d 100644 --- a/lib/resource/swedish/MorphoSwe.gf +++ b/lib/resource/swedish/MorphoSwe.gf @@ -1246,4 +1246,7 @@ oper regTal : Str -> LinDigit = \fem -> mkTal fem (fem + "ton") (fem + "tio") ; + numPl : Str -> {s : Gender => Str ; n : Number} = \n -> + {s = \\_ => n ; n = Pl} ; + } diff --git a/lib/resource/swedish/NumeralsSwe.gf b/lib/resource/swedish/NumeralsSwe.gf index 0303f4205..15844e5ed 100644 --- a/lib/resource/swedish/NumeralsSwe.gf +++ b/lib/resource/swedish/NumeralsSwe.gf @@ -1,9 +1,12 @@ concrete NumeralsSwe of Numerals = open MorphoSwe, Prelude in { lincat - Numeral = { s : Str } ; + Numeral = {s : Gender => Str ; n : Number} ; Digit = {s : DForm => Str} ; - Sub10 = {s : DForm => Str} ; + Sub10 = {s : DForm => Gender => Str ; n : Number} ; + Sub100 = {s : Gender => Str ; n : Number} ; + Sub1000 = {s : Gender => Str ; n : Number} ; + Sub1000000 = {s : Gender => Str ; n : Number} ; lin num x = x ; @@ -17,19 +20,19 @@ lin 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) ; + pot01 = {s = table {f => table {Neutr => "ett" ; _ => "en"}} ; n = Sg} ; + pot0 d = {s = \\f,g => d.s ! f ; n = Pl} ; + pot110 = numPl "tio" ; + pot111 = numPl "elva" ; + pot1to19 d = numPl (d.s ! ton) ; + pot0as1 n = {s = n.s ! ental ; n = n.n} ; + pot1 d = numPl (d.s ! tiotal) ; + pot1plus d e = {s = \\g => d.s ! tiotal ++ e.s ! ental ! g ; n = Pl} ; pot1as2 n = n ; - pot2 d = ss (d.s ! ental ++ "hundra") ; - pot2plus d e = ss (d.s ! ental ++ "hundra" ++ e.s) ; + pot2 d = numPl (d.s ! ental ! Neutr ++ "hundra") ; + pot2plus d e = {s = \\g => d.s ! ental ! Neutr ++ "hundra" ++ e.s ! g ; n = Pl} ; pot2as3 n = n ; - pot3 n = ss (n.s ++ "tusen") ; - pot3plus n m = ss (n.s ++ "tusen" ++ m.s) ; + pot3 n = numPl (n.s ! Neutr ++ "tusen") ; + pot3plus n m = {s = \\g => n.s ! Neutr ++ "tusen" ++ m.s ! g ; n = Pl} ; -} \ No newline at end of file +} diff --git a/lib/resource/swedish/StructuralSwe.gf b/lib/resource/swedish/StructuralSwe.gf index a403c3641..a31dc758d 100644 --- a/lib/resource/swedish/StructuralSwe.gf +++ b/lib/resource/swedish/StructuralSwe.gf @@ -12,7 +12,8 @@ concrete StructuralSwe of Structural = lin - UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; --- + UseNumeral i = {s = \\g => table {Nom => i.s ! g ; Gen => i.s ! g ++ + "s"} ; n = i.n} ; --- above_Prep = ss "ovanför" ; after_Prep = ss "efter" ;