added questions and relative clauses

This commit is contained in:
Krasimir Angelov
2026-04-11 12:01:59 +02:00
parent 9e402cb608
commit fea01dd313
12 changed files with 89 additions and 75 deletions

View File

@@ -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} ;

View File

@@ -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 ** {
}

View File

@@ -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}
} ;
}

View File

@@ -15500,8 +15500,7 @@ mkPron : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> GenNum -> Person -> Pronoun =
}
} ;
poss_clitic = f15 ;
g = g ;
p = p ;
a = {g = g; p = p} ;
} ;
}

View File

@@ -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;
} ;
}

View File

@@ -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} ;

View File

@@ -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 = []} ;

View File

@@ -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} ;
}

View File

@@ -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
} ;
}

View File

@@ -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 <t,a> of {
<VPresent,Simul> => subj ++ neg ++ vp.present ! Imperfective ! n ! agr.p ++ li ++ vp.compl ! agr ;
<VPresent,Anter> => 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
} ;
<VPastSimple,Simul> => subj ++ neg ++ vp.aorist ! n ! agr.p ++ li ++ vp.compl ! agr ;
<VPastSimple,Anter> => subj ++ neg ++ auxBe.imperfect ! n ! agr.p ++ li ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ;
<VPastImperfect,Simul> => subj ++ neg ++ vp.imperfect ! Perfective ! n ! agr.p ++ li ++ vp.compl ! agr ;
<VPastImperfect,Anter> => subj ++ neg ++ auxBe.imperfect ! n ! agr.p ++ li ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ;
<VFut, Simul> => subj ++ fut.p1 ++ vp.present ! Perfective ! n ! agr.p ++ fut.p2 ++ vp.compl ! agr ;
<VFut, Anter> => subj ++ fut.p1 ++ auxHave.present ! n ! agr.p ++ fut.p2 ++ vp.participle.perfect ! Perfective ++ vp.compl ! agr ;
<VCond,Simul> => subj ++ neg ++ "би" ++ li ++ vp.participle.imperfect ! Perfective ! agr.g ++ vp.compl ! agr ;
<VCond,Anter> => subj ++ neg ++ "би" ++ li ++ auxHave.participle.imperfect ! agr.g ++ vp.participle.perfect ! Perfective ++ vp.compl ! agr
} where {
neg = case p of {
Pos => "" ;
Neg => "не"
} ;
fut = case <p,o> of {
<Pos,Main> => <"ке",[]> ;
<Neg,Main> => <"нема да",[]> ;
<Pos,Quest> => <"ке","ли"> ;
<Neg,Quest> => <"нема ли да",[]>
} ;
li = case o of {
Main => "" ;
Quest => "ли"
}
} ;
}

View File

@@ -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 <t,a> of {
<VPresent,Simul> => np.s ! RSubj ++ neg ++ vp.present ! Imperfective ! n ! np.p ;
<VPresent,Anter> => np.s ! RSubj ++ neg ++ auxBe.present ! n ! np.p ++ vp.participle.imperfect ! Perfective ! np.g ;
<VPastSimple,Simul> => np.s ! RSubj ++ neg ++ vp.aorist ! n ! np.p ;
<VPastSimple,Anter> => np.s ! RSubj ++ neg ++ auxBe.imperfect ! n ! np.p ++ vp.participle.imperfect ! Perfective ! np.g ;
<VPastImperfect,Simul> => np.s ! RSubj ++ neg ++ vp.imperfect ! Perfective ! n ! np.p ;
<VPastImperfect,Anter> => np.s ! RSubj ++ neg ++ auxBe.imperfect ! n ! np.p ++ vp.participle.imperfect ! Perfective ! np.g ;
<VFut, Simul> => np.s ! RSubj ++ fut ++ vp.present ! Perfective ! n ! np.p ;
<VFut, Anter> => np.s ! RSubj ++ fut ++ auxHave.present ! n ! np.p ++ vp.participle.perfect ! Perfective ;
<VCond,Simul> => np.s ! RSubj ++ neg ++ "би" ++ vp.participle.imperfect ! Perfective ! np.g ;
<VCond,Anter> => 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
} ;
}

View File

@@ -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 = \\_ => []} ;
}