# -path=.:../abstract:../../prelude
resource ParadigmsRus = open (Predef=Predef), Prelude, SyntaxRus, ResourceRus in { flags coding=utf8 ;
oper masculine : Gender ; feminine : Gender ; neuter : Gender ;To abstract over case names, we define the following.
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.
singular : Number ; plural : Number ;
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"Masculine patterns.
nStomatolog : Str -> N ; -- masculine, animate, ending with consonant -- the next two differ only in -- plural nominative (= accusative) form(s) : nAdres : Str -> N ; -- адрес-а nTelefon : Str -> N ; -- телефон-ы -- masculine, inanimate, ending with consonant 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 -> Preposition -> Case -> Fun ; funGen : N -> Fun ;Proper names.
mkPN : Str -> Gender -> Animacy -> 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 ;
adjInvar : Str -> Adj1 ; -- khaki, mini, hindi, nettoSome regular patterns depending on the ending.
adj1Staruyj : Str -> Adj1 ; -- ending with "-ый" adj1Malenkij : Str -> Adj1 ; -- endign with "-ий" adj1Molodoj : Str -> Adj1 ; -- ending with "-ой", -- plural - молод-ые" adj1Kakoj_Nibud : Str -> Str -> Adj1 ; -- ending with "-ой", -- plural - "как-ие"Two-place adjectives need a preposition and a case as extra arguments.
mkAdj2 : Adj1 -> Str -> Case -> Adj2 ; -- "делим на"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.
mkAdjDeg : Adj1 -> Str -> AdjDeg ;On top level, there are adjectival phrases. The most common case is just to use a one-place adjective.
ap : Adj1 -> IsPostfixAdj -> AP ;
mkVerbum : Aspect -> (_,_,_,_,_,_,_,_,_ : Str) -> Verbum ;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) -> Verbum ;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 -> Tense -> 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 -> TV ; -- "войти в дом"; "в", accusative tvDir : V -> TV ; -- "видеть", "любить"The definitions should not bother the user of the API. So they are hidden from the document.