diff --git a/lib/resource-0.6/russian/CombinationsRus.gf b/lib/resource-0.6/russian/CombinationsRus.gf index 8e80a61df..410ec2c96 100644 --- a/lib/resource-0.6/russian/CombinationsRus.gf +++ b/lib/resource-0.6/russian/CombinationsRus.gf @@ -54,18 +54,20 @@ lincat -- = {s : Case => Gender => Str} ; V = Verb ; - -- = {s : VF => Str ; t: Tense ; a : Aspect ; v: Voice} ; - VG = {s : Bool => VF => Str ; s2 : Bool => Str ; t: Tense ; a : Aspect ; v: Voice} ; + -- = {s : VF => Str ; t: Tense ; a : Aspect ; w: Voice} ; + VG = VerbGroup ; + -- = Verb ; VP = VerbPhrase ; -- = Verb ** {s2 : Str ; s3 : Gender => Number => Str ; -- negBefore: Bool} ; TV = TransVerb ; -- = Verb ** {s2 : Str ; c: Case } ; - V3 = TransVerb ** {s4 : Str; c2: Case} ; + V3 = DitransVerb ; + -- = TransVerb ** {s4 : Str; c2: Case} ; VS = SentenceVerb ; -- = Verb ; - VV = Verb ; - + VV = VerbVerb ; + -- = Verb ; AdV = Adverb ; -- = {s : Str} ; Prep = Preposition; @@ -147,6 +149,22 @@ lin --PosVS = complSentVerb True ; --NegVS = complSentVerb False ; + PosVG = predVerbGroup True ; + NegVG = predVerbGroup False ; + + PredV v = v ; + PredAP = predAdjective ; + PredCN = predCommNoun ; + PredTV = complTransVerb ; + PredV3 = complDitransVerb ; + PredPassV v = v ; + PredNP = predNounPhrase ; + PredAdV = predAdverb ; + PredVS = complSentVerb ; + PredVV = complVerbVerb ; + VTrans = verbOfTransVerb ; + + AdjAdv a = mkAdverb (a.s ! AdvF) ; PrepNP p = prepPhrase p ; AdvVP = adVerbPhrase ; @@ -156,8 +174,8 @@ lin PosSlashTV = slashTransVerb True ; NegSlashTV = slashTransVerb False ; --- OneVP = predVerbPhrase (nameNounPhrase (nameReg "one")) ; ---ThereNP = thereIs ; + OneVP = predVerbPhrase (pron2NounPhrase pronKtoTo Animate) ; + ThereNP = thereIs ; IdRP = identRelPron ; FunRP = funRelPron ; @@ -178,7 +196,7 @@ lin IntVP = intVerbPhrase ; IntSlash = intSlash ; QuestAdv = questAdverbial ; ---IsThereNP = isThere ; + IsThereNP = isThere ; ImperVP = imperVerbPhrase ; diff --git a/lib/resource-0.6/russian/MorphoRus.gf b/lib/resource-0.6/russian/MorphoRus.gf index 6ab7131e3..2ddcda827 100644 --- a/lib/resource-0.6/russian/MorphoRus.gf +++ b/lib/resource-0.6/russian/MorphoRus.gf @@ -457,6 +457,7 @@ oper eEndInAnimateDecl: Str -> CommNoun = \proizvedeni -> g = Neut ; anim = Inanimate } ; oper chislo : CommNoun = oEndInAnimateDecl "числ" ; +oper vino : CommNoun = oEndInAnimateDecl "вин" ; oper oEndInAnimateDecl: Str -> CommNoun = \chisl -> let { chis = Predef.tk 1 chisl ; ending = Predef.dp 3 chisl } in oEndInAnimateDecl3 chisl (chis+"e"+ending) ; @@ -555,7 +556,9 @@ oper EN_softSignEndDeclMasc: Str -> CommNoun = \rem -> } ; oper noga : CommNoun = aEndG_K_KH_Decl "ног" ; +oper doroga : CommNoun = aEndG_K_KH_Decl "дорог" ; oper dvojka : CommNoun = aEndG_K_KH_Decl "двойк" ; +oper butyulka : CommNoun = aEndG_K_KH_Decl "бутылк" ; oper aEndG_K_KH_Decl: Str -> CommNoun = \nog -> { s = table { SF Sg Nom => nog+"а" ; @@ -717,6 +720,8 @@ oper eEnd_Decl: Str -> CommNoun = \vs -> -- and vice verca using "mkAdjDeg" operation. oper + adjInvar: Str -> Adjective = \s -> { s = \\af => s }; + kazhdujDet: Adjective = uy_j_EndDecl "кажд" ; samuj: Adjective = uy_j_EndDecl "сам" ; lubojDet: Adjective = uy_oj_EndDecl "люб" ; @@ -742,6 +747,7 @@ oper mkAdjDeg: Adjective -> Str -> AdjDegr = \adj, s -> } }; oper uzhasnuj: AdjDegr = mkAdjDeg (uy_j_EndDecl "ужасн") "ужаснее"; +oper schastlivyuj: AdjDegr = mkAdjDeg (uy_j_EndDecl "счастлив") "счастливее"; oper deshevuj: AdjDegr = mkAdjDeg (uy_j_EndDecl "дешев") "дешевле"; oper staruj: AdjDegr = mkAdjDeg (uy_j_EndDecl "стар") "старше"; oper totDet: Adjective = {s = table { @@ -1001,7 +1007,7 @@ oper have: Verbum = {s=\\ vf => "-" ; asp = Imperfective} ; -- (according to the number and the person of the subject) -- patterns in the present tense in the indicative mood. -param Conjugation = First | Second | Mixed | Dolzhen; +param Conjugation = First | FirstE | Second | Mixed | Dolzhen; --3 First conjugation (in Present) verbs : @@ -1012,11 +1018,16 @@ oper verbZhdat : Verbum = verbDecl Imperfective First "жд" "у" "ждал" "ж oper verbBegat : Verbum = verbDecl Imperfective First "бега" "ю" "бегал" "бегай" "бегать"; oper verbPrinimat : Verbum = verbDecl Imperfective First "принима" "ю" "принимал" "принимай" "принимать"; oper verbDokazuvat : Verbum = verbDecl Imperfective First "доказыва" "ю" "доказывал" "доказывай" "доказывать"; +oper verbPredpochitat : Verbum = verbDecl Imperfective First "предпочита" "ю" "предпочитал" "предпочитай" "предпочитать"; oper verbOtpravlyat : Verbum = verbDecl Imperfective First "отправля" "ю" "отправлял" "отправляй" "отправлять"; oper verbSlomat : Verbum = verbDecl Perfective First "слома" "ю" "сломал" "сломай" "сломать"; oper verbByut : Verbum = verbDecl Perfective First "буд" "у" "был" "будь" "быть"; oper verbMoch : Verbum = verbDecl Imperfective First "мог" "у" "мог" "моги" "мочь"; +-- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink) : +oper verbDavat : Verbum = verbDecl Imperfective FirstE "да" "ю" "давал" "давай" "давать"; +oper verbPit : Verbum = verbDecl Imperfective FirstE "пь" "ю" "пил" "пей" "пить"; + --3 Second conjugation (in Present) verbs : oper verbLubit : Verbum = verbDecl Imperfective Second "люб" "лю" "любил" "люби" "любить"; @@ -1069,6 +1080,15 @@ oper presentConj2: Str -> Str -> PresentVerb = \del, sgP1End -> PRF Pl P3 => del+ "ят" }; +oper presentConj1E: Str -> Str -> PresentVerb = \del, sgP1End -> + table { + PRF Sg P1 => del+ sgP1End ; + PRF Sg P2 => del+ "ёшь" ; + PRF Sg P3 => del+ "ёт" ; + PRF Pl P1 => del+ "ём" ; + PRF Pl P2 => del+ "ёте'" ; + PRF Pl P3 => del+ sgP1End + "т" + }; oper presentConj1: Str -> Str -> PresentVerb = \del, sgP1End -> table { PRF Sg P1 => del+ sgP1End ; @@ -1106,12 +1126,14 @@ oper verbDecl: Aspect -> Conjugation -> Str -> Str -> Str -> Str ->Str -> Verbum \a, c, del, sgP1End, sgMascPast, imperSgP2, inf -> case a of { Perfective => case c of { First => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConj1 del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); + FirstE => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConj1E del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); Second => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConj2 del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); Mixed => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConjMixed del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); Dolzhen => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConjDolzhen del sgP1End) (pastConjDolzhen sgMascPast)) (pastConjDolzhen sgMascPast) } ; Imperfective => case c of { First => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConj1 del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); + FirstE => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConj1E del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); Second => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConj2 del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast); Mixed => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConjMixed del sgP1End) (pastConj sgMascPast)) (pastConj sgMascPast) ; Dolzhen => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConjDolzhen del sgP1End) (pastConjDolzhen sgMascPast)) (pastConjDolzhen sgMascPast) diff --git a/lib/resource-0.6/russian/ResourceRus.gf b/lib/resource-0.6/russian/ResourceRus.gf index 83fd3abd5..55d2dd57f 100644 --- a/lib/resource-0.6/russian/ResourceRus.gf +++ b/lib/resource-0.6/russian/ResourceRus.gf @@ -1,3 +1,2 @@ ---# -path=.:../abstract:../../prelude - -resource ResourceRus = reuse StructuralRus ; +--# -path=.:../abstract:../../prelude +resource ResourceRus = reuse StructuralRus ; diff --git a/lib/resource-0.6/russian/SyntaxRus.gf b/lib/resource-0.6/russian/SyntaxRus.gf index da7b22ecc..414256e96 100644 --- a/lib/resource-0.6/russian/SyntaxRus.gf +++ b/lib/resource-0.6/russian/SyntaxRus.gf @@ -175,8 +175,7 @@ oper -- (for semantic reasons) is useful, e.g. "русский". oper - - extAdjective : AdjDegr -> Adjective = \adj -> + extAdjective : AdjDegr -> Adjective = \adj -> { s = \\af => adj.s ! Pos ! af } ; -- Coercions between the compound gen-num type and gender and number: @@ -365,10 +364,9 @@ oper -- The rule for using transitive verbs is the complementization rule: - complTransVerb : Bool -> TransVerb -> NounPhrase -> VerbPhrase = \b,se,tu -> - {s = se.s ; a = se.a ; t = se.t ; w = se.w ; s2 = negation b ; - s3 = \\_,_ => se.s2 ++ tu.s ! (mkPronForm se.c No NonPoss) ; - negBefore = True } ; + complTransVerb :TransVerb -> NounPhrase -> VerbGroup = \se,tu -> + {s =\\vf => se.s ! vf ++ se.s2 ++ tu.s ! (mkPronForm se.c No NonPoss) ; + a = se.a ; t = se.t ; w = se.w } ; --3 Verb phrases -- @@ -377,17 +375,18 @@ oper -- (s3) complement. This discontinuity is needed in sentence formation -- to account for word order variations. + VerbGroup = Verb ; + VerbPhrase : Type = Verb ** {s2 : Str ; s3 : Gender => Number => Str ; negBefore: Bool} ; -- A simple verb can be made into a verb phrase with an empty complement. -- There are two versions, depending on if we want to negate the verb. - - predVerb : Bool -> Verb -> VerbPhrase = \b,vidit -> + predVerbGroup : Bool -> VerbGroup -> VerbPhrase = \b,vidit -> vidit ** { s2 = negation b ; s3 = \\_,_ => [] ; - negBefore = True + negBefore = True -- this should be a parameter ! } ; negation : Bool -> Str = \b -> if_then_else Str b [] "не" ; @@ -405,37 +404,56 @@ oper -- Note: in some case we can even omit a dash "-" : -- "Я думаю, что это хорошая машина". - predAdjective : Bool -> Adjective -> VerbPhrase = \b,zloj -> - { s= \\_ => "-" ; + predAdverb : Adverb -> VerbGroup = \zloj -> + { s= \\vf => case vf of { + VFin _ _ => "-" ++ zloj.s ; + VImper _ _ => ""; + VInf => ""; + VSubj _ => "" + } ; t = Present ; a = Imperfective ; - w = Act ; - s2 = negation b ; - s3 = \\g,n => case n of { - Sg => zloj.s ! AF Nom Animate (ASg g) ; - Pl => zloj.s ! AF Nom Animate APl - } ; - negBefore = False + w = Act } ; - predCommNoun : Bool -> CommNounPhrase -> VerbPhrase = \b,chelovek -> - { s= \\_ => "-" ; + predAdjective : AdjPhrase -> VerbGroup = \zloj -> + { s= \\vf => case vf of { + VFin gn _ => case (numGNum gn) of { + Sg => "-" ++ zloj.s ! AF Nom Animate (ASg (genGNum gn)) ; + Pl => "-" ++ zloj.s ! AF Nom Animate APl + } ; + VImper _ _ => ""; + VInf => ""; + VSubj _ => "" + } ; t = Present ; a = Imperfective ; - w = Act ; - s2 = negation b ; - s3 = \\_,n => (indefNounPhrase n chelovek ).s ! (mkPronForm Nom No NonPoss) ; - negBefore = False - } ; + w = Act + } ; - predNounPhrase : Bool -> NounPhrase -> VerbPhrase = \b,masha -> - { s= \\_ => "-" ; + predCommNoun : CommNounPhrase -> VerbGroup = \chelovek -> + { s= \\vf => case vf of { + VFin gn _ => "-" ++ + (indefNounPhrase (numGNum gn) chelovek ).s ! (mkPronForm Nom No NonPoss) ; + VImper _ _ => ""; + VInf => ""; + VSubj _ => "" + } ; t = Present ; a = Imperfective ; - w = Act ; - s2 = negation b ; - s3 = \\_,_ => masha.s ! (mkPronForm Nom No NonPoss) ; - negBefore = False + w = Act + } ; + + predNounPhrase : NounPhrase -> VerbGroup = \masha -> + { s= \\vf => case vf of { + VFin _ _ => "-" ++ masha.s ! (mkPronForm Nom No NonPoss) ; + VImper _ _ => ""; + VInf => ""; + VSubj _ => "" + } ; + t = Present ; + a = Imperfective ; + w = Act } ; -- A function specific for Russian : @@ -462,6 +480,28 @@ oper s2 = poezd.s3; c = poezd.c2 } ; +-- *Ditransitive verbs* are verbs with three argument places. +-- We treat so far only the rule in which the ditransitive +-- verb takes both complements to form a verb phrase. + + DitransVerb = TransVerb ** {s4 : Str; c2: Case} ; + + mkDitransVerb : Verb -> Case -> Case -> DitransVerb = \v,c1,c2 -> + v ** {s2 = ""; c = c1; s4 = ""; c2=c2 } ; + + complDitransVerb : DitransVerb -> NounPhrase -> NounPhrase -> VerbGroup = + \dat,tu,pivo -> + let + tebepivo = dat.s2 ++ + tu.s ! PF dat.c Yes NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss + in + {s = \\vf => (dat.s ! vf) ++ tebepivo ; + t = dat.t ; + a = dat.a ; + w = dat.w + } ; + + --2 Adverbials -- adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \poet, khorosho -> @@ -539,7 +579,7 @@ oper -- This is a macro for simultaneous predication and complementation. predTransVerb : Bool -> TransVerb -> NounPhrase -> NounPhrase -> Sentence = - \b,vizhu,ya,tu -> predVerbPhrase ya (complTransVerb b vizhu tu) ; + \b,vizhu,ya,tu -> predVerbPhrase ya (predVerbGroup b (complTransVerb vizhu tu)) ; --3 Sentence-complement verbs -- @@ -549,12 +589,33 @@ oper -- To generate "сказал, что Иван гуляет" / "не сказал, что Иван гуляет": - complSentVerb : Bool -> SentenceVerb -> Sentence -> VerbPhrase = - \b,vidit,tuUlubaeshsya -> - {s = vidit.s ; s2 = negation b ; s3 = \\_,_ => [", что"] ++ - tuUlubaeshsya.s ; - t = vidit.t ; w = vidit.w ; a = vidit.a ; negBefore = True } ; + complSentVerb : SentenceVerb -> Sentence -> VerbGroup = + \vidit,tuUlubaeshsya -> + {s = \\vf => vidit.s ! vf ++ [", что"] ++ tuUlubaeshsya.s ; + t = vidit.t ; w = vidit.w ; a = vidit.a } ; +--3 Verb-complement verbs +-- +-- Sentence-complement verbs take verb phrases as complements. +-- They can be auxiliaries ("can", "must") or ordinary verbs +-- ("try"); this distinction cannot be done in the multilingual +-- API and leads to some anomalies in English, such as the necessity +-- to create the infinitive form "to be able to" for "can" so that +-- the construction can be iterated, and the corresponding complication +-- in the parameter structure. + + VerbVerb : Type = Verb ; + +-- To generate "can walk"/"can't walk"; "tries to walk"/"does not try to walk": +-- The contraction of "not" is not provided, since it would require changing +-- the verb parameter type. + + complVerbVerb : VerbVerb -> VerbGroup -> VerbGroup = \putatsya,bezhat -> + { s = \\vf => putatsya.s ! vf ++ bezhat.s ! VInf ; + t = putatsya.t ; + a = putatsya.a ; + w = putatsya.w + } ; --2 Sentences missing noun phrases -- @@ -570,16 +631,13 @@ oper slashTransVerb : Bool -> NounPhrase -> TransVerb -> SentenceSlashNounPhrase = \b,ivan,lubit -> - predVerbPhrase ivan (predVerb b (verbOfTransVerb lubit)) ** + predVerbPhrase ivan (predVerbGroup b (verbOfTransVerb lubit)) ** complementOfTransVerb lubit ; ---thereIs : NounPhrase -> Sentence = \abar -> - -- predVerbPhrase - -- (case abar.n of { - -- Sg => nameNounPhrase (nameReg "there") ; - -- Pl => {s = \\_ => "there" ; n = Pl ; p = P3} - -- }) - -- (predVerbGroup True (predNounPhrase abar)) ; +thereIs : NounPhrase -> Sentence = \bar -> + predVerbPhrase + ({s = \\_ => "есть" ; n = bar.n ; p = P3; g = bar.g; anim = bar.anim; pron = bar.pron }) + (predVerbGroup True (predNounPhrase bar)) ; --2 Coordination -- @@ -752,13 +810,10 @@ oper } } ; ---isThere : NounPhrase -> Question = \abar -> - -- questVerbPhrase - -- (case abar.n of { - -- Sg => nameNounPhrase (nameReg "there") ; - -- Pl => {s = \\_ => "there" ; n = Pl ; p = P3} - -- }) - -- (predVerbGroup True (predNounPhrase abar)) ; +isThere : NounPhrase -> Question = \bar -> + questVerbPhrase + ({s = \\_ => ["есть ли"] ; n = bar.n ; p = P3; g = bar.g; anim = bar.anim; pron = bar.pron}) + (predVerbGroup True (predNounPhrase bar)) ; --3 Wh-questions -- diff --git a/lib/resource-0.6/russian/TestResourceRus.gf b/lib/resource-0.6/russian/TestResourceRus.gf index d43abea61..d551cacb6 100644 --- a/lib/resource-0.6/russian/TestResourceRus.gf +++ b/lib/resource-0.6/russian/TestResourceRus.gf @@ -14,12 +14,17 @@ lin Old = staruj ; Young = molodoj ; - --Connection = cnNoHum (nounReg "connection") ** {s2 = "from" ; s3 = "to"} ; Fun2 - -- American = adj1Malenkij "американск" ; - -- Finnish = adj1Malenkij "финск" ; - -- Married = adjInvar "замужем" ** {s2 = "за"; c = instructive} ; - --Give = mkDitransVerb (verbNoPart (mkVerb "give" "gave" "given")) [] [] ; V3 - --Prefer = mkDitransVerb (mkVerb "prefer" "preferred" "preferred")) [] "to" ; V3 + Connection = (noun2CommNounPhrase (doroga) )** {s2 = "из" ; c = Gen; s3 = "в"; c2=Acc} ; + American = ij_EndK_G_KH_Decl "американск" ; -- adj1Malenkij from Paradigms + Finnish = ij_EndK_G_KH_Decl "финск" ; -- adj1Malenkij from Paradigms + Married = adjInvar "замужем" ** {s2 = "за"; c = Inst} ; -- adjinvar from Paradigms + Give = mkDitransVerb (extVerb verbDavat Act Present) Acc Dat; + Prefer = mkDitransVerb (extVerb verbPredpochitat Act Present) Acc Dat ; + Bar = bar ; + Bottle = butyulka ; + Wine = vino ; + Drink = mkDirectVerb (extVerb verbPit Act Present ) ; + Happy = schastlivyuj ; Man = muzhchina ; Woman = zhenchina ;