diff --git a/src/ukrainian/CatUkr.gf b/src/ukrainian/CatUkr.gf index 971c3ef1..366b8b01 100644 --- a/src/ukrainian/CatUkr.gf +++ b/src/ukrainian/CatUkr.gf @@ -3,7 +3,13 @@ concrete CatUkr of Cat = CommonX ** open ResUkr, (R = ParamX) in { lincat N = N ; lincat N2 = N ** {c2 : Compl} ; lincat N3 = N ** {c2,c3 : Compl} ; -lincat Pron = {s: Case => Str; g: Gender; n : Number; p: Person} ; +lincat Pron = { + s : Case => Str ; + poss : Case => Gender => Number => Str ; + g : Gender ; + n : Number ; + p : Person + } ; lincat V = V ; lincat VV,VS,VQ,VA = V ; lincat V2 = V ** {c2 : Compl} ; diff --git a/src/ukrainian/ExtendUkr.gf b/src/ukrainian/ExtendUkr.gf index 15627848..0e607a8e 100644 --- a/src/ukrainian/ExtendUkr.gf +++ b/src/ukrainian/ExtendUkr.gf @@ -1,16 +1,213 @@ --# -path=.:../abstract:../common:prelude -concrete ExtendUkr of Extend = CatUkr ** open ResUkr, ParadigmsUkr in { +concrete ExtendUkr of Extend = CatUkr ** + open ResUkr, (R = ParamX), ParadigmsUkr, Prelude in { + +lincat + VPS = {s : Gender => Number => Person => Str} ; + [VPS] = {s1,s2 : Gender => Number => Person => Str} ; + VPI = {s : Str} ; + [VPI] = {s1,s2 : Str} ; + VPS2 = {s : Gender => Number => Person => Str; c : Compl; post : Str} ; + [VPS2] = {s1,s2 : Gender => Number => Person => Str; c : Compl; post : Str} ; + VPI2 = {s : Str; c : Compl; post : Str} ; + [VPI2] = {s1,s2 : Str; c : Compl; post : Str} ; + [Comp] = {s1,s2 : Gender => Number => Str} ; + [Imp] = {s1,s2 : R.Polarity => Number => Str} ; + RNP = {s : Case => Str} ; + RNPList = {s1,s2 : Case => Str} ; + X = {s : Str} ; lin - UttAdV adv = {s = adv.s} ; + GenModNP num np cn = { + s = \\c => cn.s ! c ! num.n ++ np.s ! Gen ; + g = cn.g ; + n = num.n ; + p = P3 + } ; + EmptyRelSlash cls = {s = \\_,_ => cls.s ! R.Pres ! R.Pos} ; - iFem_Pron = mkPron "я" "мене" "мені" "мене" "мені" "мною" Fem Sg P1 ; - youFem_Pron = mkPron "ти" "тeбе" "тобі" "мене" "тобі" "тобою" Fem Sg P2 ; - weFem_Pron = mkPron "ми" "нас" "нам" "нас" "наc" "нами" Fem Pl P1 ; - youPlFem_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" Fem Pl P2 ; - theyFem_Pron = mkPron "вони" "їх" "їм" "їх" "них" "ними" Fem Pl P3 ; - youPolFem_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" Fem Pl P2 ; - youPolPl_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" Masc Pl P2 ; - youPolPlFem_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" Fem Pl P2 ; + MkVPS temp pol vp = {s = \\g,n,p => vp.s ! temp.t ! pol.p ! g ! n ! p} ; + BaseVPS x y = {s1=x.s; s2=y.s} ; + ConsVPS x xs = {s1=\\g,n,p => x.s ! g ! n ! p ++ "," ++ xs.s1 ! g ! n ! p; s2=xs.s2} ; + ConjVPS conj xs = {s = \\g,n,p => conj.s1 ++ xs.s1 ! g ! n ! p ++ conj.s2 ++ xs.s2 ! g ! n ! p} ; + PredVPS np vps = {s = np.s ! Nom ++ vps.s ! np.g ! np.n ! np.p} ; + SQuestVPS np vps = {s = np.s ! Nom ++ vps.s ! np.g ! np.n ! np.p} ; + QuestVPS ip vps = {s = ip.s ! Nom ++ vps.s ! ip.g ! ip.n ! ip.p} ; + RelVPS rp vps = {s = \\g,n => rp.s ! g ! n ! Nom ++ vps.s ! g ! n ! P3} ; + ExistS temp pol np = {s = case pol.p of {R.Pos => "є" ++ np.s ! Nom ; R.Neg => "немає" ++ np.s ! Gen}} ; + ExistNPQS temp pol np = {s = case pol.p of {R.Pos => "є" ++ np.s ! Nom ; R.Neg => "немає" ++ np.s ! Gen}} ; + ExistIPQS temp pol ip = {s = "що є" ++ ip.s ! Nom} ; + + MkVPI vp = {s = vp.inf} ; + BaseVPI x y = {s1=x.s; s2=y.s} ; + ConsVPI x xs = {s1=x.s ++ "," ++ xs.s1; s2=xs.s2} ; + ConjVPI conj xs = {s = conj.s1 ++ xs.s1 ++ conj.s2 ++ xs.s2} ; + ComplVPIVV vv vpi = { + s = \\t,pol,g,n,p => finiteVerb vv t pol g n p ++ vpi.s ; + inf = vv.infinitive ++ vpi.s ; + imp = \\pol,n => neg pol ++ vv.imperative2 ! n ++ vpi.s + } ; + + MkVPS2 temp pol slash = {s = \\g,n,p => slash.s ! temp.t ! pol.p ! g ! n ! p; c=slash.c; post=slash.post} ; + BaseVPS2 x y = {s1=x.s; s2=y.s; c=y.c; post=y.post} ; + ConsVPS2 x xs = {s1=\\g,n,p => x.s ! g ! n ! p ++ "," ++ xs.s1 ! g ! n ! p; s2=xs.s2; c=xs.c; post=xs.post} ; + ConjVPS2 conj xs = {s = \\g,n,p => conj.s1 ++ xs.s1 ! g ! n ! p ++ conj.s2 ++ xs.s2 ! g ! n ! p; c=xs.c; post=xs.post} ; + ComplVPS2 vps2 np = {s = \\g,n,p => vps2.s ! g ! n ! p ++ prepNP vps2.c np ++ vps2.post} ; + ReflVPS2 vps2 rnp = {s = \\g,n,p => vps2.s ! g ! n ! p ++ prepNP vps2.c rnp ++ vps2.post} ; + MkVPI2 slash = {s=slash.inf; c=slash.c; post=slash.post} ; + BaseVPI2 x y = {s1=x.s; s2=y.s; c=y.c; post=y.post} ; + ConsVPI2 x xs = {s1=x.s ++ "," ++ xs.s1; s2=xs.s2; c=xs.c; post=xs.post} ; + ConjVPI2 conj xs = {s=conj.s1 ++ xs.s1 ++ conj.s2 ++ xs.s2; c=xs.c; post=xs.post} ; + ComplVPI2 vpi2 np = {s = vpi2.s ++ prepNP vpi2.c np ++ vpi2.post} ; + + BaseComp x y = {s1=x.s; s2=y.s} ; + ConsComp x xs = {s1=\\g,n => x.s ! g ! n ++ "," ++ xs.s1 ! g ! n; s2=xs.s2} ; + ConjComp conj xs = {s = \\g,n => conj.s1 ++ xs.s1 ! g ! n ++ conj.s2 ++ xs.s2 ! g ! n} ; + BaseImp x y = {s1=x.s; s2=y.s} ; + ConsImp x xs = {s1=\\pol,n => x.s ! pol ! n ++ "," ++ xs.s1 ! pol ! n; s2=xs.s2} ; + ConjImp conj xs = {s = \\pol,n => conj.s1 ++ xs.s1 ! pol ! n ++ conj.s2 ++ xs.s2 ! pol ! n} ; + + ProDrop pron = pron ** {s = \\_ => []} ; + ICompAP ap = {s = ap.s ! Nom ! GSg Neuter} ; + IAdvAdv adv = adv ; + CompIQuant iq = {s = iq.s ! Nom ! Masc ! Sg} ; + PrepCN prep cn = {s = prep.s ++ cn.s ! prep.c ! Sg} ; + FocusObj np sslash = {s = np.s ! Acc ++ sslash.s} ; + FocusAdv adv s = {s = adv.s ++ s.s} ; + FocusAdV adv s = {s = adv.s ++ s.s} ; + PresPartAP vp = {s=\\c,gn => vp.inf} ; + EmbedPresPart vp = {s = vp.inf} ; + PastPartAP slash = {s=\\c,gn => slash.inf} ; + PastPartAgentAP slash np = {s=\\c,gn => slash.inf ++ prepNP {s="ким"; c=Instr} np} ; + PassVPSlash slash = { + s = \\t,pol,g,n,p => copula t pol g n p ++ slash.inf ++ slash.post ; + inf = "бути" ++ slash.inf ++ slash.post ; + imp = \\pol,n => neg pol ++ "будь" ++ slash.inf ++ slash.post + } ; + PassAgentVPSlash slash np = { + s = \\t,pol,g,n,p => copula t pol g n p ++ slash.inf ++ prepNP {s="ким"; c=Instr} np ++ slash.post ; + inf = "бути" ++ slash.inf ++ prepNP {s="ким"; c=Instr} np ++ slash.post ; + imp = \\pol,n => neg pol ++ "будь" ++ slash.inf ++ prepNP {s="ким"; c=Instr} np ++ slash.post + } ; + ProgrVPSlash slash = slash ; + ExistsNP np = {s = \\t,pol => "існує" ++ np.s ! Nom} ; + ComplBareVS vs s = { + s = \\t,pol,g,n,p => finiteVerb vs t pol g n p ++ s.s ; + inf = vs.infinitive ++ s.s ; + imp = \\pol,n => neg pol ++ vs.imperative2 ! n ++ s.s + } ; + SlashBareV2S v s = { + s = \\t,pol,g,n,p => finiteVerb v t pol g n p ; + inf = v.infinitive ; + imp = \\pol,n => neg pol ++ v.imperative2 ! n ; + c = v.c2 ; + post = s.s + } ; + ComplDirectVS vs utt = { + s = \\t,pol,g,n,p => finiteVerb vs t pol g n p ++ utt.s ; + inf = vs.infinitive ++ utt.s ; + imp = \\pol,n => neg pol ++ vs.imperative2 ! n ++ utt.s + } ; + ComplDirectVQ vq utt = { + s = \\t,pol,g,n,p => finiteVerb vq t pol g n p ++ utt.s ; + inf = vq.infinitive ++ utt.s ; + imp = \\pol,n => neg pol ++ vq.imperative2 ! n ++ utt.s + } ; + FrontComplDirectVS np vs utt = {s = \\t,pol => utt.s ++ np.s ! Nom ++ finiteVerb vs t pol np.g np.n np.p} ; + FrontComplDirectVQ np vq utt = {s = \\t,pol => utt.s ++ np.s ! Nom ++ finiteVerb vq t pol np.g np.n np.p} ; + PredAPVP ap vp = {s = \\t,pol => ap.s ! Nom ! GSg Neuter ++ vp.inf} ; + AdjAsCN ap = constN (ap.s ! Nom ! GSg Masc) Masc ; + AdjAsNP ap = {s=\\_=>ap.s ! Nom ! GSg Masc; g=Masc; n=Sg; p=P3} ; + PredIAdvVP iadv vp = {s = \\t,pol => iadv.s ++ vp.inf} ; + EmbedSSlash ss = {s = ss.s} ; + + ReflRNP slash rnp = { + s = \\t,pol,g,n,p => slash.s ! t ! pol ! g ! n ! p ++ prepNP slash.c rnp ++ slash.post ; + inf = slash.inf ++ prepNP slash.c rnp ++ slash.post ; + imp = \\pol,n => slash.imp ! pol ! n ++ prepNP slash.c rnp ++ slash.post + } ; + ReflPron = {s = \\_ => "себе"} ; + ReflPoss num cn = {s = \\c => possIy "св" c cn.g num.n ++ cn.s ! c ! num.n} ; + PredetRNP pred rnp = {s = \\c => pred.s ! c ! Masc ! Sg ++ rnp.s ! c} ; + AdvRNP np prep rnp = {s = \\c => np.s ! c ++ prepNP prep rnp} ; + AdvRVP vp prep rnp = vp ** { + s = \\t,pol,g,n,p => vp.s ! t ! pol ! g ! n ! p ++ prepNP prep rnp + } ; + AdvRAP ap prep rnp = ap ** { + s = \\c,gn => ap.s ! c ! gn ++ prepNP prep rnp + } ; + ReflA2RNP a rnp = a ** { + s = \\c,gn => a.s ! c ! gn ++ prepNP a.c2 rnp + } ; + PossPronRNP pron num cn rnp = { + s = \\c => pron.poss ! c ! cn.g ! num.n ++ cn.s ! c ! num.n ++ rnp.s ! Gen ; + g = cn.g ; + n = num.n ; + p = P3 + } ; + Base_rr_RNP x y = {s1=x.s; s2=y.s} ; + Base_nr_RNP x y = {s1=x.s; s2=y.s} ; + Base_rn_RNP x y = {s1=x.s; s2=y.s} ; + Cons_rr_RNP x xs = {s1=\\c=>x.s ! c ++ "," ++ xs.s1 ! c; s2=xs.s2} ; + Cons_nr_RNP x xs = {s1=\\c=>x.s ! c ++ "," ++ xs.s1 ! c; s2=xs.s2} ; + ConjRNP conj xs = {s = \\c => conj.s1 ++ xs.s1 ! c ++ conj.s2 ++ xs.s2 ! c} ; + ReflPossPron = {s = \\c,g,n => possIy "св" c g n} ; + + CompoundN n1 n2 = n2 ** { + s = \\c,n => n2.s ! c ! n ++ n1.s ! Gen ! Sg ; + voc = \\n => n2.voc ! n ++ n1.s ! Gen ! Sg + } ; + CompoundAP n a = {s=\\c,gn=>n.s ! Nom ! Sg ++ a.s ! c ! gn} ; + GerundCN vp = constN vp.inf Neuter ; + GerundNP vp = {s=\\_=>vp.inf; g=Neuter; n=Sg; p=P3} ; + GerundAdv vp = {s=vp.inf} ; + WithoutVP vp = {s="без" ++ vp.inf} ; + ByVP vp = {s=vp.inf} ; + ApposNP np app = np ** {s = \\c => np.s ! c ++ "," ++ app.s ! Nom} ; + AdAdV ada adv = {s = ada.s ++ adv.s} ; + UttAdV adv = adv ; + PositAdVAdj a = {s = a.s ! Nom ! GSg Neuter} ; + CompS s = {s=\\_,_=>s.s} ; + CompQS qs = {s=\\_,_=>qs.s} ; + UttVPShort vp = {s=vp.inf} ; + ComplSlashPartLast slash np = { + s = \\t,pol,g,n,p => slash.s ! t ! pol ! g ! n ! p ++ prepNP slash.c np ++ slash.post ; + inf = slash.inf ++ prepNP slash.c np ++ slash.post ; + imp = \\pol,n => slash.imp ! pol ! n ++ prepNP slash.c np ++ slash.post + } ; + UseComp_estar comp = { + s = \\t,pol,g,n,p => copula t pol g n p ++ comp.s ! g ! n ; + inf = "бути" ++ comp.s ! Masc ! Sg ; + imp = \\pol,n => neg pol ++ "будь" ++ comp.s ! Masc ! n + } ; + UseComp_ser = UseComp_estar ; + SubjRelNP np rs = np ** {s=\\c=>np.s ! c ++ rs.s ! np.g ! np.n} ; + UttAccNP np = {s=np.s ! Acc} ; + UttDatNP np = {s=np.s ! Dat} ; + UttAccIP ip = {s=ip.s ! Acc} ; + UttDatIP ip = {s=ip.s ! Dat} ; + UseDAP dap = {s=\\c=>dap.s ! c ! Masc; g=Masc; n=dap.n; p=P3} ; + UseDAPMasc dap = {s=\\c=>dap.s ! c ! Masc; g=Masc; n=dap.n; p=P3} ; + UseDAPFem dap = {s=\\c=>dap.s ! c ! Fem; g=Fem; n=dap.n; p=P3} ; + CardCNCard card cn = {s=card.s ++ cn.s ! Nom ! Pl; n=Pl} ; + TPastSimple = {s=[]; t=R.Past} ; + SubjunctRelCN cn rs = cn ** {s=\\c,n=>cn.s ! c ! n ++ rs.s ! cn.g ! n} ; + + iFem_Pron = mkPron "я" "мене" "мені" "мене" "мені" "мною" + (possIy "м") Fem Sg P1 ; + youFem_Pron = mkPron "ти" "тeбе" "тобі" "мене" "тобі" "тобою" + (possIy "тв") Fem Sg P2 ; + weFem_Pron = mkPron "ми" "нас" "нам" "нас" "наc" "нами" + (possAsh "н") Fem Pl P1 ; + youPlFem_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" + (possAsh "в") Fem Pl P2 ; + theyFem_Pron = mkPron "вони" "їх" "їм" "їх" "них" "ними" + possTheir Fem Pl P3 ; + youPolFem_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" + (possAsh "в") Fem Pl P2 ; + youPolPl_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" + (possAsh "в") Masc Pl P2 ; + youPolPlFem_Pron = mkPron "ви" "вас" "вам" "вас" "вас" "вами" + (possAsh "в") Fem Pl P2 ; } diff --git a/src/ukrainian/NounUkr.gf b/src/ukrainian/NounUkr.gf index 7ea655c2..b93dc28d 100644 --- a/src/ukrainian/NounUkr.gf +++ b/src/ukrainian/NounUkr.gf @@ -3,7 +3,7 @@ lin UseN n = n ; DetCN det cn = { - s = \\c => det.s ! c ! cn.g ++ cn.s ! Nom ! Sg ; + s = \\c => det.s ! c ! cn.g ++ cn.s ! c ! det.n ; g = cn.g ; n = det.n ; p = P3 @@ -46,13 +46,13 @@ lin IndefArt = {s = \\_,_,_ => []} ; DefArt = {s = \\_,_,_ => []} ; MassNP cn = { - s = \\_ => cn.s ! Nom ! Sg ; + s = \\c => cn.s ! c ! Sg ; g = cn.g ; n = Sg ; p = P3 } ; PossPron p = { - s = \\_,g,n => possPron p.p p.g p.n g n + s = p.poss } ; ComplN2 n2 np = n2 ** { @@ -79,7 +79,7 @@ lin s = \\c,n => cn.s ! c ! n ++ sc.s } ; ApposCN cn np = cn ** { - s = \\c,n => cn.s ! c ! n ++ np.s ! Nom + s = \\c,n => cn.s ! c ! n ++ np.s ! c } ; PossNP cn np = cn ** { s = \\c,n => cn.s ! c ! n ++ np.s ! Gen diff --git a/src/ukrainian/ParadigmsUkr.gf b/src/ukrainian/ParadigmsUkr.gf index a45322f8..d38223a2 100644 --- a/src/ukrainian/ParadigmsUkr.gf +++ b/src/ukrainian/ParadigmsUkr.gf @@ -1171,8 +1171,29 @@ oper } } ; - mkPron : (_,_,_,_,_,_ : Str) -> Gender -> Number -> Person -> Pron = - \nom,acc,dat,gen,loc,instr,g,n,p -> lin Pron { + forcePluralN : N -> N = \n -> n ** { + s = \\c,_ => n.s ! c ! Pl ; + voc = \\_ => n.voc ! Pl + } ; + + wholeA : A = { + s = table { + Nom => table {GSg Masc => "весь"; GSg Fem => "вся"; GSg Neuter => "все"; GPl => "всі"} ; + Acc => table {GSg Masc => "весь"; GSg Fem => "всю"; GSg Neuter => "все"; GPl => "всі"} ; + Dat => table {GSg Masc => "всьому"; GSg Fem => "всій"; GSg Neuter => "всьому"; GPl => "всім"} ; + Gen => table {GSg Masc => "всього"; GSg Fem => "всієї"; GSg Neuter => "всього"; GPl => "всіх"} ; + Loc => table {GSg Masc => "всьому"; GSg Fem => "всій"; GSg Neuter => "всьому"; GPl => "всіх"} ; + Instr => table {GSg Masc => "всім"; GSg Fem => "всією"; GSg Neuter => "всім"; GPl => "всіма"} + } + } ; + + wholePredet : Predet = lin Predet { + s = \\c,g,n => wholeA.s ! c ! genNum g n + } ; + + mkPron : (_,_,_,_,_,_ : Str) -> + (Case -> Gender -> Number -> Str) -> Gender -> Number -> Person -> Pron = + \nom,acc,dat,gen,loc,instr,poss,g,n,p -> lin Pron { s = table { Nom => nom ; Acc => acc ; @@ -1181,6 +1202,7 @@ oper Loc => loc ; Instr => instr } ; + poss = \\c,g,n => poss c g n ; g = g ; n = n ; p = p diff --git a/src/ukrainian/ResUkr.gf b/src/ukrainian/ResUkr.gf index 59712c46..815d9665 100644 --- a/src/ukrainian/ResUkr.gf +++ b/src/ukrainian/ResUkr.gf @@ -178,11 +178,15 @@ oper neg : R.Polarity -> Str = \p -> case p of { R.Neg => "не" } ; -oper auxBe : R.Tense -> Number -> Person -> Str = - \t,n,p -> case t of { +oper auxBe : R.Tense -> Gender -> Number -> Person -> Str = + \t,g,n,p -> case t of { R.Pres => [] ; R.Past => case n of { - Sg => "був" ; + Sg => case g of { + Masc => "був" ; + Fem => "була" ; + Neuter => "було" + } ; Pl => "були" } ; R.Fut => case
of { @@ -202,13 +206,13 @@ oper auxBe : R.Tense -> Number -> Person -> Str = oper finiteVerb : V -> R.Tense -> R.Polarity -> Gender -> Number -> Person -> Str = \v,t,pol,g,n,p -> neg pol ++ case t of { R.Pres => (v.active ! Imperf).pres ! p ! n ; - R.Past => (v.active ! Imperf).pres ! p ! n ; - R.Fut => auxBe R.Fut n p ++ v.infinitive ; - R.Cond => (v.active ! Imperf).pres ! p ! n ++ "би" + R.Past => v.participle ! g ! n ; + R.Fut => auxBe R.Fut g n p ++ v.infinitive ; + R.Cond => v.participle ! g ! n ++ "би" } ; oper copula : R.Tense -> R.Polarity -> Gender -> Number -> Person -> Str = - \t,pol,g,n,p -> neg pol ++ auxBe t n p ; + \t,pol,g,n,p -> neg pol ++ auxBe t g n p ; oper prepNP : Compl -> {s : Case => Str} -> Str = \prep,np -> prep.s ++ np.s ! prep.c ; @@ -220,28 +224,52 @@ oper constN : Str -> Gender -> N = g = g } ; -oper possPron : Person -> Gender -> Number -> Gender -> Number -> Str = - \p,pg,pn,g,n -> case
of {
-