diff --git a/lib/resource/bulgarian/AdjectiveBul.gf b/lib/resource/bulgarian/AdjectiveBul.gf index f168913d2..44e2d5d5f 100644 --- a/lib/resource/bulgarian/AdjectiveBul.gf +++ b/lib/resource/bulgarian/AdjectiveBul.gf @@ -6,14 +6,14 @@ concrete AdjectiveBul of Adjective = CatBul ** open ResBul, Prelude in { } ; ComparA a np = { - s = \\aform => "по" ++ "-" ++ a.s ! aform ++ "от" ++ np.s ! Nom ; + s = \\aform => "по" ++ "-" ++ a.s ! aform ++ "от" ++ np.s ! RSubj ; isPre = True } ; -- $SuperlA$ belongs to determiner syntax in $Noun$. ComplA2 a np = { - s = \\aform => a.s ! aform ++ a.c2 ++ np.s ! Acc ; + s = \\aform => a.s ! aform ++ a.c2 ++ np.s ! RObj Acc ; isPre = True } ; diff --git a/lib/resource/bulgarian/AdverbBul.gf b/lib/resource/bulgarian/AdverbBul.gf index 2897dcfa8..57fb601f6 100644 --- a/lib/resource/bulgarian/AdverbBul.gf +++ b/lib/resource/bulgarian/AdverbBul.gf @@ -2,13 +2,13 @@ concrete AdverbBul of Adverb = CatBul ** open ResBul, Prelude in { lin PositAdvAdj a = {s = a.s ! ASg Neut Indef} ; ComparAdvAdj cadv a np = { - s = cadv.s ++ "по" ++ "-" ++ a.s ! ASg Neut Indef ++ "от" ++ np.s ! Acc + s = cadv.s ++ "по" ++ "-" ++ a.s ! ASg Neut Indef ++ "от" ++ np.s ! RObj Acc } ; ComparAdvAdjS cadv a s = { s = cadv.s ++ "по" ++ "-" ++ a.s ! ASg Neut Indef ++ "от" ++ s.s } ; - PrepNP prep np = {s = prep.s ++ np.s ! prep.c} ; + PrepNP prep np = {s = prep.s ++ np.s ! RObj prep.c} ; AdAdv = cc2 ; diff --git a/lib/resource/bulgarian/CatBul.gf b/lib/resource/bulgarian/CatBul.gf index d492a74b8..2e52a1c71 100644 --- a/lib/resource/bulgarian/CatBul.gf +++ b/lib/resource/bulgarian/CatBul.gf @@ -30,23 +30,24 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { Cl = {s : ResBul.Tense => Anteriority => Polarity => Order => Str} ; Slash = { s : ResBul.Tense => Anteriority => Polarity => Order => Str ; - c2 : Prep + c2 : Preposition } ; Imp = {s : Polarity => GenNum => Str} ; -- Question QCl = {s : ResBul.Tense => Anteriority => Polarity => QForm => Str} ; - IP = {s : Case => Str; gn : GenNum} ; - IComp = {s : Str} ; + IP = {s : Role => Str; gn : GenNum} ; + IComp = {s1,s2 : Str} ; IDet = {s : GenNum => Str; n : Number} ; -- Verb VP = { - s : ResBul.Tense => Anteriority => Polarity => Agr => Str ; + s : ResBul.Tense => Anteriority => Polarity => Agr => Bool => Str ; imp : Polarity => Number => Str ; - s2 : Agr => Str + s2 : Agr => Str ; + subjRole : Role } ; Comp = {s : Agr => Str} ; @@ -60,15 +61,15 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { Adv = {s : Str} ; CAdv = {s : Str; sn : Str} ; - IAdv = {s : Str} ; + IAdv = {s1,s2 : Str} ; AdA = {s : Str} ; -- Noun CN = {s : NForm => Str; g : DGender} ; - NP = {s : Case => Str; a : Agr} ; - Pron = {s : Case => Str; gen : AForm => Str; a : Agr} ; - Det = {s : DGender => Case => Str ; n : Number; countable : Bool; spec : Species} ; + NP = {s : Role => Str; a : Agr} ; + Pron = {s : Role => Str; gen : AForm => Str; a : Agr} ; + Det = {s : DGender => Role => Str ; n : Number; countable : Bool; spec : Species} ; Predet = {s : GenNum => Str} ; Ord = {s : AForm => Str; nonEmpty : Bool} ; Num = {s : DGenderSpecies => Str; n : Number; nonEmpty : Bool} ; @@ -88,8 +89,8 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { -- Open lexical classes, e.g. Lexicon V, VS, VQ, VA = Verb ; - V2, V2A = Verb ** {c2 : Prep} ; - V3 = Verb ** {c2, c3 : Prep} ; + V2, V2A = Verb ** {c2 : Preposition} ; + V3 = Verb ** {c2, c3 : Preposition} ; A = {s : AForm => Str} ; A2 = {s : AForm => Str ; c2 : Str} ; diff --git a/lib/resource/bulgarian/LexiconBul.gf b/lib/resource/bulgarian/LexiconBul.gf index 1ce3a834c..1d06a7118 100644 --- a/lib/resource/bulgarian/LexiconBul.gf +++ b/lib/resource/bulgarian/LexiconBul.gf @@ -113,7 +113,7 @@ lin flow_V = mkV148 "тека" ; fly_V = mkV177 "летя" ; freeze_V = mkV186 "замръзвам" ; - laugh_V = mkV160 "смея" ; + laugh_V = reflV (mkV160 "смея") Acc ; lie_V = mkV178 "лежа" ; play_V = mkV161 "играя" ; -- sew_V = IrregEng.sew_V ; @@ -131,9 +131,9 @@ lin -- bite_V2 = dirV2 IrregEng.bite_V ; count_V2 = dirV2 (mkV175 "броя") ; cut_V2 = dirV2 (mkV157 "режа") ; - fear_V2 = dirV2 (mkV186 "страхувам") ; - fight_V2 = dirV2 (mkV173 "боря") ; --- hit_V2 = dirV2 hit_V ; + fear_V2 = dirV2 (reflV (mkV186 "страхувам") Acc) ; + fight_V2 = dirV2 (reflV (mkV173 "боря") Acc) ; + hit_V2 = dirV2 (mkV173 "ударя") ; -- hold_V2 = dirV2 hold_V ; hunt_V2 = dirV2 (mkV174 "ловя") ; kill_V2 = dirV2 (mkV163 "убия") ; diff --git a/lib/resource/bulgarian/MorphoBul.gf b/lib/resource/bulgarian/MorphoBul.gf index 4d5f72455..4bba5d47f 100644 --- a/lib/resource/bulgarian/MorphoBul.gf +++ b/lib/resource/bulgarian/MorphoBul.gf @@ -15,9 +15,9 @@ resource MorphoBul = ResBul ** open Prelude, (Predef=Predef) in { oper --2 Determiners - mkDeterminerSg : Str -> Str -> Str -> {s : DGender => Case => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako -> + mkDeterminerSg : Str -> Str -> Str -> {s : DGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako -> {s = \\g,_ => table DGender [vseki;vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ; - mkDeterminerPl : Str -> {s : DGender => Case => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> + mkDeterminerPl : Str -> {s : DGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> {s = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ; mkQuant : Str -> Str -> Str -> Str -> {s : GenNum => Str; spec : Species} = \tozi,tazi,towa,tezi -> { diff --git a/lib/resource/bulgarian/NounBul.gf b/lib/resource/bulgarian/NounBul.gf index 94f01b1ae..fbf25ad63 100644 --- a/lib/resource/bulgarian/NounBul.gf +++ b/lib/resource/bulgarian/NounBul.gf @@ -4,27 +4,27 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { lin DetCN det cn = - { s = \\c => let nf = case of { - => case c of { - Nom => NFSgDefNom ; - _ => NF Sg Def - } ; - => case det.countable of { - True => NFPlCount ; - False => NF Pl Indef - } ; - _ => NF det.n det.spec - } ; - s = det.s ! cn.g ! c ++ cn.s ! nf - in case c of { - Dat => "на" ++ s; - _ => s - } ; + { s = \\role => let nf = case of { + => case role of { + RSubj => NFSgDefNom ; + _ => NF Sg Def + } ; + => case det.countable of { + True => NFPlCount ; + False => NF Pl Indef + } ; + _ => NF det.n det.spec + } ; + s = det.s ! cn.g ! role ++ cn.s ! nf + in case role of { + RObj Dat => "на" ++ s; + _ => s + } ; a = {gn = gennum cn.g det.n; p = P3} ; } ; - UsePN pn = { s = \\c => case c of { - Dat => "на" ++ pn.s; - _ => pn.s + UsePN pn = { s = \\role => case role of { + RObj Dat => "на" ++ pn.s; + _ => pn.s } ; a = {gn = GSg pn.g; p = P3} } ; @@ -58,7 +58,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { } ; PossPron p = { - s = \\gn => p.gen ! aform gn Indef Nom ; + s = \\gn => p.gen ! aform gn Indef RSubj ; spec = Indef } ; @@ -97,8 +97,8 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { UseN2 noun = noun ; UseN3 noun = noun ; - ComplN2 f x = {s = \\nf => f.s ! nf ++ f.c2 ++ x.s ! Acc; g=f.g} ; - ComplN3 f x = {s = \\nf => f.s ! nf ++ f.c2 ++ x.s ! Acc; c2 = f.c3; g=f.g} ; + ComplN2 f x = {s = \\nf => f.s ! nf ++ f.c2 ++ x.s ! RObj Acc; g=f.g} ; + ComplN3 f x = {s = \\nf => f.s ! nf ++ f.c2 ++ x.s ! RObj Acc; c2 = f.c3; g=f.g} ; AdjCN ap cn = { s = \\nf => preOrPost ap.isPre (ap.s ! nform2aform nf cn.g) (cn.s ! (indefNForm nf)) ; diff --git a/lib/resource/bulgarian/ParadigmsBul.gf b/lib/resource/bulgarian/ParadigmsBul.gf index beed1f53a..c902f9ccb 100644 --- a/lib/resource/bulgarian/ParadigmsBul.gf +++ b/lib/resource/bulgarian/ParadigmsBul.gf @@ -59,12 +59,18 @@ oper --2 Verbs -- - + + reflV : V -> Case -> V ; + phrasalV : V -> Case -> V ; + --3 Two-place verbs -- -- Two-place verbs need a preposition, except the special case with direct object. -- (transitive verbs). Notice that a particle comes from the $V$. + reflV v c = {s = v.s; vtype = VMedial c; lock_V=<>} ; + phrasalV v c = {s = v.s; vtype = VPhrasal c; lock_V=<>} ; + mkAdv x = ss x ** {lock_Adv = <>} ; mkAdV x = ss x ** {lock_AdV = <>} ; mkAdA x = ss x ** {lock_AdA = <>} ; @@ -84,17 +90,17 @@ oper mkVS : V -> VS ; mkPN : Str -> Gender -> PN ; + + mkIAdv : Str -> IAdv ; - mkAdv x = ss x ** {lock_Adv = <>} ; - mkPrep p c = {s = p; c = c; lock_Prep = <>} ; noPrep = mkPrep [] Acc ; - prepV2 v p = {s = v.s ; c2 = p ; lock_V2 = <>} ; + prepV2 v p = {s = v.s; c2 = p; vtype = v.vtype; lock_V2 = <>} ; dirV2 v = prepV2 v noPrep ; - mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; c3 = q ; lock_V3 = <>} ; + mkV3 v p q = {s = v.s; s1 = v.s1; c2 = p; c3 = q; vtype = v.vtype; lock_V3 = <>} ; dirV3 v p = mkV3 v noPrep p ; dirdirV3 v = dirV3 v noPrep ; @@ -102,4 +108,5 @@ oper mkPN s g = {s = s; g = g ; lock_PN = <>} ; + mkIAdv s = {s1 = s; s2 = s + "то"; lock_IAdv = <>} ; } \ No newline at end of file diff --git a/lib/resource/bulgarian/PhraseBul.gf b/lib/resource/bulgarian/PhraseBul.gf index 6e29ddf3c..865be6751 100644 --- a/lib/resource/bulgarian/PhraseBul.gf +++ b/lib/resource/bulgarian/PhraseBul.gf @@ -7,5 +7,5 @@ concrete PhraseBul of Phrase = CatBul ** open Prelude, ResBul in { UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! GPl} ; UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! GPl} ; - UttIAdv iadv = iadv ; + UttIAdv iadv = {s = iadv.s1} ; } diff --git a/lib/resource/bulgarian/QuestionBul.gf b/lib/resource/bulgarian/QuestionBul.gf index 96c807126..095a675c2 100644 --- a/lib/resource/bulgarian/QuestionBul.gf +++ b/lib/resource/bulgarian/QuestionBul.gf @@ -14,18 +14,18 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { } ; QuestVP ip vp = - let cl = mkClause (ip.s ! Nom) {gn = ip.gn ; p = P3} vp + let cl = mkClause (ip.s ! RSubj) {gn = ip.gn ; p = P3} vp in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! Main} ; QuestSlash ip slash = - mkQuestion (ss (slash.c2.s ++ ip.s ! slash.c2.c)) slash ; + mkQuestion {s1 = slash.c2.s ++ ip.s ! (RObj slash.c2.c); s2 = slash.c2.s ++ ip.s ! (RObj slash.c2.c)} slash ; QuestIAdv iadv cl = mkQuestion iadv cl ; QuestIComp icomp np = - mkQuestion icomp (mkClause (np.s ! Nom) np.a (predV auxBe)) ; + mkQuestion icomp (mkClause (np.s ! RSubj) np.a (predV verbBe)) ; - PrepIP p ip = {s = p.s ++ ip.s ! Nom} ; + PrepIP p ip = {s1 = p.s ++ ip.s ! RSubj; s2 = p.s ++ ip.s ! RSubj} ; AdvIP ip adv = { s = \\c => ip.s ! c ++ adv.s ; @@ -38,8 +38,8 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { _ => NF idet.n Indef } in idet.s ! gennum cn.g idet.n ++ - num.s ! dgenderSpecies cn.g Indef Nom ++ - ord.s ! aform (gennum cn.g num.n) Indef Nom ++ + num.s ! dgenderSpecies cn.g Indef RSubj ++ + ord.s ! aform (gennum cn.g num.n) Indef RSubj ++ cn.s ! nf ; gn = gennum cn.g idet.n } ; diff --git a/lib/resource/bulgarian/ResBul.gf b/lib/resource/bulgarian/ResBul.gf index 8a378b7dd..3d4e6a9b0 100644 --- a/lib/resource/bulgarian/ResBul.gf +++ b/lib/resource/bulgarian/ResBul.gf @@ -18,7 +18,8 @@ resource ResBul = ParamX ** open Prelude in { -- This is the worst-case $Case$ needed for pronouns. param - Case = Nom | Acc | Dat; + Role = RSubj | RObj Case ; + Case = Acc | Dat; NForm = NF Number Species @@ -54,6 +55,12 @@ resource ResBul = ParamX ** open Prelude in { | VImperative Number | VGerund ; + + VType = + VNormal + | VMedial Case + | VPhrasal Case + ; -- The order of sentence is needed already in $VP$. @@ -112,39 +119,39 @@ resource ResBul = ParamX ** open Prelude in { GPl => Pl } ; - aform : GenNum -> Species -> Case -> AForm = \gn,spec,c -> + aform : GenNum -> Species -> Role -> AForm = \gn,spec,role -> case gn of { - GSg g => case of { - => ASgMascDefNom ; - _ => ASg g spec + GSg g => case of { + => ASgMascDefNom ; + _ => ASg g spec } ; GPl => APl spec } ; - dgenderSpecies : DGender -> Species -> Case -> DGenderSpecies = - \g,spec,c -> case of { - => DMascIndef ; - => case c of { - Nom => DMascDefNom ; - _ => DMascDef - } ; - => DMascPersonalIndef ; - => case c of { - Nom => DMascPersonalDefNom ; - _ => DMascPersonalDef - } ; - => DFemIndef ; - => DFemDef ; - => DNeutIndef ; - => DNeutDef - } ; + dgenderSpecies : DGender -> Species -> Role -> DGenderSpecies = + \g,spec,role -> case of { + => DMascIndef ; + => case role of { + RSubj => DMascDefNom ; + _ => DMascDef + } ; + => DMascPersonalIndef ; + => case role of { + RSubj => DMascPersonalDefNom ; + _ => DMascPersonalDef + } ; + => DFemIndef ; + => DFemDef ; + => DNeutIndef ; + => DNeutDef + } ; nform2aform : NForm -> DGender -> AForm = \nf,g -> case nf of { - NF n spec => aform (gennum g n) spec Acc ; - NFSgDefNom => aform (gennum g Sg) Def Nom ; + NF n spec => aform (gennum g n) spec (RObj Acc) ; + NFSgDefNom => aform (gennum g Sg) Def RSubj ; NFPlCount => APl Indef ; - NFVocative => aform (gennum g Sg) Indef Acc + NFVocative => aform (gennum g Sg) Indef (RObj Acc) } ; indefNForm : NForm -> NForm @@ -159,96 +166,174 @@ resource ResBul = ParamX ** open Prelude in { -- For $Verb$. Verb : Type = { - s : VForm => Str ; + s : VForm => Str ; + vtype : VType } ; VP : Type = { - s : Tense => Anteriority => Polarity => Agr => Str ; + s : Tense => Anteriority => Polarity => Agr => Bool => Str ; imp : Polarity => Number => Str ; - s2 : Agr => Str + s2 : Agr => Str ; + subjRole : Role } ; predV : Verb -> VP = \verb -> - let pol : Polarity -> Str -> Str = \p,vf -> case p of { Pos => vf ; Neg => "не" ++ vf } - in { s = \\t,a,p,agr => let present = verb.s ! (VPres (numGenNum agr.gn) agr.p) ; - aorist = verb.s ! (VAorist (numGenNum agr.gn) agr.p) ; - perfect = verb.s ! (VPerfect (aform agr.gn Indef Acc)) ; - vf = case of { - => present ; - => auxBe.s ! (VPres (numGenNum agr.gn) agr.p) ++ perfect ; - => aorist ; - => auxBe.s ! (VAorist (numGenNum agr.gn) agr.p) ++ perfect ; - => "ще" ++ present ; - => "ще" ++ auxBe.s ! (VPres (numGenNum agr.gn) agr.p) ++ perfect ; - => auxWould.s ! (VAorist (numGenNum agr.gn) agr.p) ++ perfect ; - => auxWould.s ! (VAorist (numGenNum agr.gn) agr.p) ++ auxBe.s ! (VPerfect (aform agr.gn Indef Acc)) ++ perfect + { s = \\t,a,p,agr,q => 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}} + } ; + + present = verb.s ! (VPres (numGenNum clitic.agr.gn) clitic.agr.p) ; + aorist = verb.s ! (VAorist (numGenNum clitic.agr.gn) clitic.agr.p) ; + perfect = verb.s ! (VPerfect (aform clitic.agr.gn Indef (RObj Acc))) ; + + auxPres = auxBe clitic.s ! VPres (numGenNum clitic.agr.gn) clitic.agr.p ; + auxAorist = auxBe clitic.s ! VAorist (numGenNum clitic.agr.gn) clitic.agr.p ; + auxPerfect = auxBe clitic.s ! VPerfect (aform clitic.agr.gn Indef (RObj Acc)) ; + auxCondS = auxWould clitic.s ! VAorist (numGenNum clitic.agr.gn) clitic.agr.p ; + auxCondA = auxCondS ++ + auxBe [] ! VPerfect (aform clitic.agr.gn Indef (RObj Acc)) ; + + verbs : {aux:Str; main:Str} + = case of { + => {aux=clitic.s; main=present} ; + => {aux=auxPres; main=perfect} ; + => {aux=clitic.s; main=aorist} ; + => {aux=auxAorist; main=perfect} ; + => {aux=clitic.s; main=present} ; + => {aux=auxPres; main=perfect} ; + => {aux=auxCondS; main=perfect} ; + => {aux=auxCondA; main=perfect} } ; - in pol p vf ; - imp = \\p,n => pol p (verb.s ! VImperative n) ; - s2 = \\_ => [] + + li = case q of {True => "ли"; False => []} ; + aux = case p of { + Pos => case t of { + Fut => {s1="ще"++verbs.aux; s2=li} ; + _ => case q of {True => {s1=[]; s2="ли"++verbs.aux}; + False => {s1=verbs.aux; s2=[]}} + } ; + Neg => case t of { + Fut => {s1="не"++"ще"++verbs.aux; s2=li} ; + _ => case q of {True => {s1="не"++verbs.aux; s2="ли"}; + False => {s1="не"++verbs.aux; s2=[]}} + } + } + + in aux.s1 ++ verbs.main ++ aux.s2; + imp = \\p,n => let ne = case p of {Pos => []; Neg => "не"} ; + in ne ++ verb.s ! VImperative n ; + s2 = \\_ => [] ; + subjRole = case verb.vtype of { + VNormal => RSubj ; + VMedial _ => RSubj ; + VPhrasal c => RObj c + } } ; insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { - s = vp.s ; + s = vp.s ; imp = vp.imp ; - s2 = \\a => vp.s2 ! a ++ obj ! a + s2 = \\a => vp.s2 ! a ++ obj ! a ; + subjRole = vp.subjRole } ; - auxBe : Verb = { - s = table { - VPres Sg P1 => "съм" ; - VPres Sg P2 => "си" ; - VPres Sg P3 => "е" ; - VPres Pl P1 => "сме" ; - VPres Pl P2 => "сте" ; - VPres Pl P3 => "са" ; - VAorist Sg P1 => "бях" ; - VAorist Sg _ => "беше" ; - VAorist Pl P1 => "бяхме" ; - VAorist Pl P2 => "бяхте" ; - VAorist Pl P3 => "бяха" ; - VImperfect Sg P1 => "бях" ; - VImperfect Sg _ => "беше" ; - VImperfect Pl P1 => "бяхме" ; - VImperfect Pl P2 => "бяхте" ; - VImperfect Pl P3 => "бяха" ; - VPerfect aform => (regAdjective "бил").s ! aform ; - VPluPerfect aform => (regAdjective "бил").s ! aform ; - VPassive aform => (regAdjective "бъден").s ! aform ; - VPresPart aform => (regAdjective "бъдещ").s ! aform ; - VImperative Sg => "бъди" ; - VImperative Pl => "бъдете" ; - VGerund => "бидейки" - } + auxBe : Str -> VForm => Str = \se -> + table { + VPres Sg P1 => "съм" ++ se ; + VPres Sg P2 => "си" ++ se ; + VPres Sg P3 => se ++ "е" ; + VPres Pl P1 => "сме" ++ se ; + VPres Pl P2 => "сте" ++ se ; + VPres Pl P3 => "са" ++ se ; + VAorist Sg P1 => "бях" ++ se ; + VAorist Sg P2 => "беше" ++ se ; + VAorist Sg P3 => se ++ "беше" ; + VAorist Pl P1 => "бяхме" ++ se ; + VAorist Pl P2 => "бяхте" ++ se ; + VAorist Pl P3 => "бяха" ++ se ; + VImperfect Sg P1 => "бях" ++ se ; + VImperfect Sg _ => "беше" ++ se ; + VImperfect Pl P1 => "бяхме" ++ se ; + VImperfect Pl P2 => "бяхте" ++ se ; + VImperfect Pl P3 => "бяха" ++ se ; + VPerfect aform => (regAdjective "бил").s ! aform ++ se ; + VPluPerfect aform => (regAdjective "бил").s ! aform ++ se ; + VPassive aform => (regAdjective "бъден").s ! aform ++ se ; + VPresPart aform => (regAdjective "бъдещ").s ! aform ++ se ; + VImperative Sg => "бъди" ++ se ; + VImperative Pl => "бъдете" ++ se ; + VGerund => "бидейки" ++ se } ; - auxWould : Verb = { - s = table { - VPres Sg P1 => "бъда" ; - VPres Sg P2 => "бъдеш" ; - VPres Sg P3 => "бъде" ; - VPres Pl P1 => "бъдем" ; - VPres Pl P2 => "бъдете" ; - VPres Pl P3 => "бъдат" ; - VAorist Sg P1 => "бих" ; - VAorist Sg _ => "би" ; - VAorist Pl P1 => "бихме" ; - VAorist Pl P2 => "бихте" ; - VAorist Pl P3 => "биха" ; - VImperfect Sg P1 => "бъдех" ; - VImperfect Sg _ => "бъдеше" ; - VImperfect Pl P1 => "бъдехме" ; - VImperfect Pl P2 => "бъдехте" ; - VImperfect Pl P3 => "бъдеха" ; - VPerfect aform => (regAdjective "бил").s ! aform ; - VPluPerfect aform => (regAdjective "бъдел").s ! aform ; - VPassive aform => (regAdjective "бъден").s ! aform ; - VPresPart aform => (regAdjective "бъдещ").s ! aform ; - VImperative Sg => "бъди" ; - VImperative Pl => "бъдете" ; - VGerund => "бъдейки" - } + auxWould : Str -> VForm => Str = \se -> + table { + VPres Sg P1 => "бъда" ++ se ; + VPres Sg P2 => "бъдеш" ++ se ; + VPres Sg P3 => se ++ "бъде" ; + VPres Pl P1 => "бъдем" ++ se ; + VPres Pl P2 => "бъдете" ++ se ; + VPres Pl P3 => "бъдат" ++ se ; + VAorist Sg P1 => "бих" ++ se ; + VAorist Sg _ => "би" ++ se ; + VAorist Pl P1 => "бихме" ++ se ; + VAorist Pl P2 => "бихте" ++ se ; + VAorist Pl P3 => "биха" ++ se ; + VImperfect Sg P1 => "бъдех" ++ se ; + VImperfect Sg _ => "бъдеше" ++ se ; + VImperfect Pl P1 => "бъдехме" ++ se ; + VImperfect Pl P2 => "бъдехте" ++ se ; + VImperfect Pl P3 => "бъдеха" ++ se ; + VPerfect aform => (regAdjective "бил").s ! aform ++ se ; + VPluPerfect aform => (regAdjective "бъдел").s ! aform ++ se ; + VPassive aform => (regAdjective "бъден").s ! aform ++ se ; + VPresPart aform => (regAdjective "бъдещ").s ! aform ++ se ; + VImperative Sg => "бъди" ++ se ; + VImperative Pl => "бъдете" ++ se ; + VGerund => "бъдейки" ++ se + } ; + + verbBe : Verb = {s=auxBe []; vtype=VNormal} ; + + reflClitics : Case => Str = table {Acc => "се"; Dat => "си"} ; + + personalClitics : Case => GenNum => Person => Str = + table { + Acc => table { + GSg g => table { + P1 => "ме" ; + P2 => "те" ; + P3 => case g of { + Masc => "го" ; + Fem => "я" ; + Neut => "го" + } + } ; + GPl => table { + P1 => "ни" ; + P2 => "ви" ; + P3 => "ги" + } + } ; + Dat => table { + GSg g => table { + P1 => "ми" ; + P2 => "ти" ; + P3 => case g of { + Masc => "му" ; + Fem => "й" ; + Neut => "му" + } + } ; + GPl => table { + P1 => "ни" ; + P2 => "ви" ; + P3 => "им" + } + } } ; ia2e : Str -> Str = -- to be used when the next syllable has vowel different from "а","ъ","о" or "у" @@ -345,7 +430,8 @@ resource ResBul = ParamX ** open Prelude in { _ => chete + "йки" } } ; - } ; + vtype = VNormal + } ; -- For $Sentence$. @@ -357,12 +443,13 @@ resource ResBul = ParamX ** open Prelude in { \subj,agr,vp -> { s = \\t,a,b,o => let - verb = vp.s ! t ! a ! b ! agr ; + verb = vp.s ! t ! a ! b ! agr ! False ; + verbq = vp.s ! t ! a ! b ! agr ! True ; compl = vp.s2 ! agr in case o of { Main => subj ++ verb ++ compl ; - Inv => verb ++ subj ++ compl ; - Quest => subj ++ verb ++ "ли" ++ compl + Inv => verb ++ compl ++ subj ; + Quest => subj ++ verbq ++ compl } } ; @@ -421,22 +508,22 @@ resource ResBul = ParamX ** open Prelude in { DNeutDef => addDef dve } ; - mkIP : Str -> Str -> GenNum -> {s : Case => Str ; gn : GenNum} = + mkIP : Str -> Str -> GenNum -> {s : Role => Str ; gn : GenNum} = \koi,kogo,gn -> { s = table { - Nom => koi ; - Acc => kogo ; - Dat => "на" ++ kogo + RSubj => koi ; + RObj Acc => kogo ; + RObj Dat => "на" ++ kogo } ; gn = gn } ; - mkPron : (az,men,mi,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite : Str) -> GenNum -> Person -> {s : Case => Str; gen : AForm => Str; a : Agr} = + mkPron : (az,men,mi,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite : Str) -> GenNum -> Person -> {s : Role => Str; gen : AForm => Str; a : Agr} = \az,men,mi,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite,gn,p -> { s = table { - Nom => az ; - Acc => men ; - Dat => mi + RSubj => az ; + RObj Acc => men ; + RObj Dat => mi } ; gen = (mkAdjective moj moia moiat moia_ moiata moe moeto moi moite).s ; a = { @@ -444,17 +531,18 @@ resource ResBul = ParamX ** open Prelude in { p = p } } ; + + Preposition : Type = {s : Str; c : Case}; mkQuestion : - {s : Str} -> Clause -> + {s1,s2 : Str} -> Clause -> {s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl -> { s = \\t,a,p => let cls = cl.s ! t ! a ! p ; - why = wh.s in table { - QDir => why ++ cls ! Inv ; - QIndir => why ++ cls ! Main + QDir => wh.s1 ++ cls ! Inv ; + QIndir => wh.s2 ++ cls ! Main } } ; } diff --git a/lib/resource/bulgarian/SentenceBul.gf b/lib/resource/bulgarian/SentenceBul.gf index 669151115..e5ff885fb 100644 --- a/lib/resource/bulgarian/SentenceBul.gf +++ b/lib/resource/bulgarian/SentenceBul.gf @@ -3,7 +3,7 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { flags optimize=all_subs ; lin - PredVP np vp = mkClause (np.s ! Nom) np.a vp ; + PredVP np vp = mkClause (np.s ! vp.subjRole) np.a vp ; ImpVP vp = { s = \\p,gn => @@ -15,7 +15,7 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { } ; SlashV2 np v2 = - mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; + mkClause (np.s ! RSubj) np.a (predV v2) ** {c2 = v2.c2} ; AdvSlash slash adv = { s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; diff --git a/lib/resource/bulgarian/StructuralBul.gf b/lib/resource/bulgarian/StructuralBul.gf index 37716097e..b1483c238 100644 --- a/lib/resource/bulgarian/StructuralBul.gf +++ b/lib/resource/bulgarian/StructuralBul.gf @@ -54,7 +54,7 @@ concrete StructuralBul of Structural = CatBul ** here_Adv = ss "тук" ; here7to_Adv = ss ["до тук"] ; here7from_Adv = ss ["от тук"] ; - how_IAdv = ss "как" ; + how_IAdv = mkIAdv "как" ; how8many_IDet = {s = \\_ => "колко"; n = Pl} ; if_Subj = ss "ако" ; in8front_Prep = mkPrep "пред" Acc ; @@ -133,16 +133,16 @@ concrete StructuralBul of Structural = CatBul ** we_Pron = mkPron "ние" "нас" "ни" "наш" "нашия" "нашият" "наша" "нашата" "наше" "нашето" "наши" "нашите" GPl P1 ; whatPl_IP = mkIP "какви" "какви" GPl ; whatSg_IP = mkIP "какъв" "какъв" (GSg Masc) ; - when_IAdv = ss "кога" ; + when_IAdv = mkIAdv "кога" ; {- when_Subj = ss "when" ; -} - where_IAdv = ss "къде" ; + where_IAdv = mkIAdv "къде" ; whichPl_IDet = {s = table GenNum ["кой";"коя";"кое";"кои"]; n = Pl} ; whichSg_IDet = {s = table GenNum ["кой";"коя";"кое";"кои"]; n = Sg} ; whoSg_IP = mkIP "кой" "кого" (GSg Masc) ; whoPl_IP = mkIP "кои" "кого" GPl ; - why_IAdv = ss "защо" ; + why_IAdv = mkIAdv "защо" ; without_Prep = mkPrep "без" Acc ; with_Prep = mkPrep (pre { "с" ; "със" / strs {"с" ; "з" ; "С" ; "З"} diff --git a/lib/resource/bulgarian/VerbBul.gf b/lib/resource/bulgarian/VerbBul.gf index 9bc363a80..db522c29a 100644 --- a/lib/resource/bulgarian/VerbBul.gf +++ b/lib/resource/bulgarian/VerbBul.gf @@ -4,22 +4,23 @@ concrete VerbBul of Verb = CatBul ** open ResBul, ParadigmsBul in { lin UseV = predV ; - ComplV2 v np = insertObj (\\_ => v.c2.s ++ np.s ! v.c2.c) (predV v) ; + ComplV2 v np = insertObj (\\_ => v.c2.s ++ np.s ! RObj v.c2.c) (predV v) ; ComplV3 v np np2 = - insertObj (\\_ => v.c2.s ++ np.s ! v.c2.c ++ v.c3.s ++ np2.s ! v.c3.c) (predV v) ; + insertObj (\\_ => v.c2.s ++ np.s ! RObj v.c2.c ++ v.c3.s ++ np2.s ! RObj v.c3.c) (predV v) ; ComplVS v s = insertObj (\\_ => "," ++ "че" ++ s.s) (predV v) ; - UseComp comp = insertObj comp.s (predV auxBe) ; + UseComp comp = insertObj comp.s (predV verbBe) ; AdvVP vp adv = insertObj (\\_ => adv.s) vp ; - ReflV2 v = insertObj (\\_ => v.c2.s ++ case v.c2.c of {Dat => "си"; _ => "се"}) (predV v) ; + ReflV2 v = predV (reflV v v.c2.c) ; - PassV2 v = insertObj (\\a => v.s ! VPassive (aform a.gn Indef Acc)) (predV auxBe) ; + PassV2 v = insertObj (\\a => v.s ! VPassive (aform a.gn Indef (RObj Acc))) (predV verbBe) ; - UseVS, UseVQ = \vv -> {s = vv.s ; c2 = noPrep ; isRefl = vv.isRefl} ; -- no "to" + UseVS, UseVQ = \vv -> {s = vv.s; c2 = noPrep; vtype = vv.vtype} ; -- no "to" - CompNP np = {s = \\_ => np.s ! Acc} ; + CompAP ap = {s = \\agr => ap.s ! aform agr.gn Indef (RObj Acc)} ; + CompNP np = {s = \\_ => np.s ! RObj Acc} ; CompAdv a = {s = \\_ => a.s} ; }