From 1ba9ffcff7f17e10a815d7eb221d4760dc46ba7f Mon Sep 17 00:00:00 2001 From: malin Date: Wed, 9 Nov 2011 19:23:46 +0000 Subject: [PATCH] future tense 'komma att' in scandinavian --- lib/src/danish/CatDan.gf | 2 +- lib/src/danish/DiffDan.gf | 2 ++ lib/src/danish/IdiomDan.gf | 2 +- lib/src/norwegian/CatNor.gf | 2 +- lib/src/norwegian/DiffNor.gf | 2 ++ lib/src/norwegian/ExtraNor.gf | 2 ++ lib/src/norwegian/IdiomNor.gf | 2 +- lib/src/scandinavian/CatScand.gf | 17 +++++++---- lib/src/scandinavian/CommonScand.gf | 21 ++++++++++---- lib/src/scandinavian/ConjunctionScand.gf | 8 +++--- lib/src/scandinavian/DiffScand.gf | 4 ++- lib/src/scandinavian/ExtraScandAbs.gf | 4 ++- lib/src/scandinavian/NounScand.gf | 4 +-- lib/src/scandinavian/RelativeScand.gf | 8 +++--- lib/src/scandinavian/ResScand.gf | 36 +++++++++++++----------- lib/src/scandinavian/SentenceScand.gf | 4 +-- lib/src/swedish/CatSwe.gf | 2 +- lib/src/swedish/DiffSwe.gf | 3 ++ lib/src/swedish/IdiomSwe.gf | 2 +- lib/src/swedish/ResSwe.gf | 3 +- lib/src/swedish/StructuralSwe.gf | 2 +- 21 files changed, 82 insertions(+), 50 deletions(-) diff --git a/lib/src/danish/CatDan.gf b/lib/src/danish/CatDan.gf index d3d6eec83..375c8d34a 100644 --- a/lib/src/danish/CatDan.gf +++ b/lib/src/danish/CatDan.gf @@ -1,2 +1,2 @@ -concrete CatDan of Cat = CommonX ** CatScand with +concrete CatDan of Cat = CommonX -[Tense, Temp] ** CatScand with (ResScand = ResDan) ; diff --git a/lib/src/danish/DiffDan.gf b/lib/src/danish/DiffDan.gf index 72912ae49..7faaa5b86 100644 --- a/lib/src/danish/DiffDan.gf +++ b/lib/src/danish/DiffDan.gf @@ -47,6 +47,8 @@ instance DiffDan of DiffScand = open CommonScand, Prelude in { {part = [] ; isVaere = True} ; auxFut = "vil" ; -- "skal" in ExtDan + auxFutKommer = "vil" ; + auxFutPart = "" ; auxCond = "ville" ; negation : Polarity => Str = table { diff --git a/lib/src/danish/IdiomDan.gf b/lib/src/danish/IdiomDan.gf index dd0bee9f7..28f51bb5a 100644 --- a/lib/src/danish/IdiomDan.gf +++ b/lib/src/danish/IdiomDan.gf @@ -8,7 +8,7 @@ concrete IdiomDan of Idiom = CatDan ** GenericCl vp = mkClause "man" (agrP3 MorphoDan.utrum Sg) vp ; CleftNP np rs = mkClause "det" (agrP3 MorphoDan.neutrum Sg) - (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a) (predV verbBe)) ; + (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a ! RNom) (predV verbBe)) ; CleftAdv ad s = mkClause "det" (agrP3 MorphoDan.neutrum Sg) (insertObj (\\_ => ad.s ++ s.s ! Sub) (predV verbBe)) ; diff --git a/lib/src/norwegian/CatNor.gf b/lib/src/norwegian/CatNor.gf index bfc4b5390..f432329ea 100644 --- a/lib/src/norwegian/CatNor.gf +++ b/lib/src/norwegian/CatNor.gf @@ -1,2 +1,2 @@ -concrete CatNor of Cat = CommonX ** CatScand with +concrete CatNor of Cat = CommonX - [Tense, Temp] ** CatScand with (ResScand = ResNor) ; diff --git a/lib/src/norwegian/DiffNor.gf b/lib/src/norwegian/DiffNor.gf index 3ae69f84e..3cfe4ee9b 100644 --- a/lib/src/norwegian/DiffNor.gf +++ b/lib/src/norwegian/DiffNor.gf @@ -57,6 +57,8 @@ instance DiffNor of DiffScand = open CommonScand, Prelude in { noPart = {part = []} ; auxFut = "vil" ; -- "skal" in ExtNor + auxFutKommer = "kommer" ; + auxFutPart = "til" ; auxCond = "ville" ; negation : Polarity => Str = table { diff --git a/lib/src/norwegian/ExtraNor.gf b/lib/src/norwegian/ExtraNor.gf index c3f8811ff..db5a48cfc 100644 --- a/lib/src/norwegian/ExtraNor.gf +++ b/lib/src/norwegian/ExtraNor.gf @@ -6,4 +6,6 @@ concrete ExtraNor of ExtraNorAbs = ExtraScandNor ** open CommonScand, ResNor, Pr a = np.a } ; + TFutKommer = {s = []} ** {t = SFutKommer} ; --# notpresent + } diff --git a/lib/src/norwegian/IdiomNor.gf b/lib/src/norwegian/IdiomNor.gf index b9c9dfdfe..5db5d940a 100644 --- a/lib/src/norwegian/IdiomNor.gf +++ b/lib/src/norwegian/IdiomNor.gf @@ -9,7 +9,7 @@ concrete IdiomNor of Idiom = CatNor ** GenericCl vp = mkClause "man" (agrP3 Utr Sg) vp ; CleftNP np rs = mkClause "det" (agrP3 Neutr Sg) - (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a) (predV verbBe)) ; + (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a ! RNom) (predV verbBe)) ; CleftAdv ad s = mkClause "det" (agrP3 Neutr Sg) (insertObj (\\_ => ad.s ++ s.s ! Sub) (predV verbBe)) ; diff --git a/lib/src/scandinavian/CatScand.gf b/lib/src/scandinavian/CatScand.gf index e83954b4e..cc1ab78af 100644 --- a/lib/src/scandinavian/CatScand.gf +++ b/lib/src/scandinavian/CatScand.gf @@ -1,5 +1,5 @@ incomplete concrete CatScand of Cat = - CommonX ** open ResScand, Prelude, CommonScand, (R = ParamX) in { + CommonX -[Tense,Temp] ** open (RS = ResScand), Prelude, CommonScand, (R = ParamX) in { flags optimize=all_subs ; @@ -9,14 +9,14 @@ incomplete concrete CatScand of Cat = S = {s : Order => Str} ; QS = {s : QForm => Str} ; - RS = {s : Agr => Str ; c : NPForm} ; + RS = {s : Agr => RCase => Str ; c : NPForm} ; SSlash = {s : Order => Str ; n3 : Agr => Str ; c2 : Complement} ; -- Sentence - Cl = {s : R.Tense => Anteriority => Polarity => Order => Str} ; + Cl = {s : STense => Anteriority => Polarity => Order => Str} ; ClSlash = { - s : R.Tense => Anteriority => Polarity => Order => Str ; + s : STense => Anteriority => Polarity => Order => Str ; n3 : Agr => Str ; c2 : Complement } ; @@ -24,7 +24,7 @@ incomplete concrete CatScand of Cat = -- Question - QCl = {s : R.Tense => Anteriority => Polarity => QForm => Str} ; + QCl = {s : STense => Anteriority => Polarity => QForm => Str} ; IP = {s : NPForm => Str ; g : Gender ; n : Number} ; IComp = {s : AFormPos => Str} ; IDet = {s : NGender => Str ; n : Number ; det : DetSpecies} ; @@ -32,7 +32,7 @@ incomplete concrete CatScand of Cat = -- Relative; the case $c$ is for "det" clefts. - RCl = {s : R.Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ; + RCl = {s : STense => Anteriority => Polarity => Agr => RCase => Str ; c : NPForm} ; RP = {s : Gender => Number => RCase => Str ; a : RAgr} ; -- Verb @@ -102,4 +102,9 @@ incomplete concrete CatScand of Cat = N3 = Noun ** {c2,c3 : Complement} ; PN = {s : Case => Str ; g : Gender} ; + + + lincat + Temp = {s : Str ; t : STense ; a : Anteriority} ; + Tense = {s : Str ; t : STense} ; } diff --git a/lib/src/scandinavian/CommonScand.gf b/lib/src/scandinavian/CommonScand.gf index 917de5754..548fe5d69 100644 --- a/lib/src/scandinavian/CommonScand.gf +++ b/lib/src/scandinavian/CommonScand.gf @@ -59,7 +59,7 @@ param ; VPForm = - VPFinite Tense Anteriority + VPFinite STense Anteriority | VPImperat | VPInfinit Anteriority ; @@ -73,6 +73,17 @@ param PredetAgr = PNoAg | PAg Number ; + STense = + SPres + | SPast --# notpresent + | SFut --# notpresent + | SFutKommer --# notpresent -- komma att + | SCond --# notpresent + ; + + + + oper Complement : Type = {s : Str ; hasPrep : Bool} ; @@ -121,10 +132,10 @@ oper -- Used in $DiffScand.predV$. - vFin : Tense -> Voice -> VForm = \t,v -> case t of { - Pres => VF (VPres v) + vFin : STense -> Voice -> VForm = \t,v -> case t of { + SPres => VF (VPres v) ; --# notpresent - Past => VF (VPret v) ; --# notpresent + SPast => VF (VPret v) ; --# notpresent _ => VI (VInfin v) --# notpresent } ; @@ -315,7 +326,7 @@ oper -- For $Sentence$. Clause : Type = { - s : Tense => Anteriority => Polarity => Order => Str + s : STense => Anteriority => Polarity => Order => Str } ; mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { diff --git a/lib/src/scandinavian/ConjunctionScand.gf b/lib/src/scandinavian/ConjunctionScand.gf index 03b3226f2..ffbdc2207 100644 --- a/lib/src/scandinavian/ConjunctionScand.gf +++ b/lib/src/scandinavian/ConjunctionScand.gf @@ -17,7 +17,7 @@ incomplete concrete ConjunctionScand of Conjunction = isPre = ss.isPre } ; - ConjRS conj ss = conjunctDistrTable Agr conj ss ** { + ConjRS conj ss = conjunctDistrTable2 Agr RCase conj ss ** { c = ss.c } ; @@ -43,8 +43,8 @@ incomplete concrete ConjunctionScand of Conjunction = ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ; BaseAP x y = twoTable AFormPos x y ** {isPre = andB x.isPre y.isPre} ; ConsAP xs x = consrTable AFormPos comma xs x ** {isPre = andB xs.isPre x.isPre} ; - BaseRS x y = twoTable Agr x y ** {c = y.c} ; - ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ; + BaseRS x y = twoTable2 Agr RCase x y ** {c = y.c} ; + ConsRS xs x = consrTable2 Agr RCase comma xs x ** {c = xs.c} ; BaseIAdv = twoSS ; ConsIAdv = consrSS comma ; BaseCN = twoTable3 Number DetSpecies Case ; @@ -56,7 +56,7 @@ incomplete concrete ConjunctionScand of Conjunction = [IAdv] = {s1,s2 : Str} ; [NP] = {s1,s2 : NPForm => Str ; a : Agr} ; [AP] = {s1,s2 : AFormPos => Str ; isPre : Bool} ; - [RS] = {s1,s2 : Agr => Str ; c : NPForm} ; + [RS] = {s1,s2 : Agr => RCase => Str ; c : NPForm} ; [CN] = {s1,s2 : Number => DetSpecies => Case => Str} ; --- g : NGender ; isMod : Bool} ; } diff --git a/lib/src/scandinavian/DiffScand.gf b/lib/src/scandinavian/DiffScand.gf index 584235b5f..f0c84873e 100644 --- a/lib/src/scandinavian/DiffScand.gf +++ b/lib/src/scandinavian/DiffScand.gf @@ -42,7 +42,9 @@ interface DiffScand = open CommonScand, Prelude in { verbBecome : Verb ; - auxFut : Str ; + auxFut : Str ; -- ska + auxFutKommer : Str ; -- "kommer" + auxFutPart : Str ; -- "til" auxCond : Str ; negation : Polarity => Str ; diff --git a/lib/src/scandinavian/ExtraScandAbs.gf b/lib/src/scandinavian/ExtraScandAbs.gf index 7f0fb1651..f3e2c3033 100644 --- a/lib/src/scandinavian/ExtraScandAbs.gf +++ b/lib/src/scandinavian/ExtraScandAbs.gf @@ -1,3 +1,5 @@ abstract ExtraScandAbs = Extra ** { - + + fun + TFutKommer : Tense ; --# notpresent } diff --git a/lib/src/scandinavian/NounScand.gf b/lib/src/scandinavian/NounScand.gf index f7ef79ecd..0933f9d0f 100644 --- a/lib/src/scandinavian/NounScand.gf +++ b/lib/src/scandinavian/NounScand.gf @@ -176,13 +176,13 @@ incomplete concrete NounScand of Noun = } ; RelCN cn rs = let g = cn.g in { - s = \\n,d,c => cn.s ! n ! d ! c ++ rs.s ! agrP3 (ngen2gen g) n ; + s = \\n,d,c => cn.s ! n ! d ! c ++ rs.s ! agrP3 (ngen2gen g) n ! RNom ; g = g ; isMod = cn.isMod } ; RelNP np rs = { - s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; + s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ! RNom ; a = np.a ; isMod = np.isMod } ; diff --git a/lib/src/scandinavian/RelativeScand.gf b/lib/src/scandinavian/RelativeScand.gf index 33446f2ca..373b234be 100644 --- a/lib/src/scandinavian/RelativeScand.gf +++ b/lib/src/scandinavian/RelativeScand.gf @@ -6,19 +6,19 @@ incomplete concrete RelativeScand of Relative = lin RelCl cl = { - s = \\t,a,p,ag => + s = \\t,a,p,ag,_ => pronSuch ! gennumAgr ag ++ conjThat ++ cl.s ! t ! a ! p ! Sub ; c = NPAcc } ; RelVP rp vp = { - s = \\t,ant,b,ag => + s = \\t,ant,b,ag,rc => let agr = case rp.a of { RNoAg => ag ; RAg g n p => {g = g ; n = n ; p = p} } ; - cl = mkClause (rp.s ! ag.g ! ag.n ! RNom) agr vp + cl = mkClause (rp.s ! ag.g ! ag.n ! rc) agr vp in cl.s ! t ! ant ! b ! Sub ; c = NPNom @@ -29,7 +29,7 @@ incomplete concrete RelativeScand of Relative = -- and the empty relative ("huset hon bor i") are defined in $ExtraScand$. RelSlash rp slash = { - s = \\t,a,p,ag => + s = \\t,a,p,ag,_ => let agr = case rp.a of { RNoAg => ag ; diff --git a/lib/src/scandinavian/ResScand.gf b/lib/src/scandinavian/ResScand.gf index 8ad8f4f83..ebc96aeca 100644 --- a/lib/src/scandinavian/ResScand.gf +++ b/lib/src/scandinavian/ResScand.gf @@ -16,15 +16,20 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in { Noun = {s : Number => Species => Case => Str ; g : NGender} ; --- This function is here because it depends on $verbHave, auxFut, auxCond$. +-- needed for VP conjunction + param + VPIForm = VPIInf | VPISup ; ---- sup not yet used - predV : Verb -> VP = \verb -> + +-- This function is here because it depends on $verbHave, auxFut, auxCond$. + oper + predV : Verb -> VP = \verb -> let diath = case verb.vtype of { VPass => Pass ; _ => Act } ; - vfin : Tense -> Str = \t -> verb.s ! vFin t diath ; + vfin : STense -> Str = \t -> verb.s ! vFin t diath ; vsup = verb.s ! VI (VSupin diath) ; --# notpresent vinf = verb.s ! VI (VInfin diath) ; @@ -32,8 +37,9 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in { True => verbBe.s ; _ => verbHave.s } ; + - har : Tense -> Str = \t -> auxv ! vFin t Act ; + har : STense -> Str = \t -> auxv ! vFin t Act ; ha : Str = auxv ! VI (VInfin Act) ; vf : Str -> Str -> {fin,inf : Str} = \fin,inf -> { @@ -43,16 +49,18 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in { in { s = table { VPFinite t Simul => case t of { --- Pres | Past => vf (vfin t) [] ; -- the general rule - Past => vf (vfin t) [] ; --# notpresent - Fut => vf auxFut vinf ; --# notpresent - Cond => vf auxCond vinf ; --# notpresent - Pres => vf (vfin t) [] +-- SPres | SPast => vf (vfin t) [] ; -- the general rule + SPast => vf (vfin t) [] ; --# notpresent + SFut => vf auxFut vinf ; --# notpresent + SFutKommer => vf auxFutKommer (auxFutPart ++ infMark ++ vinf) ; --# notpresent + SCond => vf auxCond vinf ; --# notpresent + SPres => vf (vfin t) [] } ; VPFinite t Anter => case t of { --# notpresent - Pres | Past => vf (har t) vsup ; --# notpresent - Fut => vf auxFut (ha ++ vsup) ; --# notpresent - Cond => vf auxCond (ha ++ vsup) --# notpresent + SPres | SPast => vf (har t) vsup ; --# notpresent + SFut => vf auxFut (ha ++ vsup) ; --# notpresent + SFutKommer => vf auxFutKommer (auxFutPart ++ infMark ++ ha ++ vsup) ; --# notpresent + SCond => vf auxCond (ha ++ vsup) --# notpresent } ; --# notpresent VPImperat => vf (verb.s ! VF (VImper diath)) [] ; VPInfinit Anter => vf [] (ha ++ vsup) ; --# notpresent @@ -68,9 +76,5 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in { en2,ea2,eext : Bool = False -- indicate if the field exists } ; --- needed for VP conjunction - param - VPIForm = VPIInf | VPISup ; ---- sup not yet used - } diff --git a/lib/src/scandinavian/SentenceScand.gf b/lib/src/scandinavian/SentenceScand.gf index 31e235eb4..d5292dce7 100644 --- a/lib/src/scandinavian/SentenceScand.gf +++ b/lib/src/scandinavian/SentenceScand.gf @@ -48,7 +48,7 @@ incomplete concrete SentenceScand of Sentence = s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! q } ; UseRCl t p cl = { - s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! r ; + s = \\r,rc => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! r ! rc ; c = cl.c } ; UseSlash t p cl = { @@ -60,6 +60,6 @@ incomplete concrete SentenceScand of Sentence = AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ; ExtAdvS a s = {s = \\o => a.s ++ "," ++ s.s ! Inv} ; - RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! agrP3 Neutr Sg} ; --- vilket + RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! agrP3 Neutr Sg ! RPrep True } ; --- vilket } diff --git a/lib/src/swedish/CatSwe.gf b/lib/src/swedish/CatSwe.gf index c35924036..ab221ea50 100644 --- a/lib/src/swedish/CatSwe.gf +++ b/lib/src/swedish/CatSwe.gf @@ -1,2 +1,2 @@ -concrete CatSwe of Cat = CommonX ** CatScand with +concrete CatSwe of Cat = CommonX - [Tense,Temp] ** CatScand with (ResScand = ResSwe) ; diff --git a/lib/src/swedish/DiffSwe.gf b/lib/src/swedish/DiffSwe.gf index f1865e2fb..0eadbf6c6 100644 --- a/lib/src/swedish/DiffSwe.gf +++ b/lib/src/swedish/DiffSwe.gf @@ -19,6 +19,7 @@ instance DiffSwe of DiffScand = open CommonScand, Prelude in { hasAuxBe _ = False ; + -- Strings. conjThat = "att" ; @@ -48,6 +49,8 @@ instance DiffSwe of DiffScand = open CommonScand, Prelude in { noPart = {part = []} ; auxFut = "ska" ; -- "skall" in ExtSwe + auxFutKommer = "kommer" ; + auxFutPart = "" ; auxCond = "skulle" ; negation : Polarity => Str = table { diff --git a/lib/src/swedish/IdiomSwe.gf b/lib/src/swedish/IdiomSwe.gf index 78b1d69be..70796feb3 100644 --- a/lib/src/swedish/IdiomSwe.gf +++ b/lib/src/swedish/IdiomSwe.gf @@ -12,7 +12,7 @@ concrete IdiomSwe of Idiom = CatSwe ** GenericCl vp = mkClause "man" (agrP3 utr Sg) vp ; CleftNP np rs = mkClause "det" (agrP3 neutr Sg) - (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a) (predV verbBe)) ; + (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a ! RNom) (predV verbBe)) ; CleftAdv ad s = mkClause "det" (agrP3 neutr Sg) (insertObj (\\_ => ad.s ++ s.s ! Sub) (predV verbBe)) ; diff --git a/lib/src/swedish/ResSwe.gf b/lib/src/swedish/ResSwe.gf index 7b5a52a88..37cf7eab0 100644 --- a/lib/src/swedish/ResSwe.gf +++ b/lib/src/swedish/ResSwe.gf @@ -1,3 +1,2 @@ -instance ResSwe of ResScand = DiffSwe ** open CommonScand, Prelude in { +instance ResSwe of ResScand = DiffSwe ** open CommonScand, Prelude in { } ; - diff --git a/lib/src/swedish/StructuralSwe.gf b/lib/src/swedish/StructuralSwe.gf index 27e15d00d..6ced2268f 100644 --- a/lib/src/swedish/StructuralSwe.gf +++ b/lib/src/swedish/StructuralSwe.gf @@ -28,7 +28,7 @@ concrete StructuralSwe of Structural = CatSwe ** everybody_NP = regNP "alla" "allas" Utr Pl ; every_Det = { s = \\_,_ => "varje" ; - sp = \\_,_ => "var och en" ; ---- + sp = \\_ => genderForms ["var och en"] ["vart och ett"] ; ---- n = Sg ; det = DIndef } ;