diff --git a/src/bulgarian/CatBul.gf b/src/bulgarian/CatBul.gf index e97317e62..249558d53 100644 --- a/src/bulgarian/CatBul.gf +++ b/src/bulgarian/CatBul.gf @@ -52,8 +52,8 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv,AdV,SC] ** open ResBul, Prelude, P -- Noun CN = {s : NForm => Str; g : AGender} ; - NP = {s : Role => Str; a : Agr; p : Polarity} ; - Pron = {s : Role => Str; clit : Case => Str; gen : AForm => Str; a : Agr} ; + NP = {s : Role => Str; gn : GenNum; p : PronPerson} ; + Pron = {s : Role => Str; gen : AForm => Str; gn : GenNum; p : PronPerson} ; Det,DAP = {s : Bool => AGender => Role => Str; nn : NNumber; spec : Species; p : Polarity} ; Predet = {s : GenNum => Str} ; Ord = {s : AForm => Str} ; @@ -118,6 +118,7 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv,AdV,SC] ** open ResBul, Prelude, P VPSlash = \vps -> let vp : ResBul.VP = {s = vps.s ; ad = vps.ad ; + clitics = vps.clitics ; compl = \\a => vps.compl1 ! a ++ vps.c2.s ++ vps.compl2 ! a ; vtype = vps.vtype ; p = Pos ; @@ -132,19 +133,19 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv,AdV,SC] ** open ResBul, Prelude, P } ; V, VS, VQ, VA = \v -> linrefVP (predV v); - V2 = \v -> linrefVP (predV v) ++ linrefPrep v.c2 ; - V2V = \v -> linrefVP (predV v) ++ linrefPrep v.c2 ++ linrefPrep v.c3 ++ "да"; - V2A, V2S, V2Q = \v -> linrefVP (predV v) ++ linrefPrep v.c2 ++ linrefPrep v.c3; - V3 = \v -> linrefVP (predV v) ++ linrefPrep v.c2 ++ linrefPrep v.c3; + V2 = \v -> linrefVP (predV v) ++ linPrep v.c2 ; + V2V = \v -> linrefVP (predV v) ++ linPrep v.c2 ++ linPrep v.c3 ++ "да"; + V2A, V2S, V2Q = \v -> linrefVP (predV v) ++ linPrep v.c2 ++ linPrep v.c3; + V3 = \v -> linrefVP (predV v) ++ linPrep v.c2 ++ linPrep v.c3; VV = \v -> linrefVP (predV v); - Prep = linrefPrep ; + Prep = linPrep ; A = \a -> a.s ! ASg Masc Indef; A2 = \a -> a.s ! ASg Masc Indef ++ a.c2; N = \n -> n.s ! NF Sg Indef; - N2 = \n -> n.s ! NF Sg Indef ++ linrefPrep n.c2; - N3 = \n -> n.s ! NF Sg Indef ++ linrefPrep n.c2 ++ linrefPrep n.c3; + N2 = \n -> n.s ! NF Sg Indef ++ linPrep n.c2; + N3 = \n -> n.s ! NF Sg Indef ++ linPrep n.c2 ++ linPrep n.c3; } diff --git a/src/bulgarian/ConjunctionBul.gf b/src/bulgarian/ConjunctionBul.gf index 9f30098e3..20e0e7411 100644 --- a/src/bulgarian/ConjunctionBul.gf +++ b/src/bulgarian/ConjunctionBul.gf @@ -25,9 +25,9 @@ concrete ConjunctionBul of Conjunction = } ; ConjNP conj ss = { - s = \\role => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!role; - a = {gn = conjGenNum (gennum (AMasc NonHuman) conj.n) ss.a.gn; p = ss.a.p}; - p = Pos + s = \\role => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!role; + gn = conjGenNum (gennum (AMasc NonHuman) conj.n) ss.gn; + p = ss.p } ; ConjAP conj ss = { @@ -59,11 +59,13 @@ concrete ConjunctionBul of Conjunction = ConsIAdv x xs = {s = \\d,t,qform=>x.s!qform++(linCoordSep comma)!d!t++xs.s!d!t!qform} ; BaseNP x y = - {s = \\d,t,role=>x.s!role++linCoord!t++y.s!role; - a = conjAgr x.a y.a} ; + {s = \\d,t,role=>x.s!role++linCoord!t++y.s!role; + gn = conjGenNum x.gn y.gn; + p = x.p} ; ConsNP x xs = - {s = \\d,t,role=>x.s!role++(linCoordSep comma)!d!t++xs.s!d!t!role; - a = conjAgr xs.a x.a} ; + {s = \\d,t,role=>x.s!role++(linCoordSep comma)!d!t++xs.s!d!t!role; + gn = conjGenNum xs.gn x.gn; + p = x.p} ; BaseAP x y = {s = \\d,t,aform,p => x.s!aform!p++linCoord!t++y.s!aform!p; @@ -91,7 +93,7 @@ concrete ConjunctionBul of Conjunction = [Adv] = {s : Bool => Ints 3 => Str} ; [AdV] = {s : Bool => Ints 3 => Str} ; [IAdv] = {s : Bool => Ints 3 => QForm => Str} ; - [NP] = {s : Bool => Ints 3 => Role => Str; a : Agr} ; + [NP] = {s : Bool => Ints 3 => Role => Str; gn : GenNum; p : PronPerson} ; [AP] = {s : Bool => Ints 3 => AForm => Person => Str; adv : Bool => Ints 3 => Str; isPre : Bool} ; [RS] = {s : Bool => Ints 3 => Agr => Str} ; [CN] = {s : Bool => Ints 3 => NForm => Str; g : AGender} ; diff --git a/src/bulgarian/ConstructionBul.gf b/src/bulgarian/ConstructionBul.gf index 912fce1aa..50fc7cbd1 100644 --- a/src/bulgarian/ConstructionBul.gf +++ b/src/bulgarian/ConstructionBul.gf @@ -24,7 +24,7 @@ lin how_old_QCl p = mkQCl (MorphoFunsBul.mkIAdv "на колко") (mkCl (mkNP a_Quant plNum (mkN041 "година"))) ; how_far_QCl name = mkQCl (ExtraBul.IAdvAdv (ss "далече")) name ; married_Cl p1 p2 = mkCl - (mkVP (mkVP (mkA076 (case p1.a.gn of { + (mkVP (mkVP (mkA076 (case p1.gn of { R.GSg R.Fem => "омъжен" ; _ => "женен" }))) (SyntaxBul.mkAdv (mkPrep "за" R.Acc) )); @@ -32,7 +32,7 @@ lin is_right_VP = mkVP (mkA084 "верен") ; is_wrong_VP = mkVP (mkA079 "грешен") ; n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; - weather_adjCl a = R.mkClause (a.s ! R.ASg R.Masc R.Indef ! R.P3) {gn=R.GSg R.Masc; p=R.P3} R.Pos (R.insertObj (\\_=>"") R.Pos (R.predV R.verbBe)) ; + weather_adjCl a = R.mkClause (a.s ! R.ASg R.Masc R.Indef ! R.P3) (R.GSg R.Masc) (R.NounP3 R.Pos) (R.insertObj (\\_=>"") R.Pos (R.predV R.verbBe)) ; lin weekdayPunctualAdv w = SyntaxBul.mkAdv in_Prep (mkNP w) ; -- on Sunday diff --git a/src/bulgarian/DocumentationBul.gf b/src/bulgarian/DocumentationBul.gf index c67c72b96..5ca6f580b 100644 --- a/src/bulgarian/DocumentationBul.gf +++ b/src/bulgarian/DocumentationBul.gf @@ -120,7 +120,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ; s2= inflVerb v ; s3= "" @@ -133,7 +133,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ v.c2.s ++ @@ -149,7 +149,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ v.c2.s ++ @@ -166,7 +166,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ v.c2.s ++ @@ -183,7 +183,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ v.c2.s ++ @@ -200,7 +200,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ v.c2.s ++ @@ -217,7 +217,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ v.c2.s ++ @@ -233,7 +233,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ case v.typ of { @@ -251,7 +251,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ "че" ++ pp "изречение"; @@ -265,7 +265,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ pp "въпрос"; @@ -279,7 +279,7 @@ lin case v.vtype of { VNormal => "" ; VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! GSg Masc ! P3 + VPhrasal c => personalClitics (agrP3 (GSg Masc)) ! c } ++ v.s ! Imperf ! VPres Sg P3 ++ pp "прилагателно"; diff --git a/src/bulgarian/ExtendBul.gf b/src/bulgarian/ExtendBul.gf index 3610fe916..745114888 100644 --- a/src/bulgarian/ExtendBul.gf +++ b/src/bulgarian/ExtendBul.gf @@ -2,7 +2,7 @@ concrete ExtendBul of Extend = CatBul ** open Prelude, Predef, ResBul, GrammarBul, MorphoFunsBul in { lin - GenModNP num np cn = DetCN (DetQuant DefArt num) (AdvCN cn (PrepNP possess_Prep np)) ; -- this man's car(s) ; DEFAULT the car of this man + GenModNP num np cn = DetCN (DetQuant DefArt num) (AdvCN cn (PrepNP (mkPrep "на") np)) ; AdAdV a adv = {s = a.s ++ adv.s; p = adv.p} ; @@ -66,9 +66,9 @@ lin } ; GerundNP vp = { - s = \\_ => daComplex Simul Pos vp ! Imperf ! {gn=GSg Neut; p=P1}; - a = {gn=GSg Neut; p=P3}; - p = Pos + s = \\_ => daComplex Simul Pos vp ! Imperf ! {gn=GSg Neut; p=P1}; + gn =GSg Neut; + p = NounP3 Pos } ; GerundAdv, ByVP = \vp -> @@ -79,7 +79,7 @@ lin InOrderToVP vp = {s = "за" ++ daComplex Simul Pos vp ! Perf ! {gn=GSg Neut; p=P3}}; - iFem_Pron = mkPron "аз" "мен" "ме" "ми" "мой" "моя" "моят" "моя" "моята" "мое" "моето" "мои" "моите" (GSg Fem) P1 ; + iFem_Pron = mkPron "аз" "мой" "моя" "моят" "моя" "моята" "мое" "моето" "мои" "моите" (GSg Fem) PronP1 ; youFem_Pron = youSg_Pron ; weFem_Pron = we_Pron ; youPlFem_Pron = youPl_Pron ; @@ -102,7 +102,7 @@ lin clitic = case vp.vtype of { VNormal => {s=[]; agr=agr} ; VMedial c => {s=reflClitics ! c; agr=agr} ; - VPhrasal c => {s=personalClitics ! c ! agr.gn ! agr.p; agr={gn=GSg Neut; p=P3}} + VPhrasal c => {s=personalClitics agr ! c; agr={gn=GSg Neut; p=P3}} } ; in vp.ad.s ++ clitic.s ++ vp.s ! Imperf ! VPres (numGenNum clitic.agr.gn) clitic.agr.p ++ @@ -117,7 +117,7 @@ lin BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; ConsVPS x xs = {s = \\d,t,a=>x.s!a++(linCoordSep bindComma)!d!t++xs.s!d!t!a} ; - PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! np.a} ; + PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! personAgr np.gn np.p} ; MkVPS t p vp = { s = \\a => @@ -135,22 +135,22 @@ lin ComplSlashPartLast = ComplSlash ; lincat - RNP = {s : Role => Str; a : Agr; p : Polarity} ; + RNP = {s : Role => Str; gn : GenNum} ; lin ReflRNP slash rnp = { s = slash.s ; ad = slash.ad ; - compl = \\a => slash.compl1 ! a ++ slash.c2.s ++ rnp.s ! RObj slash.c2.c ++ slash.compl2 ! rnp.a ; + clitics = slash.clitics ; + compl = \\a => slash.compl1 ! a ++ slash.c2.s ++ rnp.s ! RObj slash.c2.c ++ slash.compl2 ! agrP3 rnp.gn ; vtype = slash.vtype ; - p = orPol rnp.p slash.p ; + p = slash.p ; isSimple = False } ; ReflPron = - { s = \\role => "себе си"; - a = {gn = GSg Masc; p = P3} ; - p = Pos + { s = \\role => "себе си"; + gn = GSg Masc } ; ReflPoss num cn = @@ -168,43 +168,44 @@ lin } ; s = reflPron ! aform (gennum cn.g (numnnum num.nn)) Def (RObj Acc) ++ num.s ! dgenderSpecies cn.g Indef role ++ cn.s ! nf in case role of { - RObj Dat => "на" ++ s; - RObj WithPrep => with_Word ++ s; - _ => s + RObj c => linCase c Pos ++ s; + _ => s } ; - a = {gn = gennum cn.g (numnnum num.nn); p = P3} ; - p = Pos + gn = gennum cn.g (numnnum num.nn) } ; PredetRNP pred rnp = { - s = \\c => pred.s ! rnp.a.gn ++ rnp.s ! c ; - a = rnp.a ; - p = rnp.p + s = \\c => pred.s ! rnp.gn ++ rnp.s ! c ; + gn = rnp.gn } ; lin - ApposNP np1 np2 = {s = \\role => np1.s ! role ++ bindComma ++ np2.s ! role; a = np1.a; p = np1.p} ; + ApposNP np1 np2 = {s = \\role => case role of { + RObj c => linCase c (personPol np1.p) ++ np1.s ! RObj CPrep ; + role => np1.s ! role + } ++ bindComma ++ np2.s ! role; + gn = np1.gn; + p = NounP3 (personPol np1.p) + } ; DetNPMasc det = { - s = \\role => let s = det.s ! False ! (AMasc Human) ! role - in case role of { - RObj Dat => "на" ++ s; - RObj WithPrep => with_Word ++ s; - _ => s - } ; - a = {gn = gennum (AMasc Human) (numnnum det.nn); p = P3} ; - p = det.p + s = \\role => let s = det.s ! False ! (AMasc Human) ! role + in case role of { + RObj c => linCase c det.p ++ s; + _ => s + } ; + gn = gennum (AMasc Human) (numnnum det.nn); + p = NounP3 det.p } ; DetNPFem det = { s = \\role => let s = det.s ! False ! AFem ! role in case role of { - RObj Dat => "на" ++ s; - RObj WithPrep => with_Word ++ s; - _ => s + RObj c => linCase c det.p ++ s; + _ => s } ; - a = {gn = gennum AFem (numnnum det.nn); p = P3} ; - p = det.p + gn = gennum AFem (numnnum det.nn); + p = NounP3 det.p } ; } diff --git a/src/bulgarian/ExtraBul.gf b/src/bulgarian/ExtraBul.gf index ed26dc68a..5fa19f8d6 100644 --- a/src/bulgarian/ExtraBul.gf +++ b/src/bulgarian/ExtraBul.gf @@ -31,8 +31,8 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** role = RObj Acc } ; - i8fem_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Fem) P1 ; - i8neut_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Neut) P1 ; + i8fem_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Fem) PronP1 ; + i8neut_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Neut) PronP1 ; whatSg8fem_IP = mkIP "" "" (GSg Fem) ; whatSg8neut_IP = mkIP "" "" (GSg Neut) ; @@ -40,8 +40,8 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** whoSg8fem_IP = mkIP "" "" (GSg Fem) ; whoSg8neut_IP = mkIP "" "" (GSg Neut) ; - youSg8fem_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Fem) P2 ; - youSg8neut_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Neut) P2 ; + youSg8fem_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Fem) PronP2 ; + youSg8neut_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Neut) PronP2 ; onePl_Num = {s = table { CFMasc Indef _ | CFFem Indef | CFNeut Indef => "" ; @@ -79,7 +79,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; ConsVPS x xs = {s = \\d,t,a=>x.s!a++(linCoordSep bindComma)!d!t++xs.s!d!t!a} ; - PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! np.a} ; + PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! personAgr np.gn np.p} ; MkVPS t p vp = { s = \\a => diff --git a/src/bulgarian/IdiomBul.gf b/src/bulgarian/IdiomBul.gf index 31351500a..adf90ee26 100644 --- a/src/bulgarian/IdiomBul.gf +++ b/src/bulgarian/IdiomBul.gf @@ -5,14 +5,14 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in { flags optimize=all_subs ; lin - ImpersCl vp = mkClause [] (agrP3 (GSg Neut)) Pos vp ; - GenericCl vp = mkClause "" (agrP3 (GSg Neut)) Pos vp ; + ImpersCl vp = mkClause [] (GSg Neut) (NounP3 Pos) vp ; + GenericCl vp = mkClause "" (GSg Neut) (NounP3 Pos) vp ; CleftNP np rs = mkClause (np.s ! RSubj) - {gn=GSg Neut; p=np.a.p} Pos - (insertObj (\\_ => thisRP ! np.a.gn ++ rs.s ! np.a) np.p (predV verbBe)) ; - + (GSg Neut) np.p + (insertObj (\\_ => thisRP ! np.gn ++ rs.s ! personAgr np.gn np.p) (personPol np.p) (predV verbBe)) ; + CleftAdv ad s = {s = \\t,a,p,o => case p of {Pos=>[]; Neg=>""} ++ ad.s ++ s.s } ; ExistNP np = ExistNPAdv np (lin Adv {s = ""}) ; @@ -20,7 +20,7 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in { ExistNPAdv np adv = { s = \\t,a,p,o => - let verb = case orPol p np.p of { + let verb = case orPol p (personPol np.p) of { Pos => mkV186 "" ; Neg => mkV186 "" } ; @@ -56,11 +56,12 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in { ExistIPAdv ip adv = mkQuestion {s = ip.s ! RSubj} - (mkClause "" (agrP3 ip.gn) Pos (insertObj (\\_ => adv.s) Pos (predV verbBe))) ; + (mkClause "" ip.gn (NounP3 Pos) (insertObj (\\_ => adv.s) Pos (predV verbBe))) ; ProgrVP vp = { s = \\_ => vp.s ! Imperf ; ad = vp.ad ; + clitics = vp.clitics ; compl = vp.compl ; vtype = vp.vtype ; p = vp.p ; diff --git a/src/bulgarian/MorphoFunsBul.gf b/src/bulgarian/MorphoFunsBul.gf index 1f99a14fa..21ce9e917 100644 --- a/src/bulgarian/MorphoFunsBul.gf +++ b/src/bulgarian/MorphoFunsBul.gf @@ -231,12 +231,7 @@ oper dualN : N -> Prep -> N = \n,p -> lin N { s = n.s; - rel = \\_ => p.s ++ - case p.c of { - Acc => "" ; - Dat => "" ; - WithPrep => with_Word - } ++ + rel = \\_ => linPrep p ++ n.s ! NF Sg Def ; relPost = True; g = n.g @@ -267,13 +262,12 @@ oper mkPrep = overload { mkPrep : Str -> Prep = - \p -> {s = p; c = Acc; lock_Prep = <>} ; + \p -> {s = p; c = CPrep; lock_Prep = <>} ; mkPrep : Str -> Case -> Prep = - \p,c -> {s = p; c = c; lock_Prep = <>} + \p,c -> {s = p; c = c; lock_Prep = <>} } ; - noPrep : Prep = mkPrep [] Acc ; - dat_Prep : Prep = mkPrep [] Dat ; + noPrep : Prep = mkPrep [] Acc ; --2 Proper Names -- diff --git a/src/bulgarian/NounBul.gf b/src/bulgarian/NounBul.gf index 9aecbfe0b..40654005f 100644 --- a/src/bulgarian/NounBul.gf +++ b/src/bulgarian/NounBul.gf @@ -4,85 +4,84 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { lin DetCN det cn = - { s = \\role => let nf = case of { - => case role of { - RSubj => NFSgDefNom ; - RVoc => NFVocative ; - _ => NF Sg Def - } ; - => case role of { - RVoc => NFVocative ; - _ => NF Sg Indef - } ; - => NF Pl Def ; - => NF Pl Indef; - => NF Pl det.spec ; - => NFPlCount - } ; - s = det.s ! True ! cn.g ! role ++ cn.s ! nf - in case role of { - RObj Dat => "" ++ s; - RObj WithPrep => case det.p of { - Pos => with_Word ++ s ; - Neg => "" ++ s - } ; - _ => s - } ; - a = {gn = gennum cn.g (numnnum det.nn); p = P3} ; - p = det.p + { s = \\role => let nf = case of { + => case role of { + RSubj => NFSgDefNom ; + RVoc => NFVocative ; + _ => NF Sg Def + } ; + => case role of { + RVoc => NFVocative ; + _ => NF Sg Indef + } ; + => NF Pl Def ; + => NF Pl Indef; + => NF Pl det.spec ; + => NFPlCount + } ; + s = det.s ! True ! cn.g ! role ++ cn.s ! nf + in case role of { + RObj c => linCase c det.p ++ s; + _ => s + } ; + gn = gennum cn.g (numnnum det.nn); + p = NounP3 det.p } ; DetNP det = - { s = \\role => let s = det.s ! False ! ANeut ! role - in case role of { - RObj Dat => "" ++ s; - RObj WithPrep => with_Word ++ s; - _ => s - } ; - a = {gn = gennum ANeut (numnnum det.nn); p = P3} ; - p = det.p + { s = \\role => let s = det.s ! False ! ANeut ! role + in case role of { + RObj c => linCase c det.p ++ s; + _ => s + } ; + gn = gennum ANeut (numnnum det.nn); + p = NounP3 det.p } ; UsePN pn = { s = table { - RObj Dat => "" ++ pn.s; - RObj WithPrep => with_Word ++ pn.s; - _ => pn.s + RObj c => linCase c Pos ++ pn.s; + _ => pn.s } ; - a = {gn = GSg pn.g; p = P3} ; - p = Pos + gn = GSg pn.g ; + p = NounP3 Pos } ; - UsePron p = {s = p.s; a=p.a; p=Pos} ; + UsePron p = p ; PredetNP pred np = { s = \\c => case c of { - RObj Dat => ""; - RObj WithPrep => case np.p of { - Pos => with_Word ; - Neg => "" - } ; - _ => "" + RObj c => linCase c (personPol np.p) ; + _ => "" } ++ - pred.s ! np.a.gn ++ np.s ! RObj Acc ; - a = np.a ; - p = np.p + pred.s ! np.gn ++ np.s ! RObj CPrep ; + gn = np.gn ; + p = NounP3 (personPol np.p) } ; PPartNP np v2 = { - s = \\c => np.s ! c ++ v2.s ! Perf ! VPassive (aform np.a.gn Indef c) ; - a = np.a ; - p = np.p + s = \\role => case role of { + RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ; + role => np.s ! role + } ++ v2.s ! Perf ! VPassive (aform np.gn Indef role) ; + gn = np.gn ; + p = NounP3 (personPol np.p) } ; AdvNP np adv = { - s = \\c => np.s ! c ++ adv.s ; - a = np.a ; - p = np.p + s = \\role => case role of { + RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ; + role => np.s ! role + } ++ adv.s ; + gn = np.gn ; + p = NounP3 (personPol np.p) } ; ExtAdvNP np adv = { - s = \\c => np.s ! c ++ bindComma ++ adv.s ; - a = np.a ; - p = np.p + s = \\role => case role of { + RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ; + role => np.s ! role + } ++ bindComma ++ adv.s ; + gn = np.gn ; + p = NounP3 (personPol np.p) } ; DetQuant quant num = { @@ -160,13 +159,12 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { MassNP cn = { s = table { - RVoc => cn.s ! NFVocative ; - RObj Dat => "" ++ cn.s ! (NF Sg Indef) ; - RObj WithPrep => with_Word ++ cn.s ! (NF Sg Indef); - _ => cn.s ! (NF Sg Indef) + RVoc => cn.s ! NFVocative ; + RObj c => linCase c Pos ++ cn.s ! (NF Sg Indef) ; + _ => cn.s ! (NF Sg Indef) } ; - a = {gn = gennum cn.g Sg; p = P3} ; - p = Pos + gn = gennum cn.g Sg; + p = NounP3 Pos } ; UseN noun = noun ; @@ -204,21 +202,24 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { PartNP cn np = {s = \\nf => cn.s ! nf ++ "" ++ np.s ! (RObj Acc); g = cn.g} ; CountNP det np = { - s = \\role => let g = case np.a.gn of { -- this is lossy + s = \\role => let g = case np.gn of { -- this is lossy GSg Masc => AMasc NonHuman ; GSg Neut => ANeut ; GSg Fem => AFem ; GPl => ANeut } in det.s ! False ! g ! role ++ np.s ! (RObj Acc) ; - a = {gn = gennum ANeut (numnnum det.nn); p = P3} ; - p = Pos + gn = gennum ANeut (numnnum det.nn); + p = NounP3 Pos } ; RelNP np rs = { - s = \\r => np.s ! r ++ rs.s ! np.a ; - a = np.a ; - p = np.p + s = \\role => case role of { + RObj c => linCase c (personPol np.p) ++ np.s ! RObj CPrep ; + role => np.s ! role + } ++ rs.s ! personAgr np.gn np.p ; + gn = np.gn ; + p = NounP3 (personPol np.p) } ; AdjDAP dap ap = {s = \\sp,g,role => let g' = case g of { diff --git a/src/bulgarian/QuestionBul.gf b/src/bulgarian/QuestionBul.gf index 8be7c9b5b..446e03c0a 100644 --- a/src/bulgarian/QuestionBul.gf +++ b/src/bulgarian/QuestionBul.gf @@ -18,7 +18,7 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { QuestVP ip vp = { s = \\t,a,b,qform => - (mkClause (ip.s ! RSubj ! qform) {gn = ip.gn ; p = P3} Pos vp).s ! t ! a ! b ! Main + (mkClause (ip.s ! RSubj ! qform) ip.gn (NounP3 Pos) vp).s ! t ! a ! b ! Main } ; QuestSlash ip slash = @@ -28,7 +28,7 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { QuestIAdv iadv cl = mkQuestion iadv cl ; QuestIComp icomp np = - mkQuestion icomp (mkClause (np.s ! RSubj) np.a np.p (predV verbBe)) ; + mkQuestion icomp (mkClause (np.s ! RSubj) np.gn np.p (predV verbBe)) ; PrepIP p ip = {s = \\qform => p.s ++ case p.c of {Dat=>"";_=>[]} ++ ip.s ! RSubj ! qform} ; diff --git a/src/bulgarian/RelativeBul.gf b/src/bulgarian/RelativeBul.gf index ce7a2133e..c923ca934 100644 --- a/src/bulgarian/RelativeBul.gf +++ b/src/bulgarian/RelativeBul.gf @@ -7,26 +7,28 @@ concrete RelativeBul of Relative = CatBul ** open ResBul in { lin RelCl cl = { - s = \\t,a,p,agr => suchRP ! agr.gn ++ "" ++ cl.s ! t ! a ! p ! Main ; - role = RSubj + s = \\t,a,p,agr => suchRP ! agr.gn ++ "" ++ cl.s ! t ! a ! p ! Main } ; RelVP rp vp = { s = \\t,a,p,agr => - let - cl = mkClause (rp.s ! agr.gn) agr Pos vp + let + pp = case agr.p of { + P1 => PronP1 ; + P2 => PronP2 ; + P3 => PronP3 + } ; + cl = mkClause (rp.s ! agr.gn) agr.gn pp vp in - cl.s ! t ! a ! p ! Main ; - role = RSubj + cl.s ! t ! a ! p ! Main } ; RelSlash rp slash = { - s = \\t,a,p,agr => slash.c2.s ++ rp.s ! agr.gn ++ slash.s ! agr ! t ! a ! p ! Main ; - role = RObj Acc + s = \\t,a,p,agr => slash.c2.s ++ rp.s ! agr.gn ++ slash.s ! agr ! t ! a ! p ! Main } ; FunRP p np rp = { - s = \\gn => np.s ! RObj Acc ++ p.s ++ (case p.c of {Acc => []; Dat => ""; WithPrep => with_Word}) ++ rp.s ! gn ; + s = \\gn => np.s ! RObj Acc ++ linPrep p ++ rp.s ! gn ; } ; IdRP = { diff --git a/src/bulgarian/ResBul.gf b/src/bulgarian/ResBul.gf index cbe42c4e4..e1e8030b9 100644 --- a/src/bulgarian/ResBul.gf +++ b/src/bulgarian/ResBul.gf @@ -22,7 +22,7 @@ resource ResBul = ParamX ** open Prelude, Predef in { param Role = RSubj | RObj Case | RVoc ; - Case = Acc | Dat | WithPrep ; + Case = Acc | Dat | WithPrep | CPrep ; NForm = NF Number Species @@ -38,7 +38,7 @@ resource ResBul = ParamX ** open Prelude, Predef in { GenNum = GSg Gender | GPl ; --- Agreement of $NP$ is a record. We'll add $Gender$ later. + PronPerson = PronP1 | PronP2 | PronP3 | NounP3 Polarity ; oper Agr = {gn : GenNum ; p : Person} ; @@ -120,11 +120,6 @@ resource ResBul = ParamX ** open Prelude, Predef in { _ => GPl } ; - conjAgr : Agr -> Agr -> Agr = \a,b -> { - gn = conjGenNum a.gn b.gn ; - p = conjPerson a.p b.p - } ; - gennum : AGender -> Number -> GenNum = \g,n -> case n of { Sg => GSg (case g of { @@ -147,6 +142,22 @@ resource ResBul = ParamX ** open Prelude, Predef in { NCountable => Pl } ; + personPol : PronPerson -> Polarity = \p -> + case p of { + NounP3 pol => pol; + _ => Pos + } ; + + personAgr : GenNum -> PronPerson -> Agr = \gn,p -> + {gn = gn; + p = case p of { + PronP1 => P1 ; + PronP2 => P2 ; + PronP3 => P3 ; + NounP3 _ => P3 + } + } ; + orPol : Polarity -> Polarity -> Polarity = \p1,p2 -> case p1 of { Neg => Neg; @@ -223,62 +234,68 @@ resource ResBul = ParamX ** open Prelude, Predef in { } ; VP : Type = { - s : Aspect => VTable ; - ad : {isEmpty : Bool; s : Str} ; -- sentential adverb - compl : Agr => Str ; - vtype : VType ; - p : Polarity ; + s : Aspect => VTable ; + ad : {isEmpty : Bool; s : Str} ; -- sentential adverb + clitics : Str ; + compl : Agr => Str ; + vtype : VType ; + p : Polarity ; isSimple : Bool -- regulates the place of participle used as adjective } ; VPSlash = { - s : Aspect => VTable ; - ad : {isEmpty : Bool; s : Str} ; -- sentential adverb - compl1 : Agr => Str ; - compl2 : Agr => Str ; - vtype : VType ; - p : Polarity ; - c2 : Preposition ; + s : Aspect => VTable ; + ad : {isEmpty : Bool; s : Str} ; -- sentential adverb + clitics : Str ; + compl1 : Agr => Str ; + compl2 : Agr => Str ; + vtype : VType ; + p : Polarity ; + c2 : Preposition ; isSimple : Bool ; -- regulates the place of participle used as adjective subjCtrl : Bool -- the second complement agrees with the subject or with the first complement } ; predV : Verb -> VP = \verb -> { - s = verb.s ; - ad = {isEmpty=True; s=[]} ; - compl = \\_ => [] ; - vtype = verb.vtype ; - p = Pos ; + s = verb.s ; + ad = {isEmpty=True; s=[]} ; + clitics = [] ; + compl = \\_ => [] ; + vtype = verb.vtype ; + p = Pos ; isSimple = True } ; slashV : Verb -> Preposition -> Bool -> VPSlash = \verb,prep,subjCtrl -> { - s = verb.s ; - ad = {isEmpty=True; s=[]} ; - compl1 = \\_ => [] ; - compl2 = \\_ => [] ; - vtype = verb.vtype ; - p = Pos ; - c2 = prep ; + s = verb.s ; + ad = {isEmpty=True; s=[]} ; + clitics = [] ; + compl1 = \\_ => [] ; + compl2 = \\_ => [] ; + vtype = verb.vtype ; + p = Pos ; + c2 = prep ; isSimple = True ; subjCtrl = subjCtrl } ; insertObj : (Agr => Str) -> Polarity -> VP -> VP = \obj,p,vp -> { - s = vp.s ; - ad = vp.ad ; - compl = \\a => vp.compl ! a ++ obj ! a ; - vtype = vp.vtype ; - p = case p of { - Neg => Neg; - _ => vp.p - } ; + s = vp.s ; + ad = vp.ad ; + clitics= vp.clitics ; + compl = \\a => vp.compl ! a ++ obj ! a ; + vtype = vp.vtype ; + p = case p of { + Neg => Neg; + _ => vp.p + } ; isSimple = False } ; insertSlashObj1 : (Agr => Str) -> Polarity -> VPSlash -> VPSlash = \obj,p,slash -> { s = slash.s ; ad = slash.ad ; + clitics= slash.clitics ; compl1 = \\a => slash.compl1 ! a ++ obj ! a ; compl2 = slash.compl2 ; vtype = slash.vtype ; @@ -294,6 +311,7 @@ resource ResBul = ParamX ** open Prelude, Predef in { insertSlashObj2 : (Agr => Str) -> Polarity -> VPSlash -> VPSlash = \obj,p,slash -> { s = slash.s ; ad = slash.ad ; + clitics= slash.clitics ; compl1 = slash.compl1 ; compl2 = \\a => slash.compl2 ! a ++ obj ! a ; vtype = slash.vtype ; @@ -377,12 +395,12 @@ resource ResBul = ParamX ** open Prelude, Predef in { verbBe : Verb = {s=table Aspect [auxBe; auxWould] ; vtype=VNormal} ; - reflClitics : Case => Str = table {Acc => ""; Dat => ""; WithPrep => with_Word ++ " "} ; + reflClitics : Case => Str = table {Acc => ""; Dat => ""; WithPrep => with_Word ++ " "; CPrep => " "} ; - personalClitics : Case => GenNum => Person => Str = + personalClitics : Agr -> Case => Str = \agr -> table { - Acc => table { - GSg g => table { + Acc => case agr.gn of { + GSg g => case agr.p of { P1 => "" ; P2 => "" ; P3 => case g of { @@ -391,14 +409,14 @@ resource ResBul = ParamX ** open Prelude, Predef in { Neut => "" } } ; - GPl => table { + GPl => case agr.p of { P1 => "" ; P2 => "" ; P3 => "" } } ; - Dat => table { - GSg g => table { + Dat => case agr.gn of { + GSg g => case agr.p of { P1 => "" ; P2 => "" ; P3 => case g of { @@ -407,14 +425,14 @@ resource ResBul = ParamX ** open Prelude, Predef in { Neut => "" } } ; - GPl => table { + GPl => case agr.p of { P1 => "" ; P2 => "" ; P3 => "" } } ; - WithPrep => table { - GSg g => table { + WithPrep => case agr.gn of { + GSg g => case agr.p of { P1 => with_Word ++ "" ; P2 => with_Word ++ "" ; P3 => case g of { @@ -423,11 +441,27 @@ resource ResBul = ParamX ** open Prelude, Predef in { Neut => with_Word ++ "" } } ; - GPl => table { + GPl => case agr.p of { P1 => with_Word ++ "" ; P2 => with_Word ++ "" ; P3 => with_Word ++ "" } + } ; + CPrep => case agr.gn of { + GSg g => case agr.p of { + P1 => "" ; + P2 => "" ; + P3 => case g of { + Masc => "" ; + Fem => "" ; + Neut => "" + } + } ; + GPl => case agr.p of { + P1 => "" ; + P2 => "" ; + P3 => "" + } } } ; @@ -463,17 +497,18 @@ resource ResBul = ParamX ** open Prelude, Predef in { s : Tense => Anteriority => Polarity => Order => Str } ; - mkClause : Str -> Agr -> Polarity -> VP -> Clause = - \subj,agr,p1,vp -> { + mkClause : Str -> GenNum -> PronPerson -> VP -> Clause = + \subj,gn,p1,vp -> { s = \\t,a,p2,o => let p : Polarity - = case of { + = case of { => Neg ; <_,Neg,_> => Neg ; <_,_,Neg> => Neg ; _ => Pos } ; + agr = personAgr gn p1 ; verb : Bool => Str = \\q => vpTenses vp ! t ! a ! p ! agr ! q ! Perf ; compl = vp.compl ! agr @@ -487,9 +522,10 @@ resource ResBul = ParamX ** open Prelude, Predef in { vpTenses : VP -> Tense => Anteriority => Polarity => Agr => Bool => Aspect => Str = \verb -> \\t,a,p,agr,q0,asp => let clitic = case verb.vtype of { - VNormal => {s=[]; agr=agr} ; - VMedial c => {s=reflClitics ! c; agr=agr} ; - VPhrasal c => {s=personalClitics ! c ! agr.gn ! agr.p; agr={gn=GSg Neut; p=P3}} + VNormal => {s=verb.clitics; agr=agr} ; + VMedial c => {s=verb.clitics++reflClitics ! c; agr=agr} ; + VPhrasal Dat => {s=personalClitics agr ! Dat++verb.clitics; agr={gn=GSg Neut; p=P3}} ; + VPhrasal c => {s=verb.clitics++personalClitics agr ! c; agr={gn=GSg Neut; p=P3}} } ; present = verb.s ! asp ! (VPres (numGenNum clitic.agr.gn) clitic.agr.p) ; @@ -524,8 +560,8 @@ resource ResBul = ParamX ** open Prelude, Predef in { Pos => case q of {True => {s1=[]; s2=""++s}; False => {s1=s; s2=[]}} ; Neg => case verb.vtype of - {VNormal => {s1=""; s2=li} ; - _ => {s1=""++s++li; s2=[]}} + {VNormal => {s1=""++s; s2=li} ; + _ => {s1=""++s++li; s2=[]}} } ; vf3 : Str -> {s1 : Str; s2 : Str} = \s -> @@ -557,10 +593,11 @@ resource ResBul = ParamX ** open Prelude, Predef in { daComplex : Anteriority -> Polarity -> VP -> Aspect => Agr => Str = \a,p,vp -> \\asp,agr => let clitic = case vp.vtype of { - VNormal => {s=[]; agr=agr} ; - VMedial c => {s=reflClitics ! c; agr=agr} ; - VPhrasal c => {s=personalClitics ! c ! agr.gn ! agr.p; agr={gn=GSg Neut; p=P3}} - } ; + VNormal => {s=vp.clitics; agr=agr} ; + VMedial c => {s=vp.clitics++reflClitics ! c; agr=agr} ; + VPhrasal Dat => {s=personalClitics agr ! Dat++vp.clitics; agr={gn=GSg Neut; p=P3}} ; + VPhrasal c => {s=vp.clitics++personalClitics agr ! c; agr={gn=GSg Neut; p=P3}} + } ; pol = case p of {Pos => ""; Neg => ""} in vp.ad.s ++ "" ++ pol ++ clitic.s ++ case a of { @@ -576,21 +613,32 @@ resource ResBul = ParamX ** open Prelude, Predef in { clitic = case vp.vtype of { VNormal => {s=[]; agr=agr} ; VMedial c => {s=reflClitics ! c; agr=agr} ; - VPhrasal c => {s=personalClitics ! c ! agr.gn ! agr.p; agr={gn=GSg Neut; p=P3}} + VPhrasal c => {s=personalClitics agr ! c; agr={gn=GSg Neut; p=P3}} } ; in vp.ad.s ++ vp.s ! Imperf ! VPres (numGenNum clitic.agr.gn) clitic.agr.p ++ clitic.s ++ vp.compl ! agr ; - - linrefPrep : {s:Str; c:Case} -> Str = - \p -> case p.c of {Acc=>""; Dat=>""; WithPrep=>with_Word} ++ p.s ; + + linCase : Case -> Polarity -> Str = + \c,p -> case c of { + Acc => "" ; + Dat => "" ; + WithPrep => case p of { + Pos => with_Word ; + Neg => "" + } ; + CPrep => "" + } ; + + linPrep : {s:Str; c:Case} -> Str = + \p -> p.s ++ linCase p.c Pos ; gerund : VP -> Aspect => Agr => Str = \vp -> \\asp,agr => let clitic = case vp.vtype of { VNormal => {s=[]; agr=agr} ; VMedial c => {s=reflClitics ! c; agr=agr} ; - VPhrasal c => {s=personalClitics ! c ! agr.gn ! agr.p; agr={gn=GSg Neut; p=P3}} + VPhrasal c => {s=personalClitics agr ! c; agr={gn=GSg Neut; p=P3}} } in vp.ad.s ++ clitic.s ++ vp.s ! asp ! VGerund ++ vp.compl ! agr ; @@ -686,6 +734,7 @@ resource ResBul = ParamX ** open Prelude, Predef in { RObj Acc => table QForm [kogo; kogo+""] ; RObj Dat => table QForm ["" ++ kogo; "" ++ kogo+""] ; RObj WithPrep => table QForm [with_Word ++ kogo; with_Word ++ kogo+""] ; + RObj CPrep => table QForm [kogo; kogo+""] ; RVoc => table QForm [koi; koi+""] } ; gn = gn @@ -696,25 +745,18 @@ resource ResBul = ParamX ** open Prelude, Predef in { "" / strs {"" ; "" ; "" ; ""} } ; - mkPron : (az,men,me,mi,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite : Str) -> - GenNum -> Person -> {s : Role => Str; - clit : Case => Str; - gen : AForm => Str; - a : Agr - } = - \az,men,me,mi,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite,gn,p -> { + mkPron : (az,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite : Str) -> + GenNum -> PronPerson -> {s : Role => Str; + gen : AForm => Str; + gn : GenNum; + p : PronPerson + } = + \az,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite,gn,p -> { s = table { - RSubj => az ; - RObj Acc => men ; - RObj Dat => "" ++ men ; - RObj WithPrep => with_Word ++ men ; - RVoc => az + RSubj => az ; + RObj c => personalClitics (personAgr gn p) ! c ; + RVoc => az } ; - clit = table { - Acc => me; - Dat => mi; - WithPrep => with_Word ++ men - } ; gen = table { ASg Masc Indef => moj ; ASg Masc Def => moia ; @@ -726,26 +768,19 @@ resource ResBul = ParamX ** open Prelude, Predef in { APl Indef => moi ; APl Def => moite } ; - a = { - gn = gn ; - p = p - } + gn = gn ; + p = p } ; - mkNP : Str -> GenNum -> Person -> Polarity -> {s : Role => Str; a : Agr; p : Polarity} = - \s,gn,p,pol -> { + mkNP : Str -> GenNum -> PronPerson -> {s : Role => Str; gn : GenNum; p : PronPerson} = + \s,gn,p -> { s = table { - RSubj => s ; - RObj Acc => s ; - RObj Dat => "" ++ s ; - RObj WithPrep => with_Word ++ s ; - RVoc => s + RSubj => s ; + RObj c => linCase c (personPol p) ++ s ; + RVoc => s } ; - a = { - gn = gn ; - p = p - } ; - p = pol + gn = gn ; + p = p } ; Preposition : Type = {s : Str; c : Case}; diff --git a/src/bulgarian/SentenceBul.gf b/src/bulgarian/SentenceBul.gf index 3514e4cb9..364a010df 100644 --- a/src/bulgarian/SentenceBul.gf +++ b/src/bulgarian/SentenceBul.gf @@ -9,9 +9,9 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { PredVP np vp = mkClause (np.s ! (case vp.vtype of { VNormal => RSubj ; VMedial _ => RSubj ; - VPhrasal c => RObj c})) np.a np.p vp ; + VPhrasal c => RObj c})) np.gn np.p vp ; - PredSCVP sc vp = let agr = {gn=GSg Masc; p=P3} in mkClause (sc.s ! agr) agr Pos vp ; + PredSCVP sc vp = mkClause (sc.s ! {gn=GSg Masc; p=P3}) (GSg Masc) (NounP3 Pos) vp ; ImpVP vp = { s = \\p,gn => @@ -20,21 +20,23 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { = \asp -> vp.s ! asp ! VImperative (numGenNum gn) ; compl = vp.compl ! agr ; clitic = case vp.vtype of { - VNormal => [] ; - VMedial c => reflClitics ! c ; - VPhrasal c => personalClitics ! c ! agr.gn ! agr.p - } ; + VNormal => vp.clitics; + VMedial c => vp.clitics++reflClitics ! c; + VPhrasal Dat => personalClitics agr ! Dat++vp.clitics; + VPhrasal c => vp.clitics++personalClitics agr ! c + } in case p of {Pos => vp.ad.s ++ verb Perf ++ clitic ; Neg => "" ++ vp.ad.s ++ clitic ++ verb Imperf} ++ compl ; } ; SlashVP np slash = { - s = \\agr => (mkClause (np.s ! RSubj) np.a np.p {s = slash.s ; - ad = slash.ad ; - compl = \\_ => slash.compl1 ! np.a ++ slash.compl2 ! agr ; - vtype = slash.vtype ; - p = Pos ; - isSimple = slash.isSimple}).s ; + s = \\agr => (mkClause (np.s ! RSubj) np.gn np.p {s = slash.s ; + ad = slash.ad ; + clitics= slash.clitics ; + compl = \\_ => slash.compl1 ! personAgr np.gn np.p ++ slash.compl2 ! agr ; + vtype = slash.vtype ; + p = Pos ; + isSimple = slash.isSimple}).s ; c2 = slash.c2 } ; @@ -46,7 +48,7 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { SlashPrep cl prep = {s = \\_ => cl.s; c2 = prep} ; SlashVS np vs slash = { - s = \\agr => (mkClause (np.s ! RSubj) np.a np.p + s = \\agr => (mkClause (np.s ! RSubj) np.gn np.p (insertObj (\\_ => "" ++ slash.s ! agr) Pos (predV vs))).s ; c2 = slash.c2 } ; diff --git a/src/bulgarian/StructuralBul.gf b/src/bulgarian/StructuralBul.gf index 3b41f182f..a803b92ae 100644 --- a/src/bulgarian/StructuralBul.gf +++ b/src/bulgarian/StructuralBul.gf @@ -7,8 +7,8 @@ concrete StructuralBul of Structural = CatBul ** flags optimize=all ; lin - above_Prep = mkPrep "" Acc ; - after_Prep = mkPrep "" Acc ; + above_Prep = mkPrep "" ; + after_Prep = mkPrep "" ; all_Predet = {s = table GenNum ["";"";"";""]} ; almost_AdA, almost_AdN = ss "" ; at_least_AdN, at_most_AdN = ss "" ; ---- AR @@ -16,25 +16,25 @@ concrete StructuralBul of Structural = CatBul ** always_AdV = mkAdV "" ; and_Conj = {s=[]; conj=0; distr=False; n = Pl} ; because_Subj = ss "" ; - before_Prep = mkPrep "" Acc ; - behind_Prep = mkPrep "" Acc ; - between_Prep = mkPrep "" Acc ; + before_Prep = mkPrep "" ; + behind_Prep = mkPrep "" ; + between_Prep = mkPrep "" ; both7and_DConj = {s=[]; conj=0; distr=True; n = Pl} ; but_PConj = ss "" ; - by8agent_Prep = mkPrep "" Acc ; - by8means_Prep = mkPrep "" Acc ; + by8agent_Prep = mkPrep "" ; + by8means_Prep = mkPrep "" ; can8know_VV, can_VV = mkVV (stateV (mkV166 "")) ; - during_Prep = mkPrep [" "] Acc ; + during_Prep = mkPrep [" "] ; either7or_DConj = {s=[]; conj=1; distr=True; n = Sg} ; - everybody_NP = mkNP "" (GSg Masc) P3 Pos; + everybody_NP = mkNP "" (GSg Masc) (NounP3 Pos); every_Det = mkDeterminerSg "" "" ""; - everything_NP = mkNP "" (GSg Neut) P3 Pos; + everything_NP = mkNP "" (GSg Neut) (NounP3 Pos); everywhere_Adv = ss "" ; few_Det = {s = \\_,_,_ => ""; nn = NCountable; spec = Indef; p = Pos} ; --- first_Ord = ss "first" ; DEPRECATED - for_Prep = mkPrep "" Acc ; - from_Prep = mkPrep "" Acc ; - he_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Masc) P3 ; + for_Prep = mkPrep "" ; + from_Prep = mkPrep "" ; + he_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Masc) PronP3 ; here_Adv = ss "" ; here7to_Adv = ss [" "] ; here7from_Adv = ss [" "] ; @@ -42,12 +42,12 @@ concrete StructuralBul of Structural = CatBul ** how8much_IAdv = mkIAdv "" ; how8many_IDet = {s = \\_ => table QForm ["";""]; n = Pl; nonEmpty = False} ; if_Subj = ss "" ; - in8front_Prep = mkPrep "" Acc ; - i_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Masc) P1 ; + in8front_Prep = mkPrep "" ; + i_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Masc) PronP1 ; in_Prep = mkPrep (pre { "" ; "" / strs {"" ; "" ; "" ; ""} - }) Acc ; - it_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Neut) P3 ; + }) ; + it_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Neut) PronP3 ; less_CAdv = {s=""; sn="-"} ; many_Det = mkDeterminerPl "" ; more_CAdv = {s=[]; sn=""} ; @@ -72,21 +72,21 @@ concrete StructuralBul of Structural = CatBul ** lock_V=<> } ; no_Utt = ss "" ; - on_Prep = mkPrep "" Acc ; + on_Prep = mkPrep "" ; ---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED only_Predet = {s = \\_ => ""} ; or_Conj = {s=[]; conj=1; distr=False; n = Sg} ; otherwise_PConj = ss "" ; - part_Prep = mkPrep "" Acc ; + part_Prep = mkPrep "" ; please_Voc = ss "" ; possess_Prep = mkPrep [] Dat ; quite_Adv = ss "" ; - she_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Fem) P3 ; + she_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Fem) PronP3 ; so_AdA = ss "" ; - somebody_NP = mkNP "" (GSg Masc) P3 Pos; + somebody_NP = mkNP "" (GSg Masc) (NounP3 Pos); someSg_Det = mkDeterminerSg "" "" "" ; somePl_Det = mkDeterminerPl "" ; - something_NP = mkNP "" (GSg Neut) P3 Pos; + something_NP = mkNP "" (GSg Neut) (NounP3 Pos); somewhere_Adv = ss "" ; that_Quant = mkQuant "" "" "" "" ; that_Subj = ss "" ; @@ -94,15 +94,15 @@ concrete StructuralBul of Structural = CatBul ** there7to_Adv = ss [" "] ; there7from_Adv = ss [" "] ; therefore_PConj = ss [" "] ; - they_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" GPl P3 ; + they_Pron = mkPron "" "" "" "" "" "" "" "" "" "" GPl PronP3 ; this_Quant = mkQuant "" "" "" "" ; - through_Prep = mkPrep "" Acc ; + through_Prep = mkPrep "" ; too_AdA = ss "" ; - to_Prep = mkPrep "" Acc ; - under_Prep = mkPrep "" Acc ; + to_Prep = mkPrep "" ; + under_Prep = mkPrep "" ; very_AdA = ss "" ; want_VV = mkVV (stateV (mkV186 "")) ; - we_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" GPl P1 ; + we_Pron = mkPron "" "" "" "" "" "" "" "" "" "" GPl PronP1 ; whatPl_IP = mkIP "" "" GPl ; whatSg_IP = mkIP "" "" (GSg Masc) ; when_IAdv = mkIAdv "" ; @@ -115,12 +115,12 @@ concrete StructuralBul of Structural = CatBul ** whoSg_IP = mkIP "" "" (GSg Masc) ; whoPl_IP = mkIP "" "" GPl ; why_IAdv = mkIAdv "" ; - without_Prep = mkPrep "" Acc ; + without_Prep = mkPrep "" ; with_Prep = mkPrep "" WithPrep ; yes_Utt = ss "" ; - youSg_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" (GSg Masc) P2 ; - youPl_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" GPl P2 ; - youPol_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" "" GPl P2 ; + youSg_Pron = mkPron "" "" "" "" "" "" "" "" "" "" (GSg Masc) PronP2 ; + youPl_Pron = mkPron "" "" "" "" "" "" "" "" "" "" GPl PronP2 ; + youPol_Pron = mkPron "" "" "" "" "" "" "" "" "" "" GPl PronP2 ; have_V2 = dirV2 (stateV (mkV186 "")) ; diff --git a/src/bulgarian/SymbolBul.gf b/src/bulgarian/SymbolBul.gf index 89ce5d193..60851a3fd 100644 --- a/src/bulgarian/SymbolBul.gf +++ b/src/bulgarian/SymbolBul.gf @@ -12,19 +12,19 @@ lin FloatPN i = {s = i.s ; g = Neut} ; NumPN i = {s = i.s ! CFNeut Indef ; g = Neut} ; CNIntNP cn i = { - s = \\c => cn.s ! NF Sg Indef ++ i.s ; - a = agrP3 (gennum cn.g Sg) ; - p = Pos + s = \\c => cn.s ! NF Sg Indef ++ i.s ; + gn = gennum cn.g Sg ; + p = NounP3 Pos } ; CNSymbNP det cn xs = { - s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF (numnnum det.nn) Indef ++ xs.s ; - a = agrP3 (gennum cn.g (numnnum det.nn)) ; - p = Pos + s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF (numnnum det.nn) Indef ++ xs.s ; + gn = gennum cn.g (numnnum det.nn) ; + p = NounP3 Pos } ; CNNumNP cn i = { - s = \\c => (cn.s ! NF Sg Indef ++ i.s ! CFNeut Indef) ; - a = agrP3 (gennum cn.g Sg) ; - p = Pos + s = \\c => (cn.s ! NF Sg Indef ++ i.s ! CFNeut Indef) ; + gn = gennum cn.g Sg ; + p = NounP3 Pos } ; SymbS sy = sy ; diff --git a/src/bulgarian/VerbBul.gf b/src/bulgarian/VerbBul.gf index e8d549bc8..7123ff14f 100644 --- a/src/bulgarian/VerbBul.gf +++ b/src/bulgarian/VerbBul.gf @@ -10,11 +10,27 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { SlashV2a v = slashV v v.c2 False ; - Slash2V3 v np = - insertSlashObj1 (\\_ => v.c2.s ++ np.s ! RObj v.c2.c) np.p (slashV v v.c3 False) ; + Slash2V3 v np = + let arg : {obj,clitics : Str} + = case of { + => {obj=np.s ! RObj c; clitics=[]; } ; + => {obj=[]; clitics=np.s ! RObj Acc} ; + => {obj=[]; clitics=np.s ! RObj Dat} ; + => {obj=np.s ! RObj c; clitics=[]; } + } + in insertSlashObj1 (\\_ => v.c2.s ++ arg.obj) (personPol np.p) (slashV v v.c3 False) + ** {clitics = arg.clitics}; Slash3V3 v np = - insertSlashObj2 (\\_ => v.c3.s ++ np.s ! RObj v.c3.c) np.p (slashV v v.c2 False) ; + let arg : {obj,clitics : Str} + = case of { + => {obj=np.s ! RObj c; clitics=[]; } ; + => {obj=[]; clitics=np.s ! RObj Acc} ; + => {obj=[]; clitics=np.s ! RObj Dat} ; + => {obj=np.s ! RObj c; clitics=[]; } + } + in insertSlashObj2 (\\_ => v.c3.s ++ arg.obj) (personPol np.p) (slashV v v.c2 False) + ** {clitics = arg.clitics}; ComplVV vv vp = insertObj (case vv.typ of { @@ -47,7 +63,8 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { SlashVV vv slash = { s = vv.s ; ad = {isEmpty=True; s=[]}; - compl1 = daComplex Simul Pos {s=slash.s; ad=slash.ad; compl=slash.compl1; vtype=slash.vtype; p = Pos; isSimple = slash.isSimple} ! Perf ; + clitics = [] ; + compl1 = daComplex Simul Pos {s=slash.s; ad=slash.ad; clitics=slash.clitics; compl=slash.compl1; vtype=slash.vtype; p = Pos; isSimple = slash.isSimple} ! Perf ; compl2 = slash.compl2 ; vtype = vv.vtype ; p = slash.p ; @@ -60,8 +77,9 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { SlashV2VNP vv np slash = { s = vv.s ; ad = {isEmpty=True; s=[]}; + clitics = [] ; compl1 = \\agr => vv.c2.s ++ np.s ! RObj vv.c2.c ++ - daComplex Simul np.p {s=slash.s; ad=slash.ad; compl=slash.compl1; vtype=slash.vtype; p=Pos; isSimple = slash.isSimple} ! Perf ! np.a ; + daComplex Simul (personPol np.p) {s=slash.s; ad=slash.ad; clitics=slash.clitics; compl=slash.compl1; vtype=slash.vtype; p=Pos; isSimple = slash.isSimple} ! Perf ! (personAgr np.gn np.p) ; compl2 = slash.compl2 ; vtype = vv.vtype ; p = Pos ; @@ -70,15 +88,23 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { subjCtrl = slash.subjCtrl } ; - ComplSlash slash np = { - s = slash.s ; - ad = slash.ad ; - compl = \\a => let a2 = case slash.subjCtrl of {True => a; False => np.a} - in slash.compl1 ! a ++ slash.c2.s ++ np.s ! RObj slash.c2.c ++ slash.compl2 ! a2 ; - vtype = slash.vtype ; - p = orPol np.p slash.p ; - isSimple = False - } ; + ComplSlash slash np = + let arg : {obj,acc,dat : Str} + = case of { + => {obj=np.s ! RObj c; acc=[]; dat=[] } ; + => {obj=[]; acc=np.s ! RObj Acc; dat=[] } ; + => {obj=[]; acc=[]; dat=np.s ! RObj Dat} ; + => {obj=np.s ! RObj c; acc=[]; dat=[] } + } + in {s = slash.s ; + ad = slash.ad ; + clitics = arg.dat++slash.clitics++arg.acc ; + compl = \\a => let a2 = case slash.subjCtrl of {True => a; False => personAgr np.gn np.p} + in slash.compl1 ! a ++ slash.c2.s ++ arg.obj ++ slash.compl2 ! a2 ; + vtype = slash.vtype ; + p = orPol (personPol np.p) slash.p ; + isSimple = False + } ; UseComp comp = insertObj comp.s comp.p (predV verbBe) ; @@ -92,6 +118,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { AdVVP adv vp = { s = vp.s ; ad = {isEmpty=False; s=vp.ad.s ++ adv.s} ; + clitics = vp.clitics ; compl = vp.compl ; vtype = vp.vtype ; p = orPol adv.p vp.p ; @@ -100,6 +127,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { AdVVPSlash adv vp = { s = vp.s ; ad = {isEmpty=False; s=vp.ad.s ++ adv.s} ; + clitics = vp.clitics ; compl1 = vp.compl1 ; compl2 = vp.compl2 ; vtype = vp.vtype ; @@ -112,6 +140,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { ReflVP slash = { s = slash.s ; ad = slash.ad ; + clitics = slash.clitics ; compl = \\agr => slash.compl1 ! agr ++ slash.compl2 ! agr ; vtype = VMedial slash.c2.c ; p = slash.p ; @@ -121,7 +150,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { PassV2 v = insertObj (\\a => v.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc))) Pos (predV verbBe) ; CompAP ap = {s = \\agr => ap.s ! aform agr.gn Indef (RObj Acc) ! agr.p; p = Pos} ; - CompNP np = {s = \\_ => np.s ! RObj Acc; p = np.p} ; + CompNP np = {s = \\_ => np.s ! RObj Acc; p = personPol np.p} ; CompAdv a = {s = \\_ => a.s; p = Pos} ; CompCN cn = {s = \\agr => cn.s ! (NF (numGenNum agr.gn) Indef); p = Pos} ;