From fea01dd3139d179b92dc2925a3f39cdaccf52da6 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 11 Apr 2026 12:01:59 +0200 Subject: [PATCH] added questions and relative clauses --- src/macedonian/CatMkd.gf | 23 ++++++------------ src/macedonian/GrammarMkd.gf | 2 +- src/macedonian/IdiomMkd.gf | 7 +++--- src/macedonian/MorphoMkd.gf | 3 +-- src/macedonian/NounMkd.gf | 22 +++++++++++++---- src/macedonian/ParadigmsMkd.gf | 4 ++-- src/macedonian/PhraseMkd.gf | 1 + src/macedonian/QuestionMkd.gf | 3 +++ src/macedonian/RelativeMkd.gf | 3 +++ src/macedonian/ResMkd.gf | 43 +++++++++++++++++++++++++++++++--- src/macedonian/SentenceMkd.gf | 39 ++++++------------------------ src/macedonian/VerbMkd.gf | 14 +++-------- 12 files changed, 89 insertions(+), 75 deletions(-) create mode 100644 src/macedonian/QuestionMkd.gf diff --git a/src/macedonian/CatMkd.gf b/src/macedonian/CatMkd.gf index bb4bbbcd..419e750d 100644 --- a/src/macedonian/CatMkd.gf +++ b/src/macedonian/CatMkd.gf @@ -29,27 +29,18 @@ 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 : Role => Str; vocative: Str; g : GenNum; p : Person} ; +lincat NP = {s : Role => Str; vocative: Str; a : Agr} ; lincat Num = {s : Str; n : NNumber} ; lincat Quant = {s : Str; sp : Species} ; lincat Det = {s : Str; n : NNumber; 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; - imperfect : 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 : Aspect => GenNum => Str; - perfect : Aspect => Str}; - noun_from_verb : Str; vtype : VType; c2 : Compl} ; +lincat VP = Verb ** {compl : Agr => Str} ; +lincat VPSlash = Verb ** {compl : Agr => Str; c2 : Compl} ; +lincat S,QS = {s : Str} ; +lincat RS = {s : GenNum => Str} ; lincat Cl = {s : ResMkd.Tense => Anteriority => Polarity => Order => Str} ; +lincat QCl = {s : ResMkd.Tense => Anteriority => Polarity => Str} ; +lincat RCl = {s : GenNum => ResMkd.Tense => Anteriority => Polarity => Str} ; lincat RP = {s : GenNum => Str} ; lincat IP = {s : Str} ; lincat Subj = {s : Str} ; diff --git a/src/macedonian/GrammarMkd.gf b/src/macedonian/GrammarMkd.gf index 85b3eee8..0da258da 100644 --- a/src/macedonian/GrammarMkd.gf +++ b/src/macedonian/GrammarMkd.gf @@ -1,2 +1,2 @@ -concrete GrammarMkd of Grammar = VerbMkd,SentenceMkd,NounMkd,AdverbMkd,AdjectiveMkd,IdiomMkd,NumeralMkd,PhraseMkd,RelativeMkd,TextMkd,StructuralMkd,TenseMkd ** { +concrete GrammarMkd of Grammar = VerbMkd,SentenceMkd,QuestionMkd,NounMkd,AdverbMkd,AdjectiveMkd,IdiomMkd,NumeralMkd,PhraseMkd,RelativeMkd,TextMkd,StructuralMkd,TenseMkd ** { } diff --git a/src/macedonian/IdiomMkd.gf b/src/macedonian/IdiomMkd.gf index b54b46ab..7e7a30ec 100644 --- a/src/macedonian/IdiomMkd.gf +++ b/src/macedonian/IdiomMkd.gf @@ -1,13 +1,14 @@ concrete IdiomMkd of Idiom = CatMkd ** open Prelude,ResMkd in { -lin ProgrVP vp = { +lin ProgrVP vp = vp ** { present = \\a,n,p => vp.present ! Imperfective ! n ! p ; - aorist = vp.aorist ; imperfect = \\a,n,p => vp.imperfect ! Imperfective ! n ! p ; imperative = \\a,n => vp.imperative ! Imperfective ! n ; participle = {aorist = \\a,gn => vp.participle.aorist ! Imperfective ! gn ; perfect = \\a => vp.participle.perfect ! Imperfective ; - imperfect = \\a => vp.participle.imperfect ! Imperfective} + imperfect = \\a => vp.participle.imperfect ! Imperfective ; + adjectival = vp.participle.adjectival ; + adverbial = vp.participle.adverbial} } ; } diff --git a/src/macedonian/MorphoMkd.gf b/src/macedonian/MorphoMkd.gf index 605b7497..be9bd351 100644 --- a/src/macedonian/MorphoMkd.gf +++ b/src/macedonian/MorphoMkd.gf @@ -15500,8 +15500,7 @@ mkPron : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> GenNum -> Person -> Pronoun = } } ; poss_clitic = f15 ; - g = g ; - p = p ; + a = {g = g; p = p} ; } ; } diff --git a/src/macedonian/NounMkd.gf b/src/macedonian/NounMkd.gf index a805c40b..bbca43c7 100644 --- a/src/macedonian/NounMkd.gf +++ b/src/macedonian/NounMkd.gf @@ -37,11 +37,11 @@ concrete NounMkd of Noun = CatMkd ** open Prelude,ResMkd in { NNum Sg => det.s ++ cn.vocative ! Sg; _ => det.s ++ cn.vocative ! Pl } ; - g = case det.n of { - NNum Sg => GSg cn.g; - _ => GPl - } ; - p = P3; + a = {g = case det.n of { + NNum Sg => GSg cn.g; + _ => GPl + } ; + p = P3}; } ; lin DetQuant det num = {s = det.s ++ num.s; n = num.n; sp = det.sp} ; @@ -50,4 +50,16 @@ concrete NounMkd of Noun = CatMkd ** open Prelude,ResMkd in { lin NumSg = {s = []; n = NNum Sg} ; lin UseN s = s ; lin UsePron p = p ** {vocative=p.s ! RSubj} ; + + lin RelNP np rs = { + s = \\r => np.s ! r ++ rs.s ! np.a.g ; + vocative = np.vocative ++ rs.s ! np.a.g ; + a = np.a; + } ; + lin RelCN cn rs = { + s = \\sp,n => cn.s ! sp ! n ++ rs.s ! genNum cn.g n ; + count_form = cn.count_form ++ rs.s ! GPl ; + vocative = \\n => cn.vocative ! n ++ rs.s ! genNum cn.g n ; + g = cn.g; + } ; } diff --git a/src/macedonian/ParadigmsMkd.gf b/src/macedonian/ParadigmsMkd.gf index a283505a..c10c1ebb 100644 --- a/src/macedonian/ParadigmsMkd.gf +++ b/src/macedonian/ParadigmsMkd.gf @@ -1161,8 +1161,8 @@ mkInterj : Str -> Interj = \s -> lin Interj {s=s} ; mkVoc : Str -> Voc = \s -> lin Voc {s=s} ; -mkPrep : Str -> Prep = \s -> lin Prep {s=s} ; -noPrep : Prep = lin Prep {s=""} ; +mkPrep : Str -> Prep = \s -> lin Prep {s=s; c=Acc} ; +noPrep : Prep = lin Prep {s=""; c=Acc} ; mkIP : Str -> IP = \s -> lin IP {s=s} ; mkIAdv : Str -> IAdv = \s -> lin IAdv {s=s} ; diff --git a/src/macedonian/PhraseMkd.gf b/src/macedonian/PhraseMkd.gf index 5a2fa023..74263846 100644 --- a/src/macedonian/PhraseMkd.gf +++ b/src/macedonian/PhraseMkd.gf @@ -4,6 +4,7 @@ concrete PhraseMkd of Phrase = CatMkd ** open Prelude, ResMkd in { PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; UttS s = s ; + UttQS s = s ; UttInterj i = i ; NoPConj = {s = []} ; diff --git a/src/macedonian/QuestionMkd.gf b/src/macedonian/QuestionMkd.gf new file mode 100644 index 00000000..e36e7d8c --- /dev/null +++ b/src/macedonian/QuestionMkd.gf @@ -0,0 +1,3 @@ +concrete QuestionMkd of Question = CatMkd ** open Prelude,ResMkd in { + lin QuestCl cl = {s = \\t,a,p => cl.s ! t ! a ! p ! Quest} ; +} diff --git a/src/macedonian/RelativeMkd.gf b/src/macedonian/RelativeMkd.gf index 0482ea35..533d8b04 100644 --- a/src/macedonian/RelativeMkd.gf +++ b/src/macedonian/RelativeMkd.gf @@ -6,4 +6,7 @@ concrete RelativeMkd of Relative = CatMkd ** open Prelude,ResMkd in { GPl => "кои" } } ; + lin RelVP rp vp = { + s = \\gn,t,a,p => mkClause (rp.s ! gn) {g=gn; p=P3} vp ! t ! a ! p ! Main + } ; } diff --git a/src/macedonian/ResMkd.gf b/src/macedonian/ResMkd.gf index dbea0b90..e3f3efc0 100644 --- a/src/macedonian/ResMkd.gf +++ b/src/macedonian/ResMkd.gf @@ -1,6 +1,6 @@ resource ResMkd = ParamX - [Tense] ** open Prelude in { -oper Compl = {s : Str} ; +oper Compl = {s : Str; c : Case} ; param Species = Indef | Def Distance ; param Distance = Unspecified | Distal | Proximal ; @@ -10,6 +10,7 @@ param NRelType = Pref | AdjMod | AdvMod ; | NCountable ; param Gender = Masc | Fem | Neuter ; +oper Agr = {g : GenNum; p : Person} ; oper Noun = {s: Species => Number => Str; count_form: Str; vocative: Number => Str; rel: Species => GenNum => Str; relType : NRelType; g: Gender} ; -- 24855 oper mkNoun : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Gender -> Noun = \f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,g -> @@ -171,8 +172,7 @@ oper Pronoun = { clitic : Case => Str; poss : Species => GenNum => Str ; poss_clitic : Str ; - g : GenNum; - p : Person + a : {g : GenNum; p : Person} } ; genNum : Gender -> Number -> GenNum = \g,n -> @@ -274,4 +274,41 @@ auxHave = { } } ; +mkClause : Str -> Agr -> Verb ** {compl : Agr => Str} -> Tense => Anteriority => Polarity => Order => Str + = \subj,agr,vp -> + let n = case agr.g of { + GSg _ => Sg ; + GPl => Pl + } + in \\t,a,p,o => + case of { + => subj ++ neg ++ vp.present ! Imperfective ! n ! agr.p ++ li ++ vp.compl ! agr ; + => case o of { + Main => subj ++ neg ++ auxBe.present ! n ! agr.p ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ; + Quest => subj ++ neg ++ vp.participle.imperfect ! Perfective ! agr.g ++ li ++ auxBe.present ! n ! agr.p ++ vp.compl ! agr + } ; + => subj ++ neg ++ vp.aorist ! n ! agr.p ++ li ++ vp.compl ! agr ; + => subj ++ neg ++ auxBe.imperfect ! n ! agr.p ++ li ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ; + => subj ++ neg ++ vp.imperfect ! Perfective ! n ! agr.p ++ li ++ vp.compl ! agr ; + => subj ++ neg ++ auxBe.imperfect ! n ! agr.p ++ li ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ; + => subj ++ fut.p1 ++ vp.present ! Perfective ! n ! agr.p ++ fut.p2 ++ vp.compl ! agr ; + => subj ++ fut.p1 ++ auxHave.present ! n ! agr.p ++ fut.p2 ++ vp.participle.perfect ! Perfective ++ vp.compl ! agr ; + => subj ++ neg ++ "би" ++ li ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ; + => subj ++ neg ++ "би" ++ li ++ auxHave.participle.imperfect ! agr.g ++ vp.participle.perfect ! Perfective ++ vp.compl ! agr + } where { + neg = case p of { + Pos => "" ; + Neg => "не" + } ; + fut = case of { + => <"ке",[]> ; + => <"нема да",[]> ; + => <"ке","ли"> ; + => <"нема ли да",[]> + } ; + li = case o of { + Main => "" ; + Quest => "ли" + } + } ; } diff --git a/src/macedonian/SentenceMkd.gf b/src/macedonian/SentenceMkd.gf index 31e1a3b8..afa634a0 100644 --- a/src/macedonian/SentenceMkd.gf +++ b/src/macedonian/SentenceMkd.gf @@ -1,40 +1,15 @@ concrete SentenceMkd of Sentence = CatMkd ** open Prelude,ResMkd in { -lin PredVP np vp = - let n = case np.g of { - GSg _ => Sg ; - GPl => Pl - } - in {s = \\t,a,p,o => - case of { - => np.s ! RSubj ++ neg ++ vp.present ! Imperfective ! n ! np.p ; - => np.s ! RSubj ++ neg ++ auxBe.present ! n ! np.p ++ vp.participle.imperfect ! Perfective ! np.g ; - => np.s ! RSubj ++ neg ++ vp.aorist ! n ! np.p ; - => np.s ! RSubj ++ neg ++ auxBe.imperfect ! n ! np.p ++ vp.participle.imperfect ! Perfective ! np.g ; - => np.s ! RSubj ++ neg ++ vp.imperfect ! Perfective ! n ! np.p ; - => np.s ! RSubj ++ neg ++ auxBe.imperfect ! n ! np.p ++ vp.participle.imperfect ! Perfective ! np.g ; - => np.s ! RSubj ++ fut ++ vp.present ! Perfective ! n ! np.p ; - => np.s ! RSubj ++ fut ++ auxHave.present ! n ! np.p ++ vp.participle.perfect ! Perfective ; - => np.s ! RSubj ++ neg ++ "би" ++ vp.participle.imperfect ! Perfective ! np.g ; - => np.s ! RSubj ++ neg ++ "би" ++ auxHave.participle.imperfect ! np.g ++ vp.participle.perfect ! Perfective - } where { - neg = case p of { - Pos => "" ; - Neg => "не" - } ; - fut = case p of { - Pos => "ке" ; - Neg => "нема да" - } ; - li = case o of { - Main => "" ; - Quest => "ли" - } - } - } ; +lin PredVP np vp = {s = mkClause (np.s ! RSubj) np.a vp} ; UseCl t p cl = { s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Main } ; + UseQCl t p cl = { + s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p + } ; + UseRCl t p cl = { + s = \\gn => t.s ++ p.s ++ cl.s ! gn ! t.t ! t.a ! p.p + } ; } diff --git a/src/macedonian/VerbMkd.gf b/src/macedonian/VerbMkd.gf index e989b00a..4286e48e 100644 --- a/src/macedonian/VerbMkd.gf +++ b/src/macedonian/VerbMkd.gf @@ -1,15 +1,7 @@ concrete VerbMkd of Verb = CatMkd ** open Prelude,ResMkd in { - lin UseV v = v ; - lin ComplSlash vps np = {present = \\a,n,p => vps.present ! a ! n - ! p - ++ np.s ! RObj Acc ; - aorist = \\n,p => vps.aorist ! n ! p ++ np.s ! RObj Acc; - imperfect = \\a,n,p => vps.imperfect ! a ! n ! p ++ np.s ! RObj Acc; - imperative = \\a,n => vps.imperative ! a ! n ++ np.s ! RObj Acc; - participle = {aorist = \\a,gn => vps.participle.aorist ! a ! gn ++ np.s ! RObj Acc; - perfect = \\a => vps.participle.perfect ! a ++ np.s ! RObj Acc; - imperfect = \\a,gn => vps.participle.imperfect ! a ! gn ++ np.s ! RObj Acc}} ; - lin SlashV2a v = v ; + lin UseV v = v ** {compl = \\_ => []}; + lin ComplSlash vp np = vp ** {compl = \\a => vp.compl ! a ++ vp.c2.s ++ np.s ! RObj vp.c2.c} ; + lin SlashV2a v = v ** {compl = \\_ => []} ; }