From 48ec088faaf943c647c7d0119d502b40ca3f01d3 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Thu, 16 Apr 2026 16:20:18 +0200 Subject: [PATCH] more syntax --- src/armenian/AdjectiveHye.gf | 19 ++++++++++++++-- src/armenian/AdverbHye.gf | 6 +++++ src/armenian/CatHye.gf | 44 ++++++++++++++++-------------------- src/armenian/GrammarHye.gf | 3 +++ src/armenian/NounHye.gf | 13 +++++++---- src/armenian/ParadigmsHye.gf | 2 +- src/armenian/SentenceHye.gf | 14 ++++++++++++ src/armenian/VerbHye.gf | 34 ++++++++++++++++++++++++++++ 8 files changed, 103 insertions(+), 32 deletions(-) create mode 100644 src/armenian/AdverbHye.gf create mode 100644 src/armenian/SentenceHye.gf create mode 100644 src/armenian/VerbHye.gf diff --git a/src/armenian/AdjectiveHye.gf b/src/armenian/AdjectiveHye.gf index ab87d3f9..09800923 100644 --- a/src/armenian/AdjectiveHye.gf +++ b/src/armenian/AdjectiveHye.gf @@ -1,4 +1,19 @@ -concrete AdjectiveHye of Adjective = CatHye ** { +concrete AdjectiveHye of Adjective = CatHye ** open ResHye, Prelude in { lin - PositA a = a ; + AdAP ada ap = { + s = \\sp,c,num => ada.s ++ ap.s ! sp ! c ! num; + isPre = ap.isPre + } ; + PositA a = { + s = \\sp,c,num => + case of { + => a.def_nom ! num ; + => a.def_dat ! num ; + => a.poss1 ! c ! num ; + => a.poss2 ! c ! num ; + _ => a.s ! c ! num + } ; + isPre = True + } ; + } diff --git a/src/armenian/AdverbHye.gf b/src/armenian/AdverbHye.gf new file mode 100644 index 00000000..15f39b74 --- /dev/null +++ b/src/armenian/AdverbHye.gf @@ -0,0 +1,6 @@ +concrete AdverbHye of Adverb = CatHye ** open Prelude,ResHye in { + lin PrepNP p np = {s = case p.isPre of { + False => np.s ! p.c ++ p.s; + True => p.s ++ np.s ! p.c + }} ; +} diff --git a/src/armenian/CatHye.gf b/src/armenian/CatHye.gf index 9e5944ac..3b1f7362 100644 --- a/src/armenian/CatHye.gf +++ b/src/armenian/CatHye.gf @@ -2,12 +2,17 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in { lincat A = Adj ; lincat A2 = Adj ** {c2 : Compl} ; lincat ACard = {s : Str} ; - lincat AP = Adj ; - lincat CN = {s : Species => Case => Number => Str; - poss1 : Case => Number => Str; - poss2 : Case => Number => Str} ; + lincat AP = {s : Species => Case => Number => Str; isPre : Bool} ; + lincat CN = {s : Species => Case => Number => Str} ; lincat Card = {s : Str} ; - lincat Cl = {s : Str} ; + lincat Cl = {s : Str; + conditional : Aspect => Number => Str; + converb : {imperfective : Str; futCon1 : Str; + futCon2 : Str; negative : Str; + perfective : Str; simultaneous : Str}; + passive : Str; past : Person => Number => Str; + participle : PartType => Str; + subjunctive : Aspect => Number => Str} ; lincat ClSlash = {s : Str} ; lincat Comp = {s : Str} ; lincat Conj = {s : Str} ; @@ -31,7 +36,7 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in { lincat Ord = {s : Str} ; lincat PN = {s : Str} ; lincat Predet = {s : Str} ; - lincat Prep = Compl ; + lincat Prep = Compl ** {isPre : Bool} ; lincat Pron = {s : Str; empty : Str; a : Agr} ; lincat QCl = {s : Str} ; lincat QS = {s : Str} ; @@ -47,23 +52,12 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in { lincat VV,VS,VQ,VA = Verb ; lincat V2 = Verb ** {c2 : Compl} ; lincat V3,V2A,V2S,V2Q,V2V = Verb ** {c2,c3 : Compl} ; - lincat VP = {s : Case => Number => Str; - conditional : Aspect => Person => Number => Case => Number => Str; - converb : {imperfective : Case => Number => Str; - futCon1 : Case => Number => Str; FutCon2 : Case => Number => Str; - negative : Case => Number => Str; - perfective : Case => Number => Str; - simultaneous : Case => Number => Str}; - imperative : Number => Number => Str; - passive : Case => Number => Str; - past : Person => Number => Case => Number => Str; - participle : PartType => Case => Number => Str; - subjunctive : Aspect => Person => Number => Case => Number => Str} ; - lincat VPSlash = {s : Str; causative : Str; - conditional : Aspect => Person => Number => Str; - converb : {imperfective : Str; futCon1 : Str; futCon2 : Str; - negative : Str; perfective : Str; simultaneous : Str}; - imperative : Number => Str; passive : Str; - past : Person => Number => Str; participle : PartType => Str; - subjunctive : Aspect => Person => Number => Str; lock_V : {}} ; + lincat VP = {s : Str; + conditional : Aspect => Person => Number => Str; + converb : {imperfective : Str; futCon1 : Str; futCon2 : Str; + negative : Str; perfective : Str; simultaneous : Str}; + imperative : Number => Str; passive : Str; + past : Person => Number => Str; participle : PartType => Str; + subjunctive : Aspect => Person => Number => Str} ; + lincat VPSlash = Verb ** {c2 : Compl} ; } diff --git a/src/armenian/GrammarHye.gf b/src/armenian/GrammarHye.gf index 14e44c22..2a7211a2 100644 --- a/src/armenian/GrammarHye.gf +++ b/src/armenian/GrammarHye.gf @@ -2,6 +2,9 @@ concrete GrammarHye of Grammar = TenseX, PhraseHye, NounHye, + VerbHye, AdjectiveHye, + AdverbHye, + SentenceHye, StructuralHye ** { } diff --git a/src/armenian/NounHye.gf b/src/armenian/NounHye.gf index 3fbbcdc2..1f4805f0 100644 --- a/src/armenian/NounHye.gf +++ b/src/armenian/NounHye.gf @@ -1,8 +1,13 @@ concrete NounHye of Noun = CatHye ** open ResHye in { + lin AdjCN ap cn = { + s = \\sp,c,n => + case ap.isPre of { + True => ap.s ! Indef ! Nom ! Sg ++ cn.s ! sp ! c ! n; + False => cn.s ! sp ! c ! n ++ ap.s ! Indef ! Nom ! Sg + } + } ; lin AdvCN cn adv = { - s = \\sp,c,num => cn.s ! sp ! c ! num ++ adv.s ; - poss1 = \\c,num => cn.poss1 ! c ! num ++ adv.s ; - poss2 = \\c,num => cn.poss2 ! c ! num ++ adv.s + s = \\sp,c,num => adv.s ++ cn.s ! sp ! c ! num } ; lin DefArt = {s = []; sp = Def} ; lin DetCN det cn = {s = \\c => det.s ++ cn.s ! det.sp ! c ! det.n; @@ -12,7 +17,7 @@ concrete NounHye of Noun = CatHye ** open ResHye in { lin NumPl = {s = []; n = Pl} ; lin NumSg = {s = []; n = Sg} ; lin PossPron pron = {s = pron.empty; sp = Poss pron.a.p} ; - lin UseN n = n ** { + lin UseN n = { s = \\sp,c,num => case of { => n.def_nom ! num ; diff --git a/src/armenian/ParadigmsHye.gf b/src/armenian/ParadigmsHye.gf index 7629fb78..6f5e81bd 100644 --- a/src/armenian/ParadigmsHye.gf +++ b/src/armenian/ParadigmsHye.gf @@ -468,7 +468,7 @@ oper mkInterj : Str -> Interj = \s -> lin Interj {s=s} ; mkMU : Str -> MU = \s -> lin MU {s=s; isPre=False} ; - mkPrep : Str -> Prep = \s -> lin Prep {s=s; c=Dat} ; + mkPrep : Str -> Prep = \s -> lin Prep {s=s; c=Dat; isPre=False} ; singular : Number = Sg ; plural : Number = Pl ; diff --git a/src/armenian/SentenceHye.gf b/src/armenian/SentenceHye.gf new file mode 100644 index 00000000..9deae436 --- /dev/null +++ b/src/armenian/SentenceHye.gf @@ -0,0 +1,14 @@ +concrete SentenceHye of Sentence = CatHye ** open Prelude,ResHye in { + lin PredVP np vp = {s = np.s ! Nom ++ vp.s; + conditional = \\a,n => np.s ! Nom ++ vp.conditional ! a ! P3 ! n; + converb = {imperfective = np.s ! Nom ++ vp.converb.imperfective; + futCon1 = np.s ! Nom ++ vp.converb.futCon1; + futCon2 = np.s ! Nom ++ vp.converb.futCon2; + negative = np.s ! Nom ++ vp.converb.negative; + perfective = np.s ! Nom ++ vp.converb.perfective; + simultaneous = np.s ! Nom ++ vp.converb.simultaneous}; + passive = np.s ! Nom ++ vp.passive; + past = \\_,n => np.s ! Nom ++ vp.past ! P3 ! n; + participle = \\p => np.s ! Nom ++ vp.participle ! p; + subjunctive = \\a,n => np.s ! Nom ++ vp.subjunctive ! a ! P3 ! n} ; +} diff --git a/src/armenian/VerbHye.gf b/src/armenian/VerbHye.gf new file mode 100644 index 00000000..a0e93b07 --- /dev/null +++ b/src/armenian/VerbHye.gf @@ -0,0 +1,34 @@ +concrete VerbHye of Verb = CatHye ** open Prelude,ResHye in { + lin AdvVP vp adv = {s = adv.s ++ vp.s; + conditional = \\a,p,n => adv.s ++ vp.conditional ! a ! p ! n; + converb = {imperfective = adv.s ++ vp.converb.imperfective; + futCon1 = adv.s ++ vp.converb.futCon1; + futCon2 = adv.s ++ vp.converb.futCon2; + negative = adv.s ++ vp.converb.negative; + perfective = adv.s ++ vp.converb.perfective; + simultaneous = adv.s ++ vp.converb.simultaneous}; + imperative = \\n => vp.imperative ! n ++ adv.s; + passive = adv.s ++ vp.passive; + past = \\p,n => adv.s ++ vp.past ! p ! n; + participle = \\p => adv.s ++ vp.participle ! p; + subjunctive = \\a,p,n => adv.s ++ vp.subjunctive ! a ! p ! n} ; + lin ComplSlash vp np = {s = vp.s ++ vp.c2.s ++ np.s ! vp.c2.c; + conditional = \\a,p,n => vp.conditional ! a ! p ! n + ++ vp.c2.s ++ np.s ! vp.c2.c; + converb = {imperfective = vp.converb.imperfective + ++ vp.c2.s ++ np.s ! vp.c2.c; + futCon1 = vp.converb.futCon1 ++ vp.c2.s ++ np.s ! vp.c2.c; + futCon2 = vp.converb.futCon2 ++ vp.c2.s ++ np.s ! vp.c2.c; + negative = vp.converb.negative ++ vp.c2.s ++ np.s ! vp.c2.c; + perfective = vp.converb.perfective + ++ vp.c2.s ++ np.s ! vp.c2.c; + simultaneous = vp.converb.simultaneous + ++ vp.c2.s ++ np.s ! vp.c2.c}; + imperative = \\n => vp.imperative ! n ++ vp.c2.s ++ np.s ! Nom; + passive = vp.passive ++ vp.c2.s ++ np.s ! vp.c2.c; + past = \\p,n => vp.past ! p ! n ++ vp.c2.s ++ np.s ! vp.c2.c; + participle = \\p => vp.participle ! p ++ vp.c2.s ++ np.s ! vp.c2.c; + subjunctive = \\a,p,n => vp.subjunctive ! a ! p ! n + ++ vp.c2.s ++ np.s ! vp.c2.c} ; + lin SlashV2a v = v ; +}