autogenerate parts of the syntax

This commit is contained in:
Krasimir Angelov
2026-03-19 15:25:04 +01:00
parent 0cd3450e08
commit ce2f785f92
6 changed files with 102 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
concrete AdjectiveMkd of Adjective = CatMkd ** open Prelude,ResMkd in {
flags
coding = "UTF-8" ;
lin PositA a = a ** {isPre = True} ;
}

View File

@@ -23,4 +23,27 @@ linref V, VA, VV, VS, VQ, V2, V2S, V2Q, V3, V2A, V2V =
} ;
linref A, A2 = \a -> a.s ! Indef ! GSg Masc ;
lincat AP = {s : Species => GenNum => Str; isPre : Bool} ;
lincat NP = {s : Str; vocative: Str; n : Number; p : Person; g : Gender} ;
lincat Num = {s : Str; n : Number} ;
lincat Quant = {s : Str; sp : Species} ;
lincat Det = {s : Str; n : Number; sp : Species} ;
lincat VP = {present : Aspect => Number => Person => Str;
aorist : Number => Person => Str;
imperfect : Aspect => Number => Person => Str;
imperative : Aspect => Number => Str;
participle : {aorist : Aspect => GenNum => Str; perfect : Aspect => Str}} ;
lincat VPSlash = {present : Aspect => Number => Person => Str;
aorist : Number => Person => Str;
imperfect : Aspect => Number => Person => Str;
imperative : Aspect => Number => Str;
participle : {aorist : Aspect => GenNum => Str;
imperfect : GenNum => Str; perfect : Aspect => Str;
adjectival : Aspect => Str; adverbial : Str};
noun_from_verb : Str; isRefl : Bool; c2 : Compl} ;
lincat Cl = {present : Aspect => Str;
aorist : Str;
participle : {aorist : Aspect => Str; perfect : Aspect => Str}} ;
}

View File

@@ -1,8 +1,4 @@
concrete GrammarMkd of Grammar =
NumeralMkd,
PhraseMkd,
TextX,
StructuralMkd,
TenseX ** {
} ;
concrete GrammarMkd of Grammar = VerbMkd,SentenceMkd,NounMkd,AdjectiveMkd,NumeralMkd,PhraseMkd,TextX,StructuralMkd,TenseX ** {
flags
coding = "UTF-8" ;
}

46
src/macedonian/NounMkd.gf Normal file
View File

@@ -0,0 +1,46 @@
concrete NounMkd of Noun = CatMkd ** open Prelude,ResMkd in {
flags
coding = "UTF-8" ;
lin AdjCN ap cn = {
s = case ap.isPre of {
True => \\s,n => ap.s ! s
! case n of {
Sg => GSg cn.g;
Pl => GPl
} ++
cn.s ! Indef ! n;
False => \\s,n => cn.s ! s ! n ++
ap.s ! Indef
! case n of {
Sg => GSg cn.g;
Pl => GPl
}
};
vocative = \\n => ap.s ! Indef
! case n of {
Sg => GSg cn.g;
Pl => GPl
} ++
cn.vocative ! n;
count_form = ap.s ! Indef ! GPl ++ cn.count_form; g = cn.g} ;
lin AdvCN cn adv = {
s = \\s,n => cn.s ! s ! n ++ adv.s;
count_form = cn.count_form ++ adv.s;
vocative = \\n => cn.vocative ! n ++ adv.s;
g = cn.g
} ;
lin DefArt = {s = []; sp = Def Unspecified} ;
lin DetCN det cn = {
s = det.s ++ cn.s ! det.sp ! det.n;
vocative = det.s ++ cn.vocative ! det.n;
n = det.n;
p = P3;
g = cn.g
} ;
lin DetQuant det num = {s = det.s ++ num.s; n = num.n;
sp = det.sp} ;
lin IndefArt = {s = []; sp = Indef} ;
lin NumPl = {s = []; n = Pl} ;
lin NumSg = {s = []; n = Sg} ;
lin UseN s = s ;
}

View File

@@ -0,0 +1,12 @@
concrete SentenceMkd of Sentence = CatMkd ** open Prelude,ResMkd in {
flags
coding = "UTF-8" ;
lin PredVP np vp = {present = \\a => np.s ++ vp.present ! a ! np.n ! np.p ;
aorist = np.s ++ vp.aorist ! np.n ! np.p ;
participle = {aorist = \\a => np.s ++ vp.participle.aorist ! a !
case np.n of {
Sg => GSg np.g;
Pl => GPl
};
perfect = \\a => np.s ++ vp.participle.perfect ! a}} ;
}

12
src/macedonian/VerbMkd.gf Normal file
View File

@@ -0,0 +1,12 @@
concrete VerbMkd of Verb = CatMkd ** open Prelude,ResMkd in {
flags
coding = "UTF-8" ;
lin ComplSlash vps np = {present = \\a,n,p => vps.present ! a ! n
! p
++ np.s;
aorist = \\n,p => vps.aorist ! n ! p ++ np.s;
imperfect = \\a,n,p => vps.imperfect ! a ! n ! p ++ np.s;
imperative = \\a,n => vps.imperative ! a ! n ++ np.s;
participle = {aorist = \\a,gn => vps.participle.aorist ! a ! gn ++ np.s;
perfect = \\a => vps.participle.perfect ! a ++ np.s}} ;
}