mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-10 11:42:51 -06:00
initial Slavic grammar, shared between Bulgarian and Russian
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
||||
concrete CatRus of Cat = CommonX ** CatSlavic with (ResSlavic = ResRus) ** open ResRus, Prelude, (R = ParamX) in {
|
||||
|
||||
flags optimize=all_subs ; coding=utf8 ;
|
||||
|
||||
@@ -44,7 +44,6 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = {s : NForm => 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 ;
|
||||
@@ -89,9 +88,6 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
|
||||
A2 = A ** Complement ;
|
||||
|
||||
-- Substantives moreover have an inherent gender.
|
||||
N = {s : NForm => Str; g : Gender; anim : Animacy} ;
|
||||
N2 = {s : NForm => Str; g : Gender; anim : Animacy} ** Complement ;
|
||||
N3 = {s : NForm => Str; g : Gender; anim : Animacy} ** Complement ** {s3 : Str; c2: Case} ;
|
||||
PN = {s : Case => Str ; g : Gender ; anim : Animacy} ;
|
||||
|
||||
|
||||
|
||||
9
next-lib/src/russian/DiffRus.gf
Normal file
9
next-lib/src/russian/DiffRus.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
instance DiffRus of DiffSlavic = open CommonSlavic, Prelude in {
|
||||
|
||||
param
|
||||
PrepKind = PrepOther | PrepVNa;
|
||||
Case = Nom | Gen | Dat | Acc | Inst | Prepos PrepKind ;
|
||||
|
||||
NForm = NF Number Case ;
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
--# -path=.:../abstract:../common:../slavic:prelude
|
||||
|
||||
concrete LangRus of Lang =
|
||||
GrammarRus,
|
||||
|
||||
@@ -166,8 +166,8 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
||||
ComplN2 f x = {
|
||||
s = \\nf => case x.pron of {
|
||||
True => x.s ! (case nf of {NF n c => mkPronForm c No (Poss (gNum f.g n))}) ++ f.s ! nf ;
|
||||
False => f.s ! nf ++ f.s2 ++
|
||||
x.s ! (case nf of {NF n c => mkPronForm f.c Yes (Poss (gNum f.g n))})
|
||||
False => f.s ! nf ++ f.c2.s ++
|
||||
x.s ! (case nf of {NF n c => mkPronForm f.c2.c Yes (Poss (gNum f.g n))})
|
||||
};
|
||||
g = f.g ;
|
||||
anim = f.anim
|
||||
@@ -177,11 +177,10 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in {
|
||||
-- There application starts by filling the first place.
|
||||
|
||||
ComplN3 f x = {
|
||||
s = \\nf => f.s ! nf ++ f.s2 ++ x.s ! (PF f.c Yes NonPoss) ;
|
||||
s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! (PF f.c2.c Yes NonPoss) ;
|
||||
g = f.g ;
|
||||
anim = f.anim ;
|
||||
s2 = f.s3 ;
|
||||
c = f.c2
|
||||
c2 = f.c3 ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -352,11 +352,11 @@ foreign = Foreign; -- +++ MG_UR: added +++
|
||||
mkN2 : N -> Prep -> N2 = mkFun;
|
||||
} ;
|
||||
|
||||
mkFun : N -> Prep -> N2 = \f,p -> (UseN f) ** {s2 = p.s ; c = p.c}** {lock_N2 = <>} ;
|
||||
mkFun : N -> Prep -> N2 = \f,p -> UseN f ** {c2 = p ; lock_N2 = <>} ;
|
||||
|
||||
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 = <>} ;
|
||||
mkN3 f p2 p3 = (UseN f) ** {c2 = p2; c3 = p3; lock_N3 = <>} ;
|
||||
|
||||
|
||||
mkPN = \ivan, g, anim ->
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResRus = ParamX ** open Prelude in {
|
||||
instance ResRus of ResSlavic = ParamX, DiffRus, CommonSlavic ** open Prelude in {
|
||||
|
||||
flags coding=utf8 ; optimize=all ;
|
||||
|
||||
@@ -18,10 +18,6 @@ flags coding=utf8 ; optimize=all ;
|
||||
|
||||
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||
param
|
||||
Gender = Masc | Fem | Neut ;
|
||||
Case = Nom | Gen | Dat | Acc | Inst | Prepos PrepKind ;
|
||||
PrepKind = PrepOther | PrepVNa;
|
||||
Animacy = Animate | Inanimate ;
|
||||
Voice = Act | Pass ;
|
||||
Aspect = Imperfective | Perfective ;
|
||||
RusTense = Present | PastRus | Future ;
|
||||
|
||||
Reference in New Issue
Block a user