From 06cb55df48fd99c4aed88ba19426783d92392481 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 24 Jan 2006 12:55:30 +0000 Subject: [PATCH] completed French ordinals and thereby French/Romance --- doc/gf-modules.html | 2 +- lib/resource-1.0/README | 2 + lib/resource-1.0/french/MorphoFre.gf | 8 +-- lib/resource-1.0/french/NumeralFre.gf | 82 ++++++++++++++++++--------- 4 files changed, 58 insertions(+), 36 deletions(-) diff --git a/doc/gf-modules.html b/doc/gf-modules.html index 155240ea7..52859c2c0 100644 --- a/doc/gf-modules.html +++ b/doc/gf-modules.html @@ -593,7 +593,7 @@ a lock field, cat C ; ===> oper C : Type = T ** {lock_C : {}} ; lincat C = T ; - fun f : C_1 ... C_n -> C ; ===> oper f : A = \x_1,...,x_n -> + fun f : C_1 ... C_n -> C ; ===> oper f : C_1 ... C_n -> C = \x_1,...,x_n -> lin f = t ; t x_1 ... x_n ** {lock_C = <>}; (Notice that the latter translation is type-correct because of diff --git a/lib/resource-1.0/README b/lib/resource-1.0/README index 755a2ce81..58c98dd22 100644 --- a/lib/resource-1.0/README +++ b/lib/resource-1.0/README @@ -42,6 +42,8 @@ When will it be ready? Hopefully around February 2005. ---------- later history and status: +24/1 French complete, as well as the Romance parametrized modules. + 20/1 Main difficulties of French and Romance implemented. Also ParadigmsFre and fragments of LangFre. diff --git a/lib/resource-1.0/french/MorphoFre.gf b/lib/resource-1.0/french/MorphoFre.gf index bdb0c1954..0d171908b 100644 --- a/lib/resource-1.0/french/MorphoFre.gf +++ b/lib/resource-1.0/french/MorphoFre.gf @@ -1332,15 +1332,9 @@ oper t => s + tavoir ! t } ; --- for NumeralsFre +--- for Numerals 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-1.0/french/NumeralFre.gf b/lib/resource-1.0/french/NumeralFre.gf index c808f805b..0f9b57f3a 100644 --- a/lib/resource-1.0/french/NumeralFre.gf +++ b/lib/resource-1.0/french/NumeralFre.gf @@ -1,15 +1,39 @@ -concrete NumeralFre of Numeral = CatFre ** open ResRomance, MorphoFre in { +concrete NumeralFre of Numeral = CatFre ** + open CommonRomance, ResRomance, MorphoFre, Prelude in { -- originally written in 1998, automatically translated to current notation... +-- last modified 24/1/2006, adding ordinals + +-- Auxiliaries + +oper + digitPl : {s : DForm => Str; inh : DForm ; inh1 : Number} -> + {s : CardOrd => DForm => Str ; inh : DForm ; inh1 : Number} = \d -> { + s = \\co,df => let ds = d.s ! df in + case co of { + NCard _ => ds ; + NOrd _ _ => case last ds of { + "q" => "uième" ; + "e" => init ds + "ième" ; + _ => ds + "ième" + } + } ; + inh = d.inh ; inh1 = d.inh1 + } ; + + cardOrd : CardOrd -> Str -> Str -> Str = \co, x,y -> case co of { + NCard _ => x ; + NOrd _ _ => y + } ; lincat - Digit = {inh : DForm ; inh1 : Number ; s : Gender => DForm => Str ; n : Number} ; - Sub10 = {inh : Number ; s : Gender => {p1 : DForm ; p2 : Place} => Str ; n : Number} ; - Sub100 = {s : Gender => Place => Str ; n : Number} ; - Sub1000 = {s : Gender => Place => Str ; n : Number} ; - Sub1000000 = {s : Gender => Str ; n : Number} ; + Digit = {s : CardOrd => DForm => Str ; inh : DForm ; inh1 : 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} ; -lin num x0 = {s = \\_ => x0.s ! Masc} ; ---- ord +lin num x0 = x0 ; lin n2 = digitPl {inh = unit ; inh1 = Sg ; s = table {unit => "deux" ; teen => "douze" ; jten => "vingt" ; ten => "vingt" ; tenplus => "vingt"}} ; @@ -22,18 +46,19 @@ lin n5 = lin n6 = digitPl {inh = unit ; inh1 = 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 ; inh1 = 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 ; inh1 = 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 ; 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 = \\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} ; + {inh = Sg ; s = \\g => let dix = cardOrd g "dix" "dixième" in table { + {p1 = unit ; p2 = indep} => cardOrd g "un" "unième" ; {p1 = unit ; p2 = attr} => [] ; {p1 = teen ; + p2 = indep} => cardOrd g "onze" "onzième" ; {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 = \\g => table {{p1 = unit ; p2 = indep} => d.s ! g ! unit ; {p1 = unit ; p2 = attr} => d.s ! g ! unit ; {p1 = teen ; p2 = indep} @@ -42,10 +67,11 @@ lin pot0 d = {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"} ; n = Pl} ; + {s = \\g => table {_ => cardOrd g "dix" "dixième"} ; n = Pl} ; lin pot111 = - {s = \\_ => table {indep => "onze" ; attr => "onze"} ; n = Pl} ; + {s = \\g => table {_ => cardOrd g "onze" "onzième"} ; n = Pl} ; lin pot1to19 d = {s = \\g => table {indep => d.s ! g ! teen ; attr => d.s ! g ! teen} ; n = Pl} ; lin pot0as1 n = @@ -55,29 +81,29 @@ 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 ! g ! tenplus) ++ (table {{p1 = Sg + {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 = - e.inh}) ++ e.s ! g ! {p1 = d.inh ; p2 = indep} ; attr => (d.s ! g ! + 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 = indep}} ; n = Pl} ; lin pot1as2 n = n ; ----- {s = \\g,d => n.s ! indep ; attr => n.s ! attr}} ; lin pot2 d = - {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} ; + {s = \\g => table {indep => (d.s ! NCard Masc ! {p1 = unit ; p2 = attr}) + ++ table {Sg => cardOrd g "cent" "centième" ; Pl => cardOrd g "cents" "centième"} ! (d.inh) ; attr => (d.s ! + NCard Masc ! {p1 = unit ; p2 = attr}) ++ cardOrd g "cent" "centième"} ; n = Pl} ; lin pot2plus d e = - {s = \\g => table {indep => (d.s ! Masc ! {p1 = unit ; p2 = attr}) - ++ "cent" ++ e.s ! g ! indep ; attr => (d.s ! Masc ! {p1 = unit ; p2 + {s = \\g => table {indep => (d.s ! NCard Masc ! {p1 = unit ; p2 = attr}) + ++ "cent" ++ e.s ! g ! indep ; attr => (d.s ! NCard Masc ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! g ! indep} ; n = Pl} ; lin pot2as3 n = {s = \\g => n.s ! g ! indep ; n = n.n} ; lin pot3 n = - {s = \\_ => (n.s ! Masc ! attr) ++ "mille" ; n = Pl} ; + {s = \\g => (n.s ! NCard Masc ! attr) ++ cardOrd g "mille" "millième" ; n = Pl} ; lin pot3plus n m = - {s = \\g => (n.s ! Masc ! attr) ++ "mille" ++ m.s ! g ! indep ; n = + {s = \\g => (n.s ! NCard Masc ! attr) ++ "mille" ++ m.s ! g ! indep ; n = Pl} ; + } \ No newline at end of file