From 13ee63e25dc40b4c0f80e3702c39248fa7c57f35 Mon Sep 17 00:00:00 2001 From: Roman Suzi Date: Sun, 9 Aug 2020 17:20:03 +0300 Subject: [PATCH] Fixed direct object negation cases --- src/russian/AdjectiveRus.gf | 4 +- src/russian/CatRus.gf | 31 +++++--- src/russian/ConstructionRus.gf | 2 +- src/russian/ExtendRus.gf | 79 ++++++++++++++++--- src/russian/ExtraRus.gf | 11 +-- src/russian/ExtraRusAbs.gf | 1 + src/russian/IdiomRus.gf | 49 +++++++++--- src/russian/LexiconRus.gf | 2 +- src/russian/ParadigmsRus.gf | 24 +++--- src/russian/PhraseRus.gf | 2 +- src/russian/QuestionRus.gf | 7 +- src/russian/RelativeRus.gf | 4 +- src/russian/ResRus.gf | 12 ++- src/russian/SentenceRus.gf | 41 +++++++--- src/russian/StructuralRus.gf | 4 +- src/russian/VerbRus.gf | 63 +++++++++------ src/russian/test_result.treebank | 130 +++++++++++++++++++++++++++++-- src/russian/test_rus_grammar.gfs | 22 +++++- src/russian/todo.txt | 4 - 19 files changed, 386 insertions(+), 106 deletions(-) diff --git a/src/russian/AdjectiveRus.gf b/src/russian/AdjectiveRus.gf index 0e43d6c30..f554feba9 100644 --- a/src/russian/AdjectiveRus.gf +++ b/src/russian/AdjectiveRus.gf @@ -22,8 +22,8 @@ lin -- : A -> NP -> AP ; -- warmer than I - теплее меня ComparA a np = { - s = \\gn,anim,cas => a.comp ++ (applyPrep {s="" ; c=Gen ; hasPrep=False} np) ; -- True? - short = \\ag=>a.comp ++ (applyPrep {s="" ; c=Gen ; hasPrep=False} np) ; + s = \\gn,anim,cas => a.comp ++ (applyPrep {s="" ; c=Gen ; neggen=True ; hasPrep=False} np) ; -- True? + short = \\ag=>a.comp ++ (applyPrep {s="" ; c=Gen ; neggen=True ; hasPrep=False} np) ; isPost = False ; preferShort = PrefShort } ; diff --git a/src/russian/CatRus.gf b/src/russian/CatRus.gf index ce8996833..66bc648d6 100644 --- a/src/russian/CatRus.gf +++ b/src/russian/CatRus.gf @@ -23,13 +23,13 @@ lincat adv : AgrTable ; -- modals are in position of adverbials ones numgen gets fixed verb : ResRus.VerbForms ; dep : Str ; -- dependent infinitives and such - compl : AgrTable + compl : ComplTable } ; VPSlash = { adv : AgrTable ; -- modals are in position of adverbials ones numgen gets fixed verb : ResRus.VerbForms ; dep : Str ; -- dependent infinitives and such - compl : AgrTable ; + compl : ComplTable ; c : ComplementCase } ; ---- @@ -38,15 +38,19 @@ lincat S = {s : Mood => Str} ; SSlash = {s : Mood => Str; c: ComplementCase} ; Cl = { - subj,compl,adv : Str ; + subj : Str ; + adv : Str ; verb : VerbForms ; dep : Str ; -- dependent infinitives and such + compl : PolarityTable ; a : Agr } ; ClSlash = { - subj,compl,adv : Str ; + subj : Str ; + adv : Str ; verb : VerbForms ; dep : Str ; -- dependent infinitives and such + compl : PolarityTable ; a : Agr ; c : ComplementCase } ; @@ -70,9 +74,11 @@ lincat QS = {s : QForm => Str} ; QCl = { - subj,compl,adv : Str ; + subj : Str ; + adv : Str ; verb : VerbForms ; dep : Str ; -- dependent infinitives and such + compl : PolarityTable ; a : Agr } ; @@ -88,9 +94,10 @@ lincat RS = {s : AdjTable} ; RCl = { subj : AdjTable ; - compl,adv : AgrTable ; + adv : AgrTable ; verb : VerbForms ; dep : Str ; -- dependent infinitives and such + compl : ComplTable ; a : MaybeAgr } ; @@ -113,14 +120,14 @@ linref Ord = \s -> s.nsnom ; S = \s -> s.s ! Ind ; SSlash = \s -> s.s ! Ind ++ s.c.s ; --? - VP = \s -> s.adv ! Ag (GSg Neut) P3 ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Ag (GSg Neut) P3 ; -- Are these useful? + VP = \s -> s.adv ! Ag (GSg Neut) P3 ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ! Ag (GSg Neut) P3 ; Comp = \s -> copula.inf ++ s.s ! Ag (GSg Neut) P3 ++ s.adv ; IComp = \s -> s.s ! Ag (GSg Neut) P3 ++ s.adv ++ copula.inf; - VPSlash = \s -> s.adv ! Ag (GSg Neut) P3 ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Ag (GSg Neut) P3 ++ s.c.s ; -- Are these useful? - Cl = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ; - ClSlash = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ; - QCl = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ; - RCl = \s -> s.subj ! GSg Neut ! Inanimate ! Nom ++ s.adv ! Ag (GSg Neut) P3 ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Ag (GSg Neut) P3 ; + VPSlash = \s -> s.adv ! Ag (GSg Neut) P3 ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ! Ag (GSg Neut) P3 ++ s.c.s ; + Cl = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ; + ClSlash = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ; + QCl = \s -> s.subj ++ s.adv ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ; + RCl = \s -> s.subj ! GSg Neut ! Inanimate ! Nom ++ s.adv ! Ag (GSg Neut) P3 ++ (verbInf s.verb) ++ s.dep ++ s.compl ! Pos ! Ag (GSg Neut) P3 ; IP = \s -> s.nom ; RP = \s -> s.s!GSg Neut!Inanimate!Nom ; } diff --git a/src/russian/ConstructionRus.gf b/src/russian/ConstructionRus.gf index cd1870471..80003b70f 100644 --- a/src/russian/ConstructionRus.gf +++ b/src/russian/ConstructionRus.gf @@ -21,7 +21,7 @@ lin adv=np.s ! Gen ++ L.name_N.snom; verb=copulaEll ; -- ??? dep=[] ; - compl=np1.s ! Nom ; + compl=\\_ => np1.s ! Nom ; -- ??? a=Ag (GSg L.name_N.g) P3 ; } ; diff --git a/src/russian/ExtendRus.gf b/src/russian/ExtendRus.gf index f37d45358..5995b1331 100644 --- a/src/russian/ExtendRus.gf +++ b/src/russian/ExtendRus.gf @@ -8,7 +8,10 @@ concrete ExtendRus of Extend = -- VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList, -- UseComp, RelNP, UseComp_estar, SubjRelNP, PredAPVP, ImpersCl, UseComp, CompAP, EmbedVP, ExistNP, UseQCl, -- QuestCl, ExistNP, UseQCl, ExistIP, AdvVP, AdvVP, AdvVP, UseComp, CompAP, ExistS, ExistNPQS, ExistIPQS, - -- ComplDirectVS, ComplDirectVQ, AdvIsNPAP, AdAdV, AdjAsNP, + -- + ComplDirectVS, + ComplDirectVQ, + -- AdvIsNPAP, AdAdV, AdjAsNP, ApposNP, -- BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2, -- MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV, @@ -21,18 +24,24 @@ concrete ExtendRus of Extend = ExistsNP, -- ExistCN, ExistMassCN, ExistPluralCN, --ProDrop, - -- FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP, + -- FocusAP, FocusAdV, FocusAdv, + FocusObj, + -- GenIP, GenModIP, GenModNP, GenNP, GenRP, -- GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, -- MkVPS, NominalizeVPSlashNP, -- PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, - -- PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN, + -- PastPartAgentAP, + PositAdVAdj, + -- PredVPS, PredVPSVV, PredetRNP, PrepCN, -- EmbedSSlash, PresPartAP, PurposeVP, -- ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash, PredIAdvVP, -- UncontractedNeg, UttAccIP, UttAccNP, + FrontComplDirectVS, + FrontComplDirectVQ, UttAdV -- UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2 ] @@ -56,21 +65,28 @@ lin -- : VP -> Adv ; -- (in order) to publish the document InOrderToVP vp = lin Adv ({ - s = "чтобы" ++ vp.adv ! Ag (GSg Neut) P3 ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! Ag (GSg Neut) P3 + s = "чтобы" + ++ vp.adv ! Ag (GSg Neut) P3 + ++ (verbInf vp.verb) + ++ vp.dep + ++ vp.compl ! Pos ! Ag (GSg Neut) P3 }) ; -- : VP -> Adv ; -- to become happy PurposeVP vp = lin Adv ({ - s = vp.adv ! Ag (GSg Neut) P3 ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! Ag (GSg Neut) P3 + s = vp.adv ! Ag (GSg Neut) P3 ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! Pos ! Ag (GSg Neut) P3 }) ; -- : NP -> Cl ; -- there exists a number / there exist numbers ExistsNP np = { subj=[] ; adv=[] ; - compl=np.s ! Nom ; verb=M.to_exist ; dep=[] ; + compl=table { + Pos => np.s ! Nom ; + Neg => np.s ! Gen + } ; a=np.a } ; @@ -82,9 +98,17 @@ lin -- VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space PastPartAP vps = { - s=\\gn,anim,cas => vps.adv ! (genNumAgrP3 gn) - ++ (shortPastPassPart vps.verb gn) ++ vps.dep ++ vps.compl ! (genNumAgrP3 gn) ; - short=\\a => vps.adv ! a ++ (shortPastPassPart vps.verb (agrGenNum a)) ++ vps.dep ++ vps.compl ! a ++ vps.c.s ; -- + s=\\gn,anim,cas => + vps.adv ! (genNumAgrP3 gn) + ++ (shortPastPassPart vps.verb gn) + ++ vps.dep + ++ vps.compl ! Pos ! (genNumAgrP3 gn) ; + short=\\a => + vps.adv ! a + ++ (shortPastPassPart vps.verb (agrGenNum a)) + ++ vps.dep + ++ vps.compl ! Pos ! a + ++ vps.c.s ; -- isPost = False ; preferShort=PreferFull } ; @@ -102,4 +126,41 @@ lin -- : AdV -> Utt ; -- always(!) UttAdV adv = {s=adv.s} ; + + -- : A -> AdV ; -- (that she) positively (sleeps) + PositAdVAdj a = ss a.sn ; + + -- : NP -> SSlash -> Utt ; -- her I love + FocusObj np ss = { + s = applyPrep ss.c np ++ ss.s ! Ind + } ; + + -- In Russian, sentence usually ends here (or special punctuation is needed after direct phrase) + -- : VS -> Utt -> VP ; -- say: "today" + ComplDirectVS vs utt = + AdvVP (UseV ) (lin Adv {s = ":" ++ rus_quoted utt.s}) ; + -- : VQ -> Utt -> VP ; -- ask: "when" + ComplDirectVQ vq utt = + AdvVP (UseV ) (lin Adv {s = ":" ++ rus_quoted utt.s}) ; + + -- : NP -> VS -> Utt -> Cl ; -- "I am here", she said + FrontComplDirectVS np vs utt = { + subj = (rus_quoted utt.s) ++ "," ++ "—" ++ np.s ! Nom ; + adv = [] ; + verb = vs; + dep = [] ; + compl = \\_ => [] ; + a = np.a + } ; + -- : NP -> VQ -> Utt -> Cl ; -- "where", she asked + FrontComplDirectVQ np vq utt = { + subj = (rus_quoted utt.s) ++ "," ++ "—" ++ np.s ! Nom ; + adv = [] ; + verb = vq; + dep = [] ; + compl = \\_ => [] ; + a = np.a + } ; +oper + rus_quoted : Str -> Str = \s -> "«" ++ s ++ "»" ; ---- TODO bind ; move to Prelude? } ; diff --git a/src/russian/ExtraRus.gf b/src/russian/ExtraRus.gf index e44639235..a6de6fdb5 100644 --- a/src/russian/ExtraRus.gf +++ b/src/russian/ExtraRus.gf @@ -4,7 +4,7 @@ concrete ExtraRus of ExtraRusAbs = CatRus ** open ResRus, MorphoRus, (P=ParadigmsRus), Prelude, NounRus in { flags optimize=all ; coding=utf8 ; lin - obj_no_Prep = {s="" ; c=Acc ; hasPrep=False} ; + obj_no_Prep = {s="" ; c=Acc ; neggen=True ; hasPrep=False} ; to2_Prep = P.mkPrep v_prep_mod Acc ; on_to_Prep = P.mkPrep "до" Gen ; along_Prep = P.mkPrep "по" Loc ; @@ -13,13 +13,14 @@ lin have_V3 = P.mkV3 est_ell_V nom_Prep u_Prep; have2_V3 = P.mkV3 est_V nom_Prep u_Prep; - have_not_V3 = P.mkV3 net_V nom_Prep u_Prep; + have_not_V3 = P.mkV3 net_V obj_neg_Prep u_Prep; be_V3 = P.mkV3 be_ell_V nom_Prep dat_Prep; oper - nom_Prep : Prep = lin Prep {s="" ; c=Nom ; hasPrep=False} ; - dat_Prep : Prep = lin Prep {s="" ; c=Dat ; hasPrep=False} ; - u_Prep : Prep = lin Prep {s="у" ; c=Gen ; hasPrep=True} ; + nom_Prep : Prep = lin Prep {s="" ; c=Nom ; neggen=True ; hasPrep=False} ; + obj_neg_Prep : Prep = lin Prep {s="" ; c=Gen ; neggen=False ; hasPrep=False} ; + dat_Prep : Prep = lin Prep {s="" ; c=Dat ; neggen=False ; hasPrep=False} ; + u_Prep : Prep = lin Prep {s="у" ; c=Gen ; neggen=False ; hasPrep=True} ; est_V : V = lin V { inf="есть"; infrefl="" ; diff --git a/src/russian/ExtraRusAbs.gf b/src/russian/ExtraRusAbs.gf index cd7f6a35d..04553e745 100644 --- a/src/russian/ExtraRusAbs.gf +++ b/src/russian/ExtraRusAbs.gf @@ -2,6 +2,7 @@ abstract ExtraRusAbs = Cat ** { fun obj_no_Prep : Prep ; + obj_neg_Prep : Prep ; about_Prep : Prep ; to2_Prep : Prep ; on_to_Prep : Prep ; diff --git a/src/russian/IdiomRus.gf b/src/russian/IdiomRus.gf index 1648115af..c5d291728 100644 --- a/src/russian/IdiomRus.gf +++ b/src/russian/IdiomRus.gf @@ -5,10 +5,26 @@ flags optimize=all_subs ; coding=utf8 ; lin -- : VP -> Cl ; -- it is hot - ImpersCl vp = let a = Ag (GSg Neut) P3 in {subj="" ; compl=vp.compl ! a ; verb=vp.verb ; dep=vp.dep ; adv=vp.adv ! a ; a=a } ; + ImpersCl vp = + let a = Ag (GSg Neut) P3 in { + subj="" ; + adv=vp.adv ! a ; + verb=vp.verb ; + dep=vp.dep ; + compl=\\p => vp.compl ! p ! a ; + a=a + } ; -- : VP -> Cl ; -- one sleeps - GenericCl vp = let a = Ag (GSg Masc) P2 in {subj="" ; compl=vp.compl ! a ; verb=vp.verb ; dep=vp.dep ; adv=vp.adv ! a; a=a } ; + GenericCl vp = + let a = Ag (GSg Masc) P2 in { + subj="" ; + adv=vp.adv ! a ; + verb=vp.verb ; + dep=vp.dep ; + compl=\\p => vp.compl ! p ! a ; + a=a + } ; -- : NP -> RS -> Cl ; -- it is I who did it CleftNP np rs = { @@ -16,7 +32,7 @@ lin adv=[]; verb=copulaEll ; -- ??? dep=[] ; - compl=embedInCommas (rs.s ! agrGenNum np.a ! Animate ! Nom) ; -- TODO: here or in subj??? + compl=\\_ => embedInCommas (rs.s ! agrGenNum np.a ! Animate ! Nom) ; -- TODO: here or in subj??? a=np.a } ; -- : Adv -> S -> Cl ; -- it is here she slept @@ -25,12 +41,19 @@ lin adv=adv.s ; verb=nullVerb ; -- ??? dep=[] ; - compl=s.s ! Ind ; + compl=\\_ => s.s ! Ind ; a=Ag (GSg Neut) P3 } ; -- : NP -> Cl ; -- there is a house - ExistNP np = {subj=np.s ! Nom ; compl="" ; verb=to_exist ; dep=[] ; adv=[] ; a=np.a} ; + ExistNP np = { + subj=np.s ! Nom ; + compl=\\_ => [] ; + verb=to_exist ; + dep=[] ; + adv=[] ; + a=np.a + } ; -- : IP -> QCl ; -- which houses are there ExistIP ip = { @@ -38,16 +61,16 @@ lin adv=[] ; verb=to_exist; dep=[] ; - compl=[]; + compl=\\_ => [] ; a=ip.a } ; -- : NP -> Adv -> Cl ; -- there is a house in Paris ExistNPAdv np adv = { subj=np.s ! Nom ; - compl="" ; + adv=adv.s ; verb=to_exist ; dep=[] ; - adv=adv.s ; + compl=\\_ => [] ; a=np.a } ; -- : IP -> Adv -> QCl ; -- which houses are there in Paris @@ -56,7 +79,7 @@ lin adv=adv.s ; verb=to_exist; dep=[] ; - compl=[]; + compl=\\_ => [] ; a=ip.a } ; @@ -65,15 +88,17 @@ lin -- : VP -> Utt ; -- let's go ImpPl1 vp = let a = Ag GPl P1 in { - s = (verbEnvAgr "давайте" (vp.adv ! a) vp.verb Infinitive Pres a PPos) ++ vp.dep ++ vp.compl ! a + s = (verbEnvAgr "давайте" (vp.adv ! a) vp.verb Infinitive Pres a PPos) ++ vp.dep ++ vp.compl ! Pos ! a } ; -- : NP -> VP -> Utt ; -- let John walk ImpP3 np vp = { - s = (verbEnvAgr "пусть" (vp.adv ! np.a ++ np.s ! Nom) vp.verb Ind Pres np.a PPos) ++ vp.dep ++ vp.compl ! np.a + s = (verbEnvAgr "пусть" (vp.adv ! np.a ++ np.s ! Nom) vp.verb Ind Pres np.a PPos) ++ vp.dep ++ vp.compl ! Pos ! np.a } ; -- : VP -> VP ; -- is at home himself - SelfAdvVP vp = vp ** {compl=\\a => vp.compl ! a ++ (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom} ; + SelfAdvVP vp = vp ** { + compl=\\p,a => vp.compl ! p ! a ++ (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom + } ; -- : VP -> VP ; -- is himself at home SelfAdVVP vp = vp ** {adv=\\a => (adjFormsAdjective sam).s ! agrGenNum a ! Animate ! Nom ++ vp.adv ! a} ; -- : NP -> NP ; -- the president himself (is at home) diff --git a/src/russian/LexiconRus.gf b/src/russian/LexiconRus.gf index 62c12c477..a7f09e6fe 100644 --- a/src/russian/LexiconRus.gf +++ b/src/russian/LexiconRus.gf @@ -151,7 +151,7 @@ lin horse_N = mkN "лошадь" feminine animate "8e" ; hot_A = mkA "горячий" "" "4a/b"; house_N = mkN "дом" masculine inanimate "1c(1)" ; - hunt_V2 = mkV2 (mkV imperfective intransitive "охотиться" "охочусь" "охотится") (lin Prep {s="на" ; c=Acc ; hasPrep=True}) ; + hunt_V2 = mkV2 (mkV imperfective intransitive "охотиться" "охочусь" "охотится") on2_Prep ; husband_N = (mkNplus (mkN "муж" masculine animate "4c")) ** {pnom="мужья";pgen="мужей";pdat="мужьям";pacc="мужей";pins="мужьями";pprep="мужьях"}; ice_N = (mkNplus (mkN "лёд" masculine animate "1*b")) ** {sloc="льду";sptv="льду"} ; important_A = mkA "важный" ; diff --git a/src/russian/ParadigmsRus.gf b/src/russian/ParadigmsRus.gf index ba1f1aade..2df0e4351 100644 --- a/src/russian/ParadigmsRus.gf +++ b/src/russian/ParadigmsRus.gf @@ -180,7 +180,7 @@ oper mkAdv : overload { mkAdv : Str -> Adv ; - mkAdv : Temp -> Pol -> VPSlash -> Adv ; -- introduce transgressive: "делая что-то ," + mkAdv : Temp -> Pol -> VPSlash -> Adv ; -- introduce transgressive: "делая что-то ," = "(was) (not) doing smth, " } ; mkIAdv : Str -> IAdv ; mkConj : overload { @@ -198,7 +198,7 @@ oper ------------------------------ -- Nouns - nullPrep : Prep = lin Prep {s=[]; c=Gen; hasPrep=False} ; + nullPrep : Prep = lin Prep {s=[] ; c=Gen ; neggen=False ; hasPrep=False} ; mkN = overload { mkN : Str -> N @@ -241,7 +241,7 @@ oper = \word, g, anim, zi, p -> lin N2 (mkFun (noMinorCases (Z.makeNoun word g anim (Z.parseIndex zi))) p) ; } ; - nullPrep : Prep = lin Prep {s=[]; c=Gen; hasPrep=False} ; + nullPrep : Prep = lin Prep {s=[] ; c=Gen ; neggen=False ; hasPrep=False} ; mkN3 = overload { mkN3 : N -> Prep -> Prep -> N3 @@ -333,26 +333,26 @@ oper mkV2 = overload { mkV2 : V -> V2 - = \vf -> lin V2 (vf ** {c={s=[] ; c=Acc ; hasPrep=False}}) ; + = \vf -> lin V2 (vf ** {c={s=[] ; c=Acc ; neggen=True ; hasPrep=False}}) ; mkV2 : V -> Case -> V2 - = \vf, c -> lin V2 (vf ** {c={s=[] ; c=c ; hasPrep=False}}) ; + = \vf, c -> lin V2 (vf ** {c={s=[] ; c=c ; neggen=False ; hasPrep=False}}) ; mkV2 : V -> Prep -> V2 = \vf, prep -> lin V2 (vf ** {c=prep}) ; -- For backwards compatibility: mkV2 : V -> Str -> Case -> V2 - = \vf, prep_s, c -> lin V2 (vf ** {c={s=prep_s ; c=c ; hasPrep=True}}) + = \vf, prep_s, c -> lin V2 (vf ** {c={s=prep_s ; c=c ; neggen=False ; hasPrep=True}}) } ; mkV3 = overload { mkV3 : V -> Case -> Case -> V3 -- "сложить письмо в конверт" - = \vf, cas1, cas2 -> lin V3 (vf ** {c={s=[] ; c=cas1 ; hasPrep=False} ; c2={s=[] ; c=cas2 ; hasPrep=False}} ) ; + = \vf, cas1, cas2 -> lin V3 (vf ** {c={s=[] ; c=cas1 ; neggen=False ; hasPrep=False} ; c2={s=[] ; c=cas2 ; neggen=False ; hasPrep=False}} ) ; mkV3 : V -> Prep -> Prep -> V3 -- "сложить письмо в конверт" = \vf, prep1, prep2 -> lin V3 (vf ** {c=prep1 ; c2=prep2} ) ; -- For backwards compatibility: mkV3 : V -> Str -> Str -> Case -> Case -> V3 - = \vf, prep1, prep2, cas1, cas2 -> lin V3 (vf ** {c={s=prep1 ; c=cas1 ; hasPrep=True} ; c2={s=prep2 ; c=cas2 ; hasPrep=True}} ) ; + = \vf, prep1, prep2, cas1, cas2 -> lin V3 (vf ** {c={s=prep1 ; c=cas1 ; neggen=False ; hasPrep=True} ; c2={s=prep2 ; c=cas2 ; neggen=False ; hasPrep=True}} ) ; } ; @@ -381,7 +381,7 @@ oper ++ verbRefl vps.verb ++ case temp.t of {Cond => "бы" ; _ => []} ++ vps.dep - ++ vps.compl ! Ag (GSg Neut) P3 + ++ vps.compl ! pol.p ! Ag (GSg Neut) P3 ++ vps.c.s ; -- comma is needed. Up to user? } ; } ; @@ -400,7 +400,11 @@ oper = \s -> lin Interj {s = s} ; mkPrep : Str -> Case -> Prep - = \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; + = \s,c -> lin Prep {s = s ; c = c ; neggen = False ; hasPrep = True} ; + + +oper + on2_Prep = mkPrep "на" Acc ; -- for backwards compatibility only. Use mkV methods instead. -- These are deprecated! diff --git a/src/russian/PhraseRus.gf b/src/russian/PhraseRus.gf index 0ae222996..c0112360f 100644 --- a/src/russian/PhraseRus.gf +++ b/src/russian/PhraseRus.gf @@ -28,7 +28,7 @@ lin -- : VP -> Utt ; -- to sleep UttVP vp = let a=Ag (GSg Neut) P3 in { - s=vp.adv ! a ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! a + s=vp.adv ! a ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! Pos ! a } ; -- : CN -> Utt ; -- house diff --git a/src/russian/QuestionRus.gf b/src/russian/QuestionRus.gf index 89f9ac482..9e50cb3f2 100644 --- a/src/russian/QuestionRus.gf +++ b/src/russian/QuestionRus.gf @@ -13,7 +13,7 @@ lin adv=vp.adv ! ip.a ; verb=vp.verb ; dep=vp.dep ; - compl=vp.compl ! ip.a ; --??? + compl=\\p => vp.compl ! p ! ip.a ; --??? a=ip.a } ; @@ -31,7 +31,10 @@ lin -- : IComp -> NP -> QCl ; -- where is John QuestIComp icomp np = { subj=icomp.s ! Ag (GSg Neut) P3 ; --??? - compl=np.s ! Nom ; --??? + compl=table { + Pos => np.s ! Nom ; --??? + Neg => np.s ! Gen -- TODO: Check! + }; adv=icomp.adv ; verb=selectCopula icomp.cop ; dep=[] ; diff --git a/src/russian/RelativeRus.gf b/src/russian/RelativeRus.gf index 8c9435aa9..47f62f4b5 100644 --- a/src/russian/RelativeRus.gf +++ b/src/russian/RelativeRus.gf @@ -12,7 +12,7 @@ lin adv=\\a => cl.adv ; verb=cl.verb ; dep=cl.dep ; - compl=\\a => cl.compl ; + compl=\\p,a => cl.compl ! p ; a=Just Agr cl.a } ; -- : RP -> ClSlash -> RCl ; -- whom John loves @@ -21,7 +21,7 @@ lin adv=\\a=>cls.adv ; verb=cls.verb ; dep=cls.dep ; - compl=\\a=> cls.compl ; + compl=\\p,a => cls.compl ! p ; a=Just Agr cls.a } ; diff --git a/src/russian/ResRus.gf b/src/russian/ResRus.gf index 2115dc24b..20e03a4c8 100644 --- a/src/russian/ResRus.gf +++ b/src/russian/ResRus.gf @@ -196,8 +196,10 @@ oper = \n -> noMinorCases (immutableNounCases "" n.g n.anim) ; AgrTable = Agr => Str ; + ComplTable = Polarity => Agr => Str ; + PolarityTable = Polarity => Str ; - from2 = {s="из"; c=Gen; hasPrep=True} ; + from2 = {s="из" ; c=Gen ; neggen=True ; hasPrep=True} ; mkCompoundN : NounForms -> Str -> NounForms -> NounForms = \n1,link,n2 -> @@ -1452,7 +1454,7 @@ oper -- Misc oper - ComplementCase : Type = {s : Str ; c : Case ; hasPrep : Bool} ; + ComplementCase : Type = {s : Str ; c : Case ; neggen : Bool ; hasPrep : Bool} ; applyPrep : ComplementCase -> NounPhrase -> Str = \prep,np -> case of { @@ -1460,6 +1462,12 @@ oper _ => prep.s ++ np.s ! prep.c } ; + applyPolPrep : Polarity -> ComplementCase -> NounPhrase -> Str + = \pol,prep,np -> + let prep'=prep ** { + c=case of { => Gen ; _ => prep.c} + } in applyPrep prep' np ; + applyIPronPrep : ComplementCase -> IPronounForms -> Str = \prep,ip -> prep.s ++ selectIPronCase ip prep.c ; diff --git a/src/russian/SentenceRus.gf b/src/russian/SentenceRus.gf index bff077555..cac4712a6 100644 --- a/src/russian/SentenceRus.gf +++ b/src/russian/SentenceRus.gf @@ -8,7 +8,11 @@ lin -- : Temp -> Pol -> Cl -> S ; -- she had not slept - она не спала UseCl temp pol cl = { - s : Mood => Str = \\m => temp.s ++ (R.verbEnvAgr cl.subj cl.adv cl.verb m temp.t cl.a pol) ++ cl.dep ++ cl.compl ; + s : Mood => Str = \\m => + temp.s + ++ (R.verbEnvAgr cl.subj cl.adv cl.verb m temp.t cl.a pol) + ++ cl.dep + ++ cl.compl ! pol.p ; } ; -- : Temp -> Pol -> RCl -> RS ; -- that had not slept @@ -17,23 +21,27 @@ lin let a : Agr = fromMaybe Agr (genNumAgrP3 gn) rcl.a in temp.s ++ (R.verbEnvAgr (rcl.subj ! gn ! anim ! Nom) (rcl.adv ! (genNumAgrP3 gn)) rcl.verb Ind temp.t a pol) - ++ rcl.dep ++ rcl.compl ! (genNumAgrP3 gn) + ++ rcl.dep + ++ rcl.compl ! pol.p ! (genNumAgrP3 gn) } ; -- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen UseSlash temp pol cls = { - s : Mood => Str = \\m => temp.s - ++ (R.verbEnvAgr cls.subj cls.adv cls.verb m temp.t cls.a pol) ++ cls.dep ++ cls.compl ; + s : Mood => Str = \\m => + temp.s + ++ (R.verbEnvAgr cls.subj cls.adv cls.verb m temp.t cls.a pol) + ++ cls.dep + ++ cls.compl ! pol.p ; c=cls.c } ; -- : NP -> VPSlash -> ClSlash ; -- (whom) he sees SlashVP np vps = { subj=np.s ! Nom ; -- ???????? - compl=vps.compl ! np.a ; -- ?? adv=vps.adv ! np.a ; -- ?? verb=vps.verb ; dep=vps.dep ; + compl=\\p => vps.compl ! p ! np.a ; -- ?? a=np.a ; c=vps.c } ; @@ -52,7 +60,7 @@ lin -- NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves SlashVS np vs ss = { subj=np.s ! Nom ; -- ???????? - compl=embedInCommas ("что" ++ ss.s ! Ind) ; -- ?? that? + compl=\\_ => embedInCommas ("что" ++ ss.s ! Ind) ; -- ?? that? adv=[]; -- ?? verb=vs ; dep=[] ; @@ -75,7 +83,9 @@ lin s = \\polarity, gn => let pol = case polarity of {Neg => PNeg; Pos => PPos} in let a = Ag gn P2 in - (R.verbEnvAgr "" "" vp.verb Imperative Pres a pol) ++ vp.adv ! a ++ vp.compl ! a + (R.verbEnvAgr "" "" vp.verb Imperative Pres a pol) + ++ vp.adv ! a + ++ vp.compl ! pol.p ! a } ; -- : NP -> VP -> Cl ; -- John walks - Иван гуляет @@ -84,7 +94,7 @@ lin adv=vp.adv ! np.a ; verb=vp.verb ; dep=vp.dep ; - compl=vp.compl ! np.a ; + compl=\\p => vp.compl ! p ! np.a ; a=np.a } ; @@ -94,7 +104,7 @@ lin adv=vp.adv ! (Ag (GSg Neut) P3) ; -- ??? verb=vp.verb ; dep=vp.dep ; - compl=vp.compl ! Ag (GSg Neut) P3 ; -- ??? + compl=\\p => vp.compl ! p ! Ag (GSg Neut) P3 ; -- ??? a=Ag (GSg Neut) P3 -- ??? } ; @@ -103,14 +113,23 @@ lin -- : Temp -> Pol -> QCl -> QS ; -- who had not slept UseQCl temp pol cl = { - s = \\qf => temp.s ++ (R.verbEnvAgr cl.subj cl.adv cl.verb Ind temp.t cl.a pol) ++ cl.dep ++ cl.compl + s = \\qf => + temp.s + ++ (R.verbEnvAgr cl.subj cl.adv cl.verb Ind temp.t cl.a pol) + ++ cl.dep + ++ cl.compl ! pol.p } ; -- : QS -> SC ; -- who goes EmbedQS qs = {s = qs.s ! QIndir} ; -- : VP -> SC ; -- to go - EmbedVP vp = {s=vp.adv ! Ag (GSg Neut) P3 ++ (R.verbInf vp.verb) ++ vp.dep ++ vp.compl ! Ag (GSg Neut) P3} ; + EmbedVP vp = { + s=vp.adv ! Ag (GSg Neut) P3 + ++ (R.verbInf vp.verb) + ++ vp.dep + ++ vp.compl ! Pos ! Ag (GSg Neut) P3 -- ??? + } ; -- : S -> RS -> S ; -- she sleeps, which is good RelS s rs = { diff --git a/src/russian/StructuralRus.gf b/src/russian/StructuralRus.gf index 132bf5371..fa12a0b99 100644 --- a/src/russian/StructuralRus.gf +++ b/src/russian/StructuralRus.gf @@ -59,8 +59,8 @@ lin in8front_Prep = mkPrep "перед" Ins ; in_Prep = mkPrep v_prep_mod Loc ; on_Prep = mkPrep "на" Loc ; - part_Prep = {s="" ; c=Ptv ; hasPrep=False } ; - possess_Prep = {s="у" ; c=Gen ; hasPrep=False} ; + part_Prep = {s="" ; c=Ptv ; neggen=False ; hasPrep=False } ; + possess_Prep = {s="у" ; c=Gen ; neggen=False ; hasPrep=False} ; through_Prep = mkPrep "через" Acc ; to_Prep = mkPrep k_prep_dat_mod Dat ; under_Prep = mkPrep pod_prep_mod Ins ; diff --git a/src/russian/VerbRus.gf b/src/russian/VerbRus.gf index dea23aeef..23131cd06 100644 --- a/src/russian/VerbRus.gf +++ b/src/russian/VerbRus.gf @@ -6,7 +6,7 @@ lin adv = \\a=>[] ; verb = v ; dep=[] ; - compl = \\_ => [] + compl = \\_,_ => [] } ; -- : V2 -> VP ; -- be loved @@ -14,7 +14,7 @@ lin adv = \\a=>[] ; verb = passivate v2 ; dep=[] ; - compl = \\a=>[] + compl = \\p,a => [] } ; -- : VV -> VP -> VP ; -- want to run @@ -29,7 +29,7 @@ lin verb = vs ; dep=[] ; adv=\\a=>[] ; - compl=\\A=>comma ++ "что" ++ s.s ! Ind + compl=\\_,_ => comma ++ "что" ++ s.s ! Ind } ; -- : VQ -> QS -> VP ; -- wonder who runs @@ -37,7 +37,7 @@ lin verb = vq ; dep=[] ; adv=\\a=>[] ; - compl=\\A=>comma ++ "что" ++ qs.s ! QDir + compl=\\_,_ => comma ++ "что" ++ qs.s ! QDir } ; @@ -46,21 +46,27 @@ lin verb=va ; dep=[] ; adv=\\a=>[] ; - compl=case ap.preferShort of { + compl=\\_ => case ap.preferShort of { PreferFull => (\\a => ap.s ! agrGenNum a ! Inanimate ! Ins) ; PrefShort => ap.short } } ; -- : V2 -> VPSlash ; -- love (it) - SlashV2a v2 = {adv=\\a=>[] ; verb=v2 ; dep=[] ; compl=\\_ => [] ; c=v2.c} ; + SlashV2a v2 = { + adv=\\a=>[] ; + verb=v2 ; + dep=[] ; + compl=\\_,_ => [] ; + c=v2.c + } ; -- : V3 -> NP -> VPSlash ; -- give it (to her) Slash2V3 v3 np = { adv=\\a=>[] ; verb=v3 ; dep=[] ; - compl=\\a=> applyPrep v3.c np ; + compl=\\p,a => applyPolPrep p v3.c np ; c=v3.c2 } ; @@ -69,7 +75,7 @@ lin adv=\\a=>[] ; verb=v3 ; dep=[] ; - compl=\\a=> applyPrep v3.c2 np ; + compl=\\p,a => applyPolPrep p v3.c2 np ; c=v3.c } ; @@ -85,7 +91,7 @@ lin adv=\\a=>[] ; verb=v2s ; dep=[] ; - compl=\\a=> embedInCommas ("что" ++ s.s ! Ind) ; + compl=\\_,a=> embedInCommas ("что" ++ s.s ! Ind) ; c=v2s.c } ; -- : V2Q -> QS -> VPSlash ; -- ask (him) who came @@ -93,7 +99,7 @@ lin adv=\\a=>[] ; verb=v2q ; dep=[] ; - compl=\\a=>qs.s ! QDir; + compl=\\_,a=>qs.s ! QDir; c=v2q.c } ; @@ -102,16 +108,25 @@ lin adv=\\a=>[] ; verb=v2a ; dep=[] ; - compl=case ap.preferShort of { - PreferFull => (\\a => ap.s ! agrGenNum a ! Animate ! v2a.c.c) ; -- TODO: Acc depends on animacy! - PrefShort => ap.short + compl=table { + Pos => case ap.preferShort of { + PreferFull => \\a => ap.s ! agrGenNum a ! Animate ! v2a.c.c ; + PrefShort => ap.short + } ; + Neg => case ap.preferShort of { + PreferFull => case v2a.c.neggen of { + False => \\a => ap.s ! agrGenNum a ! Animate ! v2a.c.c ; + True => \\a => ap.s ! agrGenNum a ! Animate ! Gen + } ; + PrefShort => ap.short + } } ; c=v2a.c } ; -- : VPSlash -> NP -> VP ; -- love it ComplSlash vps np = vps ** { - compl=\\a => vps.compl ! a ++ (applyPrep vps.c np) + compl=\\p,a => vps.compl ! p ! a ++ applyPolPrep p vps.c np } ; -- : VV -> VPSlash -> VPSlash ; -- want to buy @@ -123,35 +138,39 @@ lin -- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy SlashV2VNP v2v np vps = vps ** { verb=v2v ; + compl=\\p,a => vps.compl ! p ! a ++ applyPolPrep p vps.c np ; dep=(verbInf vps.verb) ++ vps.dep ; - compl=\\a=>vps.compl ! a ++ (applyPrep vps.c np); -- hasPrep? Order? c=v2v.c } ; -- : VPSlash -> VP ; -- love himself ReflVP vps = vps ** { - compl=\\a => vps.compl ! a ++ vps.c.s ++ sebya.s ! vps.c.c + compl=\\p,a => vps.compl ! p ! a ++ vps.c.s ++ sebya.s ! vps.c.c } ; -- : Comp -> VP ; -- be warm UseComp comp = { - adv=\\a=>comp.adv ; - compl=comp.s ; + adv=\\a => comp.adv ; verb=selectCopula comp.cop ; dep=[] ; + compl=\\p => comp.s } ; -- : VP -> Adv -> VP ; -- sleep here - AdvVP vp adv = vp ** {compl=\\a => vp.compl ! a ++ adv.s} ; + AdvVP vp adv = vp ** { + compl=\\p,a => vp.compl ! p ! a ++ adv.s + } ; -- : VP -> Adv -> VP ; -- sleep , even though ... - ExtAdvVP vp adv = vp ** {compl=\\a => vp.compl ! a ++ embedInCommas adv.s}; + ExtAdvVP vp adv = vp ** { + compl=\\p,a => vp.compl ! p ! a ++ embedInCommas adv.s + } ; -- : AdV -> VP -> VP ; -- always sleep AdVVP adv vp = vp ** {adv=\\a => adv.s ++ vp.adv ! a} ; -- : VPSlash -> Adv -> VPSlash ; -- use (it) here - AdvVPSlash vps adv = vps ** {compl=\\a => vps.compl ! a ++ adv.s} ; + AdvVPSlash vps adv = vps ** {compl=\\p,a => vps.compl ! p ! a ++ adv.s} ; -- : AdV -> VPSlash -> VPSlash ; -- always use (it) AdVVPSlash adv vps = vps ** {adv=\\a=>adv.s ++ vps.adv ! a} ; @@ -177,5 +196,5 @@ lin } ; -- : VP ; -- be - UseCopula = {adv=\\a=>[] ; verb=copulaIns ; dep=[] ; compl=\\a=>[]} ; + UseCopula = {adv=\\a=>[] ; verb=copulaIns ; dep=[] ; compl=\\p,a=>[]} ; } diff --git a/src/russian/test_result.treebank b/src/russian/test_result.treebank index f2f7b2017..898dc6723 100644 --- a/src/russian/test_result.treebank +++ b/src/russian/test_result.treebank @@ -2593,19 +2593,19 @@ AllRusAbs: UttS (UseCl (TTAnt TPres AAnter) PPos (PredVP (UsePron he_Pron) (Comp AllRus: он ждёт машину у её окон AllRusAbs: UttS (UseCl (TTAnt TCond AAnter) PNeg (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) -AllRus: он не считал бы машины у её окон +AllRus: он не считал бы машин у её окон AllRusAbs: UttS (UseCl (TTAnt TCond AAnter) PPos (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) AllRus: он считал бы машины у её окон AllRusAbs: UttS (UseCl (TTAnt TFut AAnter) PNeg (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) -AllRus: он не будет считать машины у её окон +AllRus: он не будет считать машин у её окон AllRusAbs: UttS (UseCl (TTAnt TFut AAnter) PPos (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) AllRus: он будет считать машины у её окон AllRusAbs: UttS (UseCl (TTAnt TPast AAnter) PNeg (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) -AllRus: он не считал машины у её окон +AllRus: он не считал машин у её окон AllRusAbs: UttS (UseCl (TTAnt TPast AAnter) PPos (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) AllRus: он считал машины у её окон AllRusAbs: UttS (UseCl (TTAnt TPres AAnter) PNeg (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) -AllRus: он не считает машины у её окон +AllRus: он не считает машин у её окон AllRusAbs: UttS (UseCl (TTAnt TPres AAnter) PPos (PredVP (UsePron he_Pron) (ComplSlash (VPSlashPrep (ComplSlash (VPSlashPrep (ComplSlash (SlashV2a count_V2) (DetCN (DetQuant IndefArt NumPl) (UseN car_N))) possess_Prep) (DetNP (DetQuant (PossPron she_Pron) NumPl))) part_Prep) (DetCN (DetQuant IndefArt NumPl) (UseN window_N))))) AllRus: он считает машины у её окон @@ -2614,7 +2614,7 @@ UttS (UseCl (TTAnt TCond AAnter) PNeg (PredVP (MassNP (UseN worm_N)) (ComplSlash UttS (UseCl (TTAnt TCond AAnter) PNeg (PredVP (MassNP (UseN worm_N)) (ComplSlash (VPSlashPrep (UseV sit_V) in_Prep) (MassNP (PossNP (AdjCN (CAdvAP less_CAdv (PositA full_A) (MassNP (UseN2 brother_N2))) (UseN apple_N)) (DetNP (DetQuant (PossPron he_Pron) NumSg))))))) AllRusAbs: TFullStop (PhrUtt NoPConj (UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a do_V2) (MassNP (UseN apple_N))))) NoVoc) TEmpty -AllRus: не делай яблоко . +AllRus: не делай яблока . AllRusAbs: TFullStop (PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a do_V2) (MassNP (UseN apple_N))))) NoVoc) TEmpty AllRus: делай яблоко . @@ -2622,7 +2622,7 @@ AllRusAbs: TQuestMark (PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos ( AllRus: как делает машину ? AllRusAbs: TExclMark (PhrUtt NoPConj (UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a do_V2) (MassNP (UseN car_N))))) (VocNP (UsePN john_PN))) TEmpty -AllRus: не делай машину , Иван ! +AllRus: не делай машины , Иван ! AllRusAbs: TExclMark (PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a do_V2) (MassNP (UseN car_N))))) (VocNP (UsePN john_PN))) TEmpty AllRus: делай машину , Иван ! @@ -3293,6 +3293,39 @@ AllRus: ты будешь учиться в 2024 . AllRusAbs: UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (UseN boy_N)) (AdvVP (UseV fly_V) (PrepCN on_Prep (UseN (CompoundN carpet_N airplane_N))))) AllRus: мальчик летал на ковре &+ - &+ самолёте +AllRusAbs: UseQCl (TTAnt TCond AAnter) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не гуля &+ ла бы +AllRusAbs: UseQCl (TTAnt TCond AAnter) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина гуля &+ ла бы +AllRusAbs: UseQCl (TTAnt TCond ASimul) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не гуля &+ ла бы +AllRusAbs: UseQCl (TTAnt TCond ASimul) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина гуля &+ ла бы +AllRusAbs: UseQCl (TTAnt TFut AAnter) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не будет гулять +AllRusAbs: UseQCl (TTAnt TFut AAnter) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина будет гулять +AllRusAbs: UseQCl (TTAnt TFut ASimul) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не будет гулять +AllRusAbs: UseQCl (TTAnt TFut ASimul) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина будет гулять +AllRusAbs: UseQCl (TTAnt TPast AAnter) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не гуля &+ ла +AllRusAbs: UseQCl (TTAnt TPast AAnter) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина гуля &+ ла +AllRusAbs: UseQCl (TTAnt TPast ASimul) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не гуля &+ ла +AllRusAbs: UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина гуля &+ ла +AllRusAbs: UseQCl (TTAnt TPres AAnter) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не гуляет +AllRusAbs: UseQCl (TTAnt TPres AAnter) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина гуляет +AllRusAbs: UseQCl (TTAnt TPres ASimul) PNeg (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина не гуляет +AllRusAbs: UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how8much_IAdv (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) +AllRus: сколько эта женщина гуляет + AllRusAbs: UseComp (CompAdv here_Adv) AllRus: здесь быть @@ -3488,6 +3521,40 @@ AllRus: тысячное AllRusAbs: OrdNumeral (num (pot3 (pot1as2 pot110))) AllRus: десяти &+ тысячное +AllRusAbs: UseCl (TTAnt TCond AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: бы &+ ло бы у вас вода +AllRusAbs: UseCl (TTAnt TCond ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: бы &+ ло бы у вас вода +AllRusAbs: UseCl (TTAnt TFut AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: будет у вас вода +AllRusAbs: UseCl (TTAnt TFut ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: будет у вас вода +AllRusAbs: UseCl (TTAnt TPast AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: бы &+ ло у вас вода +AllRusAbs: UseCl (TTAnt TPast ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: бы &+ ло у вас вода +AllRusAbs: UseCl (TTAnt TPres AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: у вас вода +AllRusAbs: UseCl (TTAnt TPres ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: у вас вода + +AllRusAbs: UseCl (TTAnt TCond AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло бы у вас воды +AllRusAbs: UseCl (TTAnt TCond ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло бы у вас воды +AllRusAbs: UseCl (TTAnt TFut AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: будет у вас воды +AllRusAbs: UseCl (TTAnt TFut ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: будет у вас воды +AllRusAbs: UseCl (TTAnt TPast AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло у вас воды +AllRusAbs: UseCl (TTAnt TPast ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло у вас воды +AllRusAbs: UseCl (TTAnt TPres AAnter) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: нет у вас воды +AllRusAbs: UseCl (TTAnt TPres ASimul) PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: нет у вас воды + AllRusAbs: UseCl (TTAnt TCond AAnter) PNeg (AdvIsNP everywhere_Adv (MassNP (UseN sky_N))) AllRus: небо не везде бы &+ ло бы AllRusAbs: UseCl (TTAnt TCond AAnter) PPos (AdvIsNP everywhere_Adv (MassNP (UseN sky_N))) @@ -3617,6 +3684,40 @@ AllRus: самое большее одна секунда чашка воды б AllRusAbs: AdvS (timeunitAdv (AdNum almost_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) AllRus: почти две секунды чашка воды будет существовать +AllRusAbs: ImpVP (AdvVP (AdVVP (PositAdVAdj dull_A) (SelfAdvVP hungry_VP)) (weekdayNextAdv friday_Weekday)) +AllRus: будь скучно голоден сам в следующую пятницу + +« пусть женщина рисует молодую себя » , — яблоко говори &+ ло + +AllRusAbs: UseCl (TTAnt TPast AAnter) PPos (FrontComplDirectVQ (MassNP (UseN man_N)) know_VQ (UttAdv (weekdayNextAdv sunday_Weekday))) +AllRus: « в следующее воскресенье » , — человек знал + +AllRusAbs: ProgrVP (ComplDirectVS say_VS (ImpP3 (MassNP (UseN woman_N)) (ReflVP (SlashV2A paint_V2A (PositA young_A))))) +AllRus: говорить : « пусть женщина рисует молодую себя » + +AllRusAbs: ProgrVP (ComplDirectVQ know_VQ (UttAdv (weekdayNextAdv sunday_Weekday))) +AllRus: знать : « в следующее воскресенье » + +AllRusAbs: UseCl (TTAnt TFut AAnter) PPos (PredVP (UsePN john_PN) (ComplDirectVS say_VS (UttAdv (weekdayNextAdv sunday_Weekday)))) +AllRus: Иван будет говорить : « в следующее воскресенье » + +AllRusAbs: UseCl (TTAnt TPast AAnter) PPos (PredVP (UsePN john_PN) (ComplDirectVQ know_VQ (UttAdv (weekdayNextAdv sunday_Weekday)))) +AllRus: Иван знал : « в следующее воскресенье » + +AllRusAbs: FocusObj (UsePron she_Pron) (UseSlash (TTAnt TCond AAnter) PNeg (SlashVP (UsePN john_PN) (Slash3V3 talk_V3 (UsePN paris_PN)))) +AllRus: с н &+ ей Иван не говорил бы о Париже +AllRusAbs: FocusObj (UsePron she_Pron) (UseSlash (TTAnt TCond AAnter) PPos (SlashVP (UsePN john_PN) (Slash3V3 talk_V3 (UsePN paris_PN)))) +AllRus: с н &+ ей Иван говорил бы о Париже + +AllRusAbs: UseCl (TTAnt TCond ASimul) PNeg (ExistsNP (MassNP (UseN number_N))) +AllRus: не существова &+ ло бы числа +AllRusAbs: UseCl (TTAnt TFut ASimul) PNeg (ExistsNP (MassNP (UseN number_N))) +AllRus: не будет существовать числа +AllRusAbs: UseCl (TTAnt TPast ASimul) PNeg (ExistsNP (MassNP (UseN number_N))) +AllRus: не существова &+ ло числа +AllRusAbs: UseCl (TTAnt TPres ASimul) PNeg (ExistsNP (MassNP (UseN number_N))) +AllRus: не существует числа + AllRusAbs: OrdNumeral (num (pot3 (pot1as2 (pot1plus n2 (pot0 n2))))) AllRus: двадцати двух &+ тысячное AllRusAbs: OrdNumeral (num (pot3 (pot1as2 (pot1plus n2 (pot0 n3))))) @@ -3634,6 +3735,23 @@ AllRus: двадцати восьми &+ тысячное AllRusAbs: OrdNumeral (num (pot3 (pot1as2 (pot1plus n2 (pot0 n9))))) AllRus: двадцати девяти &+ тысячное +AllRusAbs: UseCl (TTAnt TCond AAnter) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло бы у вас воды +AllRusAbs: UseCl (TTAnt TCond ASimul) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло бы у вас воды +AllRusAbs: UseCl (TTAnt TFut AAnter) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не будет у вас воды +AllRusAbs: UseCl (TTAnt TFut ASimul) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не будет у вас воды +AllRusAbs: UseCl (TTAnt TPast AAnter) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло у вас воды +AllRusAbs: UseCl (TTAnt TPast ASimul) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: не бы &+ ло у вас воды +AllRusAbs: UseCl (TTAnt TPres AAnter) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: нет у вас воды +AllRusAbs: UseCl (TTAnt TPres ASimul) PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron)) (MassNP (UseN water_N)))) +AllRus: нет у вас воды + AllRusAbs: AdjCN (PastPartAP (SlashV2a bite_V2)) (UseN house_N) AllRus: кусан дом AllRusAbs: AdjCN (PastPartAP (SlashV2a break_V2)) (UseN house_N) diff --git a/src/russian/test_rus_grammar.gfs b/src/russian/test_rus_grammar.gfs index 0c3fb3baf..dc09fb177 100644 --- a/src/russian/test_rus_grammar.gfs +++ b/src/russian/test_rus_grammar.gfs @@ -55,7 +55,7 @@ gt UseRCl (TTAnt TPres ASimul) PPos (RelCl (PredSCVP (EmbedQS (UseQCl (TTAnt TCo gt RelS (UseCl (TTAnt TPres ASimul) PNeg (GenericCl scared_VP)) (UseRCl (TTAnt TPres ASimul) PPos (RelCl (PredSCVP (EmbedQS (UseQCl (TTAnt TCond AAnter) PNeg (QuestIAdv (AdvIAdv how8much_IAdv everywhere_Adv) (ExistNP nobody_NP)))) hungry_VP) )) | l -treebank gt UseCl (TTAnt ? ASimul) ? (GenericCl (ReflVP (SlashV2A paint_V2A (PositA young_A)))) | l -treebank -gt ImpP3 (MassNP (UseN woman_N)) (ReflVP (SlashV2A paint_V2A (PositA young_A))) | l -treebank +gt ImpP3 (MassNP (UseN woman_N)) (ReflVP (SlashV2A paint_V2A (PositA young_A))) | l -treebank gt ImpPl1 (ReflVP (SlashV2A paint_V2A (PositA young_A))) | l -treebank gt UseCl (TTAnt TCond AAnter) ? (PredVP (MassNP (UseN heart_N)) (PassV2 squeeze_V2) ) | l -treebank @@ -114,6 +114,7 @@ gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut ASimul) ? (PredVP (UsePron gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) ? (PredVP (UsePron he_Pron) (AdvVP (PassV2 learn_V2) (weekdayLastAdv ?))))) NoVoc) TEmpty |l -treebank gt TFullStop (PhrUtt NoPConj (UttS (UseCl (TTAnt TFut AAnter) PPos (PredVP (UsePron ?) (AdvVP (PassV2 teach_V2) (yearAdv (intYear 2024)))))) NoVoc) TEmpty |l -treebank gt UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (UseN boy_N)) (AdvVP (UseV fly_V) (PrepCN on_Prep (UseN (CompoundN carpet_N airplane_N))))) |l -treebank +gt UseQCl ? ? (QuestIAdv how8much_IAdv (PredVP ( DetCN (DetQuant this_Quant NumSg) (UseN woman_N)) (UseV walk_V))) | l -treebank gt UseComp (CompAdv here_Adv) | l -treebank gt PredSCVP (EmbedVP (UseV think_V)) thirsty_VP | l -treebank @@ -148,6 +149,9 @@ gt OrdNumeral (num (pot3 (pot1as2 (pot1to19 n2)))) | l -treebank gt OrdNumeral (num (pot3 (pot1as2 (pot0as1 pot01)))) | l -treebank gt OrdNumeral (num (pot3 (pot1as2 pot110))) | l -treebank +gt UseCl ? PPos (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron )) (MassNP (UseN water_N) ))) | l -treebank +gt UseCl ? PPos (ImpersCl (ComplSlash (Slash3V3 have_not_V3 (UsePron youPl_Pron )) (MassNP (UseN water_N) ))) | l -treebank + -- from extend gt UseCl (TTAnt ? AAnter) ? (AdvIsNP everywhere_Adv (MassNP (UseN sky_N))) | l -treebank @@ -165,10 +169,24 @@ gt AdvS (timeunitAdv (AdNum at_most_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0 gt AdvS (timeunitAdv (AdNum at_most_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) |l -treebank gt AdvS (timeunitAdv (AdNum almost_AdN (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))))) second_Timeunit) (ExistS (TTAnt TFut ASimul) PPos (MassNP (cup_of_CN (MassNP (UseN water_N))))) | l -treebank +gt ImpVP (AdvVP (AdVVP (PositAdVAdj dull_A) (SelfAdvVP hungry_VP)) (weekdayNextAdv friday_Weekday)) |l -treebank + +gt UseCl (TTAnt TPast AAnter) PPos (FrontComplDirectVS (MassNP (UseN apple_N)) say_VS (ImpP3 (MassNP (UseN woman_N)) (ReflVP (SlashV2A paint_V2A (PositA young_A))))) | l +gt UseCl (TTAnt TPast AAnter) PPos (FrontComplDirectVQ (MassNP (UseN man_N)) know_VQ (UttAdv (weekdayNextAdv sunday_Weekday))) | l -treebank + +gt ProgrVP (ComplDirectVS say_VS (ImpP3 (MassNP (UseN woman_N)) (ReflVP (SlashV2A paint_V2A (PositA young_A))))) | l -treebank +gt ProgrVP (ComplDirectVQ know_VQ (UttAdv (weekdayNextAdv sunday_Weekday))) | l -treebank +gt UseCl (TTAnt TFut AAnter) PPos (PredVP (UsePN john_PN) (ComplDirectVS say_VS (UttAdv (weekdayNextAdv sunday_Weekday)))) | l -treebank +gt UseCl (TTAnt TPast AAnter) PPos (PredVP (UsePN john_PN) (ComplDirectVQ know_VQ (UttAdv (weekdayNextAdv sunday_Weekday)))) | l -treebank + +gt FocusObj (UsePron she_Pron) ( UseSlash (TTAnt TCond AAnter) ? (SlashVP (UsePN john_PN) (Slash3V3 talk_V3 (UsePN paris_PN))) ) | l -treebank + +gt UseCl (TTAnt ? ASimul) PNeg (ExistsNP (MassNP (UseN number_N))) | l -treebank + -- these below sound unnatural gt OrdNumeral (num (pot3 (pot1as2 (pot1plus n2 (pot0 ?))))) | l -treebank - +gt UseCl ? PNeg (ImpersCl (ComplSlash (Slash3V3 have_V3 (UsePron youPl_Pron )) (MassNP (UseN water_N) ))) | l -treebank -- here some participles are not formed correctly gt AdjCN (PastPartAP ( SlashV2a ? ) ) (UseN house_N) | l -treebank diff --git a/src/russian/todo.txt b/src/russian/todo.txt index edfc0904d..dc91b37e2 100644 --- a/src/russian/todo.txt +++ b/src/russian/todo.txt @@ -56,10 +56,6 @@ AllRus: сколько является яблок у Ивана ? ## Exists idiom requires genetive in negation -AllRusAbs: UseCl (TTAnt TPres ASimul) PNeg (ExistsNP (MassNP (UseN number_N))) -AllRus: не существует число -Should be: не существует числа - ## Copula negation is not that simple AllRusAbs: ComplVS hope_VS (UseCl (TTAnt TPres AAnter) PNeg (have_name_Cl (UsePron he_Pron) (UsePN john_PN)))