From ec39c2315b0c71bc1a3177e68b39ac01423fb447 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 6 Apr 2010 12:24:41 +0000 Subject: [PATCH] fixed Finnish youPol complement number to Sg ; some encoding things in French --- src/finnish/CatFin.gf | 2 +- src/finnish/ConjunctionFin.gf | 2 +- src/finnish/IdiomFin.gf | 4 ++-- src/finnish/MorphoFin.gf | 2 +- src/finnish/NounFin.gf | 4 ++-- src/finnish/PhraseFin.gf | 6 +++--- src/finnish/RelativeFin.gf | 4 ++-- src/finnish/ResFin.gf | 34 ++++++++++++++++++++++++---------- src/finnish/SentenceFin.gf | 3 +-- src/finnish/StructuralFin.gf | 5 +++-- src/finnish/VerbFin.gf | 13 +++++++------ src/french/DiffFre.gf | 24 +++++++++++++----------- src/french/StructuralFre.gf | 28 ++++++++++++++-------------- 13 files changed, 74 insertions(+), 57 deletions(-) diff --git a/src/finnish/CatFin.gf b/src/finnish/CatFin.gf index 3af7ad0b6..51f54e6fb 100644 --- a/src/finnish/CatFin.gf +++ b/src/finnish/CatFin.gf @@ -15,7 +15,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in { Cl = {s : ResFin.Tense => Anteriority => Polarity => SType => Str} ; ClSlash = {s : ResFin.Tense => Anteriority => Polarity => Str ; c2 : Compl} ; - Imp = {s : Polarity => Number => Str} ; + Imp = {s : Polarity => Agr => Str} ; -- Question diff --git a/src/finnish/ConjunctionFin.gf b/src/finnish/ConjunctionFin.gf index a11d9c596..e79ba30e0 100644 --- a/src/finnish/ConjunctionFin.gf +++ b/src/finnish/ConjunctionFin.gf @@ -10,7 +10,7 @@ concrete ConjunctionFin of Conjunction = ConjAdv = conjunctDistrSS ; ConjNP conj ss = conjunctDistrTable NPForm conj ss ** { - a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} ; + a = conjAgr (Ag conj.n P3) ss.a ; -- P3 is the maximum isPron = False } ; diff --git a/src/finnish/IdiomFin.gf b/src/finnish/IdiomFin.gf index ab93d01c2..3248b0b85 100644 --- a/src/finnish/IdiomFin.gf +++ b/src/finnish/IdiomFin.gf @@ -61,10 +61,10 @@ concrete IdiomFin of Idiom = CatFin ** -- The imperative is not available in a $VP$. ImpPl1 vp = - let vps = vp.s ! VIPass ! Simul ! Pos ! {n = Pl ; p = P1} + let vps = vp.s ! VIPass ! Simul ! Pos ! Ag Pl P1 in {s = vps.fin ++ vps.inf ++ - vp.s2 ! True ! Pos ! {n = Pl ; p = P1} ++ vp.ext + vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.ext } ; oper diff --git a/src/finnish/MorphoFin.gf b/src/finnish/MorphoFin.gf index 0716b2fc7..45b465241 100644 --- a/src/finnish/MorphoFin.gf +++ b/src/finnish/MorphoFin.gf @@ -866,7 +866,7 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn -> NPCase Abess => minu + ("tt" + a) ; NPAcc => Predef.tk 1 minun + "t" } ; - a = {n = n ; p = p} + a = Ag n p } ; mkDemPronoun : (_,_,_,_,_ : Str) -> Number -> diff --git a/src/finnish/NounFin.gf b/src/finnish/NounFin.gf index 4a7234402..63ab64fc3 100644 --- a/src/finnish/NounFin.gf +++ b/src/finnish/NounFin.gf @@ -64,13 +64,13 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, Prelude in { UsePron p = p ** {isPron = True} ; PredetNP pred np = { - s = \\c => pred.s ! np.a.n ! c ++ np.s ! c ; + s = \\c => pred.s ! complNumAgr np.a ! c ++ np.s ! c ; a = np.a ; isPron = np.isPron -- kaikki minun - ni } ; PPartNP np v2 = { - s = \\c => np.s ! c ++ v2.s ! PastPartPass (AN (NCase np.a.n Ess)) ; + s = \\c => np.s ! c ++ v2.s ! PastPartPass (AN (NCase (complNumAgr np.a) Ess)) ; a = np.a ; isPron = np.isPron -- minun täällä - ni } ; diff --git a/src/finnish/PhraseFin.gf b/src/finnish/PhraseFin.gf index 35fe44133..372293b7c 100644 --- a/src/finnish/PhraseFin.gf +++ b/src/finnish/PhraseFin.gf @@ -5,9 +5,9 @@ concrete PhraseFin of Phrase = CatFin ** open ResFin, (P = Prelude) in { UttS s = s ; UttQS qs = {s = qs.s} ; - UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; - UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; - UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Ag Sg P2} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Ag Pl P2} ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! AgPol} ; UttIP ip = {s = ip.s ! NPCase Nom} ; UttIAdv iadv = iadv ; diff --git a/src/finnish/RelativeFin.gf b/src/finnish/RelativeFin.gf index 9aab4e869..a8d328f6a 100644 --- a/src/finnish/RelativeFin.gf +++ b/src/finnish/RelativeFin.gf @@ -18,7 +18,7 @@ concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin in RAg a => a } ; cl = mkClause - (subjForm {s = rp.s ! agr.n ; + (subjForm {s = rp.s ! (complNumAgr agr) ; a = agr ; isPron = False} vp.sc) agr vp in cl.s ! t ! ant ! b ! SDecl ; @@ -29,7 +29,7 @@ concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin in s = \\t,a,p,ag => let cls = slash.s ! t ! a ! p ; - who = appCompl True p slash.c2 (rp2np ag.n rp) + who = appCompl True p slash.c2 (rp2np (complNumAgr ag) rp) in who ++ cls ; c = slash.c2.c diff --git a/src/finnish/ResFin.gf b/src/finnish/ResFin.gf index 350cb2789..fcd92a94b 100644 --- a/src/finnish/ResFin.gf +++ b/src/finnish/ResFin.gf @@ -26,11 +26,22 @@ resource ResFin = ParamX ** open Prelude in { | NPossNom Number | NPossGen Number --- number needed for syntax of AdjCN | NPossTransl Number | NPossIllat Number ; --- Agreement of $NP$ is a record. We'll add $Gender$ later. +-- Agreement of $NP$ has number*person and the polite second ("te olette valmis"). + + + Agr = Ag Number Person | AgPol ; oper - Agr = {n : Number ; p : Person} ; + complNumAgr : Agr -> Number = \a -> case a of { + Ag n _ => n ; + AgPol => Sg + } ; + verbAgr : Agr -> {n : Number ; p : Person} = \a -> case a of { + Ag n p => {n = n ; p = p} ; + AgPol => {n = Pl ; p = P2} + } ; + oper NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ; -- @@ -106,7 +117,7 @@ param --2 For $Relative$ - RAgr = RNoAg | RAg {n : Number ; p : Person} ; + RAgr = RNoAg | RAg Agr ; --2 For $Numeral$ @@ -116,11 +127,13 @@ param oper agrP3 : Number -> Agr = \n -> - {n = n ; p = P3} ; + Ag n P3 ; - conjAgr : Agr -> Agr -> Agr = \a,b -> { - n = conjNumber a.n b.n ; - p = conjPerson a.p b.p + conjAgr : Agr -> Agr -> Agr = \a,b -> case of { + => Ag (conjNumber n m) (conjPerson p q) ; + => Ag Pl (conjPerson p P2) ; + => Ag Pl (conjPerson p P2) ; + _ => b } ; --- @@ -163,9 +176,10 @@ oper } ; predV : (Verb ** {sc : NPForm ; qp : Str}) -> VP = \verb -> { - s = \\vi,ant,b,agr => + s = \\vi,ant,b,agr0 => let + agr = verbAgr agr0 ; verbs = verb.s ; part : Str = case vi of { VIPass => verbs ! PastPartPass (AN (NCase agr.n Nom)) ; @@ -573,9 +587,9 @@ oper } ; possSuffixFront : Agr -> Str = \agr -> - table Agr ["ni" ; "si" ; "nsä" ; "mme" ; "nne" ; "nsä"] ! agr ; + table Agr ["ni" ; "si" ; "nsä" ; "mme" ; "nne" ; "nsä" ; "nne"] ! agr ; possSuffix : Agr -> Str = \agr -> - table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa"] ! agr ; + table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa" ; "nne"] ! agr ; oper rp2np : Number -> {s : Number => NPForm => Str ; a : RAgr} -> NP = \n,rp -> { diff --git a/src/finnish/SentenceFin.gf b/src/finnish/SentenceFin.gf index 50ef6d447..010321f78 100644 --- a/src/finnish/SentenceFin.gf +++ b/src/finnish/SentenceFin.gf @@ -9,9 +9,8 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in { PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ; ImpVP vp = { - s = \\pol,n => + s = \\pol,agr => let - agr = {n = n ; p = P2} ; verb = vp.s ! VIImper ! Simul ! pol ! agr ; compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto) in diff --git a/src/finnish/StructuralFin.gf b/src/finnish/StructuralFin.gf index c46ba64da..3f5919396 100644 --- a/src/finnish/StructuralFin.gf +++ b/src/finnish/StructuralFin.gf @@ -159,8 +159,9 @@ concrete StructuralFin of Structural = CatFin ** yes_Utt = ss "kyllä" ; youSg_Pron = mkPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ; youPl_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ; - youPol_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ; --- Sg - + youPol_Pron = + let p = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 in + {s = p.s ; a = AgPol} ; oper jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str = diff --git a/src/finnish/VerbFin.gf b/src/finnish/VerbFin.gf index 7b9c36b4a..04a057d6b 100644 --- a/src/finnish/VerbFin.gf +++ b/src/finnish/VerbFin.gf @@ -33,7 +33,8 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in { ComplVA v ap = insertObj (\\_,b,agr => - ap.s ! False ! (NCase agr.n (npform2case agr.n v.c2.c))) --- v.cs.s ignored + let n = (complNumAgr agr) in + ap.s ! False ! (NCase n (npform2case n v.c2.c))) --- v.cs.s ignored (predV v) ; SlashV2S v s = @@ -90,12 +91,12 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in { CompAP ap = { s = \\agr => let - n = agr.n ; - c = case agr.n of { - Sg => Nom ; -- minä olen iso - Pl => Part -- me olemme isoja + n = complNumAgr agr ; + c = case n of { + Sg => Nom ; -- minä olen iso ; te olette iso + Pl => Part -- me olemme isoja ; te olette isoja } --- definiteness of NP ? - in ap.s ! False ! (NCase agr.n c) + in ap.s ! False ! (NCase n c) } ; CompNP np = {s = \\_ => np.s ! NPCase Nom} ; CompAdv a = {s = \\_ => a.s} ; diff --git a/src/french/DiffFre.gf b/src/french/DiffFre.gf index 3f178a4f0..30bb1b55f 100644 --- a/src/french/DiffFre.gf +++ b/src/french/DiffFre.gf @@ -2,7 +2,7 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { - flags optimize=noexpand ; coding=utf8 ; + flags optimize=noexpand ; -- coding=utf8 ; -- flags optimize=all ; param @@ -16,7 +16,7 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { prepCase : Case -> Str = \c -> case c of { Nom => [] ; Acc => [] ; - CPrep P_a => "à" ; + CPrep P_a => "à" ; CPrep P_de => elisDe ; CPrep PNul => [] } ; @@ -24,7 +24,7 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { artDef : Gender -> Number -> Case -> Str = \g,n,c -> case of { => pre {"du" ; ["de l'"] / voyelle} ; - => pre {"au" ; ["à l'"] / voyelle} ; + => pre {"au" ; ["à l'"] / voyelle} ; => elisLe ; => prepCase c ++ elisLa ; <_, Pl, CPrep P_de> => "des" ; @@ -205,18 +205,20 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { auxPassive : Verb = copula ; - copula : Verb = {s = table VF ["être";"être";"suis";"es";"est";"sommes";"êtes";"sont";"sois";"sois";"soit";"soyons";"soyez";"soient"; -"étais";"étais";"était";"étions";"étiez";"étaient";--# notpresent -"fusse";"fusses";"fût";"fussions";"fussiez";"fussent";--# notpresent -"fus";"fus";"fut";"fûmes";"fûtes";"furent";--# notpresent + copula : Verb = {s = table VF ["être";"être";"suis";"es";"est";"sommes";"êtes";"sont";"sois";"sois" +;"soit";"soyons";"soyez";"soient"; +"étais";"étais";"était";"étions";"étiez";"étaient";--# notpresent +"fusse";"fusses";"fût";"fussions";"fussiez";"fussent";--# notpresent +"fus";"fus";"fut";"fûmes";"fûtes";"furent";--# notpresent "serai";"seras";"sera";"serons";"serez";"seront";--# notpresent "serais";"serais";"serait";"serions";"seriez";"seraient";--# notpresent -"sois";"soyons";"soyez";"été";"étés";"étée";"étées";"étant"]; vtyp=VHabere} ; +"sois";"soyons";"soyez";"été";"étés";"étée";"étées";"étant"]; vtyp=VHabere} ; - avoir_V : Verb = {s=table VF ["avoir";"avoir";"ai";"as";"a";"avons";"avez";"ont";"aie";"aies";"ait";"ayons";"ayez";"aient"; + avoir_V : Verb = {s=table VF ["avoir";"avoir";"ai";"as";"a";"avons";"avez";"ont";"aie";"aies";"ait" +;"ayons";"ayez";"aient"; "avais";"avais";"avait";"avions";"aviez";"avaient"; --# notpresent -"eusse";"eusses";"eût";"eussions";"eussiez";"eussent";--# notpresent -"eus";"eus";"eut";"eûmes";"eûtes";"eurent";--# notpresent +"eusse";"eusses";"eût";"eussions";"eussiez";"eussent";--# notpresent +"eus";"eus";"eut";"eûmes";"eûtes";"eurent";--# notpresent "aurai";"auras";"aura";"aurons";"aurez";"auront";--# notpresent "aurais";"aurais";"aurait";"aurions";"auriez";"auraient";--# notpresent "aie";"ayons";"ayez";"eu";"eus";"eue";"eues";"ayant"];vtyp=VHabere}; diff --git a/src/french/StructuralFre.gf b/src/french/StructuralFre.gf index 9077d3436..ebc7ef9d3 100644 --- a/src/french/StructuralFre.gf +++ b/src/french/StructuralFre.gf @@ -10,7 +10,7 @@ concrete StructuralFre of Structural = CatFre ** lin above_Prep = {s = ["au dessus"] ; c = MorphoFre.genitive ; isDir = False} ; - after_Prep = mkPreposition "après" ; + after_Prep = mkPreposition "après" ; all_Predet = { s = \\a,c => prepCase c ++ aagrForms "tout" "toute" "tous" "toutes" ! a ; c = Nom ; @@ -22,7 +22,7 @@ lin and_Conj = {s1 = [] ; s2 = "et" ; n = Pl} ; because_Subj = ss ("parce" ++ elisQue) ** {m = Indic} ; before_Prep = mkPreposition "avant" ; - behind_Prep = mkPreposition "derrière" ; + behind_Prep = mkPreposition "derrière" ; between_Prep = mkPreposition "entre" ; both7and_DConj = {s1,s2 = "et" ; n = Pl} ; but_PConj = ss "mais" ; @@ -80,7 +80,7 @@ lin or_Conj = {s1 = [] ; s2 = "ou" ; n = Sg} ; otherwise_PConj = ss "autrement" ; part_Prep = complGen ; - please_Voc = ss ["s'il vous plaît"] ; + please_Voc = ss ["s'il vous plaît"] ; possess_Prep = complGen ; quite_Adv = ss "assez" ; she_Pron = @@ -102,16 +102,16 @@ lin Pl => \\_,c => prepCase c ++ "ces" } ; sp = table { - Sg => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g ; - Pl => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g + Sg => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g ; + Pl => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g } ; - s2 = [] ---- "-là" + s2 = [] ---- "-là" } ; ---b that_NP = makeNP ["cela"] Masc Sg ; - there7from_Adv = ss ["de là"] ; - there7to_Adv = ss "là" ; --- y - there_Adv = ss "là" ; + there7from_Adv = ss ["de là"] ; + there7to_Adv = ss "là" ; --- y + there_Adv = ss "là" ; therefore_PConj = ss "donc" ; ---b these_NP = makeNP ["ceux-ci"] Masc Pl ; they_Pron = mkPronoun @@ -132,12 +132,12 @@ lin } ; ---b this_NP = pn2np (mkPN ["ceci"] Masc) ; ----b those_NP = makeNP ["ceux-là"] Masc Pl ; +---b those_NP = makeNP ["ceux-là"] Masc Pl ; through_Prep = mkPreposition "par" ; too_AdA = ss "trop" ; to_Prep = complDat ; under_Prep = mkPreposition "sous" ; - very_AdA = ss "très" ; + very_AdA = ss "très" ; want_VV = mkVV (vouloir_V2 ** {lock_V = <>}) ; we_Pron = mkPronoun "nous" "nous" "nous" "nous" "notre" "notre" "nos" @@ -150,7 +150,7 @@ lin where {a = aagr Masc Pl} ; when_IAdv = ss "quand" ; when_Subj = ss "quand" ** {m = Indic} ; - where_IAdv = ss "où" ; + where_IAdv = ss "où" ; which_IQuant = { s = \\n,g,c => prepCase c ++ aagrForms "quel" "quelle" "quels" "quelles" ! aagr g n @@ -190,14 +190,14 @@ lin at_least_AdN = ss "au moins" ; at_most_AdN = ss "au plus" ; - except_Prep = mkPreposition "excepté" ; + except_Prep = mkPreposition "excepté" ; as_CAdv = X.mkCAdv "aussi" conjThan ; have_V2 = avoir_V2 ; that_Subj = ss elisQue ** {m = Conjunct} ; - lin language_title_Utt = ss "français" ; + lin language_title_Utt = ss "français" ; }