Russian: checkable rules from the grammar
These rules check Russian agreement in UD 2.19 trees. They use the seed rule language (en expert-check). A warning marks a place to inspect for a grammatical exception, a treebank annotation error, or a parser error. Rule language
The checks use the features and direct dependencies recorded in the tree. A feature named without a value in match must be present. For example, each adjectival case check compares two recorded Case values. A subject check reaches a finite auxiliary only when the subject is attached directly to that auxiliary.
In a numeral phrase such as два новых стола, the modifier новых is plural and the noun стола is genitive singular. The adjectival case and number checks skip heads with a direct nummod or nummod:gov dependent. A noun marked Number=Ptan can take a modifier or verb marked Number=Plur, as in новые ножницы and ножницы лежали на столе.
rule: ru.agree.amod-case
what: an adjectival modifier agrees with its noun or pronoun in case (новой книги)
match: n[upos=NOUN|PROPN|PRON, feats.Case]; a[rel=amod, upos=ADJ|DET, feats.Case, head=n]
require: a[feats.Case=@n]
unless: exists q[rel=nummod|nummod:gov, head=n]
severity: warn
source: languages/ru (adjectives)
rule: ru.agree.amod-number
what: an adjectival modifier agrees with its noun in number (новые книги, новые ножницы)
match: n[upos=NOUN|PROPN, feats.Number]; a[rel=amod, upos=ADJ|DET, feats.Number, head=n]
require: a[feats.Number=@n] or n[feats.Number=Ptan]; a[feats.Number=@n] or a[feats.Number=Plur]
unless: exists q[rel=nummod|nummod:gov, head=n]
severity: warn
source: languages/ru (adjectives)
rule: ru.agree.amod-gender
what: a singular adjectival modifier agrees with a singular noun in gender (новый стол, новая книга)
match: n[upos=NOUN|PROPN, feats.Number=Sing, feats.Gender]; a[rel=amod, upos=ADJ|DET, feats.Number=Sing, feats.Gender, head=n]
require: a[feats.Gender=@n]
severity: warn
source: languages/ru (adjectives)
The determiner case check covers agreeing forms such as этот, мой and весь. The third-person possessives его, её and их are invariable in this use, as in его книга and его книгой. The rule exempts tokens annotated with both Poss=Yes and Person=3. Numeral phrases can produce a valid case mismatch, as in эти два стола, where эти has nominative form and стола has genitive singular form.
rule: ru.agree.det-case
what: a determiner with case agrees with its noun in case (этой книги, моим ключом)
match: n[upos=NOUN|PROPN, feats.Case]; d[rel=det, feats.Case, head=n]
require: d[feats.Case=@n]
unless: d[feats.Poss=Yes, feats.Person=3]
severity: warn
source: languages/ru (pronouns)
Subject agreement can depend on the whole phrase or on the person it denotes. The past-tense check can warn on a coordinated subject such as Маша и Петя пришли when the verb attaches to the first conjunct. It can also warn on plural agreement with a collective subject such as Большинство студентов пришли or feminine agreement with a masculine noun denoting a woman, as in Врач пришла.
rule: ru.agree.subj-past
what: a past-tense verb agrees with its nominal subject in number, and in the singular in gender (он шёл, она шла, они шли)
match: v[upos=VERB|AUX, feats.Tense=Past, feats.VerbForm=Fin]; s[rel=nsubj, upos=NOUN|PROPN|PRON, feats.Number, head=v]
require: v[feats.Number=@s] or not v[feats.Number] or s[feats.Number=Ptan]; v[feats.Number=@s] or not v[feats.Number] or v[feats.Number=Plur]; v[feats.Gender=@s] or s[feats.Number=Plur|Ptan] or not v[feats.Gender] or not s[feats.Gender]
unless: s[feats.Case=Gen]
severity: warn
source: languages/ru (verbs)
rule: ru.agree.subj-person
what: a present or future finite verb agrees with a pronoun subject in person (я пишу, ты пишешь)
match: v[upos=VERB|AUX, feats.Tense=Pres|Fut, feats.VerbForm=Fin, feats.Person]; s[rel=nsubj, upos=PRON, feats.Person, head=v]
require: v[feats.Person=@s]
severity: warn
source: languages/ru (verbs)
rule: ru.agree.subj-nonpast-number
what: a present or future finite verb agrees in number with its nominative nominal subject (книга лежит, книги лежат, я напишу, мы напишем)
match: v[upos=VERB|AUX, feats.Tense=Pres|Fut, feats.VerbForm=Fin, feats.Number]; s[rel=nsubj, upos=NOUN|PROPN|PRON, feats.Case=Nom, feats.Number, head=v]
require: v[feats.Number=@s] or s[feats.Number=Ptan]; v[feats.Number=@s] or v[feats.Number=Plur]
unless: exists c[rel=conj, head=s]
severity: warn
source: languages/ru (verbs)
This page in Markdown https://md.mova.elamur.ai/free/en/docs/languages/ru/rules/