From f71926804575e9fa5b2161e02009ca1469205a7c Mon Sep 17 00:00:00 2001 From: Roman Suzi Date: Fri, 24 Jul 2020 19:41:11 +0300 Subject: [PATCH] Some fixes and backwards compatibility --- src/russian/AdjectiveRus.gf | 2 +- src/russian/ExtraRus.gf | 8 ++++---- src/russian/LexiconRus.gf | 2 +- src/russian/ParadigmsRus.gf | 26 ++++++++++++++---------- src/russian/StructuralRus.gf | 38 ++++++++++++++++++------------------ 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/src/russian/AdjectiveRus.gf b/src/russian/AdjectiveRus.gf index 0ab1628a..a0d25a4c 100644 --- a/src/russian/AdjectiveRus.gf +++ b/src/russian/AdjectiveRus.gf @@ -22,7 +22,7 @@ lin -- : A -> NP -> AP ; -- warmer than I - теплее меня ComparA a np = { - s = \\gn,anim,cas => a.comp ++ (applyPrep {s="" ; c=Gen ; hasPrep=True} np) ; + s = \\gn,anim,cas => a.comp ++ (applyPrep {s="" ; c=Gen ; hasPrep=False} np) ; -- True? short = \\ag=>a.comp ++ (applyPrep {s="" ; c=Gen ; hasPrep=True} np) ; isPost = False ; preferShort = PrefShort diff --git a/src/russian/ExtraRus.gf b/src/russian/ExtraRus.gf index 0b5d68b4..12b26b84 100644 --- a/src/russian/ExtraRus.gf +++ b/src/russian/ExtraRus.gf @@ -6,11 +6,11 @@ concrete ExtraRus of ExtraRusAbs = CatRus ** lin obj_no_Prep = {s="" ; c=Acc ; hasPrep=False} ; - to2_Prep = {s="в" ; c=Acc ; hasPrep=True}; - on_to_Prep = {s="до"; c=Gen; hasPrep=True} ; - along_Prep = {s="по"; c=Loc; hasPrep=True} ; + to2_Prep = P.mkPrep "в" Acc ; + on_to_Prep = P.mkPrep "до" Gen ; + along_Prep = P.mkPrep "по" Loc ; from2_Prep = from2 ; - about_Prep = {s="о" ; c=Pre; hasPrep=True} ; + about_Prep = P.mkPrep "о" Pre ; have_V3 = P.mkV3 est_ell_V nom_Prep u_Prep; have2_V3 = P.mkV3 est_V nom_Prep u_Prep; diff --git a/src/russian/LexiconRus.gf b/src/russian/LexiconRus.gf index d6efc349..cb91de2d 100644 --- a/src/russian/LexiconRus.gf +++ b/src/russian/LexiconRus.gf @@ -83,7 +83,7 @@ lin doctor_N = mkN "доктор" masculine animate ; dog_N = mkN "собака" feminine animate ; door_N = mkN "дверь" ; - drink_V2 = mkV2 (mkV imperfective "пить" "пиью" "пьёт"); + drink_V2 = mkV2 (mkV imperfective "пить" "пью" "пьёт"); dry_A = mkA "сухой" "" "3b/c'"; dull_A = mkA "скучный" ; dust_N = mkN "пыль" ; diff --git a/src/russian/ParadigmsRus.gf b/src/russian/ParadigmsRus.gf index 421e021e..10872b9f 100644 --- a/src/russian/ParadigmsRus.gf +++ b/src/russian/ParadigmsRus.gf @@ -69,14 +69,16 @@ oper -- Nouns mkN = overload { - mkN : (nom : Str) -> N + mkN : Str -> N = \nom -> lin N (guessNounForms nom) ; + mkN : Str -> Animacy -> N + = \nom,anim -> lin N ((guessNounForms nom) ** {anim=anim}) ; mkN : Str -> Gender -> Animacy -> N - = \nom, g, a -> lin N (guessLessNounForms nom g a) ; + = \nom, g, anim -> lin N (guessLessNounForms nom g anim) ; mkN : Str -> Gender -> Animacy -> Z.ZNIndex -> N - = \word, g, a, z -> lin N (noMinorCases (Z.makeNoun word g a z)) ; + = \word, g, anim, z -> lin N (noMinorCases (Z.makeNoun word g anim z)) ; mkN : Str -> Gender -> Animacy -> Str -> N - = \word, g, a, zi -> lin N (noMinorCases (Z.makeNoun word g a (Z.parseIndex zi))) ; + = \word, g, anim, zi -> lin N (noMinorCases (Z.makeNoun word g anim (Z.parseIndex zi))) ; mkN : A -> Gender -> Animacy -> N = \a, g, anim -> lin N (makeNFFromAF a g anim) ; } ; @@ -87,7 +89,7 @@ oper mkN2 : N -> Prep -> N2 = \n, p -> lin N2 (mkFun n p) ; mkN2 : Str -> Gender -> Animacy -> Str -> Prep -> N2 - = \word, g, a, zi, p -> lin N2 (mkFun (noMinorCases (Z.makeNoun word g a (Z.parseIndex zi))) p) ; + = \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} ; @@ -96,20 +98,22 @@ oper mkN3 : N -> Prep -> Prep -> N3 = \n, p2, p3 -> lin N3 (mkFun2 n p2 p3) ; mkN3 : Str -> Gender -> Animacy -> Str -> Prep -> Prep -> N3 - = \word, g, a, zi, p2, p3 -> lin N3 (mkFun2 (noMinorCases (Z.makeNoun word g a (Z.parseIndex zi))) p2 p3) ; + = \word, g, anim, zi, p2, p3 -> lin N3 (mkFun2 (noMinorCases (Z.makeNoun word g anim (Z.parseIndex zi))) p2 p3) ; } ; mkPN = overload { mkPN : N -> PN = \n -> lin PN n ; - mkPN : (nom : Str) -> PN + mkPN : Str -> PN = \nom -> lin PN (guessNounForms nom) ; mkPN : Str -> Gender -> Animacy -> PN - = \nom, g, a -> lin PN (guessLessNounForms nom g a) ; + = \nom, g, anim -> lin PN (guessLessNounForms nom g anim) ; + mkPN : Str -> Gender -> Number -> Animacy -> PN + = \nom, g, n, anim -> lin PN (guessLessNounForms nom g anim) ; mkPN : Str -> Gender -> Animacy -> Z.ZNIndex -> PN - = \word, g, a, z -> lin PN (noMinorCases (Z.makeNoun word g a z)) ; + = \word, g, anim, z -> lin PN (noMinorCases (Z.makeNoun word g anim z)) ; mkPN : Str -> Gender -> Animacy -> Str -> PN - = \word, g, a, zi -> lin PN (noMinorCases (Z.makeNoun word g a (Z.parseIndex zi))) ; + = \word, g, anim, zi -> lin PN (noMinorCases (Z.makeNoun word g anim (Z.parseIndex zi))) ; } ; --------------------- @@ -197,4 +201,6 @@ oper mkInterj : Str -> Interj = \s -> lin Interj {s = s} ; + mkPrep : Str -> Case -> Prep + = \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; } \ No newline at end of file diff --git a/src/russian/StructuralRus.gf b/src/russian/StructuralRus.gf index 2bf6d42f..1d0ca174 100644 --- a/src/russian/StructuralRus.gf +++ b/src/russian/StructuralRus.gf @@ -38,26 +38,26 @@ lin c=Nom } ; - above_Prep = {s="над" ; c=Ins; hasPrep=True} ; - after_Prep = {s="после" ; c=Gen; hasPrep=True }; - before_Prep = {s="перед" ; c=Ins; hasPrep=True}; - behind_Prep = {s="за" ; c=Ins; hasPrep=True }; - between_Prep = {s="между" ; c=Ins; hasPrep=True}; - by8agent_Prep = {s=["с помощью"] ; c=Gen; hasPrep=True}; - by8means_Prep = {s=["с помощью"] ; c=Gen; hasPrep=True}; - during_Prep = {s=["в течение"] ; c=Gen; hasPrep=True}; - except_Prep = {s=["за исключением"] ; c=Gen; hasPrep=True}; - for_Prep = {s="для" ; c=Gen ; hasPrep=True}; - from_Prep = {s="от" ; c=Gen ; hasPrep=True} ; - in8front_Prep = {s="перед" ; c=Ins; hasPrep=True}; - in_Prep = {s="в" ; c=Loc ; hasPrep=True} ; - on_Prep = {s="на" ; c=Loc ; hasPrep=True}; + above_Prep = mkPrep "над" Ins ; + after_Prep = mkPrep "после" Gen ; + before_Prep = mkPrep "перед" Ins ; + behind_Prep = mkPrep "за" Ins ; + between_Prep = mkPrep "между" Ins ; + by8agent_Prep = mkPrep ["с помощью"] Gen ; + by8means_Prep = mkPrep ["с помощью"] Gen ; + during_Prep = mkPrep "в течение" Gen ; + except_Prep = mkPrep ["за исключением"] Gen ; + for_Prep = mkPrep "для" Gen ; + from_Prep = mkPrep "от" Gen ; + in8front_Prep = mkPrep "перед" Ins ; + in_Prep = mkPrep "в" Loc ; + on_Prep = mkPrep "на" Loc ; part_Prep = {s="" ; c=Nom ; hasPrep=False }; -- missing in Russian??? possess_Prep = {s="" ; c=Gen ; hasPrep=False}; - through_Prep = {s="через" ; c=Acc ; hasPrep=True}; - to_Prep = {s="к" ; c=Dat ; hasPrep=True} ; - under_Prep = {s="под" ; c=Ins ; hasPrep=True}; - without_Prep = {s="без" ; c=Gen; hasPrep=True }; + through_Prep = mkPrep "через" Acc ; + to_Prep = mkPrep "к" Dat ; + under_Prep = mkPrep "под" Ins ; + without_Prep = mkPrep "без" Gen ; or_Conj = mkConj "или" Sg ; and_Conj = mkConj "и" Pl ; @@ -65,7 +65,7 @@ lin either7or_DConj = mkConj "либо" (comma ++ "либо") Sg ; if_then_Conj = mkConj "если" (comma ++ "то") Sg ; - with_Prep = {s="с" ; c=Ins; hasPrep=True}; + with_Prep = mkPrep "с" Ins ; please_Voc = ss "пожалуйста" ;