diff --git a/lib/resource-1.0/russian/AdjectiveRus.gf b/lib/resource-1.0/russian/AdjectiveRus.gf index 07717b945..c544c8d87 100644 --- a/lib/resource-1.0/russian/AdjectiveRus.gf +++ b/lib/resource-1.0/russian/AdjectiveRus.gf @@ -1,42 +1,46 @@ - ---# -path=.:../abstract:../common:../../prelude - - -concrete AdjectiveRus of Adjective = CatRus ** open ResRus, Prelude in { --- --- lin --- --- PositA a = { --- s = \\_ => a.s ! AAdj Posit ; --- isPre = True --- } ; --- ComparA a np = { --- s = \\_ => a.s ! AAdj Compar ++ "than" ++ np.s ! Nom ; --- isPre = False --- } ; --- ----- $SuperlA$ belongs to determiner syntax in $Noun$. --- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ; --- isPre = False --- } ; --- --- ReflA2 a = { --- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; --- isPre = False --- } ; --- --- SentAP ap sc = { --- s = \\a => ap.s ! a ++ sc.s ; --- isPre = False --- } ; --- --- AdAP ada ap = { --- s = \\a => ada.s ++ ap.s ! a ; --- isPre = ap.isPre --- } ; --- --- UseA2 a = a ; --- -} + +--# -path=.:../abstract:../common:../../prelude + + +concrete AdjectiveRus of Adjective = CatRus ** open ResRus, Prelude in { +flags coding=utf8 ; + + lin + + PositA a = { s = a.s!Posit; p = False}; + -- Comparative forms are used with an object of comparison, as + -- adjectival phrases ("больше тебя"). + + ComparA bolshoj tu = + {s = \\af => bolshoj.s ! Compar ! af ++ tu.s ! (mkPronForm Gen Yes NonPoss) ; + p = True + } ; + +-- $SuperlA$ belongs to determiner syntax in $Noun$. + + ComplA2 vlublen tu = + {s = \\af => vlublen.s !Posit! af ++ vlublen.s2 ++ + tu.s ! (mkPronForm vlublen.c No NonPoss) ; + p = True + } ; + + ReflA2 vlublen = + {s = \\af => vlublen.s !Posit! af ++ vlublen.s2 ++ "себя"; + p = True + } ; + + SentAP vlublen sent= + {s = \\af => vlublen.s ! af ++ sent.s; + p = True + } ; + + + AdAP ada ap = { + s = \\af => ada.s ++ ap.s ! af ; + p = True + } ; + + UseA2 a = a ; + +} + diff --git a/lib/resource-1.0/russian/AdverbRus.gf b/lib/resource-1.0/russian/AdverbRus.gf index f3cebe10e..8a5944813 100644 --- a/lib/resource-1.0/russian/AdverbRus.gf +++ b/lib/resource-1.0/russian/AdverbRus.gf @@ -1,23 +1,25 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete AdverbRus of Adverb = CatRus ** open ResRus, Prelude in { --- --- lin --- PositAdvAdj a = {s = a.s ! AAdv} ; --- ComparAdvAdj cadv a np = { --- s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom --- } ; --- ComparAdvAdjS cadv a s = { --- s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s --- } ; --- --- PrepNP prep np = {s = prep.s ++ np.s ! Acc} ; --- --- AdAdv = cc2 ; --- --- SubjS = cc2 ; --- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing --- --- AdnCAdv cadv = {s = cadv.s ++ "than"} ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete AdverbRus of Adverb = CatRus ** open ResRus, Prelude in { +flags coding=utf8 ; + + lin + PositAdvAdj a = {s = a.s !Posit! AdvF} ; + ComparAdvAdj cadv a np = { + s = cadv.s ++ a.s !Posit! AdvF ++ "чем" ++ np.s ! PF Nom No NonPoss + } ; + ComparAdvAdjS cadv a s = { + s = cadv.s ++ a.s !Posit! AdvF ++ "чем" ++ s.s + } ; + + PrepNP na stol = ss (na.s ++ stol.s ! PF na.c Yes NonPoss) ; + + AdAdv = cc2 ; + + SubjS = cc2 ; + AdvSC s = s ; --- this rule give stack overflow in ordinary parsing + + AdnCAdv cadv = {s = cadv.s ++ "чем"} ; + +} + diff --git a/lib/resource-1.0/russian/CatRus.gf b/lib/resource-1.0/russian/CatRus.gf index 6eeae4bd3..4c6b8bcbd 100644 --- a/lib/resource-1.0/russian/CatRus.gf +++ b/lib/resource-1.0/russian/CatRus.gf @@ -1,93 +1,106 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete CatRus of Cat = CommonX ** open ResRus, Prelude in { --- --- flags optimize=all_subs ; --- --- lincat --- ----- Phrase --- --- Utt, Voc = {s : Str} ; --- ----- Tensed/Untensed --- --- S = {s : Str} ; --- QS = {s : QForm => Str} ; --- RS = {s : Agr => Str} ; --- ----- Sentence --- --- Cl = {s : Tense => Anteriority => Polarity => Order => Str} ; --- Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ; --- Imp = {s : Polarity => Number => Str} ; --- ----- Question --- --- QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; --- IP = {s : Case => Str ; n : Number} ; --- IAdv, IComp = {s : Str} ; --- IDet = {s : Str ; n : Number} ; --- ----- Relative --- --- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ; --- RP = {s : RCase => Str ; a : RAgr} ; --- ----- Verb --- --- VP = { --- s : Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ; --- prp : Str ; -- present participle --- inf : Str ; -- infinitive --- ad : Str ; --- s2 : Agr => Str --- } ; --- Comp = {s : Agr => Str} ; --- SC = {s : Str} ; --- ----- Adjective --- --- AP = {s : Agr => Str ; isPre : Bool} ; --- ----- Noun --- --- CN = {s : Number => Case => Str} ; --- NP, Pron = {s : Case => Str ; a : Agr} ; --- Det = {s : Str ; n : Number} ; --- Predet, QuantSg, QuantPl, Num, Ord = {s : Str} ; --- Quant = {s : Number => Str} ; --- ----- Adverb --- --- Adv, AdV, AdA, AdS, AdN = {s : Str} ; --- ----- Numeral --- --- Numeral = {s : CardOrd => Str ; n : Number} ; --- ----- Structural --- --- Conj = {s : Str ; n : Number} ; --- DConj = {s1,s2 : Str ; n : Number} ; --- PConj = {s : Str} ; --- CAdv = {s : Str} ; --- Subj = {s : Str} ; --- Prep = {s : Str} ; --- ----- Open lexical classes, e.g. Lexicon --- --- V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; --- V2, V2A = Verb ** {c2 : Str} ; --- V3 = Verb ** {c2, c3 : Str} ; --- VV = {s : VVForm => Str ; isAux : Bool} ; --- --- A = {s : AForm => Str} ; --- A2 = {s : AForm => Str ; c2 : Str} ; --- --- N = {s : Number => Case => Str} ; --- N2 = {s : Number => Case => Str} ** {c2 : Str} ; --- N3 = {s : Number => Case => Str} ** {c2,c3 : Str} ; --- PN = {s : Case => Str} ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete CatRus of Cat = CommonX ** open ResRus, Prelude in { + + flags optimize=all_subs ; coding=utf8 ; + + lincat + +-- Phrase + + Utt, Voc = {s : Str} ; + +-- Tensed/Untensed + + S = {s : Str} ; + SC = {s : Str} ; + QS = {s : QForm => Str} ; + RS = {s : GenNum => Case => Animacy => Str} ; + +-- Sentence + -- clause (variable tense) e.g. "John walks"/"John walked" + Cl ={s : Polarity => ClForm => Str} ; + Slash = {s : Polarity => ClForm => Str; s2: Str; c: Case} ; + Imp = { s: Polarity => Gender => Number => Str } ; + +-- Question + + QCl = {s :Polarity => ClForm => QForm => Str}; + IP = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; anim : Animacy ; pron: Bool} ; + IAdv, IComp = {s : Str} ; + IDet = Adjective ** {n: Number; g: PronGen; c: Case} ; + +-- Relative + + RCl = {s : Polarity => ClForm => GenNum => Case => Animacy => Str} ; + RP = {s : GenNum => Case => Animacy => Str} ; + +-- Verb + -- Polarity => + Comp, VP = {s : ClForm => GenNum => Person => Str ; asp : Aspect ; w: Voice} + ** {s2 : Str ; s3 : Gender => Number => Str ; negBefore: Bool} ; + + +-- Adjective + + AP = {s : AdjForm => Str; p : IsPostfixAdj} ; + +-- Noun + + CN = {s : Number => Case => Str; g : Gender; anim : Animacy} ; + NP = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; anim : Animacy ; pron: Bool} ; + Pron = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; pron: Bool} ; + +-- Determiners (only determinative pronouns +-- (or even indefinite numerals: "много" (many)) in Russian) are inflected +-- according to the gender of nouns they determine. +-- extra parameters (Number and Case) are added for the sake of +-- the determinative pronoun "bolshinstvo" ("most"); +-- Gender parameter is due to multiple determiners (Numerals in Russian) +-- like "mnogo" +-- The determined noun has the case parameter specific for the determiner + QuantSg, QuantPl , Det = {s : AdjForm => Str; n: Number; g: PronGen; c: Case} ; + Predet, Quant= {s : AdjForm => Str; g: PronGen; c: Case} ; + +-- Adverb + + Adv, AdV, AdA, AdS, AdN = {s : Str} ; + +-- Numeral + + Num, Numeral = {s : Case => Gender => Str} ; + +-- Structural +-- The conjunction has an inherent number, which is used when conjoining +-- noun phrases: "Иван и Маша поют" vs. "Иван или Маша поет"; in the +-- case of "или", the result is however plural if any of the disjuncts is. + + Conj = {s : Str ; n : Number} ; + DConj = {s1,s2 : Str ; n : Number} ; + PConj = {s : Str} ; + CAdv = {s : Str} ; + Subj = {s : Str} ; + Prep = {s : Str ; c: Case } ; + +-- Open lexical classes, e.g. Lexicon + + V, VS, VV, VQ, VA = Verbum ; -- = {s : VerbForm => Str ; asp : Aspect } ; + V2, V2A = Verbum ** Complement ; + V3 = Verbum ** Complement** {s4 : Str; c2: Case} ; +-- VV = {s : VVForm => Str ; isAux : Bool} ; + + Ord = {s : AdjForm => Str} ; + A = {s : Degree => AdjForm => Str} ; + A2 = A ** Complement ; + + -- Substantives moreover have an inherent gender. + N = {s : SubstForm => Str ; g : Gender ; anim : Animacy } ; + N2 = {s : Number => Case => Str; g : Gender; anim : Animacy} ** Complement ; + N3 = {s : Number => Case => Str; g : Gender; anim : Animacy} ** Complement ** {s3 : Str; c2: Case} ; + PN = {s : Case => Str ; g : Gender ; anim : Animacy} ; + +} + diff --git a/lib/resource-1.0/russian/ConjunctionRus.gf b/lib/resource-1.0/russian/ConjunctionRus.gf index 3d8a3ee3e..4d8dc9d7b 100644 --- a/lib/resource-1.0/russian/ConjunctionRus.gf +++ b/lib/resource-1.0/russian/ConjunctionRus.gf @@ -1,47 +1,108 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete ConjunctionRus of Conjunction = - CatRus ** open ResRus, Coordination, Prelude in { --- --- flags optimize=all_subs ; --- --- lin --- --- ConjS = conjunctSS ; --- DConjS = conjunctDistrSS ; --- --- ConjAdv = conjunctSS ; --- DConjAdv = conjunctDistrSS ; --- --- ConjNP conj ss = conjunctTable Case conj ss ** { --- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} --- } ; --- DConjNP conj ss = conjunctDistrTable Case conj ss ** { --- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} --- } ; --- --- ConjAP conj ss = conjunctTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- DConjAP conj ss = conjunctDistrTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- ----- These fun's are generated from the list cat's. --- --- BaseS = twoSS ; --- ConsS = consrSS comma ; --- BaseAdv = twoSS ; --- ConsAdv = consrSS comma ; --- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ; --- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ; --- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ; --- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ; --- --- lincat --- [S] = {s1,s2 : Str} ; --- [Adv] = {s1,s2 : Str} ; --- [NP] = {s1,s2 : Case => Str ; a : Agr} ; --- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete ConjunctionRus of Conjunction = + CatRus ** open ResRus, Coordination, Prelude in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + + ConjS = conjunctSS ; + DConjS = conjunctDistrSS ; + + ConjAdv = conjunctSS ; + DConjAdv = conjunctDistrSS ; + + ConjNP c xs = + conjunctTable PronForm c xs ** {n = conjNumber c.n xs.n ; + anim = xs.anim ; + p = xs.p; g = xs.g ; pron = xs.pron} ; + + + DConjNP c xs = + conjunctDistrTable PronForm c xs ** {n = conjNumber c.n xs.n ; + p = xs.p ; pron = xs.pron ; anim = xs.anim ; + g = xs.g } ; + + + ConjAP c xs = conjunctTable AdjForm c xs ** {p = xs.p} ; + + + DConjAP c xs = conjunctDistrTable AdjForm c xs ** {p = xs.p} ; + +-- These fun's are generated from the list cat's. + + BaseS = twoSS ; + ConsS = consrSS comma ; + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + + + ConsNP x xs = + consTable PronForm comma xs x ** + {n = conjNumber xs.n x.n ; g = conjPGender x.g xs.g ; + anim = conjAnim x.anim xs.anim ; + p = conjPerson xs.p x.p; pron = conjPron xs.pron x.pron} ; + + ConsAP x xs = consTable AdjForm comma xs x ** {p = andB xs.p x.p} ; + + + BaseAP x y = twoTable AdjForm x y ** {p = andB x.p y.p} ; + + BaseNP x y = twoTable PronForm x y ** {n = conjNumber x.n y.n ; + g = conjPGender x.g y.g ; p = conjPerson x.p y.p ; + pron = conjPron x.pron y.pron ; anim = conjAnim x.anim y.anim } ; + + + + + lincat + [S] = {s1,s2 : Str} ; + [Adv] = {s1,s2 : Str} ; + -- The structure is the same as for sentences. The result is either always plural + -- or plural if any of the components is, depending on the conjunction. + [NP] = { s1,s2 : PronForm => Str ; g: PronGen ; + anim : Animacy ; n : Number ; p : Person ; pron : Bool } ; + -- The structure is the same as for sentences. The result is a prefix adjective + -- if and only if all elements are prefix. + [AP] = {s1,s2 : AdjForm => Str ; p : Bool} ; + + + +oper + -- We have to define a calculus of numbers of persons. For numbers, +-- it is like the conjunction with $Pl$ corresponding to $False$. + + conjNumber : Number -> Number -> Number = \m,n -> case of { + => Sg ; + _ => Pl + } ; + +-- For persons, we let the latter argument win ("либо ты, либо я пойду" +-- but "либо я, либо ты пойдешь"). This is not quite clear. + + conjPerson : Person -> Person -> Person = \_,p -> + p ; + +-- For pron, we let the latter argument win - "Маша или моя мама" (Nominative case) +-- but - "моей или Машина мама" (Genetive case) both corresponds to +-- "Masha's or my mother"), which is actually not exactly correct, since +-- different cases should be used - "Машина или моя мама". + + conjPron : Bool -> Bool -> Bool = \_,p -> + p ; + +-- For gender in a similar manner as for person: +-- Needed for adjective predicates like: +-- "Маша или Оля - красивая", "Антон или Олег - красивый", +-- "Маша или Олег - красивый". +-- The later is not totally correct, but there is no correct way to say that. + + conjGender : Gender -> Gender -> Gender = \_,m -> m ; + conjPGender : PronGen -> PronGen -> PronGen = \_,m -> m ; + + conjAnim : Animacy -> Animacy -> Animacy = \_,m -> m ; + + +} + diff --git a/lib/resource-1.0/russian/IdiomRus.gf b/lib/resource-1.0/russian/IdiomRus.gf index 9f683eb07..5ebc56691 100644 --- a/lib/resource-1.0/russian/IdiomRus.gf +++ b/lib/resource-1.0/russian/IdiomRus.gf @@ -1,15 +1,37 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete IdiomRus of Idiom = CatRus ** open Prelude, ResRus in { --- --- flags optimize=all_subs ; --- --- lin --- ExistNP np = --- mkClause "there" (agrP3 np.a.n) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ; --- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ; --- GenericCl vp = mkClause "one" (agrP3 Sg) vp ; --- --- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete IdiomRus of Idiom = CatRus ** open Prelude, ResRus, MorphoRus in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + ExistNP = \bar -> + {s =\\b,clf => case b of + {Pos => verbByut.s ! (getActVerbForm clf (pgen2gen bar.g) Sg P3) + ++ bar.s ! PF Nom No NonPoss; + Neg => "не" ++ verbByut.s ! (getActVerbForm clf (pgen2gen bar.g) Sg P3) + ++ bar.s ! PF Nom No NonPoss + } +} ; + + + ImpersCl vp = {s= \\ b, clf => let ne= case b of {Pos =>[]; Neg =>""} + in + ne ++ vp.s! clf! (ASg Neut) ! P3 }; + +-- No direct correspondance in Russian. Usually expressed by infinitive: +-- "Если очень захотеть, можно в космос улететь" +-- (If one really wants one can fly into the space). +-- Note that the modal verb "can" is trasferred into adverb +-- "можно" (it is possible) in Russian +-- The closest subject is "ты" (you), which is omitted in the final sentence: +-- "Если очень захочешь, можешь в космос улететь" + + GenericCl vp = {s= \\ b, clf => let ne= case b of {Pos =>[]; Neg =>""} + in + ne ++ vp.s! clf! (ASg Masc) ! P3 }; + + ProgrVP vp = vp ; + +} + diff --git a/lib/resource-1.0/russian/LangRus.gf b/lib/resource-1.0/russian/LangRus.gf index 058daf51f..a91740233 100644 --- a/lib/resource-1.0/russian/LangRus.gf +++ b/lib/resource-1.0/russian/LangRus.gf @@ -1,23 +1,17 @@ --# -path=.:../abstract:../common:../../prelude - concrete LangRus of Lang = --- NounRus, --- VerbRus, --- AdjectiveRus, --- AdverbRus, --- NumeralRus, --- SentenceRus, --- QuestionRus, --- RelativeRus, --- ConjunctionRus, --- PhraseRus, --- TextX, --- StructuralRus, --- IdiomRus, --- LexiconRus - ** { - -flags startcat = Phr ; unlexer = text ; lexer = text ; - -} ; + NounRus, + VerbRus, + AdjectiveRus, + AdverbRus, + NumeralRus, + SentenceRus, + QuestionRus, + RelativeRus, + ConjunctionRus, + PhraseRus, + TextX, + StructuralRus, + IdiomRus, + LexiconRus ** { flags startcat = Phr ; unlexer = text ; lexer = text ;} ; diff --git a/lib/resource-1.0/russian/LexiconRus.gf b/lib/resource-1.0/russian/LexiconRus.gf index 095bb3f90..657176c3c 100644 --- a/lib/resource-1.0/russian/LexiconRus.gf +++ b/lib/resource-1.0/russian/LexiconRus.gf @@ -1,356 +1,404 @@ ---# -path=.:../abstract:../common:../../prelude - - --- -concrete LexiconRus of Lexicon = CatRus ** - open ParadigmsRus, IrregRus, Prelude in { --- ---flags --- optimize=values ; --- ---lin --- airplane_N = regN "airplane" ; --- answer_V2S = mkV2S (regV "answer") "to" ; --- apartment_N = regN "apartment" ; --- apple_N = regN "apple" ; --- art_N = regN "art" ; --- ask_V2Q = mkV2Q (regV "ask") [] ; --- baby_N = regN "baby" ; --- bad_A = mkADeg "bad" "badly" "worse" "worst" ; --- bank_N = regN "bank" ; --- beautiful_A = regADeg "beautiful" ; --- become_VA = mkVA (irregV "become" "became" "become") ; --- beer_N = regN "beer" ; --- beg_V2V = mkV2V (regDuplV "beg") [] "to" ; --- big_A = duplADeg "big" ; --- bike_N = regN "bike" ; --- bird_N = regN "bird" ; --- black_A = regADeg "black" ; --- blue_A = regADeg "blue" ; --- boat_N = regN "boat" ; --- book_N = regN "book" ; --- boot_N = regN "boot" ; --- boss_N = regN "boss" ; --- boy_N = regN "boy" ; --- bread_N = regN "bread" ; --- break_V2 = dirV2 (irregV "break" "broke" "broken") ; --- broad_A = regADeg "broad" ; --- brother_N2 = regN2 "brother" ; --- brown_A = regADeg "brown" ; --- butter_N = regN "butter" ; --- buy_V2 = dirV2 (irregV "buy" "bought" "bought") ; --- camera_N = regN "camera" ; --- cap_N = regN "cap" ; --- car_N = regN "car" ; --- carpet_N = regN "carpet" ; --- cat_N = regN "cat" ; --- ceiling_N = regN "ceiling" ; --- chair_N = regN "chair" ; --- cheese_N = regN "cheese" ; --- child_N = mk2N "child" "children" ; --- church_N = regN "church" ; --- city_N = regN "city" ; --- clean_A = regADeg "clean" ; --- clever_A = regADeg "clever" ; --- close_V2 = dirV2 (regV "close") ; --- coat_N = regN "coat" ; --- cold_A = regADeg "cold" ; --- come_V = (irregV "come" "came" "come") ; --- computer_N = regN "computer" ; --- country_N = regN "country" ; --- cousin_N = regN "cousin" ; --- cow_N = regN "cow" ; --- die_V = (regV "die") ; --- dirty_A = regADeg "dirty" ; --- distance_N3 = mkN3 (regN "distance") "from" "to" ; --- doctor_N = regN "doctor" ; --- dog_N = regN "dog" ; --- door_N = regN "door" ; --- drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ; --- easy_A2V = mkA2V (regA "easy") "for" ; --- eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ; --- empty_A = regADeg "empty" ; --- enemy_N = regN "enemy" ; --- factory_N = regN "factory" ; --- father_N2 = regN2 "father" ; --- fear_VS = mkVS (regV "fear") ; --- find_V2 = dirV2 (irregV "find" "found" "found") ; --- fish_N = mk2N "fish" "fish" ; --- floor_N = regN "floor" ; --- forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ; --- fridge_N = regN "fridge" ; --- friend_N = regN "friend" ; --- fruit_N = regN "fruit" ; --- fun_AV = mkAV (regA "fun") ; --- garden_N = regN "garden" ; --- girl_N = regN "girl" ; --- glove_N = regN "glove" ; --- gold_N = regN "gold" ; --- good_A = mkADeg "good" "well" "better" "best" ; --- go_V = (mkV "go" "goes" "went" "gone" "going") ; --- green_A = regADeg "green" ; --- harbour_N = regN "harbour" ; --- hate_V2 = dirV2 (regV "hate") ; --- hat_N = regN "hat" ; --- have_V2 = dirV2 (mkV "have" "has" "had" "had" "having") ; --- hear_V2 = dirV2 (irregV "hear" "heard" "heard") ; --- hill_N = regN "hill" ; --- hope_VS = mkVS (regV "hope") ; --- horse_N = regN "horse" ; --- hot_A = duplADeg "hot" ; --- house_N = regN "house" ; --- important_A = compoundADeg (regA "important") ; --- industry_N = regN "industry" ; --- iron_N = regN "iron" ; --- king_N = regN "king" ; --- know_V2 = dirV2 (irregV "know" "knew" "known") ; --- lake_N = regN "lake" ; --- lamp_N = regN "lamp" ; --- learn_V2 = dirV2 (regV "learn") ; --- leather_N = regN "leather" ; --- leave_V2 = dirV2 (irregV "leave" "left" "left") ; --- like_V2 = dirV2 (regV "like") ; --- listen_V2 = mkV2 (regV "listen") "to" ; --- live_V = (regV "live") ; --- long_A = regADeg "long" ; --- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ; --- love_N = regN "love" ; --- love_V2 = dirV2 (regV "love") ; --- man_N = mk2N "man" "men" ; --- married_A2 = mkA2 (regA "married") "to" ; --- meat_N = regN "meat" ; --- milk_N = regN "milk" ; --- moon_N = regN "moon" ; --- mother_N2 = regN2 "mother" ; --- mountain_N = regN "mountain" ; --- music_N = regN "music" ; --- narrow_A = regADeg "narrow" ; --- new_A = regADeg "new" ; --- newspaper_N = regN "newspaper" ; --- oil_N = regN "oil" ; --- old_A = regADeg "old" ; --- open_V2 = dirV2 (regV "open") ; --- paint_V2A = mkV2A (regV "paint") [] ; --- paper_N = regN "paper" ; --- paris_PN = regPN "Paris" nonhuman ; --- peace_N = regN "peace" ; --- pen_N = regN "pen" ; --- planet_N = regN "planet" ; --- plastic_N = regN "plastic" ; --- play_V2 = dirV2 (regV "play") ; --- policeman_N = regN "policeman" ; --- priest_N = regN "priest" ; --- probable_AS = mkAS (regA "probable") ; --- queen_N = regN "queen" ; --- radio_N = regN "radio" ; --- rain_V0 = mkV0 (regV "rain") ; --- read_V2 = dirV2 (irregV "read" "read" "read") ; --- red_A = duplADeg "red" ; --- religion_N = regN "religion" ; --- restaurant_N = regN "restaurant" ; --- river_N = regN "river" ; --- rock_N = regN "rock" ; --- roof_N = regN "roof" ; --- rubber_N = regN "rubber" ; --- run_V = (irregDuplV "run" "ran" "run") ; --- say_VS = mkVS (irregV "say" "said" "said") ; --- school_N = regN "school" ; --- science_N = regN "science" ; --- sea_N = regN "sea" ; --- seek_V2 = dirV2 (irregV "seek" "sought" "sought") ; --- see_V2 = dirV2 (irregV "see" "saw" "seen") ; --- sell_V3 = dirV3 (irregV "sell" "sold" "sold") "to" ; --- send_V3 = dirV3 (irregV "send" "sent" "sent") "to" ; --- sheep_N = mk2N "sheep" "sheep" ; --- ship_N = regN "ship" ; --- shirt_N = regN "shirt" ; --- shoe_N = regN "shoe" ; --- shop_N = regN "shop" ; --- short_A = regADeg "short" ; --- silver_N = regN "silver" ; --- sister_N = regN "sister" ; --- sleep_V = (irregV "sleep" "slept" "slept") ; --- small_A = regADeg "small" ; --- snake_N = regN "snake" ; --- sock_N = regN "sock" ; --- speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ; --- star_N = regN "star" ; --- steel_N = regN "steel" ; --- stone_N = regN "stone" ; --- stove_N = regN "stove" ; --- student_N = regN "student" ; --- stupid_A = regADeg "stupid" ; --- sun_N = regN "sun" ; --- switch8off_V2 = dirV2 (partV (regV "switch") "off") ; --- switch8on_V2 = dirV2 (partV (regV "switch") "on") ; --- table_N = regN "table" ; --- talk_V3 = mkV3 (regV "talk") "to" "about" ; --- teacher_N = regN "teacher" ; --- teach_V2 = dirV2 (irregV "teach" "taught" "taught") ; --- television_N = regN "television" ; --- thick_A = regADeg "thick" ; --- thin_A = duplADeg "thin" ; --- train_N = regN "train" ; --- travel_V = (regDuplV "travel") ; --- tree_N = regN "tree" ; --- ---- trousers_N = regN "trousers" ; --- ugly_A = regADeg "ugly" ; --- understand_V2 = dirV2 (irregV "understand" "understood" "understood") ; --- university_N = regN "university" ; --- village_N = regN "village" ; --- wait_V2 = mkV2 (regV "wait") "for" ; --- walk_V = (regV "walk") ; --- warm_A = regADeg "warm" ; --- war_N = regN "war" ; --- watch_V2 = dirV2 (regV "watch") ; --- water_N = regN "water" ; --- white_A = regADeg "white" ; --- window_N = regN "window" ; --- wine_N = regN "wine" ; --- win_V2 = dirV2 (irregDuplV "win" "won" "won") ; --- woman_N = mk2N "woman" "women" ; --- wonder_VQ = mkVQ (regV "wonder") ; --- wood_N = regN "wood" ; --- write_V2 = dirV2 (irregV "write" "wrote" "written") ; --- yellow_A = regADeg "yellow" ; --- young_A = regADeg "young" ; --- --- do_V2 = dirV2 (mkV "do" "does" "did" "done" "doing") ; --- now_Adv = mkAdv "now" ; --- already_Adv = mkAdv "already" ; --- song_N = regN "song" ; --- add_V3 = dirV3 (regV "add") "to" ; --- number_N = regN "number" ; --- put_V2 = mkV2 (irregDuplV "put" "put" "put") [] ; --- stop_V = regDuplV "stop" ; --- jump_V = regV "jump" ; --- --- left_Ord = ss "left" ; --- right_Ord = ss "right" ; --- far_Adv = mkAdv "far" ; --- correct_A = (regA "correct") ; --- dry_A = regA "dry" ; --- dull_A = regA "dull" ; --- full_A = regA "full" ; --- heavy_A = regA "heavy" ; --- near_A = regA "near" ; --- rotten_A = (regA "rotten") ; --- round_A = regA "round" ; --- sharp_A = regA "sharp" ; --- smooth_A = regA "smooth" ; --- straight_A = regA "straight" ; --- wet_A = regA "wet" ; ---- --- wide_A = regA "wide" ; --- animal_N = regN "animal" ; --- ashes_N = regN "ash" ; -- FIXME: plural only? --- back_N = regN "back" ; --- bark_N = regN "bark" ; --- belly_N = regN "belly" ; --- blood_N = regN "blood" ; --- bone_N = regN "bone" ; --- breast_N = regN "breast" ; --- cloud_N = regN "cloud" ; --- day_N = regN "day" ; --- dust_N = regN "dust" ; --- ear_N = regN "ear" ; --- earth_N = regN "earth" ; --- egg_N = regN "egg" ; --- eye_N = regN "eye" ; --- fat_N = regN "fat" ; --- feather_N = regN "feather" ; --- fingernail_N = regN "fingernail" ; --- fire_N = regN "fire" ; --- flower_N = regN "flower" ; --- fog_N = regN "fog" ; --- foot_N = mk2N "foot" "feet" ; --- forest_N = regN "forest" ; --- grass_N = regN "grass" ; --- guts_N = regN "gut" ; -- FIXME: no singular --- hair_N = regN "hair" ; --- hand_N = regN "hand" ; --- head_N = regN "head" ; --- heart_N = regN "heart" ; --- horn_N = regN "horn" ; --- husband_N = genderN masculine (regN "husband") ; --- ice_N = regN "ice" ; --- knee_N = regN "knee" ; --- leaf_N = mk2N "leaf" "leaves" ; --- leg_N = regN "leg" ; --- liver_N = regN "liver" ; --- louse_N = mk2N "louse" "lice" ; --- mouth_N = regN "mouth" ; --- name_N = regN "name" ; --- neck_N = regN "neck" ; --- night_N = regN "night" ; --- nose_N = regN "nose" ; --- person_N = genderN human (regN "person") ; --- rain_N = regN "rain" ; --- road_N = regN "road" ; --- root_N = regN "root" ; --- rope_N = regN "rope" ; --- salt_N = regN "salt" ; --- sand_N = regN "sand" ; --- seed_N = regN "seed" ; --- skin_N = regN "skin" ; --- sky_N = regN "sky" ; --- smoke_N = regN "smoke" ; --- snow_N = regN "snow" ; --- stick_N = regN "stick" ; --- tail_N = regN "tail" ; --- tongue_N = regN "tongue" ; --- tooth_N = mk2N "tooth" "teeth" ; --- wife_N = genderN feminine (mk2N "wife" "wives") ; --- wind_N = regN "wind" ; --- wing_N = regN "wing" ; --- worm_N = regN "worm" ; --- year_N = regN "year" ; --- blow_V = blow_V ; --- breathe_V = dirV2 (regV "breathe") ; --- burn_V = burn_V ; --- dig_V = dig_V ; --- fall_V = fall_V ; --- float_V = regV "float" ; --- flow_V = regV "flow" ; --- fly_V = fly_V ; --- freeze_V = freeze_V ; --- give_V3 = dirV3 give_V "to" ; --- laugh_V = regV "laugh" ; --- lie_V = lie_V ; --- play_V = regV "play" ; --- sew_V = sew_V ; --- sing_V = sing_V ; --- sit_V = sit_V ; --- smell_V = regV "smell" ; --- spit_V = spit_V ; --- stand_V = stand_V ; --- swell_V = swell_V ; --- swim_V = swim_V ; --- think_V = think_V ; --- turn_V = regV "turn" ; --- vomit_V = regV "vomit" ; --- --- bite_V2 = dirV2 bite_V ; --- count_V2 = dirV2 (regV "count") ; --- cut_V2 = dirV2 cut_V ; --- fear_V2 = dirV2 (regV "fear") ; --- fight_V2 = dirV2 fight_V ; --- hit_V2 = dirV2 hit_V ; --- hold_V2 = dirV2 hold_V ; --- hunt_V2 = dirV2 (regV "hunt") ; --- kill_V2 = dirV2 (regV "kill") ; --- pull_V2 = dirV2 (regV "pull") ; --- push_V2 = dirV2 (regV "push") ; --- rub_V2 = dirV2 (regDuplV "rub") ; --- scratch_V2 = dirV2 (regV "scratch") ; --- split_V2 = dirV2 split_V ; --- squeeze_V2 = dirV2 (regV "squeeze") ; --- stab_V2 = dirV2 (regDuplV "stab") ; --- suck_V2 = dirV2 (regV "suck") ; --- throw_V2 = dirV2 throw_V ; --- tie_V2 = dirV2 (regV "tie") ; --- wash_V2 = dirV2 (regV "wash") ; --- wipe_V2 = dirV2 (regV "wipe") ; --- ----- other_A = regA "other" ; --- -} +--# -path=.:../abstract:../common:../../prelude + +-- +concrete LexiconRus of Lexicon = CatRus ** + open ParadigmsRus, Prelude, StructuralRus, MorphoRus in { +--, IrregRus +flags + optimize=values ; + coding=utf8 ; +lin + airplane_N = nTelefon "самолет" ; + answer_V2S = tvDir (mkRegVerb imperfective first "отвеча" "ю" "отвечал" "отвечай" "отвечать" ); + apartment_N = nMashina "квартир" ; + apple_N = nChislo "яблок" ; + art_N = nChislo "искусств" ; + ask_V2Q = tvDir (mkRegVerb imperfective first "спрашива" "ю" "спрашивал" "спрашивай" "спрашивать") ; + baby_N = nMalush "малыш"; + bad_A = AKakoj_Nibud "плох" "" "хуже"; + bank_N = nBank "банк" ; + beautiful_A = AStaruyj "красив" "красивее"; + become_VA = mkRegVerb perfective second "станов" "лю" "стал" "стань" "стать" ; + beer_N = nChislo "пив" ; + beg_V2V = tvDir (mkRegVerb imperfective second "про" "шу" "просил" "проси" "просить" ); + big_A = AKakoj_Nibud "больш" "" "больше" ; + bike_N = nTelefon "велосипед" ; + bird_N = nEdinica "птиц" ; + black_A = AStaruyj "чёрн" "чернее"; + blue_A = AMolodoj "голуб" "голубее"; + boat_N = nMashina "лодк" ; + book_N = nMashina "книг" ; + boot_N = nBank "сапог" ; + boss_N = nStomatolog "начальник" ; + boy_N = nStomatolog "мальчик" ; + bread_N = nAdres "хлеб" ; + break_V2 = tvDir (mkRegVerb imperfective first "прерыва" "ю" "прерывал" "прерывай" "прерывать" ); + broad_A = AMalenkij "широк" "шире"; + brother_N2 = mkN2 (nBrat ",брат") ; + brown_A = AStaruyj "коричнев" "коричневее"; + butter_N = nChislo "масл"; + buy_V2 = tvDir (mkRegVerb imperfective first "покупа" "ю" "покупал" "покупай" "покупать" ); + camera_N = nMashina "kamer" ; + cap_N = nNoga "чашк" ; -- чаш-ек Pl-Gen + car_N = nMashina "машин" ; + carpet_N = mkN "ковёр" "ковра" "ковру" "ковёр" "ковром" "ковре" "ковры" "ковров" "коврам" "ковры" "коврами" "коврах" masculine inanimate; + cat_N = nMashina "кошк" ; +ceiling_N = nPotolok "потол" ; + chair_N = nStul "стул" ; +cheese_N = nTelefon "сыр" ; +child_N = mkN "ребёнок" "ребёнка" "ребёнку" "ребёнка" "ребёнком" "ребёнке" "дети" "детей" "детям" "детей" "детьми" "детях" masculine animate ; + church_N = mkN "церковь" "церкви" "церкви" "церковь" "церковью" "церкви" "церкви" "церквей" "церквям" "церкви" "церквями" "церквях" masculine inanimate; + city_N = nAdres "город" ; + clean_A = AStaruyj "чист" "чище"; + clever_A = AStaruyj "умн" "умнее"; + close_V2= tvDir (mkRegVerb imperfective first "закрыва" "ю" "закрывал" "закрывай" "закрывать" ); + coat_N = mkIndeclinableNoun "пальто" masculine inanimate ; + cold_A = AStaruyj "холодн" "холоднее"; + come_V = mkRegVerb imperfective first "прихо" "жу" "приходил" "приходи" "приходить" ; + computer_N = nTelefon "компьютер" ; + country_N = nMashina "стран" ; +cousin_N = nTelefon "кузен" ; +cow_N = nMashina "коров" ; +die_V = mkRegVerb imperfective first "умира" "ю" "умирал" "умрай" "умирать" ; +dirty_A = AStaruyj "грязн" "грязнее" ; +doctor_N = nAdres "доктор" ; +dog_N = nNoga "собак" ; +door_N = nBol "двер" ; +drink_V2 = tvDir (mkRegVerb imperfective firstE "пь" "ю" "пил" "пей" "пить" ); +eat_V2 = tvDir (mkRegVerb imperfective first "куша" "ю" "кушал" "кушай" "кушать" ); +enemy_N = nStomatolog "враг" ; +factory_N = nNoga "фабрик" ; +father_N2 = mkN2 (mkN "отец" "отца" "отцу" "отца" "отцом" "отце" "отцы" "отцов" "отцам" "отцов" "отцами" "отцах" masculine animate); +fear_VS= mkRegVerb imperfective second "бо" "ю" "боял" "бой" "боять" ; +find_V2 = tvDir (mkRegVerb imperfective second "нахо" "жу" "находил" "находи" "находить" ); +fish_N = nMashina "рыб" ; +floor_N = nTelefon "пол" ; +forget_V2= tvDir (mkRegVerb imperfective first "забыва" "ю" "забывал" "забывай" "забывать" ); +fridge_N = nBank "холодильник" ; +friend_N = mkN "друг" "друга" "другу" "друга" "другом" "друге" "друзья" "друзей" "друзьям" "друзей" "дузьями" "друзьях" masculine animate; +fruit_N = nTelefon "фрукт" ; +garden_N = nTelefon "сад" ; +girl_N = nNoga "девочк" ; +glove_N = nNoga "перчатк" ; +gold_N = nChislo "золот" ; +good_A = AKhoroshij "хорош" "лучше" ; +go_V= mkRegVerb imperfective second "хо" "жу" "ходил" "ходи" "ходить" ; +green_A = AStaruyj "зелен" "зеленее" ; +harbour_N = nTelefon "залив" ; +hate_V2= tvDir (mkRegVerb imperfective second "ненави" "жу" "ненавидел" "ненавидь" "ненавидеть" ); +hat_N = nMashina "шляп" ; +have_V2= tvDir (mkRegVerb imperfective first "име" "ю" "имел" "имей" "иметь" ); +hear_V2= tvDir (mkRegVerb imperfective first "слуша" "ю" "слушал" "слушай" "слушать" ); +hill_N = nTelefon "холм" ; +hope_VS= mkRegVerb imperfective first "наде" "ю" "надеял" "надей" "надеять" ; +horse_N = nBol "лошад" ; +hot_A = AKhoroshij "горяч" "горячее" ; +house_N = nAdres "дом" ; +important_A = AStaruyj "важн" "важнее" ; +industry_N = nChislo "производств" ; +iron_N = nChislo "желез" ; +king_N = mkN "король" "короля" "королю" "короля" "королем" "короле" "короли" "королей" "королям" "королей" "королями" "королях" masculine animate; +know_V2= tvDir (mkRegVerb imperfective first "зна" "ю" "знал" "знай" "знать" ); +lake_N = nChislo "озер" ; +lamp_N = nMashina "ламп" ; +learn_V2= tvDir (mkRegVerb imperfective second "уч" "у" "учил" "учи" "учить" ); +leather_N = nEdinica "кож" ; +leave_V2= tvDir (mkRegVerb imperfective second "ухож" "у" "уходил" "уходи" "уходить" ); +like_V2= tvDir (mkRegVerb imperfective second "нрав" "лю" "нравил" "нравь" "нравить" ); +listen_V2= tvDir (mkRegVerb imperfective first "слуша" "ю" "слушал" "слушай" "слушать" ); +live_V= mkRegVerb imperfective firstE "жив" "у" "жил" "живи" "жить" ; +long_A = AStaruyj "длинн" "длиннее" ; +lose_V2 = tvDir (mkRegVerb imperfective first "теря" "ю" "терял" "теряй" "терять" ); +love_N = nBol "любов" ; +love_V2= tvDir (mkRegVerb imperfective second "люб" "лю" "любил" "люби" "любить" ); +man_N = nStomatolog "человек" ; +meat_N =nChislo "мяс" ; +milk_N = nChislo "молок" ; +moon_N = nMashina "лун" ; +mother_N2 = mkN2 ( nMashina "мам") ; +mountain_N = nMashina "гор" ; +music_N = nNoga "музык" ; +narrow_A = AStaruyj "узк" "уже" ; +new_A = AStaruyj "нов" "новее" ; +newspaper_N = nMashina "газет" ; +oil_N = nBol "нефть" ; +old_A = AStaruyj "стар" "старше" ; +open_V2= tvDir (mkRegVerb imperfective first "открыва" "ю" "открывал" "открывай" "открывать" ); +paper_N = nNoga "бумаг" ; +peace_N = nTelefon "мир" ; +pen_N = nNoga "ручк" ; +planet_N = nMashina "планет" ; +plastic_N = nMashina "пластмасс" ; +play_V2 = tvDir (mkRegVerb imperfective first "игра" "ю" "играл" "играй" "играть" ); +policeman_N = nTelefon "милиционер" ; +priest_N = nStomatolog "священник" ; +queen_N = nMashina "королев" ; +radio_N = mkIndeclinableNoun "радио" neuter inanimate; +read_V2 = tvDir (mkRegVerb imperfective first "чита" "ю" "читал" "читай" "читать" ); +red_A = AStaruyj "красн" "краснее" ; +religion_N = nMalyariya "религи" ; +restaurant_N = nTelefon "ресторан" ; +river_N = nNoga "рек" ; +rock_N = nUroven "кам" ; +roof_N = nEdinica "крыш" ; +rubber_N = nMashina "резин" ; +run_V = mkRegVerb imperfective first "бега" "ю" "бегал" "бегай" "бегать" ; +say_VS = mkRegVerb imperfective second "говор" "ю" "говорил" "говори" "говорить" ; +school_N = nMashina "школ" ; +science_N = nEdinica "наук" ; +sea_N = nProizvedenie "мор" ; +seek_V2 = tvDir (mkRegVerb imperfective first "ищ" "у" "искал" "ищи" "искать" ); +see_V2 = tvDir (mkRegVerb imperfective second "виж" "у" "видел" "видь" "видеть" ); +sell_V3 = tvDirDir (mkRegVerb imperfective firstE "прода" "ю" "продавал" "продавай" "продавать" ); +send_V3 = tvDirDir (mkRegVerb imperfective first "посыла" "ю" "посылал" "посылай" "посылать" ); +sheep_N = nMashina "овц" ; +ship_N = nNol "корабл" ; +shirt_N = nNoga "рубашк" ; +shoe_N = mkN "туфля" "туфли" "туфле" "туфлю" "туфлей" "туфле" "туфли" "туфель" "туфлям" "туфли" "туфлями" "туфлях" masculine inanimate; +shop_N = nTelefon "магазин" ; +short_A = AMalenkij "коротк" "короче" ; +silver_N = nChislo "серебр" ; +sister_N = nMashina "сестр" ; +sleep_V = mkRegVerb imperfective second "сп" "лю" "спал" "спи" "спать" ; +small_A = AMalenkij "маленьк" "меньше" ; +snake_N = nTetya"зме" ; +sock_N = nPotolok "нос" ; +speak_V2 = tvDir (mkRegVerb imperfective second "говор" "ю" "говорил" "говори" "говорить" ); +star_N = nMashina "звезд" ; +steel_N = nBol "стал" ; +stone_N = nNol "камен" ; +stove_N = nBol "печ" ; +student_N = nTelefon "студент" ; +stupid_A = AMolodoj "тупой" "тупее" ; +sun_N = mkN "солнце" "солнца" "солнцу" "солнце" "солнцем" "солнце" "солнца" "солнц" "солнцам" "солнца" "солнцами" "солнцах" neuter inanimate; +switch8off_V2 = tvDir (mkRegVerb imperfective first "выключа" "ю" "выключал" "выключай" "выключать") ; +switch8on_V2 = tvDir (mkRegVerb imperfective first "включа" "ю" "включал" "включай" "включать") ; +table_N = nTelefon "стол" ; +teacher_N = nNol "учител" ; +teach_V2 = tvDir (mkRegVerb imperfective second "уч" "у" "учил" "учи" "учить" ); +television_N = nProizvedenie "телевидени" ; +thick_A = AStaruyj "толст" "толще" ; +thin_A = AMalenkij "тонк" "тоньше" ; +train_N = nAdres "поезд" ; +travel_V = mkRegVerb imperfective first "путешеству" "ю" "путешествовал" "путешествуй" "путешествовать" ; +tree_N = nChislo "дерев" ; +--trousers_N = mkN "" "" "" "" "" "" "штаны" "штанов" "штанам" "штаны" "штанами" "штанах" masculine inanimate; +ugly_A = AStaruyj "некрасив" "некрасивее" ; +understand_V2 = tvDir (mkRegVerb imperfective first "понима" "ю" "понимал" "понимай" "понимать" ); +university_N = nTelefon "университет" ; +village_N = nMalyariya "деревн" ; +wait_V2 = tvDir (mkRegVerb imperfective firstE "жд" "у" "ждал" "жди" "ждать" ); +walk_V = mkRegVerb imperfective first "гуля" "ю" "гулял" "гуляй" "гулять" ; +warm_A = AStaruyj "тёпл" "теплее" ; +war_N = nMashina "войн" ; +watch_V2 = tvDir (mkRegVerb imperfective second "смотр" "ю" "смотрел" "смотри" "смотреть" ); +water_N = nMashina "вод" ; +white_A = AStaruyj "бел" "белее" ; +window_N = nChislo "окн" ; +wine_N = nChislo "вин" ; +win_V2 = tvDir (mkRegVerb imperfective first "выигрыва" "ю" "выигрывал" "выигрывай" "выигрывать" ); +woman_N = nZhenchina "женщин" ; +wood_N = nChislo "дерев" ; +write_V2 = tvDir (mkRegVerb imperfective first "пиш" "у" "писал" "пиши" "писать" ); +yellow_A = AStaruyj "жёлт" "желтее" ; +young_A = AMolodoj "молод" "моложе"; + + do_V2 = tvDir (mkRegVerb imperfective first "дела" "ю" "делал" "делай" "делать" ); + now_Adv = mkAdv "сейчас" ; + already_Adv = mkAdv "уже" ; + song_N = nTetya "песн" ; + add_V3 = mkV3 (mkRegVerb imperfective first "складыва" "ю" "складывал" "складывай" "складывать" ) "" "в" accusative accusative; + number_N = nChislo "числ" ; + put_V2 = tvDir (mkRegVerb imperfective firstE "клад" "у" "клал" "клади" "класть" ); + stop_V = mkRegVerb imperfective first "останавлива" "ю" "останавливал" "останавливай" "останавливать"; + jump_V = mkRegVerb imperfective first "прыга" "ю" "прыгал" "прыгай" "прыгать" ; + +distance_N3 = mkN3 (nProizvedenie "расстоян") from_Prep to_Prep ; + +-- in Russian combinations with verbs are expressed with adverbs: +-- "легко понять" ("easy to understand"), which is different from +-- adjective expression "легкий для понимания" ("easy for understanding") +-- So the next to words are adjectives, since there are such adjectives +-- in Russian, but to use them with verb would be wrong in Russian: +fun_AV = AStaruyj "весёл" "веселее"; +easy_A2V = mkA2 (AMalenkij "легк" "легче") "для" genitive ; + +empty_A = AMolodoj "пуст" "пустее"; +married_A2 = mkA2 (adjInvar "замужем") "за" instructive ; +paint_V2A = tvDir (mkRegVerb imperfective first "рису" "ю" "рисовал" "рисуй" "рисовать" ) ; + probable_AS = AStaruyj "возможный" "возможнее"; +-- rain_V0 No such verb in Russian! +talk_V3 = mkV3 (mkRegVerb imperfective second "говор" "ю" "говорил" "говори" "говорить" ) "с" "о" instructive prepositional; +wonder_VQ = mkRegVerb imperfective first "интересу" "ю" "интересовал" "интересуй" "интересовать"; + + -- Nouns + + animal_N = nZhivotnoe "животн" ; + ashes_N = nPepel "пеп" ; + back_N = nMashina "спин" ; + bark_N = mkN "лай" "лая" "лаю" "лай" "лаем" "лае" "лаи" "лаев" "лаям" "лаи" "лаями" "лаях" masculine inanimate; + belly_N = nTelefon "живот" ; + bird_N = nEdinica "птиц" ; + blood_N = nBol "кров" ; + bone_N = nBol "кост" ; + breast_N = nBol "грудь" ; + + cloud_N = nChislo "облак" ; + day_N = mkN "день" "дня" "дню" "день" "днём" "дне" "дни" "дней" "дням" "дни" "днями" "днях" masculine inanimate ; + + dust_N = nBol "пыл" ; + ear_N = nChislo "ухо" ; + earth_N = nTetya "земл" ; + egg_N = nChislo "яйц" ; + eye_N = nAdres "глаз" ; + fat_N = nBank "жир" ; + +-- father_N = UseN2 father_N2 ; + feather_N = mkN "перо" "пера" "перу" "пера" "пером" "пере" "перья" "перьев" "перьям" "перьев" "перьями" "перьях" neuter inanimate ; + fingernail_N = mkN "ноготь" "ногтя" "ногтю" "ногтя" "ногтем" "ногте" "ногти" "ногтей" "ногтям" "ногтей" "ногтями" "ногтях" masculine inanimate ; + fire_N = mkN "огонь" "огня" "огню" "огня" "огнём" "огне" "огни" "огней" "огням" "огней" "огнями" "огнях" masculine inanimate ; + fish_N = nMashina "рыб" ; + flower_N = mkN "отец" "отца" "отцу" "отца" "отцом" "отце" "отцы" "отцов" "отцам" "отцов" "отцами" "отцах" masculine animate ; + fog_N = nTelefon "туман" ; + foot_N = nTetya "ступн" ; + forest_N = nAdres "лес" ; + fruit_N = nTelefon "фрукт"; + grass_N = nMashina "трав" ; + guts_N = nBol "внутренност" ; + hair_N = nTelefon "волос" ; + hand_N = nNoga "рук" ; + head_N = nMashina "голов" ; + heart_N = mkN "сердце" "сердца" "сердцу" "сердца" "сердцем" "сердце" "сердца" "сердец" "сердцам" "сердец" "сердцами" "сердцах" neuter inanimate; + horn_N = nAdres "рог" ; + husband_N = mkN "муж" "мужа" "мужу" "мужа" "мужем" "муже" "мужья" "мужей" "мужьям" "мужей" "мужьями" "мужьях" masculine animate ; + ice_N = mkN "лёд" "льда" "льду" "льда" "льдом" "льде" "льды" "льдов" "льдам" "льдов" "льдами" "льдах" masculine inanimate ; + knee_N = mkN "колено" "колена" "колену" "колена" "коленом" "колене" "колени" "колен" "коленам" "колен" "коленями" "коленях" neuter inanimate ; + lake_N = nChislo "озер" ; + leaf_N = nStul "лист" ; + leg_N = nNoga "ног" ; + liver_N = nBol "печен" ; + louse_N = mkN "вошь" "вши" "вши" "вошь" "вошью" "вше" "вши" "вшей" "вшам" "вшей" "вшами" "вшах" feminine animate ; + + meat_N = nChislo "мяс" ; + moon_N = nMashina "лун" ; + + + mountain_N = nMashina "гор" ; + mouth_N = mkN "рот" "рта" "рту" "рот" "ртом" "рте" "рты" "ртов" "ртам" "рты" "ртами" "ртах" masculine inanimate; + name_N = mkN "имя" "имени" "имени" "имя" "именем" "имени" "имена" "имён" "именам" "имена" "именами" "именах" neuter inanimate; + neck_N = nTetya "ше" ; + night_N = nBol "ноч" ; + nose_N = nTelefon "нос" ; + person_N = nBol "личность" ; + rain_N = nNol "дожд" ; + + road_N = nNoga "дорог" ; + root_N = nUroven "кор" ; + rope_N = nNoga "веревк" ; + salt_N = nBol "сол" ; + sand_N = mkN "песок" "песка" "песку" "песок" "песком" "песке" "пески" "песков" "пескам" "песков" "песками" "песках" masculine inanimate ; + sea_N = nProizvedenie "мор" ; + seed_N = mkN "семя" "семени" "семении" "семя" "семенем" "семени" "семена" "семян" "семенам" "семена" "семенами" "семенах" neuter inanimate ; + skin_N = nEdinica "кож" ; + sky_N = mkN "небо" "неба" "небу" "небо" "небом" "небе" "небеса" "небес" "небесам" "небес" "небесами" "небесах" neuter inanimate ; + smoke_N = nTelefon "дым" ; + snake_N = nTetya "зме" ; + snow_N = nAdres "снег" ; + star_N = nMashina "звезд" ; + stick_N = nNoga "палк" ; + + + tail_N = nTelefon "хвост" ; + tongue_N = nBank "язык" ; + tooth_N = nTelefon "зуб" ; + tree_N = nChislo "дерев" ; + water_N = nMashina "вод" ; + wife_N = nMashina "жен" ; + wind_N = mkN "ветер" "ветра" "ветру" "ветер" "ветром" "ветра" "ветров" "ветра" "ветрам" "ветров" "ветрами" "ветрах" masculine inanimate ; + wing_N = mkN "крыло" "крыла" "крылу" "крыло" "крылом" "крыле" "крылья" "крыльев" "крыльям" "крылья" "крыльями" "крыльях" neuter inanimate ; + + worm_N = nNol "черв" ; + year_N = nAdres "год" ; + + +-- Verbs + + bite_V2 = tvDir (mkRegVerb imperfective first "куса" "ю" "кусал" "кусай" "кусать"); + blow_V = mkRegVerb imperfective first "ду" "ю" "дул" "дуй" "дуть" ; + breathe_V = mkRegVerb imperfective second "дыш" "у" "дышал" "дыши" "дышать" ; + burn_V = mkRegVerb imperfective second "гор" "ю" "горел" "гори" "гореть" ; + count_V2 = tvDir (mkRegVerb imperfective first "счита" "ю" "считал" "считай" "считать" ) ; + cut_V2 = tvDir (mkRegVerb imperfective first "реж" "у" "резал" "режь" "резать" ) ; + dig_V = mkRegVerb imperfective first "копа" "ю" "копал" "копай" "копать" ; + + + fall_V = mkRegVerb imperfective first "пада" "ю" "падал" "падай" "падать" ; + + fight_V2 = tvDir (mkRegVerb imperfective firstE "дер" "у" "драл" "дери" "драть" ) ; + float_V = mkRegVerb imperfective firstE "плыв" "у" "плыл" "плыви" "плыть" ; + flow_V = mkRegVerb imperfective firstE "тек" "у" "тёк" "теки" "течь" ; + fly_V = mkRegVerb imperfective second "лета" "ю" "летал" "летай" "летать" ; + freeze_V = mkRegVerb imperfective first "замерза" "ю" "замерзал" "замерзай" "замерзать" ; + give_V3 = tvDirDir (mkRegVerb imperfective firstE "да" "ю" "давал" "давай" "давать" ) ; + + hit_V2 = tvDir (mkRegVerb imperfective first "ударя" "ю" "ударял" "ударяй" "ударять" ); + hold_V2 = tvDir (mkRegVerb imperfective second "держ" "у" "держал" "держи" "держать" ); + hunt_V2 = tvDir (mkRegVerb imperfective second "охоч" "у" "охотил" "охоть" "охотить" ) ; + kill_V2 = tvDir (mkRegVerb imperfective first "убива" "ю" "убивал" "убивай" "убивать" ) ; + + laugh_V = mkRegVerb imperfective firstE "сме" "ю" "смеял" "смей" "смеять" ; + lie_V = mkRegVerb imperfective firstE "лг" "у" "лгал" "лги" "лгать" ; + play_V = mkRegVerb imperfective first "игра" "ю" "играл" "играй" "играть" ; + pull_V2 = tvDir (mkRegVerb imperfective first "тян" "у" "тянул" "тяни" "тянуть" ) ; + push_V2 = tvDir (mkRegVerb imperfective first "толка" "ю" "толкал" "толкай" "толкать" ); + rub_V2 = tvDir (mkRegVerb imperfective firstE "тр" "у" "тёр" "три" "тереть" ); + + scratch_V2 = tvDir (mkRegVerb imperfective first "чеш" "у" "чесал" "чеши" "чесать" ) ; + + sew_V = mkRegVerb imperfective firstE "шь" "ю" "шил" "шей" "шить" ; + sing_V = mkRegVerb imperfective firstE "по" "ю" "пел" "пой" "петь" ; + sit_V = mkVerbum imperfective "сижу" "сидишь" "сидит" "сидим" "сидите" "сидят" "сидел" "сиди" "сидеть" ; + smell_V = mkRegVerb imperfective first "пахн" "у" "пахнул" "пахни" "пахнуть" ; + spit_V = mkRegVerb imperfective firstE "плю" "ю" "плевал" "плюй" "плевать" ; + split_V2 = tvDir (mkRegVerb imperfective first "разбива" "ю" "разбивал" "разбей" "разбивать" ) ; + squeeze_V2 = tvDir (mkRegVerb imperfective first "сжима" "ю" "сжимал" "сжимай" "сжимать" ) ; + stab_V2 = tvDir (mkRegVerb imperfective first "кол" "ю" "колол" "коли" "колоть" ) ; + stand_V = mkRegVerb imperfective second "сто" "ю" "стоял" "стой" "стоять" ; + suck_V2 = tvDir (mkRegVerb imperfective firstE "сос" "у" "сосал" "соси" "сосать") ; + swell_V = mkRegVerb imperfective first "опуха" "ю" "опухал" "опухай" "опухать" ; + swim_V = mkRegVerb imperfective first "плава" "ю" "плавал" "плавай" "плавать" ; + think_V = mkRegVerb imperfective first "дума" "ю" "думал" "думай" "думать" ; + throw_V2 = tvDir (mkRegVerb imperfective first "броса" "ю" "бросал" "бросай" "бросать" ) ; + tie_V2 = tvDir (mkRegVerb imperfective first "вяж" "у" "вязал" "вяжи" "вязать") ; + turn_V = mkRegVerb imperfective first "поворачива" "ю" "поворачивал" "поворачивай" "поворачивать" ; + vomit_V = mkRegVerb imperfective firstE "рв" "у" "рвал" "рви" "рвать" ; + wash_V2 = tvDir (mkRegVerb imperfective first "мо" "ю" "мыл" "мой" "мыть" ) ; + wipe_V2 = tvDir (mkRegVerb imperfective first "вытира" "ю" "вытирал" "вытирай" "вытирать" ); + + + correct_A = AStaruyj "правильн" "правильнее"; + dry_A = AMolodoj "сух" "суше"; + + dull_A = AStaruyj "скучн" "скучнее"; + far_Adv = mkAdv "далеко"; + full_A = AStaruyj "полн" "полнее"; + heavy_A = AStaruyj "тяжел" "тяжелее"; + left_Ord = (uy_j_EndDecl "лев" ) ** {lock_A = <>}; + near_A = AMalenkij "близк" "ближе"; + right_Ord = (uy_j_EndDecl "прав") ** {lock_A = <>} ; + rotten_A = AMolodoj "гнил" "гнилее"; + round_A = AStaruyj "кругл" "круглее"; + sharp_A = AStaruyj "остр" "острее"; + smooth_A = AMalenkij "гладк" "глаже"; + straight_A = AMolodoj "прям" "прямее"; + wet_A = AStaruyj "мокр" "мокрее"; + wide_A = AMalenkij "широк" "шире"; + +fear_V2 =tvDir (mkRegVerb imperfective first "бо" "ю" "боял" "бой" "боять" ); + +paris_PN = mkPN "Париж" Masc Inanimate ; +--rain_V0 Does not exist in Russian + + +} + diff --git a/lib/resource-1.0/russian/MorphoRus.gf b/lib/resource-1.0/russian/MorphoRus.gf index 47028bdac..305871a2d 100644 --- a/lib/resource-1.0/russian/MorphoRus.gf +++ b/lib/resource-1.0/russian/MorphoRus.gf @@ -1,199 +1,1804 @@ ---# -path=.:../abstract:../common:../../prelude - - --- -----1 A Simple Russian Resource Morphology ----- ----- Aarne Ranta 2002 -- 2005 ----- ----- This resource morphology contains definitions needed in the resource ----- syntax. To build a lexicon, it is better to use $ParadigmsRus$, which ----- gives a higher-level access to this module. --- -resource MorphoRus = ResRus ** open Prelude, (Predef=Predef) in { --- --- flags optimize=all ; --- -----2 Phonology ----- ----- To regulate the use of endings for both nouns, adjectives, and verbs: --- ---oper --- y2ie : Str -> Str -> Str = \fly,s -> --- let y = last (init fly) in --- case y of { --- "a" => fly + s ; --- "e" => fly + s ; --- "o" => fly + s ; --- "u" => fly + s ; --- _ => init fly + "ie" + s --- } ; --- --- -----2 Nouns ----- ----- For conciseness and abstraction, we define a worst-case macro for ----- noun inflection. It is used for defining special case that ----- only need one string as argument. --- ---oper --- CommonNoun : Type = {s : Number => Case => Str} ; --- --- nounGen : Str -> CommonNoun = \dog -> case last dog of { --- "y" => nounY "dog" ; --- "s" => nounS (init "dog") ; --- _ => nounReg "dog" --- } ; --- ----- These are auxiliaries to $nounGen$. --- --- nounReg : Str -> CommonNoun = \dog -> --- mkNoun dog (dog + "s") (dog + "'s") (dog + "s'"); --- nounS : Str -> CommonNoun = \kiss -> --- mkNoun kiss (kiss + "es") (kiss + "'s") (kiss + "es'") ; --- nounY : Str -> CommonNoun = \fl -> --- mkNoun (fl + "y") (fl + "ies") (fl + "y's") (fl + "ies'") ; --- --- -----3 Proper names ----- ----- Regular proper names are inflected with "'s" in the genitive. --- --- nameReg : Str -> Gender -> {s : Case => Str} = \john,g -> --- {s = table {Gen => john + "'s" ; _ => john} ; g = g} ; --- -----2 Determiners --- --- mkDeterminer : Number -> Str -> {s : Str ; n : Number} = \n,s -> --- {s = s ; n = n} ; --- -----2 Pronouns ----- ----- Here we define personal pronouns. ----- ----- We record the form "mine" and the gender for later use. --- --- Pronoun : Type = --- {s : Case => Str ; a : Agr ; g : Gender} ; --- --- mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun = --- \I,me,my,mine,n,p,g -> --- {s = table {Nom => I ; Acc => me ; Gen => my} ; --- a = {n = n ; p = p} ; --- g = g --- } ; --- --- human : Gender = Masc ; --- doesn't matter --- --- pronI = mkPronoun "I" "me" "my" "mine" Sg P1 human ; --- pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb agr OK --- pronHe = mkPronoun "he" "him" "his" "his" Sg P3 Masc ; --- pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 Fem ; --- pronIt = mkPronoun "it" "it" "its" "it" Sg P3 Neutr ; --- --- pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 human ; --- pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ; --- pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; --- --- --- -----2 Adjectives ----- ----- To form the adjectival and the adverbial forms, two strings are needed ----- in the worst case. (First without degrees.) --- --- Adjective = {s : AForm => Str} ; --- ----- However, most adjectives can be inflected using the final character. ----- N.B. this is not correct for "shy", but $mkAdjective$ has to be used. --- --- regAdjective : Str -> Adjective = \free -> --- let --- e = last free ; --- fre = init free ; --- freely = case e of { --- "y" => fre + "ily" ; --- _ => free + "ly" --- } ; --- fre = case e of { --- "e" => fre ; --- "y" => fre + "i" ; --- _ => free --- } --- in --- mkAdjective free (fre + "er") (fre + "est") freely ; --- ----- Many adjectives are 'inflected' by adding a comparison word. --- --- adjDegrLong : Str -> Adjective = \ridiculous -> --- mkAdjective --- ridiculous --- ("more" ++ ridiculous) --- ("most" ++ ridiculous) --- ((regAdjective ridiculous).s ! AAdv) ; --- --- -----3 Verbs ----- ----- The worst case needs five forms. (The verb "be" is treated separately.) --- --- mkVerb4 : (_,_,_,_: Str) -> Verb = \go,goes,went,gone -> --- let going = case last go of { --- "e" => init go + "ing" ; --- _ => go + "ing" --- } --- in --- mkVerb go goes went gone going ; --- ----- This is what we use to derive the irregular forms in almost all cases --- --- mkVerbIrreg : (_,_,_ : Str) -> Verb = \bite,bit,bitten -> --- let bites = case last bite of { --- "y" => y2ie bite "s" ; --- "s" => init bite + "es" ; --- _ => bite + "s" --- } --- in mkVerb4 bite bites bit bitten ; --- ----- This is used to derive regular forms. --- --- mkVerbReg : Str -> Verb = \soak -> --- let --- soaks = case last soak of { --- "y" => y2ie soak "s" ; --- "s" => init soak + "es" ; --- _ => soak + "s" --- } ; --- soaked = case last soak of { --- "e" => init soak + "s" ; --- _ => soak + "ed" --- } --- in --- mkVerb4 soak soaks soaked soaked ; --- --- verbGen : Str -> Verb = \kill -> case last kill of { --- "y" => verbP3y (init kill) ; --- "e" => verbP3e (init kill) ; --- "s" => verbP3s (init kill) ; --- _ => regVerbP3 kill --- } ; --- ----- These are just auxiliary to $verbGen$. --- --- regVerbP3 : Str -> Verb = \walk -> --- mkVerbIrreg walk (walk + "ed") (walk + "ed") ; --- verbP3s : Str -> Verb = \kiss -> --- mkVerb4 kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ; --- verbP3e : Str -> Verb = \love -> --- mkVerb4 love (love + "s") (love + "d") (love + "d") ; --- verbP3y : Str -> Verb = \cr -> --- mkVerb4 (cr + "y") (cr + "ies") (cr + "ied") (cr + "ied") ; --- ------ The particle always appears right after the verb. --- --- verbPart : Verb -> Str -> Verb = \v,p -> --- {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ; --- --- verbNoPart : Verb -> Verb = \v -> verbPart v [] ; --- --- -} +--# -path=.:../../prelude:../common + +--1 A Simple Russian Resource Morphology + +-- Aarne Ranta, Janna Khegai 2006 + +-- This resource morphology contains definitions of the lexical entries +-- needed in the resource syntax. +-- It moreover contains copies of the most usual inflectional patterns. + +-- We use the parameter types and word classes defined for morphology. + +-- Note: mkPassive operation is at the moment incorrect. Low-level ending-analysis +-- is needed to fix the operation. + +resource MorphoRus = ResRus ** open Prelude, (Predef=Predef) in { + +flags coding=utf8 ; + +----2 Personal (together with possesive) pronouns. +oper pronYa: Pronoun = + { s = table { + PF Nom _ NonPoss => "я" ; + PF Gen _ NonPoss => "меня" ; + PF Dat _ NonPoss => "мне" ; + PF Acc _ NonPoss => "меня" ; + PF Inst _ NonPoss => "мной" ; + PF Prepos _ NonPoss => "мне" ; + PF Nom _ (Poss (ASg Masc)) => "мой" ; + PF Gen _ (Poss (ASg Masc)) => "моего" ; + PF Dat _ (Poss (ASg Masc)) => "моему" ; + PF Acc _ (Poss (ASg Masc)) => "моего" ; + PF Inst _ (Poss (ASg Masc)) => "моим" ; + PF Prepos _ (Poss (ASg Masc)) => "моём" ; + PF Nom _ (Poss (ASg Fem)) => "моя" ; + PF Gen _ (Poss (ASg Fem)) => "моей" ; + PF Dat _ (Poss (ASg Fem)) => "моей" ; + PF Acc _ (Poss (ASg Fem)) => "мою" ; + PF Inst _ (Poss (ASg Fem)) => "моею" ; + PF Prepos _ (Poss (ASg Fem)) => "моей" ; + PF Nom _ (Poss (ASg Neut)) => "моё" ; + PF Gen _ (Poss (ASg Neut)) => "моего" ; + PF Dat _ (Poss (ASg Neut)) => "моему" ; + PF Acc _ (Poss (ASg Neut)) => "моё" ; + PF Inst _ (Poss (ASg Neut)) => "моим" ; + PF Prepos _ (Poss (ASg Neut)) => "моём" ; + PF Nom _ (Poss APl) => "мои" ; + PF Gen _ (Poss APl)=> "моих" ; + PF Dat _ (Poss APl) => "моим" ; + PF Acc _ (Poss APl) => "моих" ; + PF Inst _ (Poss APl) => "моими" ; + PF Prepos _ (Poss APl) => "моих" + } ; + g = PNoGen ; + n = Sg ; + p = P1 ; + pron = True + } ; + +oper pronTu: Pronoun = + { s = table { + PF Nom _ NonPoss => "ты" ; + PF Gen _ NonPoss => "тебя" ; + PF Dat _ NonPoss => "тебе" ; + PF Acc _ NonPoss => "тебя" ; + PF Inst _ NonPoss => "тобой" ; + PF Prepos _ NonPoss => ["о тебе"] ; + PF Nom _ (Poss (ASg Masc)) => "твой" ; + PF Gen _ (Poss (ASg Masc)) => "твоего" ; + PF Dat _ (Poss (ASg Masc)) => "твоему" ; + PF Acc _ (Poss (ASg Masc)) => "твоего" ; + PF Inst _ (Poss (ASg Masc)) => "твоим" ; + PF Prepos _ (Poss (ASg Masc)) => "твоём" ; + PF Nom _ (Poss (ASg Fem)) => "твоя" ; + PF Gen _ (Poss (ASg Fem)) => "твоей" ; + PF Dat _ (Poss (ASg Fem)) => "твоей" ; + PF Acc _ (Poss (ASg Fem)) => "твою" ; + PF Inst _ (Poss (ASg Fem)) => "твоею" ; + PF Prepos _ (Poss (ASg Fem)) => "твоей" ; + PF Nom _ (Poss (ASg Neut)) => "твоё" ; + PF Gen _ (Poss (ASg Neut)) => "твоего" ; + PF Dat _ (Poss (ASg Neut)) => "твоему" ; + PF Acc _ (Poss (ASg Neut)) => "твоё" ; + PF Inst _ (Poss (ASg Neut)) => "твоим" ; + PF Prepos _ (Poss (ASg Neut)) => "твоём" ; + PF Nom _ (Poss APl) => "твои" ; + PF Gen _ (Poss APl)=> "твоих" ; + PF Dat _ (Poss APl) => "твоим" ; + PF Acc _ (Poss APl) => "твоих" ; + PF Inst _ (Poss APl) => "твоими" ; + PF Prepos _ (Poss APl) => "твоих" + } ; + g = PNoGen ; + n = Sg ; + p = P2 ; + pron = True + } ; + +oper pronOn: Pronoun = + { s = table { + PF Nom _ NonPoss => "он" ; + PF Gen No NonPoss => "его" ; + PF Gen Yes NonPoss => "него" ; + PF Dat No NonPoss => "ему" ; + PF Dat Yes NonPoss => "нему" ; + PF Acc No NonPoss => "его" ; + PF Acc Yes NonPoss => "него" ; + PF Inst No NonPoss => "им" ; + PF Inst Yes NonPoss => "ним" ; + PF Prepos _ NonPoss => "нём" ; + PF _ _ (Poss _) => "его" + } ; + g = PGen Masc ; + n = Sg ; + p = P3 ; + pron = True + } ; + +oper pronOna: Pronoun = + { s = table { + PF Nom _ NonPoss => "она" ; + PF Gen No NonPoss => "её" ; + PF Gen Yes NonPoss => "неё" ; + PF Dat No NonPoss => "ей" ; + PF Dat Yes NonPoss => "ней" ; + PF Acc No NonPoss => "её" ; + PF Acc Yes NonPoss => "неё" ; + PF Inst No NonPoss => "ей" ; + PF Inst Yes NonPoss => "ней" ; + PF Prepos _ NonPoss => ["о ней"] ; + PF _ _ (Poss _ ) => "её" + } ; + g = PGen Fem ; + n = Sg ; + p = P3 ; + pron = True + } ; +oper pronOno: Pronoun = + { s = table { + PF Nom _ NonPoss => "оно" ; + PF Gen No NonPoss => "его" ; + PF Gen Yes NonPoss => "него" ; + PF Dat No NonPoss => "ему" ; + PF Dat Yes NonPoss => "нему" ; + PF Acc No NonPoss => "его" ; + PF Acc Yes NonPoss => "него" ; + PF Inst No NonPoss => "им" ; + PF Inst Yes NonPoss => "ним" ; + PF Prepos _ NonPoss => "нём" ; + PF _ _ (Poss _ ) => "его" + } ; + g = PGen Neut ; + n = Sg ; + p = P3 ; + + pron = True + } ; + +oper pronMu: Pronoun = + { s = table { + PF Nom _ NonPoss => "мы" ; + PF Gen _ NonPoss => "нас" ; + PF Dat _ NonPoss => "нам" ; + PF Acc _ NonPoss => "нас" ; + PF Inst _ NonPoss => "нами" ; + PF Prepos _ NonPoss => ["о нас"] ; + PF Nom _ ((Poss (ASg Masc))) => "наш" ; + PF Gen _ (Poss (ASg Masc)) => "нашего" ; + PF Dat _ ((Poss (ASg Masc))) => "нашему" ; + PF Acc _ ((Poss (ASg Masc))) => "нашего" ; + PF Inst _ (Poss (ASg Masc)) => "нашим" ; + PF Prepos _ (Poss (ASg Masc)) => "нашем" ; + PF Nom _ (Poss (ASg Fem)) => "наша" ; + PF Gen _ (Poss (ASg Fem)) => "нашей" ; + PF Dat _ (Poss (ASg Fem)) => "нашей" ; + PF Acc _ (Poss (ASg Fem)) => "нашу" ; + PF Inst _ (Poss (ASg Fem)) => "нашею" ; + PF Prepos _ (Poss (ASg Fem)) => "нашей" ; + PF Nom _ (Poss (ASg Neut)) => "наше" ; + PF Gen _ (Poss (ASg Neut)) => "нашего" ; + PF Dat _ (Poss (ASg Neut)) => "нашему" ; + PF Acc _ (Poss (ASg Neut)) => "наше" ; + PF Inst _ (Poss (ASg Neut)) => "нашим" ; + PF Prepos _ (Poss (ASg Neut)) => "нашем" ; + PF Nom _ (Poss APl) => "наши" ; + PF Gen _ (Poss APl)=> "наших" ; + PF Dat _ (Poss APl) => "нашим" ; + PF Acc _ (Poss APl) => "наших" ; + PF Inst _ (Poss APl) => "нашими" ; + PF Prepos _ (Poss APl) => "наших" + }; + g = PNoGen ; + n = Pl ; + p = P1 ; + pron = True + } ; + +oper pronVu: Pronoun = + { s = table { + PF Nom _ NonPoss => "вы" ; + PF Gen _ NonPoss => "вас" ; + PF Dat _ NonPoss => "вам" ; + PF Acc _ NonPoss => "вас" ; + PF Inst _ NonPoss => "вами" ; + PF Prepos _ NonPoss => "вас" ; + PF Nom _ (Poss (ASg Masc)) => "ваш" ; + PF Gen _ (Poss (ASg Masc)) => "вашего" ; + PF Dat _ (Poss (ASg Masc)) => "вашему" ; + PF Acc _ (Poss (ASg Masc)) => "вашего" ; + PF Inst _ (Poss (ASg Masc)) => "вашим" ; + PF Prepos _ (Poss (ASg Masc)) => "вашем" ; + PF Nom _ (Poss (ASg Fem)) => "ваша" ; + PF Gen _ (Poss (ASg Fem)) => "вашей" ; + PF Dat _ (Poss (ASg Fem)) => "вашей" ; + PF Acc _ (Poss (ASg Fem)) => "вашу" ; + PF Inst _ (Poss (ASg Fem)) => "вашею" ; + PF Prepos _ (Poss (ASg Fem)) => "вашей" ; + PF Nom _ (Poss (ASg Neut)) => "ваше" ; + PF Gen _ (Poss (ASg Neut)) => "вашего" ; + PF Dat _ (Poss (ASg Neut)) => "вашему" ; + PF Acc _ (Poss (ASg Neut)) => "ваше" ; + PF Inst _ (Poss (ASg Neut)) => "вашим" ; + PF Prepos _ (Poss (ASg Neut)) => "вашем" ; + PF Nom _ (Poss APl) => "ваши" ; + PF Gen _ (Poss APl)=> "ваших" ; + PF Dat _ (Poss APl) => "вашим" ; + PF Acc _ (Poss APl) => "ваших" ; + PF Inst _ (Poss APl) => "вашими" ; + PF Prepos _ (Poss APl) => "ваших" + }; + g = PNoGen ; + n = Pl ; + p = P2 ; + pron = True + } ; + +oper pronOni: Pronoun = + { s = table { + PF Nom _ NonPoss => "они" ; + PF Gen No NonPoss => "их" ; + PF Gen Yes NonPoss => "них" ; + PF Dat No NonPoss => "им" ; + PF Dat Yes NonPoss => "ним" ; + PF Acc No NonPoss => "их" ; + PF Acc Yes NonPoss => "них" ; + PF Inst No NonPoss => "ими" ; + PF Inst Yes NonPoss => "ними" ; + PF Prepos _ NonPoss => ["о них"] ; + PF _ _ (Poss _) => "их" + } ; + g = PNoGen ; + n = Pl ; + p = P3 ; + pron = True + } ; + +oper pronKto: Pronoun = + { s = table { + PF Nom _ _ => "кто" ; + PF Gen _ _ => "кого" ; + PF Dat _ _ => "кому" ; + PF Acc _ _ => "кого" ; + PF Inst _ _ => "кем" ; + PF Prepos _ _ => "ком" + } ; + g = PGen Masc; + n = Sg ; + p = P3 ; + pron = False + } ; +oper pronKtoTo: Pronoun = + { s = table { + PF Nom _ _ => "кто-то" ; + PF Gen _ _ => "кого-то" ; + PF Dat _ _ => "кому-то" ; + PF Acc _ _ => "кого-то" ; + PF Inst _ _ => "кем-то" ; + PF Prepos _ _ => "ком-то" + } ; + g = PGen Masc; + n = Sg ; + p = P3 ; + pron = False + } ; +oper pronChtoTo: Pronoun = + { s = table { + PF Nom _ _ => "что-то" ; + PF Gen _ _ => "чего-то" ; + PF Dat _ _ => "чему-то" ; + PF Acc _ _ => "что-то" ; + PF Inst _ _ => "чем-то" ; + PF Prepos _ _ => "чём-то" + } ; + g = PGen Masc; + n = Sg ; + p = P3 ; + pron = False + } ; + oper pronChto: Pronoun = + { s = table { + PF Nom _ _ => "что" ; + PF Gen _ _ => "чего" ; + PF Dat _ _ => "чему" ; + PF Acc _ _ => "что" ; + PF Inst _ _ => "чем" ; + PF Prepos _ _ => "чём" + } ; + g = PGen Masc; + n = Sg ; + p = P3 ; + pron = False + } ; + +--oper pronNikto: Pronoun = +-- { s = table { +-- PF Nom _ _ => "никто" ; +-- PF Gen _ _ => "никого" ; +-- PF Dat _ _ => "никому" ; +-- PF Acc _ _ => "никого" ; +-- PF Inst _ _ => "никем" ; +-- PF Prepos _ _ => ["ни о ком"] -- only together with a preposition +-- } ; +-- g = PGen Masc; +-- n = Sg ; +-- p = P3 ; +-- pron = False +-- } ; +-- +--oper pronNichto: Pronoun = +-- { s = table { +-- PF Nom _ _ => "ничто" ; +-- PF Gen _ _ => "ничего" ; +-- PF Dat _ _ => "ничему" ; +-- PF Acc _ _ => "ничего" ; +-- PF Inst _ _ => "ничем" ; +-- PF Prepos _ _ => ["ни о чём"] -- only together with preposition +-- } ; +-- g = PGen Masc; +-- n = Sg ; +-- p = P3 ; +-- pron = False +-- } ; +-- +oper pronVseInanimate: Pronoun = + { s = table { + PF Nom _ _ => "всё" ; + PF Gen _ _ => "всего" ; + PF Dat _ _ => "всему" ; + PF Acc _ _ => "всё" ; + PF Inst _ _ => "всем" ; + PF Prepos _ _ => "всём" + } ; + g = PGen Neut; + n = Sg ; + p = P3 ; + pron = False + } ; + +----2 Nouns +-- +---- Help type SubstFormDecl is introduced to reduce repetition in +---- the declination definitions. It allows us to define a declination type, +---- namely, the String component "s" of the CommNoun type +---- without any reference to the Gender parameter "g". +-- +oper + CommNoun = {s : SubstForm => Str ; g : Gender ; anim : Animacy } ; + SubstFormDecl = SS1 SubstForm ; +-- +--oper gorlo : CommNoun = l_oEndInAnimateDecl "горл" ; +--oper koleno : CommNoun = oEndInAnimateDecl "колен" ; +--oper plecho : CommNoun = oEndInAnimateDecl "плеч" ; +--oper ukho : CommNoun = oEnd_KH_InAnimateDecl "у" ; +--oper zhivot : CommNoun = nullEndInAnimateDecl1 "живот" ; +--oper grud : CommNoun = softSignEndDeclFem "груд" ; +--oper ruka : CommNoun = aEndG_K_KH_Decl "рук" ; +--oper spina : CommNoun = aEndInAnimateDecl "спин" ; +--oper stopa : CommNoun = aEndInAnimateDecl "стоп" ; +--oper sreda : CommNoun = aEndInAnimateDecl "сред" ; +--oper pyatnica : CommNoun = aEndInAnimateDecl "пятниц" ; +--oper subbota : CommNoun = aEndInAnimateDecl "суббот" ; +--oper astma : CommNoun = aEndInAnimateDecl "астм" ; +--oper angina : CommNoun = aEndInAnimateDecl "ангин" ; +--oper revmatizm : CommNoun = nullEndInAnimateDecl1 "ревматизм" ; +--oper zapor : CommNoun = nullEndInAnimateDecl1 "запор" ; +--oper ponos : CommNoun = nullEndInAnimateDecl1 "понос" ; +--oper artrit : CommNoun = nullEndInAnimateDecl1 "артрит" ; +--oper diabet : CommNoun = nullEndInAnimateDecl1 "диабет" ; +--oper tsistit : CommNoun = nullEndInAnimateDecl1 "цистит" ; +--oper izzhoga : CommNoun = aEndG_K_KH_Decl "изжог" ; +--oper allergiya : CommNoun = i_yaEndDecl "аллерги" ; +-- +--oper viagra : CommNoun = aEndInAnimateDecl "виагр" ; +--oper antidepressant : CommNoun = nullEndInAnimateDecl1 "антидепрессант" ; +--oper insulin : CommNoun = nullEndInAnimateDecl1 "инсулин" ; +--oper vitamin : CommNoun = nullEndInAnimateDecl1 "витамин" ; +--oper antibiotik : CommNoun = nullEndInAnimateDecl3 "антибиотик" ; +--oper ponedelnik : CommNoun = nullEndInAnimateDecl3 "понедельник" ; +--oper vtornik : CommNoun = nullEndInAnimateDecl3 "вторник" ; +--oper chetverg : CommNoun = nullEndInAnimateDecl3 "четверг" ; +-- +-- +--oper kaplya : CommNoun = (l_yaEndInAnimateDecl "кап") ** {g = Fem; anim = Inanimate} ; +--oper snotvornoe : CommNoun = oeEndInAnimateDecl "снотворн" ; +--oper uspokoitelnoe : CommNoun = oeEndInAnimateDecl "успокоительн" ; +--oper slabitelnoe : CommNoun = oeEndInAnimateDecl "слабительн" ; +-- +--oper urolog : CommNoun = nullEndAnimateDecl "уролог" ; +--oper ginekolog : CommNoun = nullEndAnimateDecl "гинеколог" ; +--oper nevropatolog : CommNoun = nullEndAnimateDecl "невропатолог" ; +--oper dermatolog : CommNoun = nullEndAnimateDecl "дерматолог" ; +--oper kardiolog : CommNoun = nullEndAnimateDecl "кардиолог" ; +--oper terapevt : CommNoun = nullEndAnimateDecl2 "терапевт" ; +--oper okulist : CommNoun = nullEndAnimateDecl2 "окулист" ; +--oper pediatr : CommNoun = nullEndAnimateDecl2 "педиатр" ; +--oper khirurg : CommNoun = nullEndAnimateDecl2 "хирург" ; +-- +--oper muzhchina : CommNoun = (aEndAnimateDecl "мужчин") ** { g = Masc ; anim = Animate } ; +--oper zhenchina : CommNoun = (aEndAnimateDecl "женщин") ** { g = Fem ; anim = Animate } ; +--oper mama : CommNoun = (aEndAnimateDecl "мам")**{ g = Fem ; anim = Animate } ; +--oper cena : CommNoun = (aEndAnimateDecl "цен") ** { g = Fem ; anim = Inanimate } ; +-- +oper aEndAnimateDecl: Str -> SubstFormDecl = \muzhchin -> +{s = table { + SF Sg Nom => muzhchin+"а" ; + SF Sg Gen => muzhchin+"ы" ; + SF Sg Dat => muzhchin+"е" ; + SF Sg Acc => muzhchin+"у" ; + SF Sg Inst => muzhchin+"ой" ; + SF Sg Prepos => muzhchin +"е" ; + SF Pl Nom => muzhchin +"ы" ; + SF Pl Gen => muzhchin ; SF Pl Dat => muzhchin+"ам" ; + SF Pl Acc => muzhchin ; + SF Pl Inst => muzhchin+"ами" ; + SF Pl Prepos => muzhchin+"ах" } + } ; + +--oper stomatolog : CommNoun = nullEndAnimateDecl "стоматолог" ; +oper nullEndInAnimateDecl: Str -> CommNoun = \stomatolog -> + {s = table + { SF Sg Nom => stomatolog ; + SF Sg Gen => stomatolog+"а" ; + SF Sg Dat => stomatolog+"у" ; + SF Sg Acc => stomatolog +"а" ; + SF Sg Inst => stomatolog+"ом" ; + SF Sg Prepos => stomatolog+"е" ; + SF Pl Nom => stomatolog+"и" ; + SF Pl Gen => stomatolog+"ов" ; + SF Pl Dat => stomatolog+"ам" ; + SF Pl Acc => stomatolog+"ов" ; + SF Pl Inst => stomatolog+"ами" ; + SF Pl Prepos => stomatolog+"ах" } ; + g = Masc ; anim = Inanimate + } ; + +oper nullEndAnimateDecl: Str -> CommNoun = \stomatolog -> + {s = table + { SF Sg Nom => stomatolog ; + SF Sg Gen => stomatolog+"а" ; + SF Sg Dat => stomatolog+"у" ; + SF Sg Acc => stomatolog +"а" ; + SF Sg Inst => stomatolog+"ом" ; + SF Sg Prepos => stomatolog+"е" ; + SF Pl Nom => stomatolog+"и" ; + SF Pl Gen => stomatolog+"ов" ; + SF Pl Dat => stomatolog+"ам" ; + SF Pl Acc => stomatolog+"ов" ; + SF Pl Inst => stomatolog+"ами" ; + SF Pl Prepos => stomatolog+"ах" } ; + g = Masc ; anim = Animate + } ; +oper nullEndAnimateDecl2: Str -> CommNoun = \stomatolog -> + {s = table + { SF Sg Nom => stomatolog ; + SF Sg Gen => stomatolog+"а" ; + SF Sg Dat => stomatolog+"у" ; + SF Sg Acc => stomatolog +"а" ; + SF Sg Inst => stomatolog+"ом" ; + SF Sg Prepos => stomatolog+"е" ; + SF Pl Nom => stomatolog+"ы" ; + SF Pl Gen => stomatolog+"ов" ; + SF Pl Dat => stomatolog+"ам" ; + SF Pl Acc => stomatolog+"ов" ; + SF Pl Inst => stomatolog+"ами" ; + SF Pl Prepos => stomatolog+"ах" } ; + g = Masc ; anim = Animate + } ; + +--oper gripp : CommNoun = nullEndInAnimateDecl1 "грипп" ; +--oper bar : CommNoun = nullEndInAnimateDecl1 "бар" ; +--oper telefon: CommNoun = nullEndInAnimateDecl1 "телефон" ; +--oper restoran : CommNoun = nullEndInAnimateDecl1 "ресторан" ; +-- +---- Note: Plural form of the "грипп" (influenza) is a bit doubious +---- However, according to http://starling.rinet.ru/morph.htm it exists. +---- so we also keep it. +oper nullEndInAnimateDeclPepel: Str -> CommNoun = \gripp -> + {s = table + { SF Sg Nom => gripp +"ел"; + SF Sg Gen => gripp+"ла" ; + SF Sg Dat => gripp+"лу" ; + SF Sg Acc => gripp +"ел"; + SF Sg Inst => gripp+"лом" ; + SF Sg Prepos => gripp+"ле" ; + SF Pl Nom => gripp+"лы" ; + SF Pl Gen => gripp+"лов" ; + SF Pl Dat => gripp+"лам" ; + SF Pl Acc => gripp +"лы"; + SF Pl Inst => gripp+"лами" ; + SF Pl Prepos => gripp+"лах" + } ; + g = Masc ; anim = Inanimate + + } ; +oper nullEndInAnimateDecl1: Str -> CommNoun = \gripp -> + {s = table + { SF Sg Nom => gripp ; + SF Sg Gen => gripp+"а" ; + SF Sg Dat => gripp+"у" ; + SF Sg Acc => gripp ; + SF Sg Inst => gripp+"ом" ; + SF Sg Prepos => gripp+"е" ; + SF Pl Nom => gripp+"ы" ; + SF Pl Gen => gripp+"ов" ; + SF Pl Dat => gripp+"ам" ; + SF Pl Acc => gripp +"ы"; + SF Pl Inst => gripp+"ами" ; + SF Pl Prepos => gripp+"ах" + } ; + g = Masc ; anim = Inanimate + + } ; +oper nullEndInAnimateDeclStul: Str -> CommNoun = \brat -> + {s = table + { SF Sg Nom => brat ; + SF Sg Gen => brat+"а" ; + SF Sg Dat => brat+"у" ; + SF Sg Acc => brat +"а"; + SF Sg Inst => brat+"ом" ; + SF Sg Prepos => brat+"е" ; + SF Pl Nom => brat+"ья" ; + SF Pl Gen => brat+"ьев" ; + SF Pl Dat => brat+"ьям" ; + SF Pl Acc => brat +"ьев"; + SF Pl Inst => brat+"ьями" ; + SF Pl Prepos => brat+"ьяах" + } ; + g = Masc ; anim = Inanimate + } ; +oper nullEndAnimateDeclBrat: Str -> CommNoun = \brat -> + {s = table + { SF Sg Nom => brat ; + SF Sg Gen => brat+"а" ; + SF Sg Dat => brat+"у" ; + SF Sg Acc => brat +"а"; + SF Sg Inst => brat+"ом" ; + SF Sg Prepos => brat+"е" ; + SF Pl Nom => brat+"ья" ; + SF Pl Gen => brat+"ьев" ; + SF Pl Dat => brat+"ьям" ; + SF Pl Acc => brat +"ьев"; + SF Pl Inst => brat+"ьями" ; + SF Pl Prepos => brat+"ьяах" + } ; + g = Masc ; anim = Animate + + } ; + +--oper adres: CommNoun = nullEndInAnimateDecl2 "адрес" ; +--oper dom : CommNoun = nullEndInAnimateDecl2 "дом" ; +--oper svet : CommNoun = nullEndInAnimateDecl2 "свет" ; +oper nullEndInAnimateDecl2: Str -> CommNoun = \gripp -> + {s = table + { SF Sg Nom => gripp ; + SF Sg Gen => gripp+"а" ; + SF Sg Dat => gripp+"у" ; + SF Sg Acc => gripp ; + SF Sg Inst => gripp+"ом" ; + SF Sg Prepos => gripp+"е" ; + SF Pl Nom => gripp+"а" ; + SF Pl Gen => gripp+"ов" ; + SF Pl Dat => gripp+"ам" ; + SF Pl Acc => gripp +"а"; + SF Pl Inst => gripp+"ами" ; + SF Pl Prepos => gripp+"ах" + } ; + g = Masc ; anim = Inanimate + } ; +--oper nullEndInAnimateDecl3: Str -> CommNoun = \antibiotik -> +-- {s = table +-- { SF Sg Nom => antibiotik ; +-- SF Sg Gen => antibiotik+"а" ; +-- SF Sg Dat => antibiotik+"у" ; +-- SF Sg Acc => antibiotik ; +-- SF Sg Inst => antibiotik+"ом" ; +-- SF Sg Prepos => antibiotik+"е" ; +-- SF Pl Nom => antibiotik+"и" ; +-- SF Pl Gen => antibiotik+"ов" ; +-- +-- SF Pl Dat => antibiotik+"ам" ; +-- SF Pl Acc => antibiotik +"и"; +-- SF Pl Inst => antibiotik+"ами" ; +-- SF Pl Prepos => antibiotik+"ах" +-- } ; +-- g = Masc ; anim = Inanimate +-- } ; +-- +--oper obezbolivauchee : CommNoun = eeEndInAnimateDecl "обезболивающ" ; +oper eeEndInAnimateDecl: Str -> CommNoun = \obezbolivauch -> + { s = table + { SF Sg Nom => obezbolivauch +"ее"; + SF Sg Gen => obezbolivauch+"его" ; + SF Sg Dat => obezbolivauch+"ему" ; + SF Sg Acc => obezbolivauch +"ее"; + SF Sg Inst => obezbolivauch+"им" ; + SF Sg Prepos => obezbolivauch+"ем" ; + SF Pl Nom => obezbolivauch+"ие" ; + SF Pl Gen => obezbolivauch+"их" ; + SF Pl Dat => obezbolivauch+"им" ; + SF Pl Acc => obezbolivauch+"ие" ; + SF Pl Inst => obezbolivauch+"ими" ; + SF Pl Prepos => obezbolivauch+"их" + } ; + g = Neut ; anim = Inanimate + } ; + +oper oeEndInAnimateDecl: Str -> CommNoun = \snotvorn -> + { s = table + { SF Sg Nom => snotvorn +"ое"; + SF Sg Gen => snotvorn+"ого" ; + SF Sg Dat => snotvorn+"ому" ; + SF Sg Acc => snotvorn +"ое"; + SF Sg Inst => snotvorn+"ым" ; + SF Sg Prepos => snotvorn+"ом" ; + SF Pl Nom => snotvorn+"ые" ; + SF Pl Gen => snotvorn+"ых" ; + SF Pl Dat => snotvorn+"ым" ; + SF Pl Acc => snotvorn+"ые" ; + SF Pl Inst => snotvorn+"ыми" ; + SF Pl Prepos => snotvorn+"ых" + } ; + g = Neut ; anim = Inanimate + } ; +oper oeEndAnimateDecl: Str -> CommNoun = \snotvorn -> + { s = table + { SF Sg Nom => snotvorn +"ое"; + SF Sg Gen => snotvorn+"ого" ; + SF Sg Dat => snotvorn+"ому" ; + SF Sg Acc => snotvorn +"ое"; + SF Sg Inst => snotvorn+"ым" ; + SF Sg Prepos => snotvorn+"ом" ; + SF Pl Nom => snotvorn+"ые" ; + SF Pl Gen => snotvorn+"ых" ; + SF Pl Dat => snotvorn+"ым" ; + SF Pl Acc => snotvorn+"ые" ; + SF Pl Inst => snotvorn+"ыми" ; + SF Pl Prepos => snotvorn+"ых" + } ; + g = Neut ; anim = Animate + } ; + +--oper voskresenje : CommNoun = soft_eEndInAnimateDecl "воскресен" ; +--oper soft_eEndInAnimateDecl: Str -> CommNoun = \proizvedeni -> +-- { s = table +-- { SF Sg Nom => proizvedeni +"ье"; +-- SF Sg Gen => proizvedeni+"ья" ; +-- SF Sg Dat => proizvedeni+"ью" ; +-- SF Sg Acc => proizvedeni +"ье"; +-- SF Sg Inst => proizvedeni+"ьем" ; +-- SF Sg Prepos => proizvedeni+"ье" ; +-- SF Pl Nom => proizvedeni+"ья" ; +-- SF Pl Gen => proizvedeni+"ий" ; +-- SF Pl Dat => proizvedeni+"ьям" ; +-- SF Pl Acc => proizvedeni+"ья" ; +-- SF Pl Inst => proizvedeni+"ьями" ; +-- SF Pl Prepos => proizvedeni+"ьях" +-- } ; +-- g = Neut ; anim = Inanimate +-- } ; +--oper proizvedenie : CommNoun = eEndInAnimateDecl "произведени" ; +oper eEndInAnimateDecl: Str -> CommNoun = \proizvedeni -> + { s = table + { SF Sg Nom => proizvedeni +"е"; + SF Sg Gen => proizvedeni+"я" ; + SF Sg Dat => proizvedeni+"ю" ; + SF Sg Acc => proizvedeni +"е"; + SF Sg Inst => proizvedeni+"ем" ; + SF Sg Prepos => proizvedeni+"и" ; + SF Pl Nom => proizvedeni+"я" ; + SF Pl Gen => proizvedeni+"й" ; + SF Pl Dat => proizvedeni+"ям" ; + SF Pl Acc => proizvedeni+"я" ; + SF Pl Inst => proizvedeni+"ями" ; + SF Pl Prepos => proizvedeni+"ях" + } ; + g = Neut ; anim = Inanimate + } ; +--oper chislo : CommNoun = l_oEndInAnimateDecl "числ" ; +--oper vino : CommNoun = l_oEndInAnimateDecl "вин" ; +--oper l_oEndInAnimateDecl: Str -> CommNoun = \chisl -> +-- let { chis = Predef.tk 1 chisl ; ending = Predef.dp 3 chisl } in +-- oEndInAnimateDecl3 chisl (chis+"e"+ending) ; +oper oEndInAnimateDecl3: Str -> Str -> CommNoun = \chisl, chisel -> + { s = table + { SF Sg Nom => chisl +"о"; + SF Sg Gen => chisl+"а" ; + SF Sg Dat => chisl+"у" ; + SF Sg Acc => chisl +"о"; + SF Sg Inst => chisl+"ом" ; + SF Sg Prepos => chisl+"е" ; + SF Pl Nom => chisl+"а" ; + SF Pl Gen => chisel; + SF Pl Dat => chisl+"ам" ; + SF Pl Acc => chisl+"а" ; + SF Pl Inst => chisl+"ами" ; + SF Pl Prepos => chisl+"ах" + } ; + g = Neut ; anim = Inanimate + } ; + +oper oEndInAnimateDecl: Str -> CommNoun = \plech -> + { s = table + { SF Sg Nom => plech+"о" ; + SF Sg Gen => plech+"а" ; + SF Sg Dat => plech+"у" ; + SF Sg Acc => plech+"о" ; + SF Sg Inst => plech+"ом" ; SF Sg Prepos => plech+"е" ; + SF Pl Nom => plech+"и" ; + SF Pl Gen => plech; + SF Pl Dat => plech+"ам" ; + SF Pl Acc => plech+"и" ; + SF Pl Inst => plech+"ами" ; + SF Pl Prepos => plech+"ях" + } ; + g = Neut ; anim = Inanimate + } ; +--oper oEnd_KH_InAnimateDecl: Str -> CommNoun = \u -> +-- { s = table +-- { SF Sg Nom => u+"хо" ; +-- SF Sg Gen => u+"ха" ; +-- SF Sg Dat => u+"ху" ; +-- SF Sg Acc => u+"хо" ; +-- SF Sg Inst => u+"хом" ; -- SF Sg Prepos => u+"хе" ; +-- SF Pl Nom => u+"ши" ; +-- SF Pl Gen => u +"шей"; +-- SF Pl Dat => u+"шам" ; +-- SF Pl Acc => u+"ши" ; +-- SF Pl Inst => u+"шами" ; +-- SF Pl Prepos => u+"шах" +-- } ; +-- g = Neut ; anim = Inanimate +-- } ; +-- +--oper malaria : CommNoun = i_yaEndDecl "маляри" ; +-- +--oper daniya : ProperName = mkCNProperName(i_yaEndDecl "Дани" ); +--oper angliya : ProperName = mkCNProperName(i_yaEndDecl "Англи") ; +--oper finlyandiya : ProperName = mkCNProperName(i_yaEndDecl "Финлянди") ; +--oper franciya : ProperName = mkCNProperName(i_yaEndDecl "Франци" ); +--oper germaniya : ProperName = mkCNProperName(i_yaEndDecl "Германи") ; +--oper italiya : ProperName = mkCNProperName(i_yaEndDecl "Итали" ); +--oper norvegiya : ProperName = mkCNProperName(i_yaEndDecl "Норвеги") ; +--oper rossiya : ProperName = mkCNProperName(i_yaEndDecl "Росси") ; +--oper ispaniya : ProperName = mkCNProperName(i_yaEndDecl "Испани") ; +--oper shveciya : ProperName = mkCNProperName(i_yaEndDecl "Швеци") ; +-- +oper i_yaEndDecl: Str -> CommNoun = \malar -> + { s = table + { SF Sg Nom => malar+"я" ; + SF Sg Gen => malar+"и" ; + SF Sg Dat => malar+"и" ; + SF Sg Acc => malar+"ю" ; + SF Sg Inst => malar+"ей" ; SF Sg Prepos => malar+"и" ; + SF Pl Nom => malar+"и" ; + SF Pl Gen => malar+"й" ; + SF Pl Dat => malar+"ям" ; + SF Pl Acc => malar+"и" ; + SF Pl Inst => malar+"ями" ; + SF Pl Prepos => malar+"ях" + } ; + g = Fem ; anim = Inanimate + } ; + +--oper bol : CommNoun = softSignEndDeclFem "бол" ; +--oper nol : CommNoun = softSignEndDeclMasc "нол" ; +--oper uroven : CommNoun = EN_softSignEndDeclMasc "уровен" ; +oper softSignEndDeclFem: Str -> CommNoun = \bol -> + {s = table + { SF Sg Nom => bol+"ь" ; + SF Sg Gen => bol+"и" ; + SF Sg Dat => bol+"и" ; + SF Sg Acc => bol+"ь" ; + SF Sg Inst => bol+"ью" ; + SF Sg Prepos => bol+"и" ; + SF Pl Nom => bol+"и" ; + SF Pl Gen => bol+"ей" ; + SF Pl Dat => bol+"ям" ; + SF Pl Acc => bol+"и" ; + SF Pl Inst => bol+"ями" ; + SF Pl Prepos => bol+"ях" } ; + g = Fem ; anim = Inanimate + } ; +oper softSignEndDeclMasc: Str -> CommNoun = \nol -> + {s = table + { SF Sg Nom => nol+"ь" ; + SF Sg Gen => nol+"я" ; + SF Sg Dat => nol+"ю" ; + SF Sg Acc => nol+"ь" ; + SF Sg Inst => nol+"ем" ; + SF Sg Prepos => nol+"е" ; + SF Pl Nom => nol+"и" ; + SF Pl Gen => nol+"ей" ; + SF Pl Dat => nol+"ям" ; + SF Pl Acc => nol+"и" ; + SF Pl Inst => nol+"ями" ; + SF Pl Prepos => nol+"ях" + } ; + g = Masc ; anim = Inanimate + } ; +oper okEndDeclMasc: Str -> CommNoun = \potol -> + {s = table + { SF Sg Nom => potol+"ок" ; + SF Sg Gen => potol+"ка" ; + SF Sg Dat => potol+"ку" ; + SF Sg Acc => potol+"ок" ; + SF Sg Inst => potol+"ком" ; + SF Sg Prepos => potol+"ке" ; + SF Pl Nom => potol+"ки" ; + SF Pl Gen => potol+"ков" ; + SF Pl Dat => potol+"кам" ; + SF Pl Acc => potol+"ки" ; + SF Pl Inst => potol+"ками" ; + SF Pl Prepos => potol+"ках" + } ; + g = Masc ; anim = Inanimate + } ; + + +oper shEndDeclMasc: Str -> CommNoun = \malush -> + {s = table + { SF Sg Nom => malush ; + SF Sg Gen => malush+"а" ; + SF Sg Dat => malush+"у" ; + SF Sg Acc => malush+"а" ; + SF Sg Inst => malush+"ом" ; + SF Sg Prepos => malush+"е" ; + SF Pl Nom => malush+"и" ; + SF Pl Gen => malush+"ей" ; + SF Pl Dat => malush+"ам" ; + SF Pl Acc => malush+"ей" ; + SF Pl Inst => malush+"ами" ; + SF Pl Prepos => malush+"ах" + } ; + g = Masc ; anim = Inanimate + } ; + +oper EN_softSignEndDeclMasc: Str -> CommNoun = \rem -> + {s = table + { SF Sg Nom => rem+"ень" ; + SF Sg Gen => rem+"ня" ; + SF Sg Dat => rem+"ню" ; + SF Sg Acc => rem+"ень" ; + SF Sg Inst => rem+"нем" ; + SF Sg Prepos => rem+"не" ; + SF Pl Nom => rem+"ни" ; + SF Pl Gen => rem+"ней" ; + SF Pl Dat => rem+"ням" ; + SF Pl Acc => rem+"ни" ; + SF Pl Inst => rem+"нями" ; + SF Pl Prepos => rem+"нях" + } ; + g = Masc ; anim = Inanimate + } ; + +--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+"а" ; + SF Sg Gen => nog+"и" ; + SF Sg Dat => nog+"е" ; + SF Sg Acc => nog+"у" ; + SF Sg Inst => nog+"ой" ; + SF Sg Prepos => nog+"е" ; + SF Pl Nom => nog+"и" ; + SF Pl Gen => nog ; + SF Pl Dat => nog+"ам" ; + SF Pl Acc => nog+ "и" ; + SF Pl Inst => nog+"ами" ; + SF Pl Prepos => nog+"ах" + } ; + g = Fem ; anim = Inanimate +} ; + +--oper golova : CommNoun = aEndInAnimateDecl "голов" ; +--oper mashina : CommNoun = aEndInAnimateDecl "машин" ; +--oper temperatura : CommNoun = aEndInAnimateDecl "температур" ; +--oper edinica : CommNoun = ej_aEndInAnimateDecl "единиц" ; +-- +oper aEndInAnimateDecl: Str -> CommNoun = \golov -> + { s = table + { SF Sg Nom => golov+"а" ; + SF Sg Gen => golov+"ы" ; + SF Sg Dat => golov+"е" ; + SF Sg Acc => golov+"у" ; + SF Sg Inst => golov+"ой" ; + SF Sg Prepos => golov+"е" ; + SF Pl Nom => golov+"ы" ; + SF Pl Gen => golov ; + SF Pl Dat => golov+"ам" ; + SF Pl Acc => golov+ "ы" ; + SF Pl Inst => golov+"ами" ; + SF Pl Prepos => golov+"ах" + } ; + g = Fem ; anim = Inanimate + } ; +oper ej_aEndInAnimateDecl: Str -> CommNoun = \ediniz -> + { s = table + { SF Sg Nom => ediniz+"а" ; + SF Sg Gen => ediniz+"ы" ; + SF Sg Dat => ediniz+"е" ; + SF Sg Acc => ediniz+"у" ; + SF Sg Inst => ediniz+"ей" ; + SF Sg Prepos => ediniz+"е" ; + SF Pl Nom => ediniz+"ы" ; + SF Pl Gen => ediniz ; + SF Pl Dat => ediniz+"ам" ; + SF Pl Acc => ediniz+ "ы" ; + SF Pl Inst => ediniz+"ами" ; + SF Pl Prepos => ediniz+"ах" + } ; + g = Fem ; anim = Inanimate + } ; + + +--oper dyadya : CommNoun = (yaEndAnimateDecl "дяд") ** {g = Masc; anim = Animate} ; +oper yaEndAnimateDecl: Str -> SubstFormDecl = \nyan -> + {s = table { + SF Sg Nom => nyan + "я" ; SF Sg Gen => nyan + "и" ; + SF Sg Dat => nyan + "е" ; + SF Sg Acc => nyan + "ю" ; + SF Sg Inst => nyan + "ей" ; + SF Sg Prepos => nyan + "е" ; + SF Pl Nom => nyan + "и" ; + SF Pl Gen => nyan + "ей" ; + SF Pl Inst => nyan + "ями" ; + SF Pl Prepos => nyan + "ях" ; + SF Pl Dat => nyan + "ям" ; SF Pl Acc => nyan + "ей" + } + } ; +--oper l_yaEndInAnimateDecl: Str -> SubstFormDecl = \kap -> +--{s = table { +-- SF Sg Nom => kap + "ля" ; -- SF Sg Gen => kap + "ли" ; +-- SF Sg Dat => kap + "ле" ; +-- SF Sg Acc => kap + "лю" ; +-- SF Sg Inst => kap + "лей" ; +-- SF Sg Prepos => kap + "ле" ; +-- SF Pl Nom => kap + "ли" ; +-- SF Pl Gen => kap + "ель" ; +-- SF Pl Inst => kap + "лями" ; +-- SF Pl Prepos => kap + "лях" ; +-- SF Pl Dat => kap + "лям" ; -- SF Pl Acc => kap + "ли" +-- } +-- } ; +-- +--oper oEnd_Decl: Str -> CommNoun = \bolshinstv -> +--{ s = table { +-- SF Sg Nom => bolshinstv+"о" ; +-- SF Sg Gen => bolshinstv+"а" ; +-- SF Sg Dat => bolshinstv+"у" ; +-- SF Sg Acc => bolshinstv+"о" ; +-- SF Sg Inst => bolshinstv+"ом" ; +-- SF Sg Prepos => bolshinstv+"е" ; +-- SF Pl Nom => bolshinstv+"а" ; +-- SF Pl Gen => bolshinstv ; +-- SF Pl Dat => bolshinstv+"ам" ; +-- SF Pl Acc => bolshinstv+ "а" ; +-- SF Pl Inst => bolshinstv+"ами" ; +-- SF Pl Prepos => bolshinstv+"ах" +-- } ; +-- g = Neut ; anim = Inanimate +--} ; + +oper kg_oEnd_SgDecl: Str -> CommNoun = \mnog -> +{ s = table { + SF _ Nom => mnog+"о" ; + SF _ Gen => mnog +"их"; + SF _ Dat => mnog+"им" ; + SF _ Acc => mnog+"о" ; + SF _ Inst => mnog+"ими" ; + SF _ Prepos => mnog+"их" + } ; + g = Neut ; anim = Inanimate +} ; + +oper oEnd_PlDecl: Str -> CommNoun = \menshinstv -> + { s = table { + SF _ Nom => menshinstv+"а" ; + SF _ Gen => menshinstv; + SF _ Dat => menshinstv+"ам" ; + SF _ Acc => menshinstv+"ва" ; + SF _ Inst => menshinstv+"ами" ; + SF _ Prepos => menshinstv+"вах" + } ; + g = Neut ; anim = Inanimate +} ; + +oper oEnd_SgDecl: Str -> CommNoun = \bolshinstv -> + {s = table { + SF _ Nom => bolshinstv+"о" ; + SF _ Gen => bolshinstv+"а" ; + SF _ Dat => bolshinstv+"у" ; + SF _ Acc => bolshinstv+"о" ; + SF _ Inst => bolshinstv+"ом" ; + SF _ Prepos => bolshinstv+"е" + } ; + g = Neut ; anim = Inanimate +} ; + +-- Note: Now we consider only the plural form of the pronoun "все" (all) +-- treated as an adjective (see AllDetPl definition). +-- The meaning "entire" is not considered, which allows us to form +-- the pronoun-adjective from the substantive form below: + +oper eEnd_Decl: Str -> CommNoun = \vs -> +{ s = table { + SF Sg Nom => vs+"е" ; + SF Sg Gen => vs+"ех" ; + SF Sg Dat => vs+"ем" ; + SF Sg Acc => vs+"ех" ; + SF Sg Inst => vs+"еми" ; + SF Sg Prepos => vs+"ех" ; + SF Pl Nom => vs+"е" ; + SF Pl Gen => vs +"ех"; + SF Pl Dat => vs+"ем" ; + SF Pl Acc => vs+ "ех" ; + SF Pl Inst => vs+"еми" ; + SF Pl Prepos => vs+"ех" + } ; + g = Neut ; anim = Inanimate +} ; + +--mkAdjCommNounMascInanim: Adjective -> CommNoun = +--\a -> +--{ s = table { +-- SF Sg Nom => a.s ! AF Nom Inanimate (ASg Masc) ; +-- SF Sg Gen => a.s ! AF Gen Inanimate (ASg Masc) ; +-- SF Sg Dat => a.s ! AF Dat Inanimate (ASg Masc) ; +-- SF Sg Acc => a.s ! AF Acc Inanimate (ASg Masc) ; +-- SF Sg Inst => a.s ! AF Inst Inanimate (ASg Masc) ; +-- SF Sg Prepos => a.s ! AF Prepos Inanimate (ASg Masc) ; +-- SF Pl Nom => a.s ! AF Nom Inanimate APl ; +-- SF Pl Gen => a.s ! AF Gen Inanimate APl; +-- SF Pl Dat => a.s ! AF Dat Inanimate APl ; +-- SF Pl Acc => a.s ! AF Acc Inanimate APl ; +-- SF Pl Inst => a.s ! AF Inst Inanimate APl ; +-- SF Pl Prepos => a.s ! AF Prepos Inanimate APl +-- }; +-- g = Masc ; +-- anim = Inanimate +--}; +----2 Adjectives +-- +---- Type Adjective only has positive degree while AdjDegr type +---- includes also comparative and superlative forms. +---- The later entries can be converted into the former using +---- "extAdjective" operation defined in the syntax module +---- 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 "люб" ; +-- drugojDet: Adjective = uy_oj_EndDecl "друг" ; +-- glaznoj: Adjective = uy_oj_EndDecl "глазн" ; + kotorujDet: Adjective = uy_j_EndDecl "котор"; + nekotorujDet: Adjective = uy_j_EndDecl "некотор"; + takoj: Adjective = i_oj_EndDecl "так" []; +-- kakojNibudDet: Adjective = i_oj_EndDecl "как" "-нибудь"; +-- kakojDet: Adjective = i_oj_EndDecl "как" []; +-- nikakojDet: Adjective = i_oj_EndDecl "никак" []; + bolshinstvoSgDet: Adjective = extAdjFromSubst (oEnd_SgDecl "большинств"); + mnogoSgDet: Adjective = extAdjFromSubst (kg_oEnd_SgDecl "мног"); + skolkoSgDet: Adjective = extAdjFromSubst (kg_oEnd_SgDecl "скольк"); + + bolshinstvoPlDet: Adjective = extAdjFromSubst (oEnd_PlDecl "большинств"); + + vseDetPl: Adjective = extAdjFromSubst (eEnd_Decl "вс") ; + extAdjFromSubst: CommNoun -> Adjective = \ vse -> + {s = \\af => vse.s ! SF (numAF af) (caseAF af) } ; + +oper + AdjDegr : Type = {s : Degree => AdjForm => Str} ; + +oper mkAdjDeg: Adjective -> Str -> AdjDegr = \adj, s -> + { s = table + { + Posit => adj.s ; + Compar => \\af => s ; + Superl => \\af => samuj.s !af ++ adj.s ! af + } + }; +--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 { + AF Nom _ (ASg Masc) => "тот"; + AF Nom _ (ASg Fem) => "та"; + AF Nom _ (ASg Neut) => "то"; + AF Nom _ APl => "те"; + AF Acc Inanimate (ASg Masc) => "тот"; + AF Acc Animate (ASg Masc) => "того"; + AF Acc _ (ASg Fem) => "ту"; + AF Acc _ (ASg Neut) => "то"; + AF Acc Inanimate APl => "те"; + AF Acc Animate APl => "тех"; + AF Gen _ (ASg Masc) => "того"; + AF Gen _ (ASg Fem) => "той"; + AF Gen _ (ASg Neut) => "того"; + AF Gen _ APl => "тех"; + AF Inst _ (ASg Masc) => "тем"; + AF Inst _ (ASg Fem) => "той"; + AF Inst _ (ASg Neut) => "тем"; + AF Inst _ APl => "теми"; + AF Dat _ (ASg Masc) => "тому"; + AF Dat _ (ASg Fem) => "той"; + AF Dat _ (ASg Neut) => "тому"; + AF Dat _ APl => "тем"; + AF Prepos _ (ASg Masc) => "том"; + AF Prepos _ (ASg Fem) => "той"; + AF Prepos _ (ASg Neut) => "том"; + AF Prepos _ APl => "тех" ; + AdvF => "то" + } + } ; +oper odinDet: Adjective = {s = table { + AF Nom _ (ASg Masc) => "один"; + AF Nom _ (ASg Fem) => "одна"; + AF Nom _ (ASg Neut) => "одно"; + AF Nom _ APl => "одни"; + AF Acc Inanimate (ASg Masc) => "один"; + AF Acc Animate (ASg Masc) => "одного"; + AF Acc _ (ASg Fem) => "одну"; + AF Acc _ (ASg Neut) => "одно"; + AF Acc Inanimate APl => "одни"; + AF Acc Animate APl => "одних"; + AF Gen _ (ASg Masc) => "одного"; + AF Gen _ (ASg Fem) => "одной"; + AF Gen _ (ASg Neut) => "одного"; + AF Gen _ APl => "одних"; + AF Inst _ (ASg Masc) => "одним"; + AF Inst _ (ASg Fem) => "одной"; + AF Inst _ (ASg Neut) => "одним"; + AF Inst _ APl => "одними"; + AF Dat _ (ASg Masc) => "одному"; + AF Dat _ (ASg Fem) => "одной"; + AF Dat _ (ASg Neut) => "одному"; + AF Dat _ APl => "одним"; + AF Prepos _ (ASg Masc) => "одном"; + AF Prepos _ (ASg Fem) => "одной"; + AF Prepos _ (ASg Neut) => "одном"; + AF Prepos _ APl => "дних"; + AdvF => "одно" + } + } ; +oper etotDet: Adjective = {s = table { + AF Nom _ (ASg Masc) => "этот"; + AF Nom _ (ASg Fem) => "эта"; + AF Nom _ (ASg Neut) => "это"; + AF Nom _ APl => "эти"; + AF Acc Inanimate (ASg Masc) => "этот"; + AF Acc Animate (ASg Masc) => "этого"; + AF Acc _ (ASg Fem) => "эту"; + AF Acc _ (ASg Neut) => "это"; + AF Acc Inanimate APl => "эти"; + AF Acc Animate APl => "этих"; + AF Gen _ (ASg Masc) => "этого"; + AF Gen _ (ASg Fem) => "этой"; + AF Gen _ (ASg Neut) => "этого"; + AF Gen _ APl => "этих"; + AF Inst _ (ASg Masc) => "этим"; + AF Inst _ (ASg Fem) => "этой"; + AF Inst _ (ASg Neut) => "этим"; + AF Inst _ APl => "этими"; + AF Dat _ (ASg Masc) => "этому"; + AF Dat _ (ASg Fem) => "этой"; + AF Dat _ (ASg Neut) => "этому"; + AF Dat _ APl => "этим"; + AF Prepos _ (ASg Masc) => "этом"; + AF Prepos _ (ASg Fem) => "этой"; + AF Prepos _ (ASg Neut) => "этом"; + AF Prepos _ APl => "этих"; + AdvF => "это" + } + } ; +oper vesDet: Adjective = {s = table { + AF Nom _ (ASg Masc) => "весь"; + AF Nom _ (ASg Fem) => "вся"; + AF Nom _ (ASg Neut) => "всё"; + AF Nom _ APl => "все"; + AF Acc Animate (ASg Masc) => "весь"; + AF Acc Inanimate (ASg Masc) => "всего"; + AF Acc _ (ASg Fem) => "всю"; + AF Acc _ (ASg Neut) => "всё"; + AF Acc Inanimate APl => "все"; + AF Acc Animate APl => "всех"; + AF Gen _ (ASg Masc) => "всего"; + AF Gen _ (ASg Fem) => "всей"; + AF Gen _ (ASg Neut) => "всего"; + AF Gen _ APl => "всех"; + AF Inst _ (ASg Masc) => "всем"; + AF Inst _ (ASg Fem) => "всей"; + AF Inst _ (ASg Neut) => "всем"; + AF Inst _ APl => "всеми"; + AF Dat _ (ASg Masc) => "ему"; + AF Dat _ (ASg Fem) => "ей"; + AF Dat _ (ASg Neut) => "ему"; + AF Dat _ APl => "всем"; + AF Prepos _ (ASg Masc) => "всём"; + AF Prepos _ (ASg Fem) => "всей"; + AF Prepos _ (ASg Neut) => "всём"; + AF Prepos _ APl => "всех" ; + AdvF => "полностью" + } + } ; +oper uy_j_EndDecl : Str -> Adjective = \s ->{s = table { + AF Nom _ (ASg Masc) => s+"ый"; + AF Nom _ (ASg Fem) => s+"ая"; + AF Nom _ (ASg Neut) => s+"ое"; + AF Nom _ APl => s+"ые"; + AF Acc Inanimate (ASg Masc) => s+"ый"; + AF Acc Animate (ASg Masc) => s+"ого"; + AF Acc _ (ASg Fem) => s+"ую"; + AF Acc _ (ASg Neut) => s+"ое"; + AF Acc Inanimate APl => s+"ые"; + AF Acc Animate APl => s+"ых"; + AF Gen _ (ASg Masc) => s+"ого"; + AF Gen _ (ASg Fem) => s+"ой"; + AF Gen _ (ASg Neut) => s+"ого"; + AF Gen _ APl => s+"ых"; + AF Inst _ (ASg Masc) => s+"ым"; + AF Inst _ (ASg Fem) => s+"ой"; + AF Inst _ (ASg Neut) => s+"ым"; + AF Inst _ APl => s+"ыми"; + AF Dat _ (ASg Masc) => s+"ому"; + AF Dat _ (ASg Fem) => s+"ой"; + AF Dat _ (ASg Neut) => s+"ому"; + AF Dat _ APl => s+"ым"; + AF Prepos _ (ASg Masc) => s+"ом"; + AF Prepos _ (ASg Fem) => s+"ой"; + AF Prepos _ (ASg Neut) => s+"ом"; + AF Prepos _ APl => s+"ых"; + AdvF => "о" + } + } ; +oper ti_j_EndDecl : Str -> Adjective = \s ->{s = table { + AF Nom _ (ASg Masc) => s+"ий"; + AF Nom _ (ASg Fem) => s+"ья"; + AF Nom _ (ASg Neut) => s+"ье"; + AF Nom _ APl => s+"ьи"; + AF Acc Inanimate (ASg Masc) => s+"ий"; + AF Acc Animate (ASg Masc) => s+"ьего"; + AF Acc _ (ASg Fem) => s+"ью"; + AF Acc _ (ASg Neut) => s+"ье"; + AF Acc Inanimate APl => s+"ьи"; + AF Acc Animate APl => s+"ьих"; + AF Gen _ (ASg Masc) => s+"ьего"; + AF Gen _ (ASg Fem) => s+"ьей"; + AF Gen _ (ASg Neut) => s+"ьего"; + AF Gen _ APl => s+"ьих"; + AF Inst _ (ASg Masc) => s+"ьим"; + AF Inst _ (ASg Fem) => s+"ьей"; + AF Inst _ (ASg Neut) => s+"ьим"; + AF Inst _ APl => s+"ьими"; + AF Dat _ (ASg Masc) => s+"ьему"; + AF Dat _ (ASg Fem) => s+"ьей"; + AF Dat _ (ASg Neut) => s+"ьему"; + AF Dat _ APl => s+"ьим"; + AF Prepos _ (ASg Masc) => s+"ьем"; + AF Prepos _ (ASg Fem) => s+"ьей"; + AF Prepos _ (ASg Neut) => s+"ьем"; + AF Prepos _ APl => s+"ьих"; + AdvF => "ье" + } + } ; + +--oper shi_j_EndDecl : Str -> Adjective = \s ->{s = table { +-- AF Nom _ (ASg Masc) => s+"ий"; +-- AF Nom _ (ASg Fem) => s+"ая"; +-- AF Nom _ (ASg Neut) => s+"ое"; +-- AF Nom _ APl => s+"ие"; +-- AF Acc Inanimate (ASg Masc) => s+"ий"; +-- AF Acc Animate (ASg Masc) => s+"его"; +-- AF Acc _ (ASg Fem) => s+"ую"; +-- AF Acc _ (ASg Neut) => s+"ое"; +-- AF Acc Inanimate APl => s+"ие"; +-- AF Acc Animate APl => s+"их"; +-- AF Gen _ (ASg Masc) => s+"его"; +-- AF Gen _ (ASg Fem) => s+"ей"; +-- AF Gen _ (ASg Neut) => s+"его"; +-- AF Gen _ APl => s+"их"; +-- AF Inst _ (ASg Masc) => s+"им"; +-- AF Inst _ (ASg Fem) => s+"ей"; +-- AF Inst _ (ASg Neut) => s+"им"; +-- AF Inst _ APl => s+"ими"; +-- AF Dat _ (ASg Masc) => s+"ему"; +-- AF Dat _ (ASg Fem) => s+"ей"; +-- AF Dat _ (ASg Neut) => s+"ему"; +-- AF Dat _ APl => s+"им"; +-- AF Prepos _ (ASg Masc) => s+"ем"; +-- AF Prepos _ (ASg Fem) => s+"ей"; +-- AF Prepos _ (ASg Neut) => s+"ем"; +-- AF Prepos _ APl => s+"их"; +-- AdvF => "о" +-- } +-- } ; +-- +--oper indijskij: Adjective = ij_EndK_G_KH_Decl "индийск" ; +--oper francuzskij: Adjective = ij_EndK_G_KH_Decl "французск" ; +--oper anglijskij: Adjective = ij_EndK_G_KH_Decl "английск" ; +--oper datskij: Adjective = ij_EndK_G_KH_Decl "датск" ; +--oper russkij: Adjective = ij_EndK_G_KH_Decl "русск" ; +--oper italyanskij: Adjective = ij_EndK_G_KH_Decl "итальянск" ; +--oper yaponskij: Adjective = ij_EndK_G_KH_Decl "японск" ; +--oper malenkij: AdjDegr = mkAdjDeg (ij_EndK_G_KH_Decl "маленьк") "меньше" ; +--oper vusokij: AdjDegr = mkAdjDeg (ij_EndK_G_KH_Decl "высок") "выше"; +oper ij_EndK_G_KH_Decl : Str -> Adjective = \s ->{s = table { + AF Nom _ (ASg Masc) => s+"ий"; + AF Nom _ (ASg Fem) => s+"ая"; + AF Nom _ (ASg Neut) => s+"ое"; + AF Nom _ APl => s+"ие"; + AF Acc Animate (ASg Masc) => s+"ого"; + AF Acc Inanimate (ASg Masc) => s+"ий"; + AF Acc _ (ASg Fem) => s+"ую"; + AF Acc _ (ASg Neut) => s+"ое"; + AF Acc Animate APl => s+"их"; + AF Acc Inanimate APl => s+"ие"; + AF Gen _ (ASg Masc) => s+"ого"; + AF Gen _ (ASg Fem) => s+"ой"; + AF Gen _ (ASg Neut) => s+"ого"; + AF Gen _ APl => s+"их"; + AF Inst _ (ASg Masc) => s+"им"; + AF Inst _ (ASg Fem) => s+"ой"; + AF Inst _ (ASg Neut) => s+"им"; + AF Inst _ APl => s+"ими"; + AF Dat _ (ASg Masc) => s+"ому"; + AF Dat _ (ASg Fem) => s+"ой"; + AF Dat _ (ASg Neut) => s+"ому"; + AF Dat _ APl => s+"им"; + AF Prepos _ (ASg Masc) => s+"ом"; + AF Prepos _ (ASg Fem) => s+"ой"; + AF Prepos _ (ASg Neut) => s+"ом"; + AF Prepos _ APl => s+"их"; + AdvF => "о" + } + } ; +oper shij_End_Decl : Str -> Adjective = \s ->{s = table { + AF Nom _ (ASg Masc) => s+"ий"; + AF Nom _ (ASg Fem) => s+"ая"; + AF Nom _ (ASg Neut) => s+"ое"; + AF Nom _ APl => s+"ие"; + AF Acc Animate (ASg Masc) => s+"его"; + AF Acc Inanimate (ASg Masc) => s+"ий"; + AF Acc _ (ASg Fem) => s+"ую"; + AF Acc _ (ASg Neut) => s+"ое"; + AF Acc Animate APl => s+"их"; + AF Acc Inanimate APl => s+"ие"; + AF Gen _ (ASg Masc) => s+"его"; + AF Gen _ (ASg Fem) => s+"ей"; + AF Gen _ (ASg Neut) => s+"его"; + AF Gen _ APl => s+"их"; + AF Inst _ (ASg Masc) => s+"им"; + AF Inst _ (ASg Fem) => s+"ей"; + AF Inst _ (ASg Neut) => s+"им"; + AF Inst _ APl => s+"ими"; + AF Dat _ (ASg Masc) => s+"ему"; + AF Dat _ (ASg Fem) => s+"ей"; + AF Dat _ (ASg Neut) => s+"ему"; + AF Dat _ APl => s+"им"; + AF Prepos _ (ASg Masc) => s+"ем"; + AF Prepos _ (ASg Fem) => s+"ей"; + AF Prepos _ (ASg Neut) => s+"ем"; + AF Prepos _ APl => s+"их"; + AdvF => "о" + } + } ; + +--oper bolshoj: AdjDegr = mkAdjDeg (i_oj_EndDecl "больш" []) "больше"; +--oper dorogoj: AdjDegr = mkAdjDeg (i_oj_EndDecl "дорог" []) "дороже"; +oper i_oj_EndDecl : Str -> Str -> Adjective = \s, chastica ->{s = table { + AF Nom _ (ASg Masc) => s+"ой" + chastica ; + AF Nom _ (ASg Fem) => s+"ая"+ chastica ; + AF Nom _ (ASg Neut) => s+"ое"+ chastica ; + AF Nom _ APl => s+"ие"+ chastica ; + AF Acc Animate (ASg Masc) => s+"ого"+ chastica ; + AF Acc Inanimate (ASg Masc) => s+"ое"+ chastica ; + AF Acc _ (ASg Fem) => s+"ую"+ chastica ; + AF Acc _ (ASg Neut) => s+"ое"+ chastica ; + AF Acc Animate APl => s+"их"+ chastica ; + AF Acc Inanimate APl => s+"ие"+ chastica ; + AF Gen _ (ASg Masc) => s+"ого"+ chastica ; + AF Gen _ (ASg Fem) => s+"ой"+ chastica ; + AF Gen _ (ASg Neut) => s+"ого"+ chastica ; + AF Gen _ APl => s+"их"+ chastica ; + AF Inst _ (ASg Masc) => s+"им"+ chastica ; AF Inst _ (ASg Fem) => s+"ой"+ chastica ; + AF Inst _ (ASg Neut) => s+"им"+ chastica ; + AF Inst _ APl => s+"ими"+ chastica ; + AF Dat _ (ASg Masc) => s+"ому"+ chastica ; + AF Dat _ (ASg Fem) => s+"ой"+ chastica ; + AF Dat _ (ASg Neut) => s+"ому"+ chastica ; + AF Dat _ APl => s+"им"+ chastica ; + AF Prepos _ (ASg Masc) => s+"ом"+ chastica ; + AF Prepos _ (ASg Fem) => s+"ой"+ chastica ; + AF Prepos _ (ASg Neut) => s+"ом"+ chastica ; + AF Prepos _ APl => s+"их" + chastica; + AdvF => "о" + } + } ; +--oper molodoj: AdjDegr = mkAdjDeg (uy_oj_EndDecl "молод") "моложе"; + +oper uy_oj_EndDecl : Str -> Adjective = \s ->{s = table { + AF Nom _ (ASg Masc) => s+"ой"; + AF Nom _ (ASg Fem) => s+"ая"; + AF Nom _ (ASg Neut) => s+"ое"; + AF Nom _ APl => s+"ые"; + AF Acc Animate (ASg Masc) => s+"ого"; + AF Acc Inanimate (ASg Masc) => s+"ой"; + AF Acc _ (ASg Fem) => s+"ую"; + AF Acc _ (ASg Neut) => s+"ое"; + AF Acc Animate APl => s+"ых"; + AF Acc Inanimate APl => s+"ые"; + AF Gen _ (ASg Masc) => s+"ого"; + AF Gen _ (ASg Fem) => s+"ой"; + AF Gen _ (ASg Neut) => s+"ого"; + AF Gen _ APl => s+"ых"; + AF Inst _ (ASg Masc) => s+"ым"; + AF Inst _ (ASg Fem) => s+"ой"; + AF Inst _ (ASg Neut) => s+"ым"; + AF Inst _ APl => s+"ыми"; + AF Dat _ (ASg Masc) => s+"ому"; + AF Dat _ (ASg Fem) => s+"ой"; + AF Dat _ (ASg Neut) => s+"ому"; + AF Dat _ APl => s+"ым"; + AF Prepos _ (ASg Masc) => s+"ом"; + AF Prepos _ (ASg Fem) => s+"ой"; + AF Prepos _ (ASg Neut) => s+"ом"; + AF Prepos _ APl => s+"ых"; + AdvF => "о" + } + } ; +--oper prostuzhen: Adjective = shortDecl1 "простужен" ; +--oper beremenen: Adjective = shortDecl "беремен" ; +--oper need: Adjective = shortDecl "нуж" ; +--oper shortDecl1 : Str -> Adjective = \s ->{s = table { +-- AF _ _ (ASg Masc) => s; +-- AF _ _ (ASg Fem) => s+"а"; +-- AF _ _ (ASg Neut) => s+"о"; +-- AF _ _ APl => s+"ы" ; +-- AdvF => "о" +-- } +-- } ; +--oper shortDecl : Str -> Adjective = \s ->{s = table { +-- AF _ _ (ASg Masc) => s +"ен"; +-- AF _ _ (ASg Fem) => s+"на"; +-- AF _ _ (ASg Neut) => s+"но"; +-- AF _ _ APl => s+"ны" ; +-- AdvF => "о" +-- } -- } ; +-- +---- 2 Adverbs +-- +--oper vsegda: Adverb = { s = "всегда" } ; +--oper chorosho: Adverb = { s = "хорошо" } ; +-- +---- 2 Verbs +-- +---- Dummy verbum "have" that corresponds to the phrases like +---- "I have a headache" in English. The corresponding sentence +---- in Russian doesn't contain a verb: +-- +--oper have: Verbum = {s=\\ vf => "-" ; asp = Imperfective} ; +-- +---- There are two common conjugations +---- (according to the number and the person of the subject) +---- patterns in the present tense in the indicative mood. +-- +param Conjugation = First | FirstE | Second | Mixed | Dolzhen; +-- +--3 First conjugation (in Present) verbs : + +--oper verbGulyat : Verbum = verbDecl Imperfective First "гуля" "ю" "гулял" "гуляй" "гулять"; +--oper verbVkluchat : Verbum = verbDecl Imperfective First "включа" "ю" "включал" "включай" "включать"; +--oper verbSuchestvovat : Verbum = verbDecl Imperfective First "существу" "ю" "существовал" "существуй" "существовать"; +--oper verbVukluchat : Verbum = verbDecl Imperfective First "выключа" "ю" "выключал" "выключай" "выключать"; +--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 = verbDeclMoch 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 "люб" "лю" "любил" "люби" "любить"; +--oper verbGovorit : Verbum = verbDecl Imperfective Second "говор" "ю" "говорил" "говори" "говорить"; +-- --oper verbBolet_2 : Verbum = verbDecl Imperfective Second "бол" "ю" "болел" "боли" "болеть"; +--oper verbPoranit : Verbum = verbDecl Perfective Second "поран" "ю" "поранил" "порань" "поранить"; +-- -- Irregular Mixed: +oper verbKhotet : Verbum = verbDecl Imperfective Mixed "хоч" "у" "хотел" "хоти" "хотеть"; + +-- Irregular +oper verbDolzhen : Verbum = verbDecl Imperfective Dolzhen "долж" "ен" "долж" ["будь должен"] ["быть должным"] ; + +-- To reduces the redundancies in the definitions +-- we introduce some intermediate types, +-- so that the full type can be described as a combination +-- of the intermediate types. For example "AspectVoice" +-- is a type for defining a pattern for a particular +-- aspect and voice. + +oper AspectVoice: Type = { s : VerbConj => Str ; asp: Aspect } ; + +-- "PresentVerb" takes care of the present tense conjugation. + +param PresentVF = PRF GenNum Person; +oper PresentVerb : Type = PresentVF => Str ; +oper presentConjDolzhen: Str -> Str -> PresentVerb = \del, sgP1End -> + table { + PRF APl _ => del+ "ны" ; + PRF (ASg Masc) P1 => del+ sgP1End ; + PRF (ASg Fem) P1 => del+ "на" ; + PRF (ASg Neut) P1 => del+ "но" ; + PRF (ASg Masc) P2 => del+ sgP1End ; + PRF (ASg Fem) P2 => del+ "на" ; + PRF (ASg Neut) P2 => del+ "но" ; + PRF (ASg Masc) P3 => del+ sgP1End ; + PRF (ASg Fem) P3 => del+ "на" ; + PRF (ASg Neut) P3 => del+ "но" }; + +oper presentConjMixed: Str -> Str -> PresentVerb = \del, sgP1End -> + table { + PRF (ASg _) P1 => del+ sgP1End ; + PRF (ASg _) P2 => del+ "ешь" ; + PRF (ASg _) P3 => del+ "ет" ; + PRF APl P1 => del+ "им" ; + PRF APl P2 => del+ "ите" ; + PRF APl P3 => del+ "ят" + }; +oper presentConj2: Str -> Str -> PresentVerb = \del, sgP1End -> + table { + PRF (ASg _) P1 => del+ sgP1End ; + PRF (ASg _) P2 => del+ "ишь" ; + PRF (ASg _) P3 => del+ "ит" ; + PRF APl P1 => del+ "им" ; + PRF APl P2 => del+ "ите" ; + PRF APl P3 => del+ "ят" + }; + +oper presentConj1E: Str -> Str -> PresentVerb = \del, sgP1End -> + table { + PRF (ASg _) P1 => del+ sgP1End ; + PRF (ASg _) P2 => del+ "ёшь" ; + PRF (ASg _) P3 => del+ "ёт" ; + PRF APl P1 => del+ "ём" ; + PRF APl P2 => del+ "ёте" ; + PRF APl P3 => del+ sgP1End + "т" + }; +oper presentConj1: Str -> Str -> PresentVerb = \del, sgP1End -> + table { + PRF (ASg _) P1 => del+ sgP1End ; + PRF (ASg _) P2 => del+ "ешь" ; + PRF (ASg _) P3 => del+ "ет" ; + PRF APl P1 => del+ "ем" ; + PRF APl P2 => del+ "ете" ; + PRF APl P3 => del+ sgP1End + "т" + }; +oper presentConj1Moch: Str -> Str -> Str -> PresentVerb = \del, sgP1End, altRoot -> + table { + PRF (ASg _) P1 => del + sgP1End ; + PRF (ASg _) P2 => altRoot + "ешь" ; + PRF (ASg _) P3 => altRoot + "ет" ; + PRF APl P1 => altRoot + "ем" ; + PRF APl P2 => altRoot + "ете" ; + PRF APl P3 => del+ sgP1End + "т" + }; + +-- "PastVerb" takes care of the past tense conjugation. + +param PastVF = PSF GenNum ; +oper PastVerb : Type = PastVF => Str ; +oper pastConj: Str -> PastVerb = \del -> + table { + PSF (ASg Masc) => del ; + PSF (ASg Fem) => del +"а" ; + PSF (ASg Neut) => del+"о" ; + PSF APl => del+ "и" + }; + +oper pastConjDolzhen: Str -> PastVerb = \del -> + table { + PSF (ASg Masc) => ["был "] + del + "ен" ; + PSF (ASg Fem) => ["была "] + del + "на" ; + PSF (ASg Neut) => ["было "] + del + "но" ; + PSF APl => ["были "] + del + "ны" + }; + +-- "verbDecl" sorts out verbs according to the aspect and voice parameters. +-- It produces the full conjugation table for a verb entry + +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) + } +}; + +-- for verbs like "мочь" ("can") with changing consonants (first conjugation): +-- "могу - можешь" +oper verbDeclMoch: Aspect -> Conjugation -> Str -> Str -> Str -> Str ->Str -> Str -> Verbum = + \a, c, del, sgP1End, sgMascPast, imperSgP2, inf, altRoot -> case a of + { Perfective => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConj1Moch del sgP1End altRoot) (pastConj sgMascPast)) (pastConj sgMascPast); + Imperfective => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConj1Moch del sgP1End altRoot) (pastConj sgMascPast)) (pastConj sgMascPast) + }; + + +-- "mkVerb" produce the passive forms from +-- the active forms using the "mkPassive" method. +-- Passive is expressed in Russian by so called reflexive verbs, +-- which are formed from the active form by suffixation. + +oper mkVerb : AspectVoice -> PastVerb -> Verbum = \av1, pv -> { s = table { + VFORM Act vf => av1.s !vf; + VFORM Pass vf => (mkPassive av1 pv ).s ! vf + } ; + asp = av1.asp +}; + +-- vowels : Strs = strs { +-- "а" ; "е" ; "ё" ; "и" ; "о" ; "у" ; +-- "ы" ; "э" ; "ю" ; "я" +-- } ; +-- +oper mkPassive: AspectVoice -> PastVerb -> AspectVoice = \av, pv -> + { s = table { + VINF => av.s ! VINF + "ся"; + VIMP Sg P1 => av.s ! (VIMP Sg P1) +"сь" ; + VIMP Pl P1 => av.s ! (VIMP Pl P1) +"ся"; + VIMP Sg P2 => av.s ! (VIMP Sg P2 ) +"сь"; + VIMP Pl P2 => av.s! (VIMP Pl P2) +"сь"; + VIMP Sg P3 => av.s ! (VIMP Sg P3) +"ся"; + VIMP Pl P3 => av.s ! (VIMP Pl P3) +"ся"; + VSUB (ASg Masc) => pv ! (PSF (ASg Masc)) + "ся"+[" бы"]; + VSUB (ASg Fem) => pv ! (PSF (ASg Fem)) + "сь"+[" бы"]; + VSUB (ASg Neut) => pv ! (PSF (ASg Neut)) + "сь"+[" бы"]; + VSUB APl => pv ! (PSF APl) + "сь"+[" бы"] ; + VIND (ASg _) (VPresent P1) => + -- case av.asp of { Imperfective => + av.s ! (VIND (ASg Masc) (VPresent P1)) + "сь" ; + -- Perfective = > nonExist + -- } ; + VIND (ASg _) (VPresent P2) => av.s ! (VIND (ASg Masc) (VPresent P2))+ "ся" ; + VIND (ASg _) (VPresent P3) => av.s ! (VIND (ASg Masc) (VPresent P3))+ "ся" ; + VIND APl (VPresent P1) => av.s !( VIND APl (VPresent P1)) + "ся" ; + VIND APl (VPresent P2) => av.s !( VIND APl (VPresent P2)) + "сь" ; + VIND APl (VPresent P3) => av.s !( VIND APl (VPresent P3)) + "ся" ; + VIND (ASg _) (VFuture P1) => av.s ! (VIND (ASg Masc) (VFuture P1)) + "сь"; + VIND (ASg _) (VFuture P2) => av.s! (VIND (ASg Masc) (VFuture P2) )+ "ся"; + VIND (ASg _) (VFuture P3) => av.s! (VIND (ASg Masc) (VFuture P3)) + "ся"; + VIND APl (VFuture P1) => av.s! (VIND APl (VFuture P1) )+ "ся"; + VIND APl (VFuture P2) => av.s! (VIND APl (VFuture P2) )+ "сь"; + VIND APl (VFuture P3) => av.s! (VIND APl (VFuture P3)) + "ся"; + VIND (ASg Masc) VPast => av.s ! (VIND (ASg Masc) VPast ) + "ся"; + VIND (ASg Fem) VPast => av.s ! (VIND (ASg Fem) VPast ) + "сь"; + VIND (ASg Neut) VPast => av.s ! (VIND (ASg Neut) VPast) + "сь"; + VIND APl VPast => av.s ! (VIND APl VPast ) + "сь" + } ; + asp = av.asp +}; + +-- Generation the imperfective active pattern given +-- a number of basic conjugation forms. + +oper + imperfectiveActivePattern : Str -> Str -> PresentVerb -> PastVerb -> AspectVoice = + \inf, imper, presentFuture, past -> { s= table { + VINF => inf ; + VIMP Sg P1 => ["давайте "]+ inf ; + VIMP Pl P1 => ["давайте "] + inf ; + VIMP Sg P2 => imper ; + VIMP Pl P2 => imper+"те" ; + VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF (ASg Masc) P3) ; + VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF APl P3) ; + VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"]; + VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"]; + VSUB (ASg Neut) => past ! (PSF (ASg Neut) )+[" бы"]; + VSUB APl => past ! (PSF APl) +[" бы"]; + VIND (ASg _) (VPresent P1) => presentFuture ! ( PRF (ASg Masc) P1); + VIND (ASg _) (VPresent P2) => presentFuture! (PRF (ASg Masc) P2) ; + VIND (ASg _) (VPresent P3) => presentFuture ! (PRF (ASg Masc) P3) ; + VIND APl (VPresent P1) => presentFuture ! (PRF APl P1); + VIND APl (VPresent P2) => presentFuture ! (PRF APl P2); + VIND APl (VPresent P3) => presentFuture ! (PRF APl P3); + VIND (ASg _) (VFuture P1) => ["буду "] + presentFuture ! (PRF (ASg Masc) P1) ; + VIND (ASg _) (VFuture P2) => ["будешь"] + presentFuture ! (PRF (ASg Masc) P2) ; + VIND (ASg _) (VFuture P3) => ["будет "] + presentFuture ! (PRF (ASg Masc) P3) ; + VIND APl (VFuture P1) => ["будем "] + presentFuture ! (PRF APl P1) ; + VIND APl (VFuture P2) => ["будете "] + presentFuture ! (PRF APl P2) ; + VIND APl (VFuture P3) => ["будут "] + presentFuture ! (PRF APl P3) ; + VIND (ASg Masc) VPast => past ! (PSF (ASg Masc)) ; + VIND (ASg Fem) VPast => past ! (PSF (ASg Fem) ) ; + VIND (ASg Neut) VPast => past ! (PSF (ASg Neut)) ; + VIND APl VPast => past ! (PSF APl) + } ; + asp = Imperfective +} ; + + oper perfectiveActivePattern: Str -> Str -> PresentVerb -> PastVerb -> AspectVoice = + \inf, imper, presentFuture, past -> { s= table { + VINF => inf ; + VIMP Sg P1 => ["давайте "]+ presentFuture ! (PRF (ASg Masc) P1); + VIMP Pl P1 => ["давайте "] + presentFuture ! (PRF APl P1); + VIMP Sg P2 => imper ; + VIMP Pl P2 => imper+"те" ; + VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF (ASg Masc) P3) ; + VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF APl P3) ; + VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"]; + VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"]; + + VSUB (ASg Neut) => past ! (PSF (ASg Neut) )+[" бы"]; + VSUB APl => past ! (PSF APl) +[" бы"]; + VIND (ASg _) (VPresent _) => [] ; + VIND APl (VPresent P1) => nonExist ; + VIND APl (VPresent P2) => nonExist ; + VIND APl (VPresent P3) => [] ; + VIND (ASg _) (VFuture P1) => presentFuture ! (PRF (ASg Masc) P1) ; + VIND (ASg _) (VFuture P2) => presentFuture ! (PRF (ASg Masc) P2) ; + VIND (ASg _) (VFuture P3) => presentFuture ! (PRF (ASg Masc) P3) ; + VIND APl (VFuture P1) => presentFuture ! (PRF APl P1) ; + VIND APl (VFuture P2) => presentFuture ! (PRF APl P2) ; + VIND APl (VFuture P3) => presentFuture ! (PRF APl P3) ; + VIND (ASg Masc) VPast => past ! (PSF (ASg Masc)) ; + VIND (ASg Fem) VPast => past ! (PSF (ASg Fem) ) ; + VIND (ASg Neut) VPast => past ! (PSF (ASg Neut)) ; + VIND APl VPast => past ! (PSF APl) + } ; + asp = Perfective +} ; + +----2 Proper names are a simple kind of noun phrases. +-- +oper + ProperName : Type = {s : Case => Str ; g : Gender ; anim : Animacy} ; +-- +-- mkCNProperName : CommNoun -> ProperName = \cn -> +--{s = \\c => cn.s! (SF Sg c); g=cn.g; anim = cn.anim }; +-- + mkProperNameMasc : Str -> Animacy -> ProperName = \ivan, anim -> + { s = table { Nom => ivan ; + Gen => ivan + "а"; + Dat => ivan + "у"; + Acc => case anim of + { Animate => ivan + "а"; + Inanimate => ivan + }; + Inst => ivan + "ом"; + Prepos => ivan + "е" } ; + g = Masc; anim = anim }; + + mkProperNameFem : Str -> Animacy -> ProperName = \masha, anim -> + { s = table { Nom => masha + "а"; + Gen => masha + "и"; + Dat => masha + "е"; + Acc => masha + "у"; + Inst => masha + "ей"; + Prepos => masha + "е" } ; + g = Fem ; anim = anim }; + +}; + + diff --git a/lib/resource-1.0/russian/NounRus.gf b/lib/resource-1.0/russian/NounRus.gf index b4918c3e5..2e232ffdc 100644 --- a/lib/resource-1.0/russian/NounRus.gf +++ b/lib/resource-1.0/russian/NounRus.gf @@ -1,77 +1,166 @@ ---# -path=.:../abstract:../common:../../prelude - - - -concrete NounRus of Noun = CatRus ** open ResRus, Prelude in { --- --- flags optimize=all_subs ; --- --- lin --- DetCN det cn = { --- s = \\c => det.s ++ cn.s ! det.n ! c ; --- a = agrP3 det.n --- } ; --- UsePN pn = pn ** {a = agrP3 Sg} ; --- UsePron p = p ; --- --- PredetNP pred np = { --- s = \\c => pred.s ++ np.s ! c ; --- a = np.a --- } ; --- --- DetSg quant ord = { --- s = quant.s ++ ord.s ; --- n = Sg --- } ; --- --- DetPl quant num ord = { --- s = quant.s ++ num.s ++ ord.s ; --- n = Pl --- } ; --- --- SgQuant quant = {s = quant.s ! Sg} ; --- PlQuant quant = {s = quant.s ! Pl} ; --- --- PossPron p = {s = \\_ => p.s ! Gen} ; --- --- NoNum, NoOrd = {s = []} ; --- --- NumInt n = n ; --- OrdInt n = {s = n.s ++ "th"} ; --- --- --- NumNumeral numeral = {s = numeral.s ! NCard} ; --- OrdNumeral numeral = {s = numeral.s ! NOrd} ; --- --- AdNum adn num = {s = adn.s ++ num.s} ; --- --- OrdSuperl a = {s = a.s ! AAdj Superl} ; --- --- DefArt = {s = \\_ => artDef} ; --- --- IndefArt = { --- s = table { --- Sg => artIndef ; --- Pl => [] --- } --- } ; --- --- MassDet = {s = [] ; n = Sg} ; --- --- UseN n = n ; --- UseN2 n = n ; --- UseN3 n = n ; --- --- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ; --- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ; --- --- AdjCN ap cn = { --- s = \\n,c => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n ! c) --- } ; --- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ; --- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ; --- --- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ; --- --- ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! c} ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { + + flags optimize=all_subs ; + + lin + DetCN kazhduj okhotnik = { + s = \\c => case kazhduj.c of { + Nom => + kazhduj.s ! AF (extCase c) okhotnik.anim (gNum okhotnik.g kazhduj.n) ++ + okhotnik.s ! kazhduj.n ! (extCase c) ; + _ => + kazhduj.s ! AF (extCase c) okhotnik.anim (gNum okhotnik.g kazhduj.n) ++ + okhotnik.s ! kazhduj.n ! kazhduj.c }; + n = kazhduj.n ; + p = P3 ; + pron = False; + g = kazhduj.g ; + anim = okhotnik.anim + } ; + + UsePN masha = { + s = \\c => masha.s ! (extCase c) ; + p = P3; g = PGen masha.g ; anim = masha.anim ; + n = Sg; nComp = Sg; pron = False} ; + + UsePron p = p ** {anim = Inanimate}; + + PredetNP pred np = { + s = \\pf => pred.s! (AF (extCase pf) np.anim (gNum (pgen2gen np.g) np.n))++ np.s ! pf ; + n = np.n; + p = np.p; + g = np.g; + anim = np.anim; + pron = np.pron + } ; + + DetSg quant ord = { + s = \\af => quant.s!af ++ ord.s!af ; + n = quant.n; + g = quant.g; + c = quant.c + } ; + + DetPl quant num ord = { + s = \\af => quant.s !af ++ num.s! (caseAF af) ! (genAF af) ++ ord.s!af ; + n = Pl; + g = quant.g; + c = quant.c + } ; + + SgQuant quant = {s = quant.s; c=quant.c; g=quant.g; n= Sg} ; + PlQuant quant = {s = quant.s ; c=quant.c; g=quant.g; n= Pl} ; + + PossPron p = {s = \\af => p.s ! mkPronForm (caseAF af) No (Poss (gNum (genAF af) (numAF af) )); c=Nom; g = PNoGen} ; + + NoNum = {s = \\_,_ => []} ; -- cardinal numeral + NoOrd = {s = \\_ => []} ; -- adjective + +-- unclear how to tell apart the numbers from their string representation, +-- so just leave a decimal representation, without case-suffixes: + NumInt i = {s = table { _ => table {_ => i.s } } } ; + +-- OrdInt n = case n of { +-- 0|2|6 => (uy_oj_EndDecl n.s) ; +-- 3 => (ti_j_EndDecl n.s) ; +-- _ => uy_j_EndDecl n.s } ; + +-- OrdNumeral numeral = +-- {s = \\ af => (uy_j_EndDecl (numeral.s ! caseAF af ! genAF af)).s!af} ; + + NumNumeral n = n ; + + + AdNum adn num = {s = \\c,n => adn.s ++ num.s!c!n} ; + + OrdSuperl a = {s = a.s!Posit}; + + DefArt = {s = \\_=>[] ; c=Nom; g = PNoGen }; + IndefArt = { s = \\_=>[] ; c=Nom; g = PNoGen }; + MassDet = {s = \\_=>[] ; c=Nom; g = PNoGen; n = Sg} ; + + UseN sb = + {s = \\n,c => sb.s ! SF n c ; + g = sb.g ; + anim = sb.anim + } ; + +-- It is possible to use a function word as a common noun; the semantics is +-- often existential or indexical. + UseN2 x = x ; + UseN3 x = x ; + +-- The application of a function gives, in the first place, a common noun: +-- "ключ от дома". From this, other rules of the resource grammar +-- give noun phrases, such as "ключи от дома", "ключи от дома +-- и от машины", and "ключ от дома и машины" (the +-- latter two corresponding to distributive and collective functions, +-- respectively). Semantics will eventually tell when each +-- of the readings is meaningful. + + ComplN2 mama ivan = + {s = \\n, cas => case ivan.pron of + { True => ivan.s ! (mkPronForm cas No (Poss (gNum mama.g n))) ++ mama.s ! n ! cas; + False => mama.s ! n ! cas ++ mama.s2 ++ + ivan.s ! (mkPronForm mama.c Yes (Poss (gNum mama.g n))) + }; + g = mama.g ; + anim = mama.anim + } ; + +-- Two-place functions add one argument place. +-- There application starts by filling the first place. + + ComplN3 poezd paris = + {s = \\n,c => poezd.s ! n ! c ++ poezd.s2 ++ paris.s ! (PF poezd.c Yes NonPoss) ; + g = poezd.g ; anim = poezd.anim; + s2 = poezd.s3; c = poezd.c2 + } ; + + +-- The two main functions of adjective are in predication ("Иван - молод") +-- and in modification ("молодой человек"). Predication will be defined +-- later, in the chapter on verbs. + + AdjCN khoroshij novayaMashina = + {s = \\n, c => + khoroshij.s ! AF c novayaMashina.anim (gNum novayaMashina.g n) ++ + novayaMashina.s ! n ! c ; + g = novayaMashina.g ; + anim = novayaMashina.anim + } ; + +-- This is a source of the "man with a telescope" ambiguity, and may produce +-- strange things, like "машины всегда". +-- Semantics will have to make finer distinctions among adverbials. + + AdvCN chelovek uTelevizora = + {s = \\n,c => chelovek.s ! n ! c ++ uTelevizora.s ; + g = chelovek.g ; + anim = chelovek.anim + } ; + +-- Constructions like "the idea that two is even" are formed at the +-- first place as common nouns, so that one can also have "a suggestion that...". + + SentCN idea x = + {s = \\n,c => idea.s ! n ! c ++ ["о том, что"] ++ x.s ; + g = idea.g; anim = idea.anim + } ; + + RelCN idea x = + {s = \\n,c => idea.s ! n ! c ++ ["о том, что"] ++ x.s !(gNum idea.g n)!c!idea.anim ; + g = idea.g; anim = idea.anim + } ; + + ApposCN cn s = + {s = \\n,c => cn.s ! n ! c ++ s.s! PF c No NonPoss ; + g = cn.g ; + anim = cn.anim + } ; + + +} + diff --git a/lib/resource-1.0/russian/NumeralRus.gf b/lib/resource-1.0/russian/NumeralRus.gf index 6a3840adb..1f7de26e3 100644 --- a/lib/resource-1.0/russian/NumeralRus.gf +++ b/lib/resource-1.0/russian/NumeralRus.gf @@ -1,46 +1,103 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete NumeralRus of Numeral = CatRus ** open ResRus in { --- ---lincat --- Digit = {s : DForm => CardOrd => Str} ; --- Sub10 = {s : DForm => CardOrd => Str ; n : Number} ; --- Sub100 = {s : CardOrd => Str ; n : Number} ; --- Sub1000 = {s : CardOrd => Str ; n : Number} ; --- Sub1000000 = {s : CardOrd => Str ; n : Number} ; --- ---lin num x = x ; ---lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in --- {s = \\f,c => case of { --- => "twelfth" ; --- _ => two.s ! f ! c --- } --- } ; --- ---lin n3 = mkNum "three" "thirteen" "thirty" "third" ; ---lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; ---lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; ---lin n6 = regNum "six" ; ---lin n7 = regNum "seven" ; ---lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; ---lin n9 = regNum "nine" ; --- ---lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; ---lin pot0 d = d ** {n = Pl} ; ---lin pot110 = regCardOrd "ten" ** {n = Pl} ; ---lin pot111 = regCardOrd "eleven" ** {n = Pl} ; ---lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; ---lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; ---lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; ---lin pot1plus d e = { --- s = \\c => d.s ! ten ! NCard ++ "-" ++ e.s ! unit ! c ; n = Pl} ; ---lin pot1as2 n = n ; ---lin pot2 d = {s = \\c => d.s ! unit ! NCard ++ mkCard c "hundred"} ** {n = Pl} ; ---lin pot2plus d e = { --- s = \\c => d.s ! unit ! NCard ++ "hundred" ++ "and" ++ e.s ! c ; n = Pl} ; ---lin pot2as3 n = n ; ---lin pot3 n = { --- s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ; ---lin pot3plus n m = { --- s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ; -} +--# -path=.:../abstract:../common:../../prelude + +concrete NumeralRus of Numeral = CatRus ** open ResRus in { + +flags coding=utf8 ; + +-- Toiska, 13/8/2000, AR with Arto Mustajoki. + +lincat Digit = {s : DForm => Gender => Str ; size : Size} ; +lincat Sub10 = {s : Place => DForm => Gender => Str ; size : Size} ; +lincat Sub100 = {s : Place => Gender => Str ; size : Size} ; +lincat Sub1000 = {s : Place => Gender => Str ; size : Size} ; +lincat Sub1000000 = {s : Gender => Str} ; + +lin num x = {s = table{ _ => x.s }}; + +lin n2 = + {s = table {{unit} => table {{Fem} => "две" ; _ => "два"} ; + {teen} => gg "двенадцать" ; + {ten} => gg "двадцать" ; + {hund} => gg "двести"} ; + size = sgg} ; +lin n3 = + {s = table {{unit} => gg "три" ; + {teen} => gg "тринадцать" ; + {ten} => gg "тридцать" ; + {hund} => gg "триста"} ; + size = sgg} ; +lin n4 = + {s = table {{unit} => gg "четыре" ; + {teen} => gg "четырнадцать" ; + {ten} => gg "сорок" ; + {hund} => gg "четыреста"} ; + size = sgg} ; +lin n5 = + {s = table {{unit} => gg "пять" ; + {teen} => gg "пятнадцать" ; + {ten} => gg "пятьдесят" ; + {hund} => gg "пятьсот"} ; + size = plg} ; +lin n6 = + {s = table {{unit} => gg "шесть" ; + {teen} => gg "шестнадцать" ; + {ten} => gg "шестьдесят" ; + {hund} => gg "шестьсот"} ; + size = plg} ; +lin n7 = + {s = table {{unit} => gg "семь" ; + {teen} => gg "семнадцать" ; + {ten} => gg "семьдесят" ; + {hund} => gg "семьсот"} ; + size = plg} ; +lin n8 = + {s = table {{unit} => gg "восемь" ; + {teen} => gg "восемнадцать" ; + {ten} => gg "восемьдесят" ; + {hund} => gg "восемьсот"} ; + size = plg} ; +lin n9 = + {s = table {{unit} => gg "девять" ; + {teen} => gg "девятнадцать" ; + {ten} => gg "девяносто" ; + {hund} => gg "девятьсот"} ; + size = plg} ; + + +lin pot01 = + {s = table {{attr} => table {{hund} => gg "сто" ; _ => gg []} ; + _ => table {{hund} => gg "сто" ; + _ => table {{Masc} => "один" ; {Fem} => "одна" ; _ => "одно"}}} ; + size = nom} ; +lin pot0 d = + {s = table {_ => d.s} ; size = d.size} ; +lin pot110 = + {s = table {_ => gg "десять"} ; size = plg} ; +lin pot111 = + {s = table {_ => gg "одиннадцать"} ; size = plg} ; --- 11 +lin pot1to19 d = + {s = table {_ => d.s ! teen} ; size = plg} ; +lin pot0as1 n = + {s = table {p => n.s ! p ! unit} ; size = n.size} ; +lin pot1 d = + {s = table {_ => d.s ! ten} ; size = plg} ; --- +lin pot1plus d e = + {s = table {_ => + table {g => d.s ! ten ! g ++ e.s ! indep ! unit ! g}} ; size = e.size} ; +lin pot1as2 n = + {s = n.s ; size = n.size} ; +lin pot2 d = + {s = table {p => d.s ! p ! hund} ; size = plg} ; +lin pot2plus d e = + {s = table {p => table {g => d.s ! p ! hund ! g ++ e.s ! indep ! g}} ; size = e.size} ; +lin pot2as3 n = + {s = n.s ! indep} ; +lin pot3 n = + {s = gg (n.s ! attr ! Fem ++ mille ! n.size)} ; +lin pot3plus n m = + {s = table {g => n.s ! attr ! Fem ++ mille ! n.size ++ m.s ! indep ! g}} ; + +--- TODO +--- raz/odin +} + diff --git a/lib/resource-1.0/russian/ParadigmsRus.gf b/lib/resource-1.0/russian/ParadigmsRus.gf index 43b3a2600..041feed4b 100644 --- a/lib/resource-1.0/russian/ParadigmsRus.gf +++ b/lib/resource-1.0/russian/ParadigmsRus.gf @@ -1,468 +1,925 @@ ---# -path=.:../abstract:../../prelude:../common --- -----1 Russian Lexical Paradigms ----- ----- Aarne Ranta 2003--2005 ----- ----- This is an API to the user of the resource grammar ----- for adding lexical items. It gives functions for forming ----- expressions of open categories: nouns, adjectives, verbs. ----- ----- Closed categories (determiners, pronouns, conjunctions) are ----- accessed through the resource syntax API, $Structural.gf$. ----- ----- The main difference with $MorphoRus.gf$ is that the types ----- referred to are compiled resource grammar types. We have moreover ----- had the design principle of always having existing forms, rather ----- than stems, as string arguments of the paradigms. ----- ----- The structure of functions for each word class $C$ is the following: ----- first we give a handful of patterns that aim to cover all ----- regular cases. Then we give a worst-case function $mkC$, which serves as an ----- escape to construct the most irregular words of type $C$. ----- However, this function should only seldom be needed: we have a ----- separate module $IrregularRus$, which covers all irregularly inflected ----- words. ----- ----- The following modules are presupposed: --- -resource ParadigmsRus = open - (Predef=Predef), - Prelude, - MorphoRus, - CatRus - in { -----2 Parameters ----- ----- To abstract over gender names, we define the following identifiers. --- ---oper --- Gender : Type ; --- --- human : Gender ; --- nonhuman : Gender ; --- masculine : Gender ; --- ----- To abstract over number names, we define the following. --- --- Number : Type ; --- --- singular : Number ; --- plural : Number ; --- ----- To abstract over case names, we define the following. --- --- Case : Type ; --- --- nominative : Case ; --- genitive : Case ; --- ----- Prepositions are used in many-argument functions for rection. --- --- Preposition : Type ; --- --- -----2 Nouns --- ----- Worst case: give all four forms and the semantic gender. --- --- mkN : (man,men,man's,men's : Str) -> N ; --- ----- The regular function captures the variants for nouns ending with ----- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes"; ----- "fly - flies" (but "toy - toys"), --- --- regN : Str -> N ; --- ----- In practice the worst case is just: give singular and plural nominative. --- --- mk2N : (man,men : Str) -> N ; --- ----- All nouns created by the previous functions are marked as ----- $nonhuman$. If you want a $human$ noun, wrap it with the following ----- function: --- --- genderN : Gender -> N -> N ; --- -----3 Compound nouns ----- ----- A compound noun ia an uninflected string attached to an inflected noun, ----- such as "baby boom", "chief executive officer". --- --- compoundN : Str -> N -> N ; --- --- -----3 Relational nouns ----- ----- Relational nouns ("daughter of x") need a preposition. --- --- mkN2 : N -> Preposition -> N2 ; --- ----- The most common preposition is "of", and the following is a ----- shortcut for regular relational nouns with "of". --- --- regN2 : Str -> N2 ; --- ----- Use the function $mkPreposition$ or see the section on prepositions below to ----- form other prepositions. ----- ----- Three-place relational nouns ("the connection from x to y") need two prepositions. --- --- mkN3 : N -> Preposition -> Preposition -> N3 ; --- --- -----3 Relational common noun phrases ----- ----- In some cases, you may want to make a complex $CN$ into a ----- relational noun (e.g. "the old town hall of"). --- --- cnN2 : CN -> Preposition -> N2 ; --- cnN3 : CN -> Preposition -> Preposition -> N3 ; --- ----- -----3 Proper names and noun phrases ----- ----- Proper names, with a regular genitive, are formed as follows --- --- regPN : Str -> Gender -> PN ; -- John, John's --- ----- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". --- --- nounPN : N -> PN ; --- ----- To form a noun phrase that can also be plural and have an irregular ----- genitive, you can use the worst-case function. --- --- mkNP : Str -> Str -> Number -> Gender -> NP ; --- -----2 Adjectives --- ----- Non-comparison one-place adjectives need two forms: one for ----- the adjectival and one for the adverbial form ("free - freely") --- --- mkA : (free,freely : Str) -> A ; --- ----- For regular adjectives, the adverbial form is derived. This holds ----- even for cases with the variation "happy - happily". --- --- regA : Str -> A ; --- -----3 Two-place adjectives ----- ----- Two-place adjectives need a preposition for their second argument. --- --- mkA2 : A -> Preposition -> A2 ; --- ----- Comparison adjectives may two more forms. --- --- ADeg : Type ; --- --- mkADeg : (good,better,best,well : Str) -> ADeg ; --- ----- The regular pattern recognizes two common variations: ----- "-e" ("rude" - "ruder" - "rudest") and ----- "-y" ("happy - happier - happiest - happily") --- --- regADeg : Str -> ADeg ; -- long, longer, longest --- ----- However, the duplication of the final consonant is nor predicted, ----- but a separate pattern is used: --- --- duplADeg : Str -> ADeg ; -- fat, fatter, fattest --- ----- If comparison is formed by "more, "most", as in general for ----- long adjective, the following pattern is used: --- --- compoundADeg : A -> ADeg ; -- -/more/most ridiculous --- ----- From a given $ADeg$, it is possible to get back to $A$. --- --- adegA : ADeg -> A ; --- --- -----2 Adverbs --- ----- Adverbs are not inflected. Most lexical ones have position ----- after the verb. Some can be preverbal (e.g. "always"). --- --- mkAdv : Str -> Adv ; --- mkAdV : Str -> AdV ; --- ----- Adverbs modifying adjectives and sentences can also be formed. --- --- mkAdA : Str -> AdA ; --- -----2 Prepositions ----- ----- A preposition as used for rection in the lexicon, as well as to ----- build $PP$s in the resource API, just requires a string. --- --- mkPreposition : Str -> Preposition ; --- mkPrep : Str -> Prep ; --- ----- (These two functions are synonyms.) --- -----2 Verbs ----- ----- Except for "be", the worst case needs five forms: the infinitive and ----- the third person singular present, the past indicative, and the ----- past and present participles. --- --- mkV : (go, goes, went, gone, going : Str) -> V ; --- ----- The regular verb function recognizes the special cases where the last ----- character is "y" ("cry - cries" but "buy - buys") or "s", "sh", "x", "z" ----- ("fix - fixes", etc). --- --- regV : Str -> V ; --- ----- The following variant duplicates the last letter in the forms like ----- "rip - ripped - ripping". --- --- regDuplV : Str -> V ; --- ----- There is an extensive list of irregular verbs in the module $IrregularRus$. ----- In practice, it is enough to give three forms, ----- e.g. "drink - drank - drunk", with a variant indicating consonant ----- duplication in the present participle. --- --- irregV : (drink, drank, drunk : Str) -> V ; --- irregDuplV : (get, got, gotten : Str) -> V ; --- --- -----3 Verbs with a particle. ----- ----- The particle, such as in "switch on", is given as a string. --- --- partV : V -> Str -> V ; --- -----3 Reflexive verbs ----- ----- By default, verbs are not reflexive; this function makes them that. --- --- reflV : V -> 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$. --- --- mkV2 : V -> Preposition -> V2 ; --- --- dirV2 : V -> V2 ; --- -----3 Three-place verbs ----- ----- Three-place (ditransitive) verbs need two prepositions, of which ----- the first one or both can be absent. --- --- mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about --- dirV3 : V -> Preposition -> V3 ; -- give,_,to --- dirdirV3 : V -> V3 ; -- give,_,_ --- -----3 Other complement patterns ----- ----- Verbs and adjectives can take complements such as sentences, ----- questions, verb phrases, and adjectives. --- --- mkV0 : V -> V0 ; --- mkVS : V -> VS ; --- mkV2S : V -> Str -> V2S ; --- mkVV : V -> VV ; --- mkV2V : V -> Str -> Str -> V2V ; --- mkVA : V -> VA ; --- mkV2A : V -> Str -> V2A ; --- mkVQ : V -> VQ ; --- mkV2Q : V -> Str -> V2Q ; --- --- mkAS : A -> AS ; --- mkA2S : A -> Str -> A2S ; --- mkAV : A -> AV ; --- mkA2V : A -> Str -> A2V ; --- ----- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated ----- just as synonyms of $V2$, and the second argument is given ----- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$. ----- $V0$ is just $V$. --- --- V0, V2S, V2V, V2A, V2Q : Type ; --- AS, A2S, AV, A2V : Type ; --- --- -----2 Definitions of paradigms ----- ----- The definitions should not bother the user of the API. So they are ----- hidden from the document. -----. --- --- Gender = MorphoRus.Gender ; --- Number = MorphoRus.Number ; --- Case = MorphoRus.Case ; --- human = Masc ; --- nonhuman = Neutr ; --- masculine = Masc ; --- feminine = Fem ; --- singular = Sg ; --- plural = Pl ; --- nominative = Nom ; --- genitive = Gen ; --- --- Preposition = Str ; --- --- regN = \ray -> --- let --- ra = Predef.tk 1 ray ; --- y = Predef.dp 1 ray ; --- r = Predef.tk 2 ray ; --- ay = Predef.dp 2 ray ; --- rays = --- case y of { --- "y" => y2ie ray "s" ; --- "s" => ray + "es" ; --- "z" => ray + "es" ; --- "x" => ray + "es" ; --- _ => case ay of { --- "sh" => ray + "es" ; --- "ch" => ray + "es" ; --- _ => ray + "s" --- } --- } --- in --- mk2N ray rays ; --- --- mk2N = \man,men -> --- let mens = case last men of { --- "s" => men + "'" ; --- _ => men + "'s" --- } --- in --- mkN man men (man + "'s") mens ; --- --- mkN = \man,men,man's,men's -> --- mkNoun man man's men men's ** {g = Neutr ; lock_N = <>} ; --- --- genderN g man = {s = man.s ; g = g ; lock_N = <>} ; --- --- compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ; --- --- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; --- regN2 n = mkN2 (regN n) (mkPreposition "of") ; --- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; --- cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; --- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; --- --- regPN n g = nameReg n g ** {lock_PN = <>} ; --- nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ; --- mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = agrP3 n ; --- lock_NP = <>} ; --- --- mkA a b = mkAdjective a a a b ** {lock_A = <>} ; --- regA a = regAdjective a ** {lock_A = <>} ; --- --- mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; --- --- ADeg = A ; ---- --- --- mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ; --- --- regADeg happy = --- let --- happ = init happy ; --- y = last happy ; --- happie = case y of { --- "y" => happ + "ie" ; --- "e" => happy ; --- _ => happy + "e" --- } ; --- happily = case y of { --- "y" => happ + "ily" ; --- _ => happy + "ly" --- } ; --- in mkADeg happy (happie + "r") (happie + "st") happily ; --- --- duplADeg fat = --- mkADeg fat --- (fat + last fat + "er") (fat + last fat + "est") (fat + "ly") ; --- --- compoundADeg a = --- let ad = (a.s ! AAdj Posit) --- in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ; --- --- adegA a = a ; --- --- mkAdv x = ss x ** {lock_Adv = <>} ; --- mkAdV x = ss x ** {lock_AdV = <>} ; --- mkAdA x = ss x ** {lock_AdA = <>} ; --- --- mkPreposition p = p ; --- mkPrep p = ss p ** {lock_Prep = <>} ; --- --- mkV a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ; --- --- regV cry = --- let --- cr = init cry ; --- y = last cry ; --- cries = (regN cry).s ! Pl ! Nom ; -- ! --- crie = init cries ; --- cried = case last crie of { --- "e" => crie + "d" ; --- _ => crie + "ed" --- } ; --- crying = case y of { --- "e" => case last cr of { --- "e" => cry + "ing" ; --- _ => cr + "ing" --- } ; --- _ => cry + "ing" --- } --- in mkV cry cries cried cried crying ; --- --- regDuplV fit = --- let fitt = fit + last fit in --- mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ; --- --- irregV x y z = let reg = (regV x).s in --- mkV x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ; --- --- irregDuplV fit y z = --- let --- fitting = (regDuplV fit).s ! VPresPart --- in --- mkV fit (fit + "s") y z fitting ; --- --- partV v p = verbPart v p ** {lock_V = <>} ; --- reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ; --- --- mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; lock_V2 = <>} ; --- dirV2 v = mkV2 v [] ; --- --- mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; c3 = q ; lock_V3 = <>} ; --- dirV3 v p = mkV3 v [] p ; --- dirdirV3 v = dirV3 v [] ; --- --- mkVS v = v ** {lock_VS = <>} ; --- mkVV v = { --- s = table {VVF vf => v.s ! vf ; _ => variants {}} ; --- isAux = False ; lock_VV = <> --- } ; --- mkVQ v = v ** {lock_VQ = <>} ; --- --- V0 : Type = V ; --- V2S, V2V, V2Q, V2A : Type = V2 ; --- AS, A2S, AV : Type = A ; --- A2V : Type = A2 ; --- --- mkV0 v = v ** {lock_V = <>} ; --- mkV2S v p = mkV2 v p ** {lock_V2 = <>} ; --- mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2 = <>} ; --- mkVA v = v ** {lock_VA = <>} ; --- mkV2A v p = mkV2 v p ** {lock_V2A = <>} ; --- mkV2Q v p = mkV2 v p ** {lock_V2 = <>} ; --- --- mkAS v = v ** {lock_A = <>} ; --- mkA2S v p = mkA2 v p ** {lock_A = <>} ; --- mkAV v = v ** {lock_A = <>} ; --- mkA2V v p = mkA2 v p ** {lock_A2 = <>} ; --- -} ; +--# -path=.:../abstract:../../prelude:../common + +--1 Russian Lexical Paradigms +-- +-- Janna Khegai 2003--2005 +-- +-- This is an API to the user of the resource grammar +-- for adding lexical items. It gives functions for forming +-- expressions of open categories: nouns, adjectives, verbs. +-- +-- Closed categories (determiners, pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural.gf$. +-- +-- The main difference with $MorphoEng.gf$ is that the types +-- referred to are compiled resource grammar types. We have moreover +-- had the design principle of always having existing forms, rather +-- than stems, as string arguments of the paradigms. +-- +-- The structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- regular cases. Then we give a worst-case function $mkC$, which serves as an +-- escape to construct the most irregular words of type $C$. +-- However, this function should only seldom be needed: we have a +-- separate module $IrregularEng$, which covers all irregularly inflected +-- words. +-- +-- The following modules are presupposed: + +resource ParadigmsRus = open + (Predef=Predef), + Prelude, + MorphoRus, + CatRus, + NounRus + in { + +flags coding=utf8 ; + +--2 Parameters +-- +-- To abstract over gender names, we define the following identifiers. + +oper + Gender : Type ; + masculine : Gender ; + feminine : Gender ; + neuter : Gender ; + +-- To abstract over case names, we define the following. + Case : Type ; + + nominative : Case ; + genitive : Case ; + dative : Case ; + accusative : Case ; + instructive : Case ; + prepositional : Case ; + +-- In some (written in English) textbooks accusative case +-- is put on the second place. However, we follow the case order +-- standard for Russian textbooks. + +-- To abstract over number names, we define the following. + Number : Type ; + + singular : Number ; + plural : Number ; + +--2 Nouns + +-- Best case: indeclinabe nouns: "кофе", "пальто", "ВУЗ". + Animacy: Type ; + + animate: Animacy; + inanimate: Animacy; + + mkIndeclinableNoun: Str -> Gender -> Animacy -> N ; + +-- Worst case - give six singular forms: +-- Nominative, Genetive, Dative, Accusative, Instructive and Prepositional; +-- corresponding six plural forms and the gender. +-- May be the number of forms needed can be reduced, +-- but this requires a separate investigation. +-- Animacy parameter (determining whether the Accusative form is equal +-- to the Nominative or the Genetive one) is actually of no help, +-- since there are a lot of exceptions and the gain is just one form less. + + mkN : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Gender -> Animacy -> N ; + + -- мужчина, мужчины, мужчине, мужчину, мужчиной, мужчине + -- мужчины, мужчин, мужчинам, мужчин, мужчинами, мужчинах + + +-- Here are some common patterns. The list is far from complete. + +-- Feminine patterns. + + nMashina : Str -> N ; -- feminine, inanimate, ending with "-а", Inst -"машин-ой" + nEdinica : Str -> N ; -- feminine, inanimate, ending with "-а", Inst -"единиц-ей" + nZhenchina : Str -> N ; -- feminine, animate, ending with "-a" + nNoga : Str -> N ; -- feminine, inanimate, ending with "г_к_х-a" + nMalyariya : Str -> N ; -- feminine, inanimate, ending with "-ия" + nTetya : Str -> N ; -- feminine, animate, ending with "-я" + nBol : Str -> N ; -- feminine, inanimate, ending with "-ь"(soft sign) + +-- Neuter patterns. + + nObezbolivauchee : Str -> N ; -- neutral, inanimate, ending with "-ee" + nProizvedenie : Str -> N ; -- neutral, inanimate, ending with "-e" + nChislo : Str -> N ; -- neutral, inanimate, ending with "-o" + nZhivotnoe : Str -> N ; -- masculine, inanimate, ending with "-ень" + +-- Masculine patterns. + +--Ending with consonant: +nPepel : Str -> N ; -- masculine, inanimate, ending with "-ел"- "пеп-ла" + + nBrat: Str -> N ; -- animate, брат-ья + nStul: Str -> N ; -- same as above, but inanimate + nMalush : Str -> N ; -- малышей + nPotolok : Str -> N ; -- потол-ок - потол-ка + + -- the next four differ in plural nominative and/or accusative form(s) : + nBank: Str -> N ; -- банк-и (Nom=Acc) + nStomatolog : Str -> N ; -- same as above, but animate + nAdres : Str -> N ; -- адрес-а (Nom=Acc) + nTelefon : Str -> N ; -- телефон-ы (Nom=Acc) + + nNol : Str -> N ; -- masculine, inanimate, ending with "-ь" (soft sign) + nUroven : Str -> N ; -- masculine, inanimate, ending with "-ень" + +-- Nouns used as functions need a preposition. The most common is with Genitive. + + mkFun : N -> Prep -> N2 ; + mkN2 : N -> N2 ; + mkN3 : N -> Prep -> Prep -> N3 ; + +-- Proper names. + + mkPN : Str -> Gender -> Animacy -> PN ; -- "Иван", "Маша" + nounPN : N -> PN ; + +-- On the top level, it is maybe $CN$ that is used rather than $N$, and +-- $NP$ rather than $PN$. + + mkCN : N -> CN ; + mkNP : Str -> Gender -> Animacy -> NP ; + + +--2 Adjectives + +-- Non-comparison (only positive degree) one-place adjectives need 28 (4 by 7) +-- forms in the worst case: + + +-- Masculine | Feminine | Neutral | Plural +-- Nominative +-- Genitive +-- Dative +-- Accusative Inanimate +-- Accusative Animate +-- Instructive +-- Prepositional + + +-- Notice that 4 short forms, which exist for some adjectives are not included +-- in the current description, otherwise there would be 32 forms for +-- positive degree. + +-- mkA : ( : Str) -> A ; + +-- Invariable adjective is a special case. + + adjInvar : Str -> A ; -- khaki, mini, hindi, netto + +-- Some regular patterns depending on the ending. + + AStaruyj : Str -> Str -> A ; -- ending with "-ый" + AMalenkij : Str -> Str -> A ; -- ending with "-ий", Gen - "маленьк-ого" + AKhoroshij : Str -> Str -> A ; -- ending with "-ий", Gen - "хорош-его" + AMolodoj : Str -> Str -> A ; -- ending with "-ой", + -- plural - молод-ые" + AKakoj_Nibud : Str -> Str -> Str -> A ; -- ending with "-ой", + -- plural - "как-ие" + +-- Two-place adjectives need a preposition and a case as extra arguments. + + mkA2 : A -> Str -> Case -> A2 ; -- "делим на" + +-- Comparison adjectives need a positive adjective +-- (28 forms without short forms). +-- Taking only one comparative form (non-syntaxic) and +-- only one superlative form (syntaxic) we can produce the +-- comparison adjective with only one extra argument - +-- non-syntaxic comparative form. +-- Syntaxic forms are based on the positive forms. + + +-- mkADeg : A -> Str -> ADeg ; + +-- On top level, there are adjectival phrases. The most common case is +-- just to use a one-place adjective. +-- ap : A -> IsPostfixAdj -> AP ; + +--2 Adverbs + +-- Adverbs are not inflected. Most lexical ones have position +-- after the verb. Some can be preverbal (e.g. "always"). + + mkAdv : Str -> Adv ; + +--2 Verbs +-- +-- In our lexicon description ("Verbum") there are 62 forms: +-- 2 (Voice) by { 1 (infinitive) + [2(number) by 3 (person)](imperative) + +-- [ [2(Number) by 3(Person)](present) + [2(Number) by 3(Person)](future) + +-- 4(GenNum)(past) ](indicative)+ 4 (GenNum) (subjunctive) } +-- Participles (Present and Past) and Gerund forms are not included, +-- since they fuction more like Adjectives and Adverbs correspondingly +-- rather than verbs. Aspect regarded as an inherent parameter of a verb. +-- Notice, that some forms are never used for some verbs. Actually, +-- the majority of verbs do not have many of the forms. +Voice: Type; +Aspect: Type; +--Tense : Type; +Bool: Type; +Conjugation: Type ; + +first: Conjugation; -- "гуля-Ешь, гуля-Ем" +firstE: Conjugation; -- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink) +second: Conjugation; -- "вид-Ишь, вид-Им" +mixed: Conjugation; -- "хоч-Ешь - хот-Им" +dolzhen: Conjugation; -- irregular + +true: Bool; +false: Bool; + +active: Voice ; +passive: Voice ; +imperfective: Aspect; +perfective: Aspect ; +--present : Tense ; +--past : Tense ; + + +-- The worst case need 6 forms of the present tense in indicative mood +-- ("я бегу", "ты бежишь", "он бежит", "мы бежим", "вы бежите", "они бегут"), +-- a past form (singular, masculine: "я бежал"), an imperative form +-- (singular, second person: "беги"), an infinitive ("бежать"). +-- Inherent aspect should also be specified. + + mkVerbum : Aspect -> (_,_,_,_,_,_,_,_,_ : Str) -> V ; + +-- Common conjugation patterns are two conjugations: +-- first - verbs ending with "-ать/-ять" and second - "-ить/-еть". +-- Instead of 6 present forms of the worst case, we only need +-- a present stem and one ending (singular, first person): +-- "я люб-лю", "я жд-у", etc. To determine where the border +-- between stem and ending lies it is sufficient to compare +-- first person from with second person form: +-- "я люб-лю", "ты люб-ишь". Stems shoud be the same. +-- So the definition for verb "любить" looks like: +-- mkRegVerb Imperfective Second "люб" "лю" "любил" "люби" "любить"; + + mkRegVerb :Aspect -> Conjugation -> (_,_,_,_,_ : Str) -> V ; + +-- For writing an application grammar one usualy doesn't need +-- the whole inflection table, since each verb is used in +-- a particular context that determines some of the parameters +-- (Tense and Voice while Aspect is fixed from the beginning) for certain usage. +-- The "V" type, that have these parameters fixed. +-- We can extract the "V" from the lexicon. + +-- mkV: Verbum -> Voice -> V ; +-- mkPresentV: Verbum -> Voice -> V ; + + +-- Two-place verbs, and the special case with direct object. Notice that +-- a particle can be included in a $V$. + + mkTV : V -> Str -> Case -> V2 ; -- "войти в дом"; "в", accusative + mkV3 : V -> Str -> Str -> Case -> Case -> V3 ; -- "сложить письмо в конверт" + tvDir : V -> V2 ; -- "видеть", "любить" + tvDirDir : V -> V3 ; + +-- The definitions should not bother the user of the API. So they are +-- hidden from the document. +--. + Gender = MorphoRus.Gender ; + Case = MorphoRus.Case ; + Number = MorphoRus.Number ; + Animacy = MorphoRus.Animacy; + Aspect = MorphoRus.Aspect; + Voice = MorphoRus.Voice ; + --Tense = Tense ; + Bool = Prelude.Bool ; + Conjugation = MorphoRus.Conjugation; +first = First ; +firstE = FirstE ; +second = Second ; +mixed = Mixed ; +dolzhen = Dolzhen; + + true = True; + false = False ; + masculine = Masc ; + feminine = Fem ; + neuter = Neut ; + nominative = Nom ; + accusative = Acc ; + dative = Dat ; + genitive = Gen ; + instructive = Inst ; + prepositional = Prepos ; + singular = Sg ; + plural = Pl ; + animate = Animate ; + inanimate = Inanimate ; + active = Act ; + passive = Pass ; + imperfective = Imperfective ; + perfective = Perfective ; + -- present = Present ; + --past = Past ; + -- Degree = Pos | Comp | Super ; + -- Person = P1 | P2 | P3 ; + -- AfterPrep = Yes | No ; + -- Possessive = NonPoss | Poss GenNum ; + +-- Noun definitions + + mkIndeclinableNoun = \s,g, anim -> + { + s = table { SF _ _ => s } ; + g = g ; + anim = anim + } ** {lock_N = <>}; + + + mkN = \nomSg, genSg, datSg, accSg, instSg, preposSg, + nomPl, genPl, datPl, accPl, instPl, preposPl, g, anim -> + { + s = table { + SF Sg Nom => nomSg ; + SF Sg Gen => genSg ; + SF Sg Dat => datSg ; + SF Sg Acc => accSg ; + SF Sg Inst => instSg ; + SF Sg Prepos => preposSg ; + SF Pl Nom => nomPl ; + SF Pl Gen => genPl ; + SF Pl Dat => datPl ; + SF Pl Acc => accPl ; + SF Pl Inst => instPl ; + SF Pl Prepos => preposPl + } ; + g = g ; + anim = anim + } ** {lock_N = <>} ; + + nMashina = \s -> aEndInAnimateDecl s ** {lock_N = <>}; + nEdinica = \s -> ej_aEndInAnimateDecl s ** {lock_N = <>}; + nZhenchina = \s -> (aEndAnimateDecl s) ** { g = Fem ; anim = Animate } ** {lock_N = <>}; + nNoga = \s -> aEndG_K_KH_Decl s ** {lock_N = <>}; + nMalyariya = \s -> i_yaEndDecl s ** {lock_N = <>}; + nTetya = \s -> (yaEndAnimateDecl s) ** {g = Fem; anim = Animate; lock_N = <>} ; + nBol = \s -> softSignEndDeclFem s ** {lock_N = <>}; + +-- Neuter patterns. + + nObezbolivauchee = \s -> eeEndInAnimateDecl s ** {lock_N = <>}; + nZhivotnoe = \s -> oeEndAnimateDecl s ** {lock_N = <>}; + nProizvedenie = \s -> eEndInAnimateDecl s ** {lock_N = <>}; + nChislo = \s -> oEndInAnimateDecl s ** {lock_N = <>}; + + +-- Masculine patterns. + nBank = \s -> nullEndInAnimateDecl s ** {lock_N = <>}; + nStomatolog = \s -> nullEndAnimateDecl s ** {lock_N = <>}; + nMalush = \s -> shEndDeclMasc s ** {lock_N = <>}; + nPotolok = \s ->okEndDeclMasc s ** {lock_N = <>}; + + nBrat = \s -> nullEndAnimateDeclBrat s** {lock_N = <>}; + nStul = \s -> nullEndInAnimateDeclStul s** {lock_N = <>}; + + nAdres = \s -> nullEndInAnimateDecl2 s ** {lock_N = <>}; + nTelefon = \s -> nullEndInAnimateDecl1 s ** {lock_N = <>}; + nPepel = \s -> nullEndInAnimateDeclPepel s ** {lock_N = <>}; + + nNol = \s -> softSignEndDeclMasc s ** {lock_N = <>}; + nUroven = \s -> EN_softSignEndDeclMasc s ** {lock_N = <>}; + + +-- An individual-valued function is a common noun together with the +-- preposition prefixed to its argument ("клZ+ о' дома"). +-- The situation is analogous to two-place adjectives and transitive verbs. +-- +-- We allow the genitive construction to be used as a variant of +-- all function applications. It would definitely be too restrictive only +-- to allow it when the required case is genitive. We don't know if there +-- are counterexamples to the liberal choice we've made. + + mkFun f p = (UseN f) ** {s2 = p.s ; c = p.c}** {lock_N2 = <>} ; + +-- The commonest cases are functions with Genitive. + mkN2 n = mkFun n nullPrep ; + nullPrep : Prep = {s = []; c= Gen; lock_Prep=<>} ; + + mkN3 f p r = (UseN f) ** {s2 = p.s ; c=p.c; s3=r.s ; c2=r.c; lock_N3 = <>} ; + + + mkPN = \ivan, g, anim -> + case g of { + Masc => mkProperNameMasc ivan anim ; + _ => mkProperNameFem ivan anim + } ** {lock_PN =<>}; + nounPN n = {s=\\c => n.s! SF Sg c; anim=n.anim; g=n.g; lock_PN=<>}; + + mkCN = UseN; + + mkNP = \x,y,z -> UsePN (mkPN x y z) ; + +-- Adjective definitions + + adjInvar = \s -> { s = \\_,_ => s } ** {lock_A= <>}; + + AStaruyj s comp = mkAdjDeg (uy_j_EndDecl s) comp ** {lock_A = <>} ; + AKhoroshij s comp = mkAdjDeg (shij_End_Decl s) comp ** {lock_A= <>}; + AMalenkij s comp = mkAdjDeg (ij_EndK_G_KH_Decl s) comp ** {lock_A= <>}; + AMolodoj s comp = mkAdjDeg (uy_oj_EndDecl s) comp ** {lock_A= <>}; + AKakoj_Nibud s t comp = mkAdjDeg (i_oj_EndDecl s t) comp ** {lock_A= <>}; + + mkA2 a p c= a ** {s2 = p ; c = c; lock_A2 = <>}; +-- mkADeg a s = mkAdjDeg a s ** {lock_ADeg = <>}; -- defined in morpho.RusU + +-- ap a p = mkAdjPhrase a p ** {lock_AP = <>}; -- defined in syntax module + + mkAdv x = ss x ** {lock_Adv = <>} ; + +-- Verb definitions + + mkVerbum = \asp, sgP1, sgP2, sgP3, plP1, plP2, plP3, + sgMascPast, imperSgP2, inf -> case asp of { + Perfective => + mkVerb (perfectiveActivePattern inf imperSgP2 + (presentConj sgP1 sgP2 sgP3 plP1 plP2 plP3) (pastConj sgMascPast)) + (pastConj sgMascPast) ** { lock_V=<> }; + Imperfective => + mkVerb (imperfectiveActivePattern inf imperSgP2 + (presentConj sgP1 sgP2 sgP3 plP1 plP2 plP3) (pastConj sgMascPast)) + (pastConj sgMascPast) ** { lock_V=<> } + }; + + oper presentConj: (_,_,_,_,_,_: Str) -> PresentVerb = + \sgP1, sgP2, sgP3, plP1, plP2, plP3 -> + table { + PRF (ASg _) P1 => sgP1 ; + PRF (ASg _) P2 => sgP2 ; + PRF (ASg _) P3 => sgP3 ; + PRF APl P1 => plP1 ; + PRF APl P2 => plP2 ; + PRF APl P3 => plP3 + }; + + mkRegVerb a b c d e f g = verbDecl a b c d e f g ** {lock_V = <>} ; + -- defined in morpho.RusU.gf +{- + mkV a b = extVerb a b ** {lock_V = <>}; -- defined in types.RusU.gf + + mkPresentV = \aller, vox -> + { s = table { + VFin gn p => aller.s ! VFORM vox (VIND (VPresent (numGNum gn) p)) ; + VImper n p => aller.s ! VFORM vox (VIMP n p) ; + VInf => aller.s ! VFORM vox VINF ; + VSubj gn => aller.s ! VFORM vox (VSUB gn) + }; t = Present ; a = aller.asp ; w = vox ; lock_V = <>} ; +-} + mkTV v p cas = v ** {s2 = p ; c = cas; lock_V2 = <>}; + tvDir v = mkTV v [] Acc; + + + tvDirDir v = mkV3 v "" "" Acc Dat; + +-- *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. + + mkV3 v s1 s2 c1 c2 = v ** {s2 = s1; c = c1; s4 = s2; c2=c2; lock_V3 = <>}; + + +----2 Parameters +---- +---- To abstract over gender names, we define the following identifiers. +-- +--oper +-- Gender : Type ; +-- +-- human : Gender ; +-- nonhuman : Gender ; +-- masculine : Gender ; +-- +---- To abstract over number names, we define the following. +-- +-- Number : Type ; +-- +-- singular : Number ; +-- plural : Number ; +-- +---- To abstract over case names, we define the following. +-- +-- Case : Type ; +-- +-- nominative : Case ; +-- genitive : Case ; +-- +---- Prepositions are used in many-argument functions for rection. +-- +-- Preposition : Type ; +-- +-- +----2 Nouns +-- +---- Worst case: give all four forms and the semantic gender. +-- +-- mkN : (man,men,man's,men's : Str) -> N ; +-- +---- The regular function captures the variants for nouns ending with +---- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes"; +---- "fly - flies" (but "toy - toys"), +-- +-- regN : Str -> N ; +-- +---- In practice the worst case is just: give singular and plural nominative. +-- +-- mk2N : (man,men : Str) -> N ; +-- +---- All nouns created by the previous functions are marked as +---- $nonhuman$. If you want a $human$ noun, wrap it with the following +---- function: +-- +-- genderN : Gender -> N -> N ; +-- +----3 Compound nouns +---- +---- A compound noun ia an uninflected string attached to an inflected noun, +---- such as "baby boom", "chief executive officer". +-- +-- compoundN : Str -> N -> N ; +-- +-- +----3 Relational nouns +---- +---- Relational nouns ("daughter of x") need a preposition. +-- +-- mkN2 : N -> Preposition -> N2 ; +-- +---- The most common preposition is "of", and the following is a +---- shortcut for regular relational nouns with "of". +-- +-- regN2 : Str -> N2 ; +-- +---- Use the function $mkPreposition$ or see the section on prepositions below to +---- form other prepositions. +---- +---- Three-place relational nouns ("the connection from x to y") need two prepositions. +-- +-- mkN3 : N -> Preposition -> Preposition -> N3 ; +-- +-- +----3 Relational common noun phrases +---- +---- In some cases, you may want to make a complex $CN$ into a +---- relational noun (e.g. "the old town hall of"). +-- +-- cnN2 : CN -> Preposition -> N2 ; +-- cnN3 : CN -> Preposition -> Preposition -> N3 ; +-- +---- +----3 Proper names and noun phrases +---- +---- Proper names, with a regular genitive, are formed as follows +-- +-- regPN : Str -> Gender -> PN ; -- John, John's +-- +---- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". +-- +-- nounPN : N -> PN ; +-- +---- To form a noun phrase that can also be plural and have an irregular +---- genitive, you can use the worst-case function. +-- +-- mkNP : Str -> Str -> Number -> Gender -> NP ; +-- +----2 Adjectives +-- +---- Non-comparison one-place adjectives need two forms: one for +---- the adjectival and one for the adverbial form ("free - freely") +-- +-- mkA : (free,freely : Str) -> A ; +-- +---- For regular adjectives, the adverbial form is derived. This holds +---- even for cases with the variation "happy - happily". +-- +-- regA : Str -> A ; +-- +----3 Two-place adjectives +---- +---- Two-place adjectives need a preposition for their second argument. +-- +-- mkA2 : A -> Preposition -> A2 ; +-- +---- Comparison adjectives may two more forms. +-- +-- ADeg : Type ; +-- +-- mkADeg : (good,better,best,well : Str) -> ADeg ; +-- +---- The regular pattern recognizes two common variations: +---- "-e" ("rude" - "ruder" - "rudest") and +---- "-y" ("happy - happier - happiest - happily") +-- +-- regADeg : Str -> ADeg ; -- long, longer, longest +-- +---- However, the duplication of the final consonant is nor predicted, +---- but a separate pattern is used: +-- +-- duplADeg : Str -> ADeg ; -- fat, fatter, fattest +-- +---- If comparison is formed by "more, "most", as in general for +---- long adjective, the following pattern is used: +-- +-- compoundADeg : A -> ADeg ; -- -/more/most ridiculous +-- +---- From a given $ADeg$, it is possible to get back to $A$. +-- +-- adegA : ADeg -> A ; +-- +-- +----2 Adverbs +-- +---- Adverbs are not inflected. Most lexical ones have position +---- after the verb. Some can be preverbal (e.g. "always"). +-- +-- mkAdv : Str -> Adv ; +-- mkAdV : Str -> AdV ; +-- +---- Adverbs modifying adjectives and sentences can also be formed. +-- +-- mkAdA : Str -> AdA ; +-- +----2 Prepositions +---- +---- A preposition as used for rection in the lexicon, as well as to +---- build $PP$s in the resource API, just requires a string. +-- +-- mkPreposition : Str -> Preposition ; +-- mkPrep : Str -> Prep ; +-- +---- (These two functions are synonyms.) +-- +----2 Verbs +---- +---- Except for "be", the worst case needs five forms: the infinitive and +---- the third person singular present, the past indicative, and the +---- past and present participles. +-- +-- mkV : (go, goes, went, gone, going : Str) -> V ; +-- +---- The regular verb function recognizes the special cases where the last +---- character is "y" ("cry - cries" but "buy - buys") or "s", "sh", "x", "z" +---- ("fix - fixes", etc). +-- +-- regV : Str -> V ; +-- +---- The following variant duplicates the last letter in the forms like +---- "rip - ripped - ripping". +-- +-- regDuplV : Str -> V ; +-- +---- There is an extensive list of irregular verbs in the module $IrregularEng$. +---- In practice, it is enough to give three forms, +---- e.g. "drink - drank - drunk", with a variant indicating consonant +---- duplication in the present participle. +-- +-- irregV : (drink, drank, drunk : Str) -> V ; +-- irregDuplV : (get, got, gotten : Str) -> V ; +-- +-- +----3 Verbs with a particle. +---- +---- The particle, such as in "switch on", is given as a string. +-- +-- partV : V -> Str -> V ; +-- +----3 Reflexive verbs +---- +---- By default, verbs are not reflexive; this function makes them that. +-- +-- reflV : V -> 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$. +-- +-- mkV2 : V -> Preposition -> V2 ; +-- +-- dirV2 : V -> V2 ; +-- +----3 Three-place verbs +---- +---- Three-place (ditransitive) verbs need two prepositions, of which +---- the first one or both can be absent. +-- +-- mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about +-- dirV3 : V -> Preposition -> V3 ; -- give,_,to +-- dirdirV3 : V -> V3 ; -- give,_,_ +-- +----3 Other complement patterns +---- +---- Verbs and adjectives can take complements such as sentences, +---- questions, verb phrases, and adjectives. +-- +-- mkV0 : V -> V0 ; +-- mkVS : V -> VS ; +-- mkV2S : V -> Str -> V2S ; +-- mkVV : V -> VV ; +-- mkV2V : V -> Str -> Str -> V2V ; +-- mkVA : V -> VA ; +-- mkV2A : V -> Str -> V2A ; +-- mkVQ : V -> VQ ; +-- mkV2Q : V -> Str -> V2Q ; +-- +-- mkAS : A -> AS ; +-- mkA2S : A -> Str -> A2S ; +-- mkAV : A -> AV ; +-- mkA2V : A -> Str -> A2V ; +-- +---- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated +---- just as synonyms of $V2$, and the second argument is given +---- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$. +---- $V0$ is just $V$. +-- +-- V0, V2S, V2V, V2A, V2Q : Type ; +-- AS, A2S, AV, A2V : Type ; +-- +-- +----2 Definitions of paradigms +---- +---- The definitions should not bother the user of the API. So they are +---- hidden from the document. +----. +-- +-- Gender = MorphoEng.Gender ; +-- Number = MorphoEng.Number ; +-- Case = MorphoEng.Case ; +-- human = Masc ; +-- nonhuman = Neutr ; +-- masculine = Masc ; +-- feminine = Fem ; +-- singular = Sg ; +-- plural = Pl ; +-- nominative = Nom ; +-- genitive = Gen ; +-- +-- Preposition = Str ; +-- +-- regN = \ray -> +-- let +-- ra = Predef.tk 1 ray ; +-- y = Predef.dp 1 ray ; +-- r = Predef.tk 2 ray ; +-- ay = Predef.dp 2 ray ; +-- rays = +-- case y of { +-- "y" => y2ie ray "s" ; +-- "s" => ray + "es" ; +-- "z" => ray + "es" ; +-- "x" => ray + "es" ; +-- _ => case ay of { +-- "sh" => ray + "es" ; +-- "ch" => ray + "es" ; +-- _ => ray + "s" +-- } +-- } +-- in +-- mk2N ray rays ; +-- +-- mk2N = \man,men -> +-- let mens = case last men of { +-- "s" => men + "'" ; +-- _ => men + "'s" +-- } +-- in +-- mkN man men (man + "'s") mens ; +-- +-- mkN = \man,men,man's,men's -> +-- mkNoun man man's men men's ** {g = Neutr ; lock_N = <>} ; +-- +-- genderN g man = {s = man.s ; g = g ; lock_N = <>} ; +-- +-- compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ; +-- +-- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; +-- regN2 n = mkN2 (regN n) (mkPreposition "of") ; +-- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; +-- cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; +-- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; +-- +-- regPN n g = nameReg n g ** {lock_PN = <>} ; +-- nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ; +-- mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = agrP3 n ; +-- lock_NP = <>} ; +-- +-- mkA a b = mkAdjective a a a b ** {lock_A = <>} ; +-- regA a = regAdjective a ** {lock_A = <>} ; +-- +-- mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; +-- +-- ADeg = A ; ---- +-- +-- mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ; +-- +-- regADeg happy = +-- let +-- happ = init happy ; +-- y = last happy ; +-- happie = case y of { +-- "y" => happ + "ie" ; +-- "e" => happy ; +-- _ => happy + "e" +-- } ; +-- happily = case y of { +-- "y" => happ + "ily" ; +-- _ => happy + "ly" +-- } ; +-- in mkADeg happy (happie + "r") (happie + "st") happily ; +-- +-- duplADeg fat = +-- mkADeg fat +-- (fat + last fat + "er") (fat + last fat + "est") (fat + "ly") ; +-- +-- compoundADeg a = +-- let ad = (a.s ! AAdj Posit) +-- in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ; +-- +-- adegA a = a ; +-- +-- mkAdv x = ss x ** {lock_Adv = <>} ; +-- mkAdV x = ss x ** {lock_AdV = <>} ; +-- mkAdA x = ss x ** {lock_AdA = <>} ; +-- +-- mkPreposition p = p ; +-- mkPrep p = ss p ** {lock_Prep = <>} ; +-- +-- mkV a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ; +-- +-- regV cry = +-- let +-- cr = init cry ; +-- y = last cry ; +-- cries = (regN cry).s ! Pl ! Nom ; -- ! +-- crie = init cries ; +-- cried = case last crie of { +-- "e" => crie + "d" ; +-- _ => crie + "ed" +-- } ; +-- crying = case y of { +-- "e" => case last cr of { +-- "e" => cry + "ing" ; +-- _ => cr + "ing" +-- } ; +-- _ => cry + "ing" +-- } +-- in mkV cry cries cried cried crying ; +-- +-- regDuplV fit = +-- let fitt = fit + last fit in +-- mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ; +-- +-- irregV x y z = let reg = (regV x).s in +-- mkV x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ; +-- +-- irregDuplV fit y z = +-- let +-- fitting = (regDuplV fit).s ! VPresPart +-- in +-- mkV fit (fit + "s") y z fitting ; +-- +-- partV v p = verbPart v p ** {lock_V = <>} ; +-- reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ; +-- +-- mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; lock_V2 = <>} ; +-- dirV2 v = mkV2 v [] ; +-- +-- mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; c3 = q ; lock_V3 = <>} ; +-- dirV3 v p = mkV3 v [] p ; +-- dirdirV3 v = dirV3 v [] ; +-- +-- mkVS v = v ** {lock_VS = <>} ; +-- mkVV v = { +-- s = table {VVF vf => v.s ! vf ; _ => variants {}} ; +-- isAux = False ; lock_VV = <> +-- } ; +-- mkVQ v = v ** {lock_VQ = <>} ; +-- +-- V0 : Type = V ; +-- V2S, V2V, V2Q, V2A : Type = V2 ; +-- AS, A2S, AV : Type = A ; +-- A2V : Type = A2 ; +-- +-- mkV0 v = v ** {lock_V = <>} ; +-- mkV2S v p = mkV2 v p ** {lock_V2 = <>} ; +-- mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2 = <>} ; +-- mkVA v = v ** {lock_VA = <>} ; +-- mkV2A v p = mkV2 v p ** {lock_V2A = <>} ; +-- mkV2Q v p = mkV2 v p ** {lock_V2 = <>} ; +-- +-- mkAS v = v ** {lock_A = <>} ; +-- mkA2S v p = mkA2 v p ** {lock_A = <>} ; +-- mkAV v = v ** {lock_A = <>} ; +-- mkA2V v p = mkA2 v p ** {lock_A2 = <>} ; +-- +} ; + diff --git a/lib/resource-1.0/russian/PhraseRus.gf b/lib/resource-1.0/russian/PhraseRus.gf index 6639dc3dc..073f3f881 100644 --- a/lib/resource-1.0/russian/PhraseRus.gf +++ b/lib/resource-1.0/russian/PhraseRus.gf @@ -1,25 +1,25 @@ --# -path=.:../abstract:../common:../../prelude concrete PhraseRus of Phrase = CatRus ** open Prelude, ResRus in { --- --- lin --- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; --- --- UttS s = s ; --- UttQS qs = {s = qs.s ! QDir} ; --- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; --- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; --- --- UttIP ip = {s = ip.s ! Nom} ; --- Acc also --- UttIAdv iadv = iadv ; --- UttNP np = {s = np.s ! Acc} ; --- UttVP vp = {s = infVP False vp (agrP3 Sg)} ; --- UttAdv adv = adv ; --- --- NoPConj = {s = []} ; --- PConjConj conj = conj ; --- --- NoVoc = {s = []} ; --- VocNP np = {s = "," ++ np.s ! Nom} ; --- + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = s ; + UttQS qs = {s = qs.s ! QDir} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc! Sg} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc!Pl} ; + + UttIP ip = {s = ip.s ! PF Nom No NonPoss} ; --- Acc also + UttIAdv iadv = iadv ; + UttNP np = {s = np.s ! PF Acc No NonPoss} ; + UttVP vp = {s = vp.s ! ClInfinit ! ASg Masc! P3} ; + UttAdv adv = adv ; + + NoPConj = {s = []} ; + PConjConj conj = conj ; + + NoVoc = {s = []} ; + VocNP np = {s = "," ++ np.s ! PF Nom No NonPoss} ; + } diff --git a/lib/resource-1.0/russian/QuestionRus.gf b/lib/resource-1.0/russian/QuestionRus.gf index 90e44bf65..23c1aff13 100644 --- a/lib/resource-1.0/russian/QuestionRus.gf +++ b/lib/resource-1.0/russian/QuestionRus.gf @@ -1,61 +1,55 @@ --# -path=.:../abstract:../common:../../prelude concrete QuestionRus of Question = CatRus ** open ResRus, Prelude in { --- --- flags optimize=all_subs ; --- --- lin --- --- QuestCl cl = { --- s = \\t,a,p => --- let cls = cl.s ! t ! a ! p --- in table { --- QDir => cls ! OQuest ; --- QIndir => "if" ++ cls ! ODir --- } ---- "whether" in ExtRus --- } ; --- --- QuestVP qp vp = --- let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp --- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; --- --- QuestSlash ip slash = --- mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ; --- --- stranding in ExtRus --- --- QuestIAdv iadv cl = mkQuestion iadv cl ; --- --- QuestIComp icomp np = --- mkQuestion icomp (mkClause (np.s ! Nom) np.a (predAux auxBe)) ; --- --- --- PrepIP p ip = {s = p.s ++ ip.s ! Nom} ; --- --- AdvIP ip adv = { --- s = \\c => ip.s ! c ++ adv.s ; --- n = ip.n --- } ; --- --- IDetCN idet num ord cn = { --- s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ; --- n = idet.n --- } ; --- --- CompIAdv a = a ; --- --- oper --- mkQuestion : --- {s : 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 ! OQuest ; --- QIndir => why ++ cls ! ODir --- } --- } ; --- + + flags optimize=all_subs ; + + lin + + QuestCl cl = {s = \\b,cf,_ => cl.s ! b ! cf } ; + + QuestVP kto spit = + {s = \\b,clf,qf => (predVerbPhrase kto spit).s!b!clf } ; + + QuestSlash Kto yaGovoruO = + let { kom = Kto.s ! (mkPronForm yaGovoruO.c No NonPoss) ; o = yaGovoruO.s2 } in + {s = \\b,clf,_ => o ++ kom ++ yaGovoruO.s ! b ! clf + } ; + + QuestIAdv kak tuPozhivaesh = + {s = \\b,clf,q => kak.s ++ tuPozhivaesh.s!b!clf } ; + + QuestIComp kak tuPozhivaesh = + {s = \\b,clf,q => let ne = case b of {Neg => ""; Pos => []} + in + kak.s ++ ne ++tuPozhivaesh.s! PF Nom No NonPoss } ; + + + PrepIP p ip = {s = p.s ++ ip.s ! PF Nom No NonPoss} ; + + AdvIP ip adv = { + s = \\c => ip.s ! c ++ adv.s ; + n = ip.n; p=ip.p; g=ip.g; anim=ip.anim; pron=ip.pron + } ; + + IDetCN kakoj pyat umeluj okhotnik = + {s = \\pf => case kakoj.c of { + Nom => + kakoj.s ! AF (extCase pf) okhotnik.anim (gNum okhotnik.g kakoj.n) ++ + pyat.s! (extCase pf) ! okhotnik.g ++ + umeluj.s!AF (extCase pf) okhotnik.anim (gNum okhotnik.g kakoj.n)++ + okhotnik.s ! kakoj.n ! (extCase pf) ; + _ => + kakoj.s ! AF (extCase pf) okhotnik.anim (gNum okhotnik.g kakoj.n) ++ + pyat.s! (extCase pf) ! okhotnik.g ++ + umeluj.s!AF (extCase pf) okhotnik.anim (gNum okhotnik.g kakoj.n)++ + okhotnik.s ! kakoj.n ! kakoj.c }; + n = kakoj.n ; + p = P3 ; + pron = False; + g = kakoj.g ; + anim = okhotnik.anim + } ; + + CompIAdv a = a ; } diff --git a/lib/resource-1.0/russian/RelativeRus.gf b/lib/resource-1.0/russian/RelativeRus.gf index f3afd557d..b3966de39 100644 --- a/lib/resource-1.0/russian/RelativeRus.gf +++ b/lib/resource-1.0/russian/RelativeRus.gf @@ -1,46 +1,36 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete RelativeRus of Relative = CatRus ** open ResRus in { --- --- flags optimize=all_subs ; --- --- lin --- --- RelCl cl = { --- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir --- } ; --- --- RelVP rp vp = { --- s = \\t,ant,b,ag => --- let --- agr = case rp.a of { --- RNoAg => ag ; --- RAg a => a --- } ; --- cl = mkClause (rp.s ! RC Nom) agr vp --- in --- cl.s ! t ! ant ! b ! ODir --- } ; --- ----- Preposition stranding: "that we are looking at". Pied-piping is ----- deferred to $ExtRus.gf$ ("at which we are looking"). --- --- RelSlash rp slash = { --- s = \\t,a,p,_ => rp.s ! RC Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 --- } ; --- --- FunRP p np rp = { --- s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep ; --- a = RAg np.a --- } ; --- --- IdRP = { --- s = table { --- RC Gen => "whose" ; --- RC _ => "that" ; --- RPrep => "which" --- } ; --- a = RNoAg --- } ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete RelativeRus of Relative = CatRus ** open ResRus, MorphoRus in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + + RelCl A = {s = \\b,clf,gn,c, anim => + takoj.s ! AF c anim gn ++ "что" ++ A.s !b!clf}; + + RelVP kotoruj gulyaet = + { s = \\b,clf,gn, c, anim => let { nu = numGNum gn } in + kotoruj.s ! gn ! c ! anim ++ gulyaet.s2 ++ gulyaet.s ! clf ! gn !P3 ++ + gulyaet.s3 ! genGNum gn ! nu + } ; + + +-- Preposition stranding: "that we are looking at". Pied-piping is +-- deferred to $ExtRus.gf$ ("at which we are looking"). + + RelSlash kotoruj yaVizhu = + {s = \\b,clf,gn, _ , anim => yaVizhu.s2 ++ kotoruj.s ! gn ! yaVizhu.c ! anim + ++ yaVizhu.s!b!clf + } ; + + FunRP p mama kotoruj = + {s = \\gn,c, anim => let {nu = numGNum gn} in + mama.s ! PF c No NonPoss ++ + p.s ++ kotoruj.s ! gn ! p.c ! anim + } ; + + IdRP ={ s = \\gn, c, anim => + kotorujDet.s ! (AF c anim gn )} ; +} + diff --git a/lib/resource-1.0/russian/ResRus.gf b/lib/resource-1.0/russian/ResRus.gf index 24515c227..75591f8a8 100644 --- a/lib/resource-1.0/russian/ResRus.gf +++ b/lib/resource-1.0/russian/ResRus.gf @@ -1,393 +1,710 @@ ---# -path=.:../abstract:../common:../../prelude --- -----1 Russian auxiliary operations. --- ----- This module contains operations that are needed to make the ----- resource syntax work. To define everything that is needed to ----- implement $Test$, it moreover contains regular lexical ----- patterns needed for $Lex$. --- -resource ResRus = ParamX ** open Prelude in { --- --- flags optimize=all ; --- --- ----- Some parameters, such as $Number$, are inherited from $ParamX$. --- -----2 For $Noun$ --- ----- This is the worst-case $Case$ needed for pronouns. --- --- param --- Case = Nom | Acc | Gen ; --- ----- Agreement of $NP$ is a record. We'll add $Gender$ later. --- --- oper --- Agr = {n : Number ; p : Person} ; --- --- param --- Gender = Neutr | Masc | Fem ; --- -----2 For $Verb$ --- ----- Only these five forms are needed for open-lexicon verbs. --- --- param --- VForm = --- VInf --- | VPres --- | VPPart --- | VPresPart --- | VPast --# notpresent --- ; --- ----- Auxiliary verbs have special negative forms. --- --- VVForm = --- VVF VForm --- | VVPresNeg --- | VVPastNeg --# notpresent --- ; --- ----- The order of sentence is needed already in $VP$. --- --- Order = ODir | OQuest ; --- --- -----2 For $Adjective$ --- --- AForm = AAdj Degree | AAdv ; --- -----2 For $Relative$ --- --- RAgr = RNoAg | RAg {n : Number ; p : Person} ; --- RCase = RPrep | RC Case ; --- -----2 For $Numeral$ --- --- CardOrd = NCard | NOrd ; --- DForm = unit | teen | ten ; --- -----2 Transformations between parameter types --- --- oper --- agrP3 : Number -> Agr = \n -> --- {n = n ; p = P3} ; --- --- conjAgr : Agr -> Agr -> Agr = \a,b -> { --- n = conjNumber a.n b.n ; --- p = conjPerson a.p b.p --- } ; --- ----- For $Lex$. --- ----- For each lexical category, here are the worst-case constructors. --- --- mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} = --- \man,mans,men,mens -> { --- s = table { --- Sg => table { --- Gen => mans ; --- _ => man --- } ; --- Pl => table { --- Gen => mens ; --- _ => men --- } --- } --- } ; --- --- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str} = --- \good,better,best,well -> { --- s = table { --- AAdj Posit => good ; --- AAdj Compar => better ; --- AAdj Superl => best ; --- AAdv => well --- } --- } ; --- --- mkVerb : (_,_,_,_,_ : Str) -> Verb = --- \go,goes,went,gone,going -> { --- s = table { --- VInf => go ; --- VPres => goes ; --- VPast => went ; --# notpresent --- VPPart => gone ; --- VPresPart => going --- } ; --- isRefl = False --- } ; --- --- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} = --- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ; --- --- mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} = --- \i,me,my,n,p -> { --- s = table { --- Nom => i ; --- Acc => me ; --- Gen => my --- } ; --- a = { --- n = n ; --- p = p --- } --- } ; --- ----- These functions cover many cases; full coverage inflectional patterns are ----- in $MorphoRus$. --- --- regN : Str -> {s : Number => Case => Str} = \car -> --- mkNoun car (car + "'s") (car + "s") (car + "s'") ; --- --- regA : Str -> {s : AForm => Str} = \warm -> --- mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ; --- --- regV : Str -> Verb = \walk -> --- mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ; --- --- regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n -> --- mkNP that that (that + "'s") n P3 ; --- ----- We have just a heuristic definition of the indefinite article. ----- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic ----- "o" ("one-sided"), vocalic "u" ("umbrella"). --- --- artIndef = pre { --- "a" ; --- "an" / strs {"a" ; "e" ; "i" ; "o" ; "A" ; "E" ; "I" ; "O" } --- } ; --- --- artDef = "the" ; --- ----- For $Verb$. --- --- Verb : Type = { --- s : VForm => Str ; --- isRefl : Bool --- } ; --- --- VerbForms : Type = --- Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ; --- --- VP : Type = { --- s : VerbForms ; --- prp : Str ; -- present participle --- inf : Str ; -- infinitive --- ad : Str ; --- s2 : Agr => Str --- } ; --- ------ The order gets wrong with AdV, but works around a parser ------ generation bug. --- --- predV : Verb -> VP = \verb -> { --- s = \\t,ant,b,ord,agr => --- let --- inf = verb.s ! VInf ; --- fin = presVerb verb agr ; --- part = verb.s ! VPPart ; --- vf : Str -> Str -> {fin, inf : Str} = \x,y -> --- {fin = x ; inf = y} ; --- in --- case of { --- => vf fin [] ; --- should be opp --- => vf (does agr) inf ; --- => vf (have agr) part ; --# notpresent --- => vf (havent agr) part ; --# notpresent --- => vf (verb.s ! VPast) [] ; --# notpresent --- should be opp --- => vf "did" inf ; --# notpresent --- => vf "didn't" inf ; --# notpresent --- => vf "had" part ; --# notpresent --- => vf "hadn't" part ; --# notpresent --- => vf "will" inf ; --# notpresent --- => vf "won't" inf ; --# notpresent --- => vf "will" ("have" ++ part) ; --# notpresent --- => vf "won't" ("have" ++ part) ; --# notpresent --- => vf "would" inf ; --# notpresent --- => vf "wouldn't" inf ; --# notpresent --- => vf "would" ("have" ++ part) ; --# notpresent --- => vf "wouldn't" ("have" ++ part) ; --# notpresent --- => vf (doesnt agr) inf --- } ; --- prp = verb.s ! VPresPart ; --- inf = verb.s ! VInf ; --- ad = [] ; --- s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] --- } ; --- --- predAux : Aux -> VP = \verb -> { --- s = \\t,ant,b,ord,agr => --- let --- inf = verb.inf ; --- fin = verb.pres ! b ! agr ; --- part = verb.ppart ; --- vf : Str -> Str -> {fin, inf : Str} = \x,y -> --- {fin = x ; inf = y} ; --- in --- case of { --- => vf (have agr) part ; --# notpresent --- => vf (havent agr) part ; --# notpresent --- => vf (verb.past ! b ! agr) [] ; --# notpresent --- => vf "had" part ; --# notpresent --- => vf "hadn't" part ; --# notpresent --- => vf "will" inf ; --# notpresent --- => vf "won't" inf ; --# notpresent --- => vf "will" ("have" ++ part) ; --# notpresent --- => vf "won't" ("have" ++ part) ; --# notpresent --- => vf "would" inf ; --# notpresent --- => vf "wouldn't" inf ; --# notpresent --- => vf "would" ("have" ++ part) ; --# notpresent --- => vf "wouldn't" ("have" ++ part) ; --# notpresent --- => vf fin [] --- } ; --- prp = verb.prpart ; --- inf = verb.inf ; --- ad = [] ; --- s2 = \\_ => [] --- } ; --- --- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- inf = vp.inf ; --- ad = vp.ad ; --- s2 = \\a => vp.s2 ! a ++ obj ! a --- } ; --- ------ The adverb should be before the finite verb. --- --- insertAdV : Str -> VP -> VP = \adv,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- inf = vp.inf ; --- ad = vp.ad ++ adv ; --- s2 = \\a => vp.s2 ! a --- } ; --- ----- --- --- predVV : {s : VVForm => Str ; isAux : Bool} -> VP = \verb -> --- let verbs = verb.s --- in --- case verb.isAux of { --- True => predAux { --- pres = table { --- Pos => \\_ => verbs ! VVF VPres ; --- Neg => \\_ => verbs ! VVPresNeg --- } ; --- past = table { --# notpresent --- Pos => \\_ => verbs ! VVF VPast ; --# notpresent --- Neg => \\_ => verbs ! VVPastNeg --# notpresent --- } ; --# notpresent --- inf = verbs ! VVF VInf ; --- ppart = verbs ! VVF VPPart ; --- prpart = verbs ! VVF VPresPart ; --- } ; --- _ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False} --- } ; --- --- presVerb : {s : VForm => Str} -> Agr -> Str = \verb -> --- agrVerb (verb.s ! VPres) (verb.s ! VInf) ; --- --- infVP : Bool -> VP -> Agr -> Str = \isAux,vp,a -> --- if_then_Str isAux [] "to" ++ --- vp.inf ++ vp.s2 ! a ; --- --- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> --- case agr of { --- {n = Sg ; p = P3} => has ; --- _ => have --- } ; --- --- have = agrVerb "has" "have" ; --- havent = agrVerb "hasn't" "haven't" ; --- does = agrVerb "does" "do" ; --- doesnt = agrVerb "doesn't" "don't" ; --- --- Aux = { --- pres : Polarity => Agr => Str ; --- past : Polarity => Agr => Str ; --# notpresent --- inf,ppart,prpart : Str --- } ; --- --- auxBe : Aux = { --- pres = \\b,a => case of { --- => "am" ; --- => ["am not"] ; --- am not I --- _ => agrVerb (posneg b "is") (posneg b "are") a --- } ; --- past = \\b,a => case a of { --# notpresent --- {n = Sg ; p = P1|P3} => (posneg b "was") ; --# notpresent --- _ => (posneg b "were") --# notpresent --- } ; --# notpresent --- inf = "be" ; --- ppart = "been" ; --- prpart = "being" --- } ; --- --- posneg : Polarity -> Str -> Str = \p,s -> case p of { --- Pos => s ; --- Neg => s + "n't" --- } ; --- --- conjThat : Str = "that" ; --- --- reflPron : Agr => Str = table { --- {n = Sg ; p = P1} => "myself" ; --- {n = Sg ; p = P2} => "yourself" ; --- {n = Sg ; p = P3} => "itself" ; ---- --- {n = Pl ; p = P1} => "ourselves" ; --- {n = Pl ; p = P2} => "yourselves" ; --- {n = Pl ; p = P3} => "themselves" --- } ; --- ----- For $Sentence$. --- --- Clause : Type = { --- s : Tense => Anteriority => Polarity => Order => Str --- } ; --- --- mkClause : Str -> Agr -> VP -> Clause = --- \subj,agr,vp -> { --- s = \\t,a,b,o => --- let --- verb = vp.s ! t ! a ! b ! o ! agr ; --- compl = vp.s2 ! agr --- in --- case o of { --- ODir => subj ++ verb.fin ++ vp.ad ++ verb.inf ++ compl ; --- OQuest => verb.fin ++ subj ++ vp.ad ++ verb.inf ++ compl --- } --- } ; --- --- ----- For $Numeral$. --- --- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} = --- \two, twelve, twenty, second -> --- {s = table { --- unit => table {NCard => two ; NOrd => second} ; --- teen => \\c => mkCard c twelve ; --- ten => \\c => mkCard c twenty --- } --- } ; --- --- regNum : Str -> {s : DForm => CardOrd => Str} = --- \six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ; --- --- regCardOrd : Str -> {s : CardOrd => Str} = \ten -> --- {s = table {NCard => ten ; NOrd => regOrd ten}} ; --- --- mkCard : CardOrd -> Str -> Str = \c,ten -> --- (regCardOrd ten).s ! c ; --- --- regOrd : Str -> Str = \ten -> --- case last ten of { --- "y" => init ten + "ieth" ; --- _ => ten + "th" --- } ; --- -} +--# -path=.:../abstract:../common:../../prelude + +--1 Russian auxiliary operations. + +-- This module contains operations that are needed to make the +-- resource syntax work. To define everything that is needed to +-- implement $Test$, it moreover contains regular lexical +-- patterns needed for $Lex$. + +resource ResRus = ParamX ** open Prelude in { + +flags coding=utf8 ; optimize=all ; + +--2 Enumerated parameter types +-- +-- These types are the ones found in school grammars. +-- Their parameter values are atomic. + +-- Some parameters, such as $Number$, are inherited from $ParamX$. +param + Gender = Masc | Fem | Neut ; + Case = Nom | Gen | Dat | Acc | Inst | Prepos ; + Animacy = Animate | Inanimate ; + Voice = Act | Pass ; + Aspect = Imperfective | Perfective ; +-- RusTense = Present | Past | Future ; +-- Degree = Pos | Comp | Super ; + AfterPrep = Yes | No ; + Possessive = NonPoss | Poss GenNum ; +-- Anteriority = Simul | Anter ; + ClForm = ClIndic Tense Anteriority | ClCondit | ClInfinit | ClImper; + -- "naked infinitive" clauses + +-- A number of Russian nouns have common gender. They can +-- denote both males and females: "умница" (a clever person), "инженер" (an engineer). +-- We overlook this phenomenon for now. + +-- The AfterPrep parameter is introduced in order to describe +-- the variations of the third person personal pronoun forms +-- depending on whether they come after a preposition or not. + +-- Declination forms depend on Case, Animacy , Gender: +-- "большие дома" - "больших домов" (big houses - big houses'), +-- Animacy plays role only in the Accusative case (Masc Sg and Plural forms): +-- Accusative Animate = Genetive, Accusaive Inanimate = Nominative +-- "я люблю большие дома-"я люблю больших мужчин" +-- (I love big houses - I love big men); +-- and on Number: "большой дом - "большие дома" +-- (a big house - big houses). +-- The plural never makes a gender distinction. + + GenNum = ASg Gender | APl ; + + -- Coercions between the compound gen-num type and gender and number: +oper + gNum : Gender -> Number -> GenNum = \g,n -> + case n of + { Sg => case g of + { Fem => ASg Fem ; + Masc => ASg Masc ; + Neut => ASg Neut } ; + Pl => APl + } ; + + +-- The Possessive parameter is introduced in order to describe +-- the possessives of personal pronouns, which are used in the +-- Genetive constructions like "моя мама" (my mother) instead of +-- "мама моя" (the mother of mine). + +--2 For $Noun$ +-- Nouns decline according to number and case. +-- For the sake of shorter description these parameters are +-- combined in the type SubstForm. +param + SubstForm = SF Number Case ; + + +-- Real parameter types (i.e. ones on which words and phrases depend) +-- are mostly hierarchical. The alternative would be cross-products of +-- simple parameters, but this would usually overgenerate. + +-- However, we use the cross-products in complex cases +-- (for example, aspect and tense parameter in the verb description) +-- where the relationship between the parameters are non-trivial +-- even though we aware that some combinations do not exist +-- (for example, present perfective does not exist, but removing +-- this combination would lead to having different descriptions +-- for perfective and imperfective verbs, which we do not want for the +-- sake of uniformity). + +param PronForm = PF Case AfterPrep Possessive; + +oper Pronoun = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; pron: Bool} ; + +-- Gender is not morphologically determined for first +-- and second person pronouns. + +param PronGen = PGen Gender | PNoGen ; + +-- The following coercion is useful: + +oper + pgen2gen : PronGen -> Gender = \p -> case p of { + PGen g => g ; + PNoGen => variants {Masc ; Fem} --- the best we can do for ya, tu + } ; + +oper + extCase: PronForm -> Case = \pf -> case pf of + { PF Nom _ _ => Nom ; + PF Gen _ _ => Gen ; + PF Dat _ _ => Dat ; + PF Inst _ _ => Inst ; + PF Acc _ _ => Acc ; + PF Prepos _ _ => Prepos + } ; + + mkPronForm: Case -> AfterPrep -> Possessive -> PronForm = + \c,n,p -> PF c n p ; + + CommNounPhrase: Type = {s : Number => Case => Str; g : Gender; anim : Animacy} ; + + NounPhrase : Type = { s : PronForm => Str ; n : Number ; + p : Person ; g: PronGen ; anim : Animacy ; pron: Bool} ; + + mkNP : Number -> CommNounPhrase -> NounPhrase = \n,chelovek -> + {s = \\cas => chelovek.s ! n ! (extCase cas) ; + n = n ; g = PGen chelovek.g ; p = P3 ; pron =False ; + anim = chelovek.anim + } ; + + det2NounPhrase : Adjective -> NounPhrase = \eto -> + {s = \\pf => eto.s ! (AF (extCase pf) Inanimate (ASg Neut)); n = Sg ; g = PGen Neut ; pron = False ; p = P3 ; anim = Inanimate } ; + + + + pron2NounPhraseNum : Pronoun -> Animacy -> Number -> NounPhrase = \ona, anim, num -> + {s = ona.s ; n = num ; g = ona.g ; + pron = ona.pron; p = ona.p ; anim = anim } ; + + +-- Agreement of $NP$ is a record. We'll add $Gender$ later. +-- oper Agr = {n : Number ; p : Person} ; + + +----2 For $Verb$ + +-- Mood is the main verb classification parameter. +-- The verb mood can be infinitive, subjunctive, imperative, and indicative. + +-- Note: subjunctive mood is analytical, i.e. formed from the past form of the +-- indicative mood plus the particle "ли". That is why they have the same GenNum +-- parameter. We choose to keep the "redundant" form in order to indicate +-- the presence of the subjunctive mood in Russian verbs. + +-- Aspect and Voice parameters are present in every mood, so Voice is put +-- before the mood parameter in verb form description the hierachy. +-- Moreover Aspect is regarded as an inherent parameter of a verb entry. +-- The primary reason for that is that one imperfective form can have several +-- perfective forms: "ломать" - "сломать" - "поломать" (to break). +-- Besides, the perfective form could be formed from imperfective +-- by prefixation, but also by taking a completely different stem: +-- "говорить"-"сказать" (to say). In the later case it is even natural to +-- regard them as different verb entries. +-- Another reason is that looking at the Aspect as an inherent verb parameter +-- seem to be customary in other similar projects: +-- http://starling.rinet.ru/morph.htm + +-- Note: Of course, the whole inflection table has many redundancies +-- in a sense that many verbs do not have all grammatically possible +-- forms. For example, passive does not exist for the verb +-- "любить" (to love), but exists for the verb "ломаться" (to break). +-- In present tense verbs do not conjugate according to Genus, +-- so parameter GenNum instead Number is used for the sake of +-- using for example as adjective in predication. + +-- Depending on the tense verbs conjugate according to combinations +-- of gender, person and number of the verb objects. +-- Participles (Present and Past) and Gerund forms are not included in the +-- current description. This is the verb type used in the lexicon: + +oper Verbum : Type = { s: VerbForm => Str ; asp : Aspect }; + +param + + VerbForm = VFORM Voice VerbConj ; + VerbConj = VIND GenNum VTense | VIMP Number Person | VINF | VSUB GenNum ; + VTense = VPresent Person | VPast | VFuture Person ; + +oper + getVTense : Tense -> Person -> VTense= \t,p -> + case t of { Present => VPresent p ; Past => VPast; Future => VFuture p } ; + + getVoice: VerbForm -> Voice = \vf -> + case vf of { + VFORM Act _ => Act; + VFORM Pass _ => Pass + }; +oper sebya : Case => Str =table { +Nom => ""; +Gen => "себя"; +Dat=> "себе"; +Acc => "себя"; +Instr => "собой"; +Prep =>"себе"}; + + Verb : Type = {s : ClForm => GenNum => Person => Str ; asp : Aspect ; w: Voice} ; +-- Verb phrases are discontinuous: the parts of a verb phrase are +-- (s) an inflected verb, (s2) verb adverbials (not negation though), and +-- (s3) complement. This discontinuity is needed in sentence formation +-- to account for word order variations. + + VerbPhrase : Type = Verb ** {s2: Str; s3 : Gender => Number => Str ; + negBefore: Bool} ; + + +-- This is one instance of Gazdar's *slash categories*, corresponding to his +-- $S/NP$. +-- We cannot have - nor would we want to have - a productive slash-category former. +-- Perhaps a handful more will be needed. +-- +-- Notice that the slash category has the same relation to sentences as +-- transitive verbs have to verbs: it's like a *sentence taking a complement*. + + SlashNounPhrase = Clause ** Complement ; + Clause = {s : Polarity => ClForm => Str} ; + +-- This is the traditional $S -> NP VP$ rule. + + predVerbPhrase : NounPhrase -> VerbPhrase -> SlashNounPhrase = + \Ya, tebyaNeVizhu -> { s = \\b,clf => + let + { ya = Ya.s ! (mkPronForm Nom No NonPoss); + khorosho = tebyaNeVizhu.s2; + vizhu = tebyaNeVizhu.s ! clf !(gNum (pgen2gen Ya.g) Ya.n)! Ya.p; + tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n + } + in + ya ++ khorosho ++ vizhu ++ tebya; + s2= ""; + c = Nom +} ; + +-- Questions are either direct ("Ты счастлив?") +-- or indirect ("Потом он спросил счастлив ли ты"). + +param + QuestForm = DirQ | IndirQ ; + +---- The order of sentence is needed already in $VP$. +-- +-- Order = ODir | OQuest ; + +oper + getActVerbForm : ClForm -> Gender -> Number -> Person -> VerbForm = \clf,g,n, p -> case clf of + { ClIndic Future _ => VFORM Act (VIND (gNum g n) (VFuture p)); + ClIndic Past _ => VFORM Act (VIND (gNum g n) VPast); + ClIndic Present _ => VFORM Act (VIND (gNum g n) (VPresent p)); + ClCondit => VFORM Act (VSUB (gNum g n)); + ClInfinit => VFORM Act VINF ; + ClImper => VFORM Act (VIMP n p) + }; + + +--2 For $Adjective$ +param + AdjForm = AF Case Animacy GenNum | AdvF; + +oper + Complement = {s2 : Str ; c : Case} ; + + pgNum : PronGen -> Number -> GenNum = \g,n -> + case n of + { Sg => case g of + { PGen Fem => ASg Fem ; + PGen Masc => ASg Masc ; + PGen Neut => ASg Neut ; + _ => ASg Masc } ; + Pl => APl + } ; + -- _ => variants {ASg Masc ; ASg Fem} } ; + -- "variants" version cause "no term variants" error during linearization + + + +oper numGNum : GenNum -> Number = \gn -> + case gn of { APl => Pl ; _ => Sg } ; + +oper genGNum : GenNum -> Gender = \gn -> + case gn of { ASg Fem => Fem; _ => Masc } ; + +oper numAF: AdjForm -> Number = \af -> + case af of { AdvF => Sg; AF _ _ gn => (numGNum gn) } ; + +oper genAF: AdjForm -> Gender = \af -> + case af of { AdvF => Neut; AF _ _ gn => (genGNum gn) } ; + +oper caseAF: AdjForm -> Case = \af -> + case af of { AdvF => Nom; AF c _ _ => c } ; + +-- The Degree parameter should also be more complex, since most Russian +-- adjectives have two comparative forms: +-- attributive (syntactic (compound), declinable) - +-- "более высокий" (corresponds to "more high") +-- and predicative (indeclinable)- "выше" (higher) and more than one +-- superlative forms: "самый высокий" (corresponds to "the most high") - +-- "высочайший" (the highest). + +-- Even one more parameter independent of the degree can be added, +-- since Russian adjectives in the positive degree also have two forms: +-- long (attributive and predicative) - "высокий" (high) and short (predicative) - "высок" +-- although this parameter will not be exactly orthogonal to the +-- degree parameter. +-- Short form has no case declension, so in principle +-- it can be considered as an additional case. + +-- Note: although the predicative usage of the long +-- form is perfectly grammatical, it can have a slightly different meaning +-- compared to the short form. +-- For example: "он - больной" (long, predicative) vs. +-- "он - болен" (short, predicative). + +--3 Adjective phrases +-- +-- An adjective phrase may contain a complement, e.g. "моложе Риты". +-- Then it is used as postfix in modification, e.g. "человек, моложе Риты". + + IsPostfixAdj = Bool ; + + +-- Simple adjectives are not postfix: + +-- Adjective type includes both non-degree adjective classes: +-- possesive ("мамин"[mother's], "лисий" [fox'es]) +-- and relative ("русский" [Russian]) adjectives. + + Adjective : Type = {s : AdjForm => Str} ; + +-- A special type of adjectives just having positive forms +-- (for semantic reasons) is useful, e.g. "финский". + + AdjPhrase = Adjective ** {p : IsPostfixAdj} ; + + + mkAdjPhrase : Adjective -> IsPostfixAdj -> AdjPhrase = \novuj ,p -> novuj ** {p = p} ; + +----2 For $Relative$ +-- +-- RAgr = RNoAg | RAg {n : Number ; p : Person} ; +-- RCase = RPrep | RC Case ; +-- +--2 For $Numeral$ + +param DForm = unit | teen | ten | hund ; +param Place = attr | indep ; +param Size = nom | sgg | plg ; +--param Gend = masc | fem | neut ; +oper mille : Size => Str = table { + {nom} => "тысяча" ; + {sgg} => "тысячи" ; + _ => "тысяч"} ; + +oper gg : Str -> Gender => Str = \s -> table {_ => s} ; + +-- CardOrd = NCard | NOrd ; + +----2 Transformations between parameter types +-- + +oper + + numSF: SubstForm -> Number = \sf -> case sf of + { + SF Sg _ => Sg ; + _ => Pl + } ; + + caseSF: SubstForm -> Case = \sf -> case sf of + { + SF _ Nom => Nom ; + SF _ Gen => Gen ; + SF _ Dat => Dat ; + SF _ Inst => Inst ; + SF _ Acc => Acc ; + SF _ Prepos => Prepos + } ; + + +-- oper +-- agrP3 : Number -> Agr = \n -> +-- {n = n ; p = P3} ; +-- +-- conjAgr : Agr -> Agr -> Agr = \a,b -> { +-- n = conjNumber a.n b.n ; +-- p = conjPerson a.p b.p +-- } ; +-- +---- For $Lex$. +-- +---- For each lexical category, here are the worst-case constructors. +-- +-- mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} = +-- \man,mans,men,mens -> { +-- s = table { +-- Sg => table { +-- Gen => mans ; +-- _ => man +-- } ; +-- Pl => table { +-- Gen => mens ; +-- _ => men +-- } +-- } +-- } ; +-- +-- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str} = +-- \good,better,best,well -> { +-- s = table { +-- AAdj Posit => good ; +-- AAdj Compar => better ; +-- AAdj Superl => best ; +-- AAdv => well +-- } +-- } ; +-- +-- mkVerb : (_,_,_,_,_ : Str) -> Verb = +-- \go,goes,went,gone,going -> { +-- s = table { +-- VInf => go ; +-- VPres => goes ; +-- VPast => went ; --# notpresent +-- VPPart => gone ; +-- VPresPart => going +-- } ; +-- isRefl = False +-- } ; +-- +-- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} = +-- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ; +-- +-- mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} = +-- \i,me,my,n,p -> { +-- s = table { +-- Nom => i ; +-- Acc => me ; +-- Gen => my +-- } ; +-- a = { +-- n = n ; +-- p = p +-- } +-- } ; +-- +---- These functions cover many cases; full coverage inflectional patterns are +---- in $MorphoRus$. +-- +-- regN : Str -> {s : Number => Case => Str} = \car -> +-- mkNoun car (car + "'s") (car + "s") (car + "s'") ; +-- +-- regA : Str -> {s : AForm => Str} = \warm -> +-- mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ; +-- +-- regV : Str -> Verb = \walk -> +-- mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ; +-- +-- regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n -> +-- mkNP that that (that + "'s") n P3 ; +-- +---- We have just a heuristic definition of the indefinite article. +---- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic +---- "o" ("one-sided"), vocalic "u" ("umbrella"). +-- +-- artIndef = pre { +-- "a" ; +-- "an" / strs {"a" ; "e" ; "i" ; "o" ; "A" ; "E" ; "I" ; "O" } +-- } ; +-- +-- artDef = "the" ; +-- +---- For $Verb$. +-- +-- Verb : Type = { +-- s : VForm => Str ; +-- isRefl : Bool +-- } ; +-- +-- VerbForms : Type = +-- Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ; +-- +-- VP : Type = { +-- s : VerbForms ; +-- prp : Str ; -- present participle +-- inf : Str ; -- infinitive +-- ad : Str ; +-- s2 : Agr => Str +-- } ; +-- +----- The order gets wrong with AdV, but works around a parser +----- generation bug. +-- +-- predV : Verb -> VP = \verb -> { +-- s = \\t,ant,b,ord,agr => +-- let +-- inf = verb.s ! VInf ; +-- fin = presVerb verb agr ; +-- part = verb.s ! VPPart ; +-- vf : Str -> Str -> {fin, inf : Str} = \x,y -> +-- {fin = x ; inf = y} ; +-- in +-- case of { +-- => vf fin [] ; --- should be opp +-- => vf (does agr) inf ; +-- => vf (have agr) part ; --# notpresent +-- => vf (havent agr) part ; --# notpresent +-- => vf (verb.s ! VPast) [] ; --# notpresent --- should be opp +-- => vf "did" inf ; --# notpresent +-- => vf "didn't" inf ; --# notpresent +-- => vf "had" part ; --# notpresent +-- => vf "hadn't" part ; --# notpresent +-- => vf "will" inf ; --# notpresent +-- => vf "won't" inf ; --# notpresent +-- => vf "will" ("have" ++ part) ; --# notpresent +-- => vf "won't" ("have" ++ part) ; --# notpresent +-- => vf "would" inf ; --# notpresent +-- => vf "wouldn't" inf ; --# notpresent +-- => vf "would" ("have" ++ part) ; --# notpresent +-- => vf "wouldn't" ("have" ++ part) ; --# notpresent +-- => vf (doesnt agr) inf +-- } ; +-- prp = verb.s ! VPresPart ; +-- inf = verb.s ! VInf ; +-- ad = [] ; +-- s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] +-- } ; +-- +-- predAux : Aux -> VP = \verb -> { +-- s = \\t,ant,b,ord,agr => +-- let +-- inf = verb.inf ; +-- fin = verb.pres ! b ! agr ; +-- part = verb.ppart ; +-- vf : Str -> Str -> {fin, inf : Str} = \x,y -> +-- {fin = x ; inf = y} ; +-- in +-- case of { +-- => vf (have agr) part ; --# notpresent +-- => vf (havent agr) part ; --# notpresent +-- => vf (verb.past ! b ! agr) [] ; --# notpresent +-- => vf "had" part ; --# notpresent +-- => vf "hadn't" part ; --# notpresent +-- => vf "will" inf ; --# notpresent +-- => vf "won't" inf ; --# notpresent +-- => vf "will" ("have" ++ part) ; --# notpresent +-- => vf "won't" ("have" ++ part) ; --# notpresent +-- => vf "would" inf ; --# notpresent +-- => vf "wouldn't" inf ; --# notpresent +-- => vf "would" ("have" ++ part) ; --# notpresent +-- => vf "wouldn't" ("have" ++ part) ; --# notpresent +-- => vf fin [] +-- } ; +-- prp = verb.prpart ; +-- inf = verb.inf ; +-- ad = [] ; +-- s2 = \\_ => [] +-- } ; +-- +-- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { +-- s = vp.s ; +-- prp = vp.prp ; +-- inf = vp.inf ; +-- ad = vp.ad ; +-- s2 = \\a => vp.s2 ! a ++ obj ! a +-- } ; +-- +----- The adverb should be before the finite verb. +-- +-- insertAdV : Str -> VP -> VP = \adv,vp -> { +-- s = vp.s ; +-- prp = vp.prp ; +-- inf = vp.inf ; +-- ad = vp.ad ++ adv ; +-- s2 = \\a => vp.s2 ! a +-- } ; +-- +---- +-- +-- predVV : {s : VVForm => Str ; isAux : Bool} -> VP = \verb -> +-- let verbs = verb.s +-- in +-- case verb.isAux of { +-- True => predAux { +-- pres = table { +-- Pos => \\_ => verbs ! VVF VPres ; +-- Neg => \\_ => verbs ! VVPresNeg +-- } ; +-- past = table { --# notpresent +-- Pos => \\_ => verbs ! VVF VPast ; --# notpresent +-- Neg => \\_ => verbs ! VVPastNeg --# notpresent +-- } ; --# notpresent +-- inf = verbs ! VVF VInf ; +-- ppart = verbs ! VVF VPPart ; +-- prpart = verbs ! VVF VPresPart ; +-- } ; +-- _ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False} +-- } ; +-- +-- presVerb : {s : VForm => Str} -> Agr -> Str = \verb -> +-- agrVerb (verb.s ! VPres) (verb.s ! VInf) ; +-- +-- infVP : Bool -> VP -> Agr -> Str = \isAux,vp,a -> +-- if_then_Str isAux [] "to" ++ +-- vp.inf ++ vp.s2 ! a ; +-- +-- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> +-- case agr of { +-- {n = Sg ; p = P3} => has ; +-- _ => have +-- } ; +-- +-- have = agrVerb "has" "have" ; +-- havent = agrVerb "hasn't" "haven't" ; +-- does = agrVerb "does" "do" ; +-- doesnt = agrVerb "doesn't" "don't" ; +-- +-- Aux = { +-- pres : Polarity => Agr => Str ; +-- past : Polarity => Agr => Str ; --# notpresent +-- inf,ppart,prpart : Str +-- } ; +-- +-- auxBe : Aux = { +-- pres = \\b,a => case of { +-- => "am" ; +-- => ["am not"] ; --- am not I +-- _ => agrVerb (posneg b "is") (posneg b "are") a +-- } ; +-- past = \\b,a => case a of { --# notpresent +-- {n = Sg ; p = P1|P3} => (posneg b "was") ; --# notpresent +-- _ => (posneg b "were") --# notpresent +-- } ; --# notpresent +-- inf = "be" ; +-- ppart = "been" ; +-- prpart = "being" +-- } ; +-- +-- posneg : Polarity -> Str -> Str = \p,s -> case p of { +-- Pos => s ; +-- Neg => s + "n't" +-- } ; +-- +-- conjThat : Str = "that" ; +-- +-- reflPron : Agr => Str = table { +-- {n = Sg ; p = P1} => "myself" ; +-- {n = Sg ; p = P2} => "yourself" ; +-- {n = Sg ; p = P3} => "itself" ; ---- +-- {n = Pl ; p = P1} => "ourselves" ; +-- {n = Pl ; p = P2} => "yourselves" ; +-- {n = Pl ; p = P3} => "themselves" +-- } ; +-- +---- For $Sentence$. +-- +-- Clause : Type = { +-- s : Tense => Anteriority => Polarity => Order => Str +-- } ; +-- +-- mkClause : Str -> Agr -> VP -> Clause = +-- \subj,agr,vp -> { +-- s = \\t,a,b,o => +-- let +-- verb = vp.s ! t ! a ! b ! o ! agr ; +-- compl = vp.s2 ! agr +-- in +-- case o of { +-- ODir => subj ++ verb.fin ++ vp.ad ++ verb.inf ++ compl ; +-- OQuest => verb.fin ++ subj ++ vp.ad ++ verb.inf ++ compl +-- } +-- } ; +-- +-- +---- For $Numeral$. +-- +-- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} = +-- \two, twelve, twenty, second -> +-- {s = table { +-- unit => table {NCard => two ; NOrd => second} ; +-- teen => \\c => mkCard c twelve ; +-- ten => \\c => mkCard c twenty +-- } +-- } ; +-- +-- regNum : Str -> {s : DForm => CardOrd => Str} = +-- \six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ; +-- +-- regCardOrd : Str -> {s : CardOrd => Str} = \ten -> +-- {s = table {NCard => ten ; NOrd => regOrd ten}} ; +-- +-- mkCard : CardOrd -> Str -> Str = \c,ten -> +-- (regCardOrd ten).s ! c ; +-- +-- regOrd : Str -> Str = \ten -> +-- case last ten of { +-- "y" => init ten + "ieth" ; +-- _ => ten + "th" +-- } ; +-- +} diff --git a/lib/resource-1.0/russian/SentenceRus.gf b/lib/resource-1.0/russian/SentenceRus.gf index 47c5bbb41..404d13d54 100644 --- a/lib/resource-1.0/russian/SentenceRus.gf +++ b/lib/resource-1.0/russian/SentenceRus.gf @@ -1,51 +1,79 @@ - ---# -path=.:../abstract:../common:../../prelude - - -concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { --- --- flags optimize=all_subs ; --- --- lin --- --- PredVP np vp = mkClause (np.s ! Nom) np.a vp ; --- --- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; --- --- ImpVP vp = { --- s = \\pol,n => --- let --- agr = {n = n ; p = P2} ; --- verb = infVP True vp agr ; --- dont = case pol of { --- Neg => "don't" ; --- _ => [] --- } --- in --- dont ++ verb --- } ; --- --- SlashV2 np v2 = --- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; --- --- SlashVVV2 np vv v2 = --- mkClause (np.s ! Nom) np.a --- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) ** --- {c2 = v2.c2} ; --- --- AdvSlash slash adv = { --- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; --- c2 = slash.c2 --- } ; --- --- SlashPrep cl prep = cl ** {c2 = prep.s} ; --- --- EmbedS s = {s = conjThat ++ s.s} ; --- EmbedQS qs = {s = qs.s ! QIndir} ; --- EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr --- --- UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! ODir} ; --- UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ; --- UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ; --- -} + +--# -path=.:../abstract:../common:../../prelude + + +concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { + + flags optimize=all_subs ; coding=utf8 ; + + lin + + PredVP Ya tebyaNeVizhu = { s = \\b,clf => + let { + ya = Ya.s ! (case clf of { + ClInfinit => (mkPronForm Acc No NonPoss); + _ => (mkPronForm Nom No NonPoss) + }); + ne = case b of {Pos=>""; Neg=>"не"}; + vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.g Ya.n)! Ya.p; + tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n + } + in + if_then_else Str tebyaNeVizhu.negBefore + (ya ++ ne ++ vizhu ++ tebya) + (ya ++ vizhu ++ ne ++ tebya) + } ; + + + PredSCVP sc vp = { s = \\b,clf => + let { + ne = case b of {Pos=>""; Neg=>"не"}; + vizhu = vp.s ! clf ! (ASg Neut)! P3; + tebya = vp.s3 ! Neut ! Sg + } + in + if_then_else Str vp.negBefore + (sc.s ++ ne ++ vizhu ++ tebya) + (sc.s ++ vizhu ++ ne ++ tebya) + } ; + + SlashV2 ivan lubit = { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ + lubit.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ; + s2=lubit.s2; c=lubit.c }; + + SlashVVV2 ivan khotet lubit = + { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ khotet.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ++ lubit.s! VFORM Act VINF ; + s2=lubit.s2; + c=lubit.c }; + + AdvSlash slash adv = { + s = \\b,clf => slash.s ! b ! clf ++ adv.s ; + c = slash.c; + s2 = slash.s2; + } ; + + SlashPrep cl p = {s=cl.s; s2=p.s; c=p.c} ; + + ImpVP inf = {s = \\pol, g,n => + let + dont = case pol of { + Neg => "don't" ; + _ => [] + } + in + dont ++ inf.s ! ClImper ! (gNum g n )!P3++ + inf.s2++inf.s3!g!n + } ; + + EmbedS s = {s = "что" ++ s.s} ; + -- In Russian "Whether you go" transformed in "go whether you": + EmbedQS qs = {s = qs.s ! QIndir} ; + EmbedVP vp = {s = vp.s!ClInfinit!(ASg Masc) !P3} ; + + UseCl t a p cl = {s = cl.s! p.p ! ClIndic t.t a.a}; + + UseQCl t a p qcl= {s = qcl.s!p.p! ClIndic t.t a.a }; + UseRCl t a p rcl ={s = rcl.s! p.p ! ClIndic t.t a.a }; + +} + diff --git a/lib/resource-1.0/russian/StructuralRus.gf b/lib/resource-1.0/russian/StructuralRus.gf index a659624a3..19d6cfb18 100644 --- a/lib/resource-1.0/russian/StructuralRus.gf +++ b/lib/resource-1.0/russian/StructuralRus.gf @@ -1,117 +1,136 @@ ---# -path=.:../abstract:../common:../../prelude - -concrete StructuralRus of Structural = CatRus ** --- open MorphoRus, (P = ParadigmsRus), Prelude in { --- --- flags optimize=all ; --- --- lin --- above_Prep = ss "above" ; --- after_Prep = ss "after" ; --- all_Predet = ss "all" ; --- almost_AdA, almost_AdN = ss "almost" ; --- although_Subj = ss "although" ; --- always_AdV = ss "always" ; --- and_Conj = ss "and" ** {n = Pl} ; --- because_Subj = ss "because" ; --- before_Prep = ss "before" ; --- behind_Prep = ss "behind" ; --- between_Prep = ss "between" ; --- both7and_DConj = sd2 "both" "and" ** {n = Pl} ; --- but_PConj = ss "but" ; --- by8agent_Prep = ss "by" ; --- by8means_Prep = ss "by" ; --- can8know_VV, can_VV = { --- s = table VVForm [["be able to"] ; "can" ; "could" ; --- ["been able to"] ; ["being able to"] ; "can't" ; "couldn't"] ; --- isAux = True --- } ; --- during_Prep = ss "during" ; --- either7or_DConj = sd2 "either" "or" ** {n = Sg} ; --- everybody_NP = regNP "everybody" Sg ; --- every_Det = mkDeterminer Sg "every" ; --- everything_NP = regNP "everything" Sg ; --- everywhere_Adv = ss "everywhere" ; --- few_Det = mkDeterminer Pl "few" ; --- first_Ord = ss "first" ; --- from_Prep = ss "from" ; --- he_Pron = mkNP "he" "him" "his" Sg P3 ; --- here_Adv = ss "here" ; --- here7to_Adv = ss ["to here"] ; --- here7from_Adv = ss ["from here"] ; --- how_IAdv = ss "how" ; --- how8many_IDet = mkDeterminer Pl ["how many"] ; --- if_Subj = ss "if" ; --- in8front_Prep = ss ["in front of"] ; --- i_Pron = mkNP "I" "me" "my" Sg P1 ; --- in_Prep = ss "in" ; --- it_Pron = mkNP "it" "it" "its" Sg P3 ; --- less_CAdv = ss "less" ; --- many_Det = mkDeterminer Pl "many" ; --- more_CAdv = ss "more" ; --- most_Predet = ss "most" ; --- much_Det = mkDeterminer Sg "much" ; --- must_VV = { --- s = table VVForm [["be have to"] ; "must" ; ["had to"] ; --- ["had to"] ; ["having to"] ; "mustn't" ; ["hadn't to"]] ; ---- --- isAux = True --- } ; --- no_Phr = ss "no" ; --- on_Prep = ss "on" ; --- one_Quant = mkDeterminer Sg "one" ; --- only_Predet = ss "only" ; --- or_Conj = ss "or" ** {n = Sg} ; --- otherwise_PConj = ss "otherwise" ; --- part_Prep = ss "of" ; --- please_Voc = ss "please" ; --- possess_Prep = ss "of" ; --- quite_Adv = ss "quite" ; --- she_Pron = mkNP "she" "her" "her" Sg P3 ; --- so_AdA = ss "so" ; --- somebody_NP = regNP "somebody" Sg ; --- someSg_Det = mkDeterminer Sg "some" ; --- somePl_Det = mkDeterminer Pl "some" ; --- something_NP = regNP "something" Sg ; --- somewhere_Adv = ss "somewhere" ; --- that_Quant = mkQuant "that" "those" ; --- that_NP = regNP "that" Sg ; --- there_Adv = ss "there" ; --- there7to_Adv = ss "there" ; --- there7from_Adv = ss ["from there"] ; --- therefore_PConj = ss "therefore" ; --- these_NP = regNP "these" Pl ; --- they_Pron = mkNP "they" "them" "their" Pl P3 ; --- this_Quant = mkQuant "this" "these" ; --- this_NP = regNP "this" Sg ; --- those_NP = regNP "those" Pl ; --- through_Prep = ss "through" ; --- too_AdA = ss "too" ; --- to_Prep = ss "to" ; --- under_Prep = ss "under" ; --- very_AdA = ss "very" ; --- want_VV = P.mkVV (P.regV "want") ; --- we_Pron = mkNP "we" "us" "our" Pl P1 ; --- whatPl_IP = mkIP "what" "what" "what's" Sg ; --- whatSg_IP = mkIP "what" "what" "what's" Sg ; --- when_IAdv = ss "when" ; --- when_Subj = ss "when" ; --- where_IAdv = ss "where" ; --- whichPl_IDet = mkDeterminer Pl ["which"] ; --- whichSg_IDet = mkDeterminer Sg ["which"] ; --- whoSg_IP = mkIP "who" "whom" "whose" Sg ; --- whoPl_IP = mkIP "who" "whom" "whose" Pl ; --- why_IAdv = ss "why" ; --- without_Prep = ss "without" ; --- with_Prep = ss "with" ; --- yes_Phr = ss "yes" ; --- youSg_Pron = mkNP "you" "you" "your" Sg P2 ; --- youPl_Pron = mkNP "you" "you" "your" Pl P2 ; --- youPol_Pron = mkNP "you" "you" "your" Sg P2 ; --- --- ---oper --- mkQuant : Str -> Str -> {s : Number => Str} = \x,y -> { --- s = table Number [x ; y] --- } ; --- -} +--# -path=.:../abstract:../common:../../prelude + +concrete StructuralRus of Structural = CatRus ** + open ResRus, MorphoRus, (P = ParadigmsRus), Prelude, NounRus, in { + + flags optimize=all ; coding=utf8 ; + +lin +-- First mount the numerals. +-- UseNumeral i = i ; + +-- Then an alphabetical list of structural words + + above_Prep = { s = "над" ; c = Inst} ; + after_Prep = { s = "после" ; c = Gen }; +-- all8mass_Det = vesDet ** {n = Sg; g = PNoGen; c = Nom} ; + all_Predet = vseDetPl ** { g = PNoGen; c = Nom} ; + almost_AdA = {s= "почти"} ; + almost_AdN = {s= "почти"} ; + although_Subj = ss "хотя" ; + always_AdV = ss "всегда" ; + and_Conj = ss "и" ** {n = Pl} ; + because_Subj = ss ["потому что"] ; + before_Prep ={ s = "перед" ; c = Inst}; + behind_Prep = { s = "за" ; c = Inst }; + between_Prep = { s = "между" ; c = Inst}; + both7and_DConj = sd2 "как" [", так и"] ** {n = Pl} ; + but_PConj = ss "но" ; + by8agent_Prep = { s = ["с помощью"] ; c = Gen}; + by8means_Prep = { s = ["с помощью"] ; c = Gen}; + can8know_VV = verbMoch ; + can_VV = verbMoch ; + during_Prep = { s = ["в течение"] ; c = Gen}; + either7or_DConj = sd2 "либо" [", либо"] ** {n = Sg} ; +-- comma is not visible in GUI! + every_Det = kazhdujDet ** {n = Sg ; g = PNoGen; c= Nom} ; + everybody_NP = mkNP Pl (UseN ((eEnd_Decl "вс")**{lock_N=<>})) ; + everything_NP = UsePron (pronVseInanimate ** {lock_Pron=<>}) ; + everywhere_Adv = ss "везде" ; + few_Det = (ij_EndK_G_KH_Decl "немног") **{lock_Det= <>; n= Sg; g = PNoGen; c = Nom}; -- AMalenkij + first_Ord = (uy_j_EndDecl "перв" ) ** {lock_A = <>}; --AStaruyj + from_Prep = { s = "от" ; c = Gen }; + he_Pron = pronOn ; + here_Adv = ss "здесь" ; + here7to_Adv = ss "сюда" ; + here7from_Adv = ss "отсюда" ; + how_IAdv = ss "как" ; + how8many_IDet = skolkoSgDet ** {n = Sg; g = (PGen Neut); c= Gen}; + i_Pron = pronYa ; + if_Subj = ss "если" ; + in8front_Prep = { s = "перед" ; c = Inst}; + in_Prep = { s = "в" ; c = Prepos }; + it_Pron = pronOno ; + less_CAdv = ss "меньше" ; + many_Det = mnogoSgDet ** {n = Sg; g = (PGen Neut); c= Gen} ; + more_CAdv = ss "более" ; + most_Predet = bolshinstvoSgDet ** {n = Sg; g = (PGen Neut); c= Gen} ; + -- inanimate, Sg: "большинство телефонов безмолству-ет" +-- most8many_Det = bolshinstvoPlDet ** {n = Pl; g = (PGen Neut); c= Gen} ; + -- animate, Pl: "большинство учащихся хорошо подготовлен-ы" + much_Det = mnogoSgDet ** {n = Sg; g = (PGen Neut); c= Gen} ; -- same as previous + must_VV = verbDolzhen ; + no_Phr = ss ["Нет ."] ; + on_Prep = { s = "на" ; c = Prepos }; + one_Quant = odinDet ** {lock_QuantSg = <>; n= Sg; g = PNoGen; c = Nom }; +--AStaruyj : + only_Predet = (uy_j_EndDecl "единственн" ) ** {lock_Predet = <>; n= Sg; g = PNoGen; c = Nom }; + or_Conj = ss "или" ** {n = Sg} ; + otherwise_PConj = ss "иначе" ; + part_Prep = { s = "" ; c = Nom}; -- missing in Russian + please_Voc = ss "пожалуйста" ; + possess_Prep = { s = "" ; c = Gen}; --- ?? AR 19/2/2004 + quite_Adv = ss "довольно" ; + she_Pron = pronOna ; + so_AdA = ss "так"; + somebody_NP = UsePron (pronKtoTo** {lock_Pron = <>}); + someSg_Det = nekotorujDet ** {n = Sg; g = PNoGen; c= Nom} ; + somePl_Det = nekotorujDet ** {n = Pl; g = PNoGen; c= Nom} ; + something_NP = UsePron (pronChtoTo** {lock_Pron=<> }) ; + somewhere_Adv = ss "где-нибудь" ; +--- these_NP n = { s =\\_ => [] ; n = Pl; p = P3; g= PGen Fem ; +--- anim = Animate ; pron = True} ; -- missing in Russian +--- those_NP n = { s =\\_ => [] ; n = Pl; p = P3; g=PGen Fem ; +--- anim = Animate ; pron = True} ; -- missing in Russian + that_Quant = totDet ** {n = Sg; g = PNoGen; c= Nom} ; + that_NP = det2NounPhrase totDet ; -- inanimate form only + there_Adv = ss "там" ; + there7to_Adv = ss "туда" ; + there7from_Adv = ss "оттуда" ; + therefore_PConj = ss "следовательно" ; +-- these_NDet = etotDet ** { g = PNoGen; c= Nom} ; +-- they8fem_NP = UsePron pronOni Animate; + they_Pron = pronOni; + this_Quant = etotDet ** {n = Sg; g = PNoGen; c= Nom} ; + this_NP = det2NounPhrase etotDet ; -- inanimate form only +-- those_NDet = totDet ** {g = PNoGen; c= Nom} ; +-- thou_NP = UsePron pronTu Animate; + through_Prep = { s = "через" ; c = Acc }; + to_Prep = { s = "к" ; c = Dat }; + too_AdA = ss "слишком" ; + under_Prep = { s = "под" ; c = Inst }; + very_AdA = ss "очень" ; + want_VV = verbKhotet ; + we_Pron = pronMu ; + whatPl_IP = pron2NounPhraseNum pronChto Inanimate Pl; + whatSg_IP = pron2NounPhraseNum pronChto Inanimate Sg; + when_IAdv = ss "когда" ; + when_Subj = ss "когда" ; + where_IAdv = ss "где" ; + whichPl_IDet = kotorujDet ** {n = Pl; g = PNoGen; c= Nom} ; + whichSg_IDet = kotorujDet ** {n = Sg; g = PNoGen; c= Nom} ; + whoPl_IP = pron2NounPhraseNum pronKto Animate Pl; + whoSg_IP = pron2NounPhraseNum pronKto Animate Sg; + why_IAdv = ss "почему" ; + with_Prep = { s = "с" ; c = Inst}; + without_Prep = { s = "без" ; c = Gen}; + youPl_Pron = pronVu; + yes_Phr = ss ["Да ."] ; + youSg_Pron = pronVu; + youPol_Pron = pronVu; + +--- NoDet = nikakojDet ** {n = Sg; g = PNoGen; c= Nom} ; +--- AnyDet = lubojDet ** {n = Sg; g = PNoGen; c= Nom} ; +--- AnyNumDet = mkDeterminerNum (lubojDet ** {n = Pl; g = PNoGen; c= Nom} ); +--- NoNumDet = mkDeterminerNum (nikakojDet ** {n = Pl; g = PNoGen; c= Nom} ); +---NobodyNP = UsePron pronNikto Animate; +---NothingNP = UsePron pronNichto Inanimate; + +-- In case of "neither.. no" expression double negation is not +-- only possible, but also required in Russian. +-- There is no means of control for this however in the resource grammar. +--- NeitherNor = sd2 "ни" [", ни"] ** {n = Sg} ; +--- NowhereNP = ss "нигде" ; +--- AgentPrep = { s = "" ; c = Nom}; -- missing in Russian +} + diff --git a/lib/resource-1.0/russian/VerbRus.gf b/lib/resource-1.0/russian/VerbRus.gf index dbf16da5c..c5f2e5b10 100644 --- a/lib/resource-1.0/russian/VerbRus.gf +++ b/lib/resource-1.0/russian/VerbRus.gf @@ -1,41 +1,239 @@ - ---# -path=.:../abstract:../common:../../prelude - - -concrete VerbRus of Verb = CatRus ** open ResRus in { --- --- flags optimize=all_subs ; --- --- lin --- UseV = predV ; --- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ; --- ComplV3 v np np2 = --- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ; --- --- ComplVV v vp = insertObj (\\a => infVP v.isAux vp a) (predVV v) ; --- --- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ; --- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; --- --- ComplVA v ap = insertObj (ap.s) (predV v) ; --- ComplV2A v np ap = --- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; --- --- UseComp comp = insertObj comp.s (predAux auxBe) ; --- --- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; --- --- AdVVP adv vp = insertAdV adv.s vp ; --- --- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; --- --- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; --- --- UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to" --- --- CompAP ap = ap ; --- CompNP np = {s = \\_ => np.s ! Acc} ; --- CompAdv a = {s = \\_ => a.s} ; --- --- -} + +--# -path=.:../abstract:../common:../../prelude + +concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { + + flags optimize=all_subs ; coding=utf8 ; + lin + CompNP masha = + { s=\\clf,gn,p => case clf of + { + (ClIndic Present _) => masha.s ! (mkPronForm Nom No NonPoss) ; + (ClIndic Past _) => case gn of + { (ASg Fem) =>"была"++masha.s ! (mkPronForm Inst No NonPoss); + (ASg Masc) =>"был" ++ masha.s!(mkPronForm Inst No NonPoss); + (ASg Neut) =>"было" ++ masha.s!(mkPronForm Inst No NonPoss); + APl => "были" ++ masha.s ! (mkPronForm Inst No NonPoss) + }; + (ClIndic Future _) => case gn of + { APl => case p of + { P3 => "будут"++masha.s ! (mkPronForm Inst No NonPoss); + P2 => "будете"++masha.s !(mkPronForm Inst No NonPoss); + P1 => "будем"++masha.s ! (mkPronForm Inst No NonPoss) + }; + (ASg _) => case p of + { P3=>"будет"++masha.s!(mkPronForm Inst No NonPoss) ; + P2 => "будешь"++ masha.s ! (mkPronForm Inst No NonPoss) ; + P1=> "буду"++ masha.s ! (mkPronForm Inst No NonPoss) + } --case p + }; --case gn + ClCondit => "" ; + ClImper => case (numGNum gn) of + {Sg => "будь" ++ masha.s ! (mkPronForm Inst No NonPoss); + Pl => "будьте" ++ masha.s ! (mkPronForm Inst No NonPoss) + }; + ClInfin => "быть" ++ masha.s ! (mkPronForm Inst No NonPoss) +}; -- case clf + asp = Imperfective ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n => "" + } ; + + CompAP zloj ={ + s= \\clf,gn,p => case clf of { +-- person is ignored ! + ClInfinit => "быть" ++ zloj.s ! AF Inst Animate (ASg Masc) ; + ClImper => case gn of + { (ASg _) => "будь" ++ zloj.s ! AF Inst Animate (ASg Masc); + APl => "будьте" ++ zloj.s ! AF Inst Animate APl + }; +-- infinitive does not save GenNum, +-- but indicative does for the sake of adjectival predication ! + ClIndic Present _ => zloj.s ! AF Nom Animate gn ; + ClIndic Past _ => case gn of + { (ASg Fem) => "была" ++ zloj.s! AF Nom Animate (ASg Fem); + (ASg Masc) => "был" ++ zloj.s! AF Nom Animate (ASg Masc); + (ASg Neut) => "был" ++ zloj.s! AF Nom Animate (ASg Neut); + APl => "были" ++ zloj.s! AF Nom Animate APl + }; + ClIndic Future _ => case gn of + { APl => case p of + { P3 => "будут" ++ zloj.s! AF Nom Animate APl; + P2 => "будете" ++ zloj.s! AF Nom Animate APl; + P1 => "будем" ++ zloj.s! AF Nom Animate APl + } ; + (ASg _) => case p of + {P3 => "будет" ++ zloj.s! AF Nom Animate (ASg (genGNum gn)); + P2 => "будешь"++ zloj.s! AF Nom Animate (ASg (genGNum gn)); + P1=> "буду" ++ zloj.s! AF Nom Animate (ASg (genGNum gn)) + } + }; + ClCondit => "" + } ; + + asp = Imperfective ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n=> "" + } ; + + +-- Verb phrases can also be formed from adjectives (" молод"), +-- common nouns (" человек"), and noun phrases (" самый молодой"). +-- The third rule is overgenerating: " каждый человек" has to be ruled out +-- on semantic grounds. +-- Note: we omit a dash "-" because it will cause problems with negation word order: +-- "Я не - волшебник". Alternatively, we can consider verb-based VP and +-- all the rest. + + CompAdv zloj = + { s= \\clf,gn,p => case clf of { + ClImper => case gn of + { ASg _ => "будь" ++ zloj.s; -- person is ignored ! + APl => "будьте" ++ zloj.s + }; + ClInfinit => "быть" ++ zloj.s; + ClIndic Present _ => zloj.s ; + ClIndic Past _ => case gn of + { (ASg Fem) => "была" ++ zloj.s; + (ASg Masc) => "был" ++ zloj.s; + (ASg Neut) => "было" ++ zloj.s; + APl => "были" ++ zloj.s + }; + ClIndic Future _ => case gn of + { (ASg _) => "будет" ++ zloj.s; + APl => "будут" ++ zloj.s + }; + ClCondit => "" + } ; + asp = Imperfective ; + w = Act; + s2 = ""; + negBefore = True; + s3 = \\g,n => "" + } ; + + + + UseComp comp = comp ; + UseVS, UseVQ = \vv -> {s = vv.s ; asp = vv.asp; s2 = [] ; c = Acc} ; + +-- CompAP ap = ap ; +-- CompNP np = {s = \\_ => np.s ! Acc} ; +-- CompAdv a = {s = \\_ => a.s} ; + + +-- 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. +-- N.B. negation is *not* a function applicable to a verb phrase, since +-- double negations with "inte" are not grammatical. + + UseV se = + {s=\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; + asp = se.asp ; + w=Act; + s2 = ""; + negBefore = True; + s3 = table{_=> table{_ => ""}} + } ; + +-- The rule for using transitive verbs is the complementization rule: + ComplV2 se tu = + {s =\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) + ++ se.s2 ++ tu.s ! (mkPronForm se.c No NonPoss) ; + asp = se.asp ; + w = Act; + s2 = ""; + s3 = \\g,n => ""; + negBefore = True + } ; + + ComplV3 dat tu pivo = + let + tebepivo = dat.s2 ++ + tu.s ! PF dat.c No NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss + in + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tebepivo ; + asp = dat.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n=> "" + } ; + + ReflV2 v = + { s = \\clf,gn,p => v.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ v.s2 ++ sebya!v.c; + asp = v.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n=> "" + } ; + +-- To generate "сказал, что Иван гуляет" / "не сказал, что Иван гуляет": + ComplVS vidit tuUlubaeshsya = + {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) + ++ [", что"] ++ tuUlubaeshsya.s ; + asp = vidit.asp; + w = Act; + s2=""; + negBefore = True; + s3 = \\g,n => "" + } ; +-- 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. + + ComplVV putatsya bezhat = + { s = \\clf,gn,p => putatsya.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ bezhat.s!clf!gn!p ; + asp = putatsya.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 =\\g,n => "" + } ; + ComplVQ dat esliOnPridet = + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ esliOnPridet.s ! QDir ; + asp = dat.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n=> "" + } ; + ComplVA vuglyadet molodoj = + {s = \\clf,gn,p => vuglyadet.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; + asp = vuglyadet.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n => molodoj.s!(AF Inst Animate (gNum g n)) + } ; + + ComplV2A obechat tu molodoj = + {s = \\clf,gn,p => obechat.s2++obechat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tu.s ! PF obechat.c No NonPoss ++molodoj.s!AF Inst tu.anim (pgNum tu.g tu.n) ; + asp = obechat.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 = \\g,n =>"" + } ; + AdvVP poet khorosho = + {s = \\clf,gn,p => poet.s ! clf!gn!p; s2 = poet.s2 ++ khorosho.s; s3 = poet.s3; + asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ; + + AdVVP khorosho poet = + {s = \\clf,gn,p => poet.s ! clf!gn!p; s2 = poet.s2 ++ khorosho.s; s3 = poet.s3; + asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ; + +PassV2 se = + {s=\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; + asp=se.asp; w=Pass; s2 = se.s2; + negBefore = True; + s3 = table{_=> table{_ => ""}} +}; + +} +