extensions from Codex

This commit is contained in:
Krasimir Angelov
2026-09-21 18:13:07 +02:00
parent 1e6aa119fe
commit 9e2a83040a
23 changed files with 1837 additions and 1115 deletions
+16
View File
@@ -15,5 +15,21 @@ lin
} ;
isPre = True
} ;
UseA2 a = PositA a ;
ComplA2 a np = {
s = \\sp,c,n => (case a.c2.isPre of {
True => a.c2.s ++ np.s ! a.c2.c;
False => np.s ! a.c2.c ++ a.c2.s
}) ++ a.s ! c ! n;
isPre = False
} ;
AdvAP ap adv = {s = \\sp,c,n => ap.s ! sp ! c ! n ++ adv.s; isPre = ap.isPre} ;
SentAP ap sc = {s = \\sp,c,n => ap.s ! sp ! c ! n ++ sc.s; isPre = ap.isPre} ;
ComparA a np = {
s = \\sp,c,n => a.s ! c ! n ++ "քան" ++ np.s ! Nom; isPre = False
} ;
UseComparA a = {
s = \\sp,c,n => "ավելի" ++ (a.s ! c ! n); isPre = True
} ;
}
+4
View File
@@ -3,4 +3,8 @@ concrete AdverbHye of Adverb = CatHye ** open Prelude,ResHye in {
False => np.s ! p.c ++ p.s;
True => p.s ++ np.s ! p.c
}} ;
lin PositAdvAdj a = {s = a.s ! Instr ! Sg} ;
lin PositAdAAdj a = {s = a.s ! Instr ! Sg} ;
lin AdAdv ada adv = {s = ada.s ++ adv.s} ;
lin SubjS subj s = {s = subj.s ++ s.s} ;
}
+2 -1
View File
@@ -1,4 +1,5 @@
concrete AllHye of AllHyeAbs =
LangHye
LangHye,
ExtendHye
**
{} ;
+3 -2
View File
@@ -1,3 +1,4 @@
abstract AllHyeAbs =
Lang
** {}
Lang,
Extend
** {}
+6 -5
View File
@@ -6,6 +6,7 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in {
lincat CN = {s : Species => Case => Number => Str} ;
lincat Card = {s : Str} ;
lincat Cl = {s : Str;
negative : Tense => Str;
conditional : Aspect => Number => Str;
converb : {imperfective : Str; futCon1 : Str;
futCon2 : Str; negative : Str;
@@ -17,9 +18,9 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in {
lincat Comp = {s : Str} ;
lincat Conj = {s : Str} ;
lincat DAP = {s : Str} ;
lincat Decimal = {s : Str} ;
lincat Decimal = {s : CardOrd => Str; n : Number; hasDot : Bool} ;
lincat Det = {s : Str; n : Number; sp : Species} ;
lincat Digits = {s : Str} ;
lincat Digits = {s : CardOrd => Str; n : Number; tail : DTail} ;
lincat GN = {s : Str} ;
lincat IComp = {s : Str} ;
lincat IDet = {s : Str} ;
@@ -32,12 +33,12 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in {
lincat N3 = Noun ** {c2,c3 : Compl} ;
lincat NP = {s : Case => Str; a : Agr} ;
lincat Num = {s : Str; n : Number} ;
lincat Numeral = {s : Str} ;
lincat Numeral = {s : CardOrd => Str; n : Number} ;
lincat Ord = {s : Str} ;
lincat PN = {s : Str} ;
lincat Predet = {s : Str} ;
lincat Prep = Compl ** {isPre : Bool} ;
lincat Pron = {s : Str; empty : Str; a : Agr} ;
lincat Prep = Compl ;
lincat Pron = {s : Case => Str; empty : Str; a : Agr} ;
lincat QCl = {s : Str} ;
lincat QS = {s : Str} ;
lincat Quant = {s : Str; sp : Species} ;
+22
View File
@@ -0,0 +1,22 @@
concrete ConjunctionHye of Conjunction = CatHye ** open Prelude, ResHye in {
lincat
[S] = {s1,s2 : Str} ; [RS] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Str} ;
[AdV] = {s1,s2 : Str} ; [NP] = {s1,s2 : Str} ; [AP] = {s1,s2 : Str} ;
[IAdv] = {s1,s2 : Str} ; [CN] = {s1,s2 : Str} ; [DAP] = {s1,s2 : Str} ;
lin
BaseS x y = {s1=x.s;s2=y.s}; ConsS x xs = {s1=x.s;s2=xs.s1 ++ "," ++ xs.s2}; ConjS c xs = {s=xs.s1 ++ c.s ++ xs.s2};
BaseRS x y = {s1=x.s;s2=y.s}; ConsRS x xs = {s1=x.s;s2=xs.s1 ++ "," ++ xs.s2}; ConjRS c xs = {s=xs.s1 ++ c.s ++ xs.s2};
BaseAdv x y = {s1=x.s;s2=y.s}; ConsAdv x xs = {s1=x.s;s2=xs.s1 ++ "," ++ xs.s2}; ConjAdv c xs = {s=xs.s1 ++ c.s ++ xs.s2};
BaseAdV x y = {s1=x.s;s2=y.s}; ConsAdV x xs = {s1=x.s;s2=xs.s1 ++ "," ++ xs.s2}; ConjAdV c xs = {s=xs.s1 ++ c.s ++ xs.s2};
BaseIAdv x y = {s1=x.s;s2=y.s}; ConsIAdv x xs = {s1=x.s;s2=xs.s1 ++ "," ++ xs.s2}; ConjIAdv c xs = {s=xs.s1 ++ c.s ++ xs.s2};
BaseNP x y = {s1=x.s ! Nom;s2=y.s ! Nom}; ConsNP x xs = {s1=x.s ! Nom;s2=xs.s1 ++ "," ++ xs.s2};
ConjNP c xs = {s=\\_ => xs.s1 ++ c.s ++ xs.s2; a={n=Pl;p=P3}};
BaseAP x y = {s1=x.s ! Indef ! Nom ! Sg;s2=y.s ! Indef ! Nom ! Sg};
ConsAP x xs = {s1=x.s ! Indef ! Nom ! Sg;s2=xs.s1 ++ "," ++ xs.s2};
ConjAP c xs = {s=\\_,_,_ => xs.s1 ++ c.s ++ xs.s2;isPre=True};
BaseCN x y = {s1=x.s ! Indef ! Nom ! Sg;s2=y.s ! Indef ! Nom ! Sg};
ConsCN x xs = {s1=x.s ! Indef ! Nom ! Sg;s2=xs.s1 ++ "," ++ xs.s2};
ConjCN c xs = {s=\\_,_,_ => xs.s1 ++ c.s ++ xs.s2};
BaseDAP x y = {s1=x.s;s2=y.s}; ConsDAP x xs = {s1=x.s;s2=xs.s1 ++ "," ++ xs.s2};
ConjDet c xs = {s=xs.s1 ++ c.s ++ xs.s2;n=Pl;sp=Indef};
}
+59
View File
@@ -0,0 +1,59 @@
concrete ConstructionHye of Construction = CatHye ** open ResHye, ParadigmsHye, Prelude in {
lincat Timeunit, Hour, Weekday, Month, Monthday, Year, Language = {s:Str} ;
oper
stateVP : Str -> VP = \s -> lin VP (invarVerb s) ;
constCN : Str -> CN = \s -> lin CN {s=\\_,_,_=>s} ;
lin
hungry_VP=stateVP "սոված";thirsty_VP=stateVP "ծարավ";tired_VP=stateVP "հոգնած";
scared_VP=stateVP "վախեցած";ill_VP=stateVP "հիվանդ";ready_VP=stateVP "պատրաստ";
has_age_VP c=stateVP (c.s++"տարեկան");
have_name_Cl np name=lin Cl {s=np.s!Nom++name.s!Nom;negative=table {_=>np.s!Nom++"չի"++name.s!Nom};conditional=\\_,_=>np.s!Nom++name.s!Nom;
converb={imperfective=np.s!Nom++name.s!Nom;futCon1=np.s!Nom++name.s!Nom;futCon2=np.s!Nom++name.s!Nom;
negative=np.s!Nom++name.s!Nom;perfective=np.s!Nom++name.s!Nom;simultaneous=np.s!Nom++name.s!Nom};
passive=np.s!Nom++name.s!Nom;past=\\_,_=>np.s!Nom++name.s!Nom;participle=\\_=>np.s!Nom++name.s!Nom;
subjunctive=\\_,_=>np.s!Nom++name.s!Nom};
married_Cl x y=have_name_Cl x y;
what_name_QCl np={s="ինչ է"++np.s!Nom++"անունը"};how_old_QCl np={s=np.s!Nom++"քանի տարեկան է"};
how_far_QCl np={s=np.s!Nom++"որքան հեռու է"};weather_adjCl ap=have_name_Cl {s=\\_=>[];a={n=Sg;p=P3}} {s=\\_=>ap.s!Indef!Nom!Sg;a={n=Sg;p=P3}};
is_right_VP=stateVP "ճիշտ";is_wrong_VP=stateVP "սխալ";
n_units_AP card cn a={s=\\sp,c,n=>card.s++cn.s!Indef!Nom!Pl++a.s!c!n;isPre=True};
n_units_of_NP card cn np={s=\\c=>card.s++cn.s!Indef!Nom!Pl++np.s!c;a=np.a};
n_unit_CN card unit cn={s=\\sp,c,n=>card.s++unit.s!Indef!Nom!Sg++cn.s!sp!c!n};
bottle_of_CN np=constCN ("շիշ"++np.s!Dat);cup_of_CN np=constCN ("բաժակ"++np.s!Dat);
glass_of_CN np=constCN ("բաժակ"++np.s!Dat);
few_X_short_of_Y np x y={s=np.s!Dat++x.s!Indef!Nom!Pl++y.s!Indef!Nom!Sg++"չի բավականացնում"};
timeunitAdv c u={s=c.s++u.s};timeunitRange a b u={s=a.s++b.s++u.s};
timeHour h={s="ժամը"++h.s};timeHourMinute h m={s="ժամը"++h.s++m.s};
weekdayPunctualAdv d={s=d.s};weekdayHabitualAdv d={s="ամեն"++d.s};weekdayLastAdv d={s="անցյալ"++d.s};
weekdayNextAdv d={s="հաջորդ"++d.s};monthAdv m={s=m.s};yearAdv y={s=y.s++"թվականին"};
dayMonthAdv d m={s=d.s++m.s};monthYearAdv m y={s=m.s++y.s};dayMonthYearAdv d m y={s=d.s++m.s++y.s};
intYear i={s=i.s};intMonthday i={s=i.s};InLanguage l={s=l.s++"երեն"};
weekdayN d=lin N (invarNoun d.s);monthN m=lin N (invarNoun m.s);weekdayPN d={s=d.s};monthPN m={s=m.s};
languageNP l={s=\\_=>l.s;a={n=Sg;p=P3}};languageCN l=constCN l.s;
oneHour={s="մեկ"};twoHour={s="երկու"};threeHour={s="երեք"};fourHour={s="չորս"};fiveHour={s="հինգ"};
sixHour={s="վեց"};sevenHour={s="յոթ"};eightHour={s="ութ"};nineHour={s="ինը"};tenHour={s="տասը"};
elevenHour={s="տասնմեկ"};twelveHour={s="տասներկու"};
thirteenHour={s="տասներեք"};fourteenHour={s="տասնչորս"};fifteenHour={s="տասնհինգ"};
sixteenHour={s="տասնվեց"};seventeenHour={s="տասնյոթ"};eighteenHour={s="տասնութ"};
nineteenHour={s="տասնինը"};twentyHour={s="քսան"};twentyOneHour={s="քսանմեկ"};
twentyTwoHour={s="քսաներկու"};twentyThreeHour={s="քսաներեք"};twentyFourHour={s="քսանչորս"};
second_Timeunit={s="վայրկյան"};minute_Timeunit={s="րոպե"};hour_Timeunit={s="ժամ"};day_Timeunit={s="օր"};
week_Timeunit={s="շաբաթ"};month_Timeunit={s="ամիս"};year_Timeunit={s="տարի"};
monday_Weekday={s="երկուշաբթի"};tuesday_Weekday={s="երեքշաբթի"};wednesday_Weekday={s="չորեքշաբթի"};
thursday_Weekday={s="հինգշաբթի"};friday_Weekday={s="ուրբաթ"};saturday_Weekday={s="շաբաթ"};sunday_Weekday={s="կիրակի"};
january_Month={s="հունվար"};february_Month={s="փետրվար"};march_Month={s="մարտ"};april_Month={s="ապրիլ"};
may_Month={s="մայիս"};june_Month={s="հունիս"};july_Month={s="հուլիս"};august_Month={s="օգոստոս"};
september_Month={s="սեպտեմբեր"};october_Month={s="հոկտեմբեր"};november_Month={s="նոյեմբեր"};december_Month={s="դեկտեմբեր"};
afrikaans_Language={s="աֆրիկաանս"};amharic_Language={s="ամհարերեն"};arabic_Language={s="արաբերեն"};
bulgarian_Language={s="բուլղարերեն"};catalan_Language={s="կատալաներեն"};chinese_Language={s="չինարեն"};
danish_Language={s="դանիերեն"};dutch_Language={s="հոլանդերեն"};english_Language={s="անգլերեն"};
estonian_Language={s="էստոներեն"};finnish_Language={s="ֆիններեն"};french_Language={s="ֆրանսերեն"};
german_Language={s="գերմաներեն"};greek_Language={s="հունարեն"};hebrew_Language={s="եբրայերեն"};
hindi_Language={s="հինդի"};italian_Language={s="իտալերեն"};japanese_Language={s="ճապոներեն"};
latin_Language={s="լատիներեն"};latvian_Language={s="լատվիերեն"};maltese_Language={s="մալթերեն"};
nepali_Language={s="նեպալերեն"};norwegian_Language={s="նորվեգերեն"};persian_Language={s="պարսկերեն"};
polish_Language={s="լեհերեն"};punjabi_Language={s="փենջաբերեն"};romanian_Language={s="ռումիներեն"};
russian_Language={s="ռուսերեն"};sindhi_Language={s="սինդհի"};spanish_Language={s="իսպաներեն"};
swahili_Language={s="սուահիլի"};swedish_Language={s="շվեդերեն"};thai_Language={s="թայերեն"};
turkish_Language={s="թուրքերեն"};urdu_Language={s="ուրդու"};
}
+116
View File
@@ -0,0 +1,116 @@
--# -path=.:../abstract:../common:prelude
concrete ExtendHye of Extend =
CatHye ** ExtendFunctor - [
VPS, ListVPS, VPI, ListVPI,
ListComp, ListImp,
RNP, RNPList,
GenModNP, EmptyRelSlash,
MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, SQuestVPS, QuestVPS, RelVPS,
ExistS, ExistNPQS, ExistIPQS,
MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
PresPartAP, EmbedPresPart, PastPartAP, PastPartAgentAP,
PassVPSlash, PassAgentVPSlash, ProgrVPSlash, ComplBareVS,
ReflPron, ReflPoss, PredetRNP, AdvRNP, AdvRVP, AdvRAP, PossPronRNP,
Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ConjRNP,
CompoundN, CompoundAP, GerundCN, GerundNP, GerundAdv, ByVP, ApposNP,
PositAdVAdj, UttVPShort, ComplSlashPartLast,
UseDAPMasc, UseDAPFem, UseDAP,
DetNPMasc, DetNPFem, PredAPVP, SubjRelNP,
BaseComp, ConsComp, ConjComp, BaseImp, ConsImp, ConjImp,
TPastSimple
] with (Grammar = GrammarHye) **
open Prelude, ResHye, ParadigmsHye, (R = ParamX) in {
lincat
VPS = {s : Str} ; [VPS] = {s1,s2 : Str} ;
VPI = {s : Str} ; [VPI] = {s1,s2 : Str} ;
[Comp] = {s1,s2 : Str} ; [Imp] = {s1,s2 : Str} ;
RNP = {s : Case => Str} ; RNPList = {s : Case => Str} ;
oper
extToVP : Verb -> VP = \v -> lin VP {s=v.s;conditional=v.conditional;converb=v.converb;
imperative=v.imperative;passive=v.passive;past=v.past;participle=v.participle;
subjunctive=v.subjunctive} ;
extAddVP : VP -> Str -> VP = \v,x -> lin VP {s=v.s ++ x;
conditional=\\a,p,n=>v.conditional!a!p!n ++ x;
converb={imperfective=v.converb.imperfective++x;futCon1=v.converb.futCon1++x;
futCon2=v.converb.futCon2++x;negative=v.converb.negative++x;
perfective=v.converb.perfective++x;simultaneous=v.converb.simultaneous++x};
imperative=\\n=>v.imperative!n++x;passive=v.passive++x;
past=\\p,n=>v.past!p!n++x;participle=\\p=>v.participle!p++x;
subjunctive=\\a,p,n=>v.subjunctive!a!p!n++x} ;
refl : RNP = lin RNP {s=\\_=>"իրեն"} ;
lin
GenModNP num np cn = {s=\\c=>np.s!Dat ++ cn.s!Indef!c!num.n;a={n=num.n;p=P3}} ;
EmptyRelSlash slash = {s="որը" ++ slash.s} ;
MkVPS temp pol vp = {s=pol.s ++ vp.s} ;
BaseVPS x y = {s1=x.s;s2=y.s} ;
ConsVPS x xs = {s1=x.s;s2=xs.s1++","++xs.s2} ;
ConjVPS c xs = {s=xs.s1++c.s++xs.s2} ;
PredVPS np vps = {s=np.s!Nom++vps.s} ;
SQuestVPS np vps = {s=np.s!Nom++vps.s++"՞"} ;
QuestVPS ip vps = {s=ip.s++vps.s++"՞"} ;
RelVPS rp vps = {s=rp.s++vps.s} ;
ExistS t p np = {s=np.s!Nom++"կա"} ;
ExistNPQS t p np = {s=np.s!Nom++"կա՞"} ;
ExistIPQS t p ip = {s=ip.s++"կա՞"} ;
MkVPI vp = {s=vp.s} ;
BaseVPI x y = {s1=x.s;s2=y.s} ;
ConsVPI x xs = {s1=x.s;s2=xs.s1++","++xs.s2} ;
ConjVPI c xs = {s=xs.s1++c.s++xs.s2} ;
ComplVPIVV vv vpi = extAddVP (extToVP vv) vpi.s ;
PresPartAP vp = {s=\\_,_,_=>vp.participle!Subject;isPre=True} ;
EmbedPresPart vp = {s=vp.participle!Subject} ;
PastPartAP slash = {s=\\_,_,_=>slash.participle!Resultative;isPre=True} ;
PastPartAgentAP slash np = {s=\\_,_,_=>slash.participle!Resultative++np.s!Instr;isPre=True} ;
PassVPSlash slash = extAddVP (extToVP (mkV "լինել")) (slash.participle!Resultative) ;
PassAgentVPSlash slash np = extAddVP (extToVP (mkV "լինել")) (slash.participle!Resultative++np.s!Instr) ;
ProgrVPSlash slash = slash ;
ComplBareVS vs s = extAddVP (extToVP vs) s.s ;
ReflPron = refl ;
ReflPoss num cn = {s=\\c=>"իր"++cn.s!Indef!c!num.n} ;
PredetRNP pred r = {s=\\c=>pred.s++r.s!c} ;
AdvRNP np prep r = {s=\\c=>np.s!c++prep.s++r.s!prep.c} ;
AdvRVP vp prep r = extAddVP vp (prep.s++r.s!prep.c) ;
AdvRAP ap prep r = {s=\\sp,c,n=>ap.s!sp!c!n++prep.s++r.s!prep.c;isPre=ap.isPre} ;
PossPronRNP pron num cn r = {s=\\c=>pron.empty++cn.s!Indef!c!num.n++r.s!Dat;a={n=num.n;p=P3}} ;
Base_rr_RNP x y = {s=\\c=>x.s!c++y.s!c} ;
Base_nr_RNP x y = {s=\\c=>x.s!c++y.s!c} ;
Base_rn_RNP x y = {s=\\c=>x.s!c++y.s!c} ;
Cons_rr_RNP x xs = {s=\\c=>x.s!c++xs.s!c} ;
Cons_nr_RNP x xs = {s=\\c=>x.s!c++xs.s!c} ;
ConjRNP conj xs = {s=\\c=>conj.s++xs.s!c} ;
CompoundN n1 n2 = lin N {s=\\c,n=>n1.s!Nom!Sg++n2.s!c!n;def_dat=\\n=>n1.s!Nom!Sg++n2.def_dat!n;
def_nom=\\n=>n1.s!Nom!Sg++n2.def_nom!n;poss1=\\c,n=>n1.s!Nom!Sg++n2.poss1!c!n;poss2=\\c,n=>n1.s!Nom!Sg++n2.poss2!c!n} ;
CompoundAP n a = {s=\\sp,c,num=>n.s!Nom!Sg++a.s!c!num;isPre=True} ;
GerundCN vp = {s=\\_,_,_=>vp.s} ;
GerundNP vp = {s=\\_=>vp.s;a={n=Sg;p=P3}} ;
GerundAdv vp = {s=vp.s} ;
ByVP vp = {s=vp.s} ;
ApposNP np app = {s=\\c=>np.s!c++","++app.s!Nom;a=np.a} ;
PositAdVAdj a = {s=a.s!Instr!Sg} ;
UttVPShort vp = {s=vp.s} ;
ComplSlashPartLast slash np = extAddVP (extToVP slash) (slash.c2.s++np.s!slash.c2.c) ;
UseDAPMasc dap = {s=\\_=>dap.s;a={n=Sg;p=P3}} ;
UseDAPFem dap = {s=\\_=>dap.s;a={n=Sg;p=P3}} ;
UseDAP dap = {s=\\_=>dap.s;a={n=Sg;p=P3}} ;
DetNPMasc = variants {} ;
DetNPFem = variants {} ;
PredAPVP = variants {} ;
SubjRelNP = variants {} ;
BaseComp x y = {s1=x.s;s2=y.s} ;
ConsComp x xs = {s1=x.s;s2=xs.s1++","++xs.s2} ;
ConjComp c xs = {s=xs.s1++c.s++xs.s2} ;
BaseImp x y = {s1=x.s;s2=y.s} ;
ConsImp x xs = {s1=x.s;s2=xs.s1++","++xs.s2} ;
ConjImp c xs = {s=xs.s1++c.s++xs.s2} ;
TPastSimple = {s=[];t=R.Past} ;
}
+9 -3
View File
@@ -1,10 +1,16 @@
concrete GrammarHye of Grammar =
TenseX,
PhraseHye,
NounHye,
VerbHye,
AdjectiveHye,
AdverbHye,
NumeralHye,
SentenceHye,
StructuralHye ** {
QuestionHye,
RelativeHye,
ConjunctionHye,
PhraseHye,
StructuralHye,
IdiomHye,
TenseX,
NamesHye ** {
}
+21
View File
@@ -0,0 +1,21 @@
concrete IdiomHye of Idiom = CatHye ** open ResHye in {
oper
bareCl : Str -> Cl = \s -> lin Cl {
s=s; negative=table {_ => "չ" ++ s}; conditional=\\_,_ => s;
converb={imperfective=s;futCon1=s;futCon2=s;negative=s;perfective=s;simultaneous=s};
passive=s;past=\\_,_ => s;participle=\\_ => s;subjunctive=\\_,_ => s
} ;
lin
ImpersCl vp = bareCl vp.s ;
GenericCl vp = bareCl ("մարդ" ++ vp.s) ;
CleftNP np rs = bareCl (np.s ! Nom ++ rs.s) ;
CleftAdv adv s = bareCl (adv.s ++ s.s) ;
ExistNP np = bareCl (np.s ! Nom ++ "կա") ;
ExistIP ip = {s=ip.s ++ "կա՞"} ;
ExistNPAdv np adv = bareCl (adv.s ++ np.s ! Nom ++ "կա") ;
ExistIPAdv ip adv = {s=adv.s ++ ip.s ++ "կա՞"} ;
ProgrVP vp = vp ;
ImpPl1 vp = {s="եկեք" ++ vp.s} ;
ImpP3 np vp = {s="թող" ++ np.s ! Nom ++ vp.s} ;
SelfAdvVP vp = vp ; SelfAdVVP vp = vp ; SelfNP np = np ;
}
+2 -1
View File
@@ -2,9 +2,10 @@
concrete LangHye of Lang =
GrammarHye,
LexiconHye
,ConstructionHye
,DocumentationHye --# notpresent
** {
flags startcat = Phr ;
}
}
+1021 -1061
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
concrete NamesHye of Names = CatHye ** open Prelude, ResHye in {
lin
GivenName n = {s=\\_=>n.s;a={n=Sg;p=P3}} ;
MaleSurname n = {s=\\_=>n.s;a={n=Sg;p=P3}} ;
FemaleSurname n = {s=\\_=>n.s;a={n=Sg;p=P3}} ;
PlSurname n = {s=\\_=>n.s;a={n=Pl;p=P3}} ;
FullName n s = {s=\\_=>n.s++s.s;a={n=Sg;p=P3}} ;
UseLN n = {s=\\_=>n.s;a={n=Sg;p=P3}} ;
PlainLN n = {s=\\_=>n.s;a={n=Sg;p=P3}} ;
InLN n = {s=n.s++BIND++"-ում"} ;
AdjLN a n = {s=a.s!Indef!Nom!Sg++n.s} ;
}
+56 -3
View File
@@ -1,4 +1,4 @@
concrete NounHye of Noun = CatHye ** open ResHye in {
concrete NounHye of Noun = CatHye ** open Prelude, ResHye in {
lin AdjCN ap cn = {
s = \\sp,c,n =>
case ap.isPre of {
@@ -9,17 +9,70 @@ concrete NounHye of Noun = CatHye ** open ResHye in {
lin AdvCN cn adv = {
s = \\sp,c,num => adv.s ++ cn.s ! sp ! c ! num
} ;
lin AdvNP np adv = {s = \\c => np.s ! c ++ adv.s; a = np.a} ;
lin ExtAdvNP np adv = {s = \\c => np.s ! c ++ "," ++ adv.s; a = np.a} ;
lin PredetNP pred np = {s = \\c => pred.s ++ np.s ! c; a = np.a} ;
lin UsePN pn = {s = \\_ => pn.s; a = {n = Sg; p = P3}} ;
lin DefArt = {s = []; sp = Def} ;
lin DetCN det cn = {s = \\c => det.s ++ cn.s ! det.sp ! c ! det.n;
a = {n=det.n; p=P3}} ;
lin DetQuant quant num = {s = quant.s ++ num.s; n = num.n; sp=quant.sp} ;
lin IndefArt = {s = "մի"; sp = Indef} ;
lin DetQuantOrd quant num ord = {
s = quant.s ++ num.s ++ ord.s; n = num.n; sp = quant.sp
} ;
lin IndefArt = {s = []; sp = Indef} ;
lin NumPl = {s = []; n = Pl} ;
lin NumSg = {s = []; n = Sg} ;
lin NumCard card = {s = card.s; n = Pl} ;
lin NumDigits digits = {s = digits.s ! NCard} ;
lin NumDecimal decimal = {s = decimal.s ! NCard} ;
lin NumNumeral numeral = {s = numeral.s ! NCard} ;
lin AdNum adn card = {s = adn.s ++ card.s} ;
lin OrdDigits digits = {s = digits.s ! NOrd} ;
lin OrdNumeral numeral = {s = numeral.s ! NOrd} ;
lin OrdSuperl a = {s = "ամենա" ++ a.s ! Nom ! Sg} ;
lin OrdNumeralSuperl numeral a = {s = numeral.s ! NOrd ++ "ամենա" ++ a.s ! Nom ! Sg} ;
lin MassNP cn = {
s = \\c => cn.s ! Indef ! c ! Sg;
a = {n=Sg; p=P3}
} ;
lin ComplN2 n np = {
s = \\sp,c,num => (case n.c2.isPre of {
True => n.c2.s ++ np.s ! n.c2.c;
False => np.s ! n.c2.c ++ n.c2.s
}) ++
case <sp,c> of {
<Def,Nom> => n.def_nom ! num;
<Def,Dat> => n.def_dat ! num;
<Poss P1,_> => n.poss1 ! c ! num;
<Poss P2,_> => n.poss2 ! c ! num;
_ => n.s ! c ! num
}
} ;
lin ComplN3 n np = n ** {c2 = n.c3} ;
lin Use2N3 n = lin N2 {s=n.s;def_dat=n.def_dat;def_nom=n.def_nom;
poss1=n.poss1;poss2=n.poss2;c2=n.c2} ;
lin Use3N3 n = lin N2 {s=n.s;def_dat=n.def_dat;def_nom=n.def_nom;
poss1=n.poss1;poss2=n.poss2;c2=n.c3} ;
lin PossNP cn np = {
s = \\sp,c,num => np.s ! Dat ++ cn.s ! sp ! c ! num
} ;
lin PartNP cn np = {
s = \\sp,c,num => cn.s ! sp ! c ! num ++ np.s ! Ablat
} ;
lin SentCN cn sc = {s = \\sp,c,n => cn.s ! sp ! c ! n ++ sc.s} ;
lin ApposCN cn np = {s = \\sp,c,n => cn.s ! sp ! c ! n ++ np.s ! Nom} ;
lin RelCN cn rs = {s = \\sp,c,n => cn.s ! sp ! c ! n ++ rs.s} ;
lin CountNP det np = {s = \\c => det.s ++ np.s ! c; a = {n=det.n;p=P3}} ;
lin DetDAP det = {s = det.s} ;
lin AdjDAP dap ap = {s = dap.s ++ ap.s ! Indef ! Nom ! Sg} ;
lin QuantityNP decimal mu = {
s = \\_ => case mu.isPre of {
True => mu.s ++ decimal.s ! NCard;
False => decimal.s ! NCard ++ mu.s
};
a = {n=Pl;p=P3}
} ;
lin PossPron pron = {s = pron.empty; sp = Poss pron.a.p} ;
lin UseN n = {
s = \\sp,c,num =>
@@ -31,5 +84,5 @@ concrete NounHye of Noun = CatHye ** open ResHye in {
_ => n.s ! c ! num
}
} ;
lin UsePron pron = {s = \\c => pron.s; a=pron.a} ;
lin UsePron pron = {s = pron.s; a=pron.a} ;
}
+181
View File
@@ -0,0 +1,181 @@
--# -path=.:../abstract:../common:../prelude
concrete NumeralHye of Numeral = CatHye [Numeral,Digits,Decimal] **
open Prelude, ResHye in {
flags coding = utf8 ;
param DForm = Unit | Teen | Ten ;
lincat
Digit = {s : DForm => CardOrd => Str; compoundOrd : DForm => Str} ;
Sub10 = {s : DForm => CardOrd => Str; compoundOrd : DForm => Str; n : Number} ;
Sub100, Sub1000, Sub1000000, Sub1000000000, Sub1000000000000 = LinNum ;
lin
num n = {s = n.s; n = n.n} ;
n2 = mkDigit "երկու" "տասներկու" "քսան" "երկրորդ" ;
n3 = mkDigit "երեք" "տասներեք" "երեսուն" "երրորդ" ;
n4 = mkDigit "չորս" "տասնչորս" "քառասուն" "չորրորդ" ;
n5 = mkDigit "հինգ" "տասնհինգ" "հիսուն" "հինգերորդ" ;
n6 = mkDigit "վեց" "տասնվեց" "վաթսուն" "վեցերորդ" ;
n7 = mkDigit "յոթ" "տասնյոթ" "յոթանասուն" "յոթերորդ" ;
n8 = mkDigit "ութ" "տասնութ" "ութսուն" "ութերորդ" ;
n9 = mkDigit "ինը" "տասնինը" "իննսուն" "իններորդ" ;
pot01 = mkDigit "մեկ" "տասնմեկ" "տասը" "առաջին" ** {
compoundOrd = table {
Unit => "մեկերորդ" ;
Teen => "տասնմեկերորդ" ;
Ten => "տասներորդ"
} ;
n = Sg
} ;
pot0 d = d ** {n = Pl} ;
pot110 = mkNum "տասը" "տասներորդ" Pl ** {attr = "տաս"} ;
pot111 = regNum "տասնմեկ" Pl ;
pot1to19 d = {
s = d.s ! Teen ;
compoundOrd = d.compoundOrd ! Teen ;
attr = d.s ! Teen ! NCard ;
n = Pl
} ;
pot0as1 n = {
s = n.s ! Unit ;
compoundOrd = n.compoundOrd ! Unit ;
attr = n.s ! Unit ! NCard ;
n = n.n
} ;
pot1 d = {
s = d.s ! Ten ;
compoundOrd = d.compoundOrd ! Ten ;
attr = d.s ! Ten ! NCard ;
n = Pl
} ;
pot1plus d e = regNum
(d.s ! Ten ! NCard ++ BIND ++ e.s ! Unit ! NCard) Pl ;
pot1as2 n = n ;
pot21 = mkNum "հարյուր" "հարյուրերորդ" Pl ;
pot2 d = scaleNum (d.s ! Unit ! NCard) "հարյուր" Pl ;
pot2plus d e = plusNum
(d.s ! Unit ! NCard ++ "հարյուր") e Pl ;
pot2as3 n = n ;
pot31 = mkNum "հազար" "հազարերորդ" Pl ;
pot3 n = scaleNum n.attr "հազար" Pl ;
pot3plus n m = plusNum (n.attr ++ "հազար") m Pl ;
pot3as4 n = n ;
pot3decimal n = decimalScale n "հազար" ;
pot41 = mkNum "միլիոն" "միլիոներորդ" Pl ;
pot4 n = scaleNum n.attr "միլիոն" Pl ;
pot4plus n m = plusNum (n.attr ++ "միլիոն") m Pl ;
pot4as5 n = n ;
pot4decimal n = decimalScale n "միլիոն" ;
pot51 = mkNum "միլիարդ" "միլիարդերորդ" Pl ;
pot5 n = scaleNum n.attr "միլիարդ" Pl ;
pot5plus n m = plusNum (n.attr ++ "միլիարդ") m Pl ;
pot5decimal n = decimalScale n "միլիարդ" ;
lincat Dig = {s : CardOrd => Str; n : Number} ;
lin
IDig d = d ** {tail = T1} ;
IIDig d ds = {
s = table {
NCard => glue (d.s ! NCard) (ds.s ! NCard) ;
NOrd => glue (glue (d.s ! NCard) (ds.s ! NCard)) "-րդ"
} ;
n = Pl ;
tail = inc ds.tail
} ;
D_0 = mkDig "0" ;
D_1 = mkDig1 ;
D_2 = mkDig "2" ;
D_3 = mkDig "3" ;
D_4 = mkDig "4" ;
D_5 = mkDig "5" ;
D_6 = mkDig "6" ;
D_7 = mkDig "7" ;
D_8 = mkDig "8" ;
D_9 = mkDig "9" ;
PosDecimal d = d ** {hasDot = False} ;
NegDecimal d = {
s = \\o => "-" ++ BIND ++ d.s ! o ;
n = Pl ;
hasDot = False
} ;
IFrac d i = {
s = \\o => d.s ! NCard ++
if_then_Str d.hasDot BIND (BIND ++ "." ++ BIND) ++
i.s ! o ;
n = Pl ;
hasDot = True
} ;
oper
LinNum : Type = {
s : CardOrd => Str ;
compoundOrd : Str ;
attr : Str ;
n : Number
} ;
mkNum : Str -> Str -> Number -> LinNum = \card,ord,n -> {
s = table {NCard => card; NOrd => ord} ;
compoundOrd = ord ;
attr = card ;
n = n
} ;
regNum : Str -> Number -> LinNum = \card,n ->
mkNum card (glue card "երորդ") n ;
mkDigit : Str -> Str -> Str -> Str ->
{s : DForm => CardOrd => Str; compoundOrd : DForm => Str} =
\unit,teen,ten,unitOrd -> {
s = table {
Unit => table {NCard => unit; NOrd => unitOrd} ;
Teen => table {NCard => teen; NOrd => glue teen "երորդ"} ;
Ten => table {NCard => ten; NOrd => glue ten "երորդ"}
} ;
compoundOrd = table {
Unit => unitOrd ;
Teen => glue teen "երորդ" ;
Ten => glue ten "երորդ"
}
} ;
scaleNum : Str -> Str -> Number -> LinNum = \prefix,scale,n ->
mkNum (prefix ++ scale) (prefix ++ glue scale "երորդ") n ;
plusNum : Str -> LinNum -> Number -> LinNum = \prefix,last,n -> {
s = table {
NCard => prefix ++ last.s ! NCard ;
NOrd => prefix ++ last.compoundOrd
} ;
compoundOrd = prefix ++ last.compoundOrd ;
attr = prefix ++ last.s ! NCard ;
n = n
} ;
decimalScale : Decimal -> Str -> LinNum = \decimal,scale ->
mkNum (decimal.s ! NCard ++ scale)
(decimal.s ! NCard ++ glue scale "երորդ") Pl ;
mkDig : Str -> {s : CardOrd => Str; n : Number} = \d -> {
s = table {NCard => d; NOrd => glue d "-րդ"} ;
n = Pl
} ;
mkDig1 : {s : CardOrd => Str; n : Number} = {
s = table {NCard => "1"; NOrd => "1-ին"} ;
n = Sg
} ;
}
+13 -5
View File
@@ -23,7 +23,7 @@ oper
_ + "չալ" => mkV002 form;
_ + "նալ" => mkV004 form;
_ + "ել" => mkV001 form;
_ => error "Cannot find an inflection rule"
_ => lin V (invarVerb form)
} ;
reg2V : Str -> Str -> V -- s Imperative_Jussive;Pl
@@ -212,7 +212,7 @@ oper
_ + "ի" => mkN003 form;
_ + "ե" => mkN006 form;
_ + "է" => mkN006 form;
_ => error "Cannot find an inflection rule"
_ => mkN007 form
} ;
reg2N : Str -> Str -> N -- s;Nom;Sg s;Dat;Sg
@@ -313,7 +313,7 @@ oper
_ + "ղմ" => mkA005 form;
_ + "տք" => mkA005 form;
_ + "իղ" => mkA006 form;
_ + "նչ" => mkA008 form;
_ + "ունչ"=>mkA008 form;
_ + "ոխ" => mkA005 form;
_ + "ղխ" => mkA005 form;
_ + "ղթ" => mkA005 form;
@@ -368,7 +368,7 @@ oper
_ + "ի" => mkA002 form;
_ + "ա" => mkA004 form;
_ + "ո" => mkA004 form;
_ => error "Cannot find an inflection rule"
_ => mkA001 form
} ;
reg2A : Str -> Str -> A -- s;Nom;Sg s;Nom;Pl
@@ -440,6 +440,14 @@ oper
mkN : Str -> Str -> N = reg2N -- s;Nom;Sg s;Dat;Sg
} ;
compoundN : A -> N -> N = \a,n -> lin N {
s = \\c,num => a.s ! Nom ! Sg ++ n.s ! c ! num ;
def_dat = \\num => a.s ! Dat ! num ++ n.def_dat ! num ;
def_nom = \\num => a.s ! Nom ! Sg ++ n.def_nom ! num ;
poss1 = \\c,num => a.s ! Nom ! Sg ++ n.poss1 ! c ! num ;
poss2 = \\c,num => a.s ! Nom ! Sg ++ n.poss2 ! c ! num
} ;
mkN2 = overload {
mkN2 : N -> N2 = \n -> lin N2 (n ** {c2 = noPrep}) ;
mkN2 : N -> Prep -> N2 = \n,p -> lin N2 (n ** {c2 = p}) ;
@@ -493,7 +501,7 @@ oper
mkPron : Str -> Number -> Person -> Pron = \s,n,p ->
lin Pron {
s = s ;
s = \\_ => s ;
empty = [] ;
a = {n = n; p = p}
} ;
+13 -1
View File
@@ -1,9 +1,21 @@
concrete PhraseHye of Phrase = CatHye ** {
concrete PhraseHye of Phrase = CatHye ** open ResHye in {
lin
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
UttS s = s ;
UttInterj i = i ;
UttNP np = {s = np.s ! Nom} ;
UttAdv adv = adv ;
UttCN cn = {s = cn.s ! Indef ! Nom ! Sg} ;
UttCard card = card ;
UttIAdv adv = adv ;
UttIP ip = ip ;
UttQS qs = qs ;
UttImpSg pol imp = {s = case pol.p of {Pos => imp.s; Neg => "մի" ++ imp.s}} ;
UttImpPl pol imp = {s = case pol.p of {Pos => imp.s; Neg => "մի" ++ imp.s}} ;
UttImpPol pol imp = {s = case pol.p of {Pos => imp.s; Neg => "մի" ++ imp.s}} ;
VocNP np = {s = np.s ! Nom} ;
PConjConj conj = conj ;
NoPConj = {s = []} ;
+21
View File
@@ -0,0 +1,21 @@
concrete QuestionHye of Question = CatHye ** open ResHye in {
lincat QVP = {s : Str} ;
lin
QuestCl cl = {s = cl.s ++ "՞"} ;
QuestVP ip vp = {s = ip.s ++ vp.s ++ "՞"} ;
QuestSlash ip slash = {s = ip.s ++ slash.s ++ "՞"} ;
QuestIAdv adv cl = {s = adv.s ++ cl.s ++ "՞"} ;
QuestIComp comp np = {s = comp.s ++ np.s ! Nom ++ "՞"} ;
IdetCN det cn = {s = det.s ++ cn.s ! Indef ! Nom ! Sg} ;
IdetIP det = {s = det.s} ;
AdvIP ip adv = {s = ip.s ++ adv.s} ;
IdetQuant quant num = {s = quant.s ++ num.s} ;
PrepIP prep ip = {s = case prep.isPre of {True=>prep.s++ip.s;False=>ip.s++prep.s}} ;
AdvIAdv iadv adv = {s = iadv.s ++ adv.s} ;
CompIAdv adv = adv ;
CompIP ip = ip ;
ComplSlashIP slash ip = {s = slash.s ++ ip.s} ;
AdvQVP vp adv = {s = vp.s ++ adv.s} ;
AddAdvQVP qvp adv = {s = qvp.s ++ adv.s} ;
QuestQVP ip qvp = {s = ip.s ++ qvp.s ++ "՞"} ;
}
+11
View File
@@ -0,0 +1,11 @@
concrete RelativeHye of Relative = CatHye ** open ResHye in {
lin
RelCl cl = {s = "որը" ++ cl.s} ;
RelVP rp vp = {s = rp.s ++ vp.s} ;
RelSlash rp slash = {s = rp.s ++ slash.s} ;
IdRP = {s = "որը"} ;
FunRP prep np rp = {s = case prep.isPre of {
True=>prep.s++np.s!prep.c++rp.s;
False=>np.s!prep.c++prep.s++rp.s
}} ;
}
+18 -3
View File
@@ -1,9 +1,19 @@
resource ResHye = ParamX ** {
resource ResHye = ParamX ** open Prelude in {
param CardOrd = NCard | NOrd ;
param Aspect = Non_Past | Perfect ;
param Case = Nom | Dat | Ablat | Instr | Loc ;
param PartType = Resultative | Subject ;
oper Verb = {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} ; -- 898
oper invarVerb : Str -> Verb = \s -> {
s=s; causative=s;
conditional=table {_ => table {_ => table {_ => s}}};
converb={imperfective=s;futCon1=s;futCon2=s;negative=s;perfective=s;simultaneous=s};
imperative=table {_ => s}; passive=s;
past=table {_ => table {_ => s}};
participle=table {_ => s};
subjunctive=table {_ => table {_ => table {_ => s}}}
} ;
oper mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
\f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30,f31,f32,f33,f34,f35,f36,f37,f38,f39,f40,f41,f42,f43 ->
{ s = f1 ;
@@ -103,6 +113,11 @@ oper mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_
param Species = Indef | Def | Poss Person ;
oper Agr = {n : Number; p : Person} ;
oper Noun = {s: Case => Number => Str; def_dat: Number => Str; def_nom: Number => Str; poss1: Case => Number => Str; poss2: Case => Number => Str} ; -- 4880
oper invarNoun : Str -> Noun = \s -> {
s=table {_ => table {_ => s}};
def_dat=table {_ => s}; def_nom=table {_ => s};
poss1=table {_ => table {_ => s}}; poss2=table {_ => table {_ => s}}
} ;
oper mkNoun : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Noun =
\f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30,f31,f32,f33,f34 ->
{ s = table {
@@ -262,7 +277,7 @@ oper mkAdj : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,
} ;
oper Compl = {s : Str; c : Case} ;
oper noPrep : Compl = {s=""; c=Dat} ;
oper Compl = {s : Str; c : Case; isPre : Bool} ;
oper noPrep : Compl = {s=""; c=Nom; isPre=False} ;
}
+55 -4
View File
@@ -1,6 +1,20 @@
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;
oper negAux : Agr -> Str = \a -> case <a.p,a.n> of {
<P1,Sg> => "չեմ"; <P2,Sg> => "չես"; <P3,Sg> => "չի";
<P1,Pl> => "չենք"; <P2,Pl> => "չեք"; <P3,Pl> => "չեն"
} ;
lin PredVP np vp = {s = np.s ! Nom ++ vp.converb.imperfective ++
case <np.a.p,np.a.n> of {
<P1,Sg> => "եմ"; <P2,Sg> => "ես"; <P3,Sg> => "է";
<P1,Pl> => "ենք"; <P2,Pl> => "եք"; <P3,Pl> => "են"
};
negative = table {
Pres => np.s ! Nom ++ negAux np.a ++ vp.converb.imperfective;
Past => np.s ! Nom ++ "չ" ++ BIND ++ vp.past ! np.a.p ! np.a.n;
Fut => np.s ! Nom ++ negAux np.a ++ vp.converb.futCon1;
Cond => np.s ! Nom ++ "չ" ++ BIND ++ vp.conditional ! Non_Past ! np.a.p ! np.a.n
};
conditional = \\a,_ => np.s ! Nom ++ vp.conditional ! a ! np.a.p ! np.a.n;
converb = {imperfective = np.s ! Nom ++ vp.converb.imperfective;
futCon1 = np.s ! Nom ++ vp.converb.futCon1;
futCon2 = np.s ! Nom ++ vp.converb.futCon2;
@@ -8,7 +22,44 @@ concrete SentenceHye of Sentence = CatHye ** open Prelude,ResHye in {
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;
past = \\_,_ => np.s ! Nom ++ vp.past ! np.a.p ! np.a.n;
participle = \\p => np.s ! Nom ++ vp.participle ! p;
subjunctive = \\a,n => np.s ! Nom ++ vp.subjunctive ! a ! P3 ! n} ;
subjunctive = \\a,_ => np.s ! Nom ++ vp.subjunctive ! a ! np.a.p ! np.a.n} ;
lin PredSCVP sc vp = {s = sc.s ++ vp.s;
negative=table {_ => sc.s ++ "չ" ++ BIND ++ vp.s};
conditional=\\a,n => sc.s ++ vp.conditional ! a ! P3 ! n;
converb={imperfective=sc.s ++ vp.converb.imperfective; futCon1=sc.s ++ vp.converb.futCon1;
futCon2=sc.s ++ vp.converb.futCon2; negative=sc.s ++ vp.converb.negative;
perfective=sc.s ++ vp.converb.perfective; simultaneous=sc.s ++ vp.converb.simultaneous};
passive=sc.s ++ vp.passive; past=\\p,n => sc.s ++ vp.past ! p ! n;
participle=\\p => sc.s ++ vp.participle ! p;
subjunctive=\\a,n => sc.s ++ vp.subjunctive ! a ! P3 ! n} ;
lin UseCl temp pol cl = {s = case pol.p of {
Neg => cl.negative ! temp.t;
Pos => case <temp.t,temp.a> of {
<Pres,Simul> => cl.s;
<Pres,Anter> => cl.converb.perfective;
<Past,Simul> => cl.past ! P3 ! Sg;
<Past,Anter> => cl.converb.perfective;
<Fut,Simul> => cl.conditional ! Non_Past ! Sg;
<Fut,Anter> => cl.conditional ! Perfect ! Sg;
<Cond,Simul> => cl.conditional ! Non_Past ! Sg;
<Cond,Anter> => cl.conditional ! Perfect ! Sg
}
}} ;
lin UseQCl temp pol qcl = {s = case pol.p of {Pos => qcl.s; Neg => "չ" ++ qcl.s}} ;
lin UseRCl temp pol rcl = {s = case pol.p of {Pos => rcl.s; Neg => "չ" ++ rcl.s}} ;
lin UseSlash temp pol slash = {s = case pol.p of {Pos => slash.s; Neg => "չ" ++ slash.s}} ;
lin AdvS adv s = {s = adv.s ++ s.s} ;
lin ExtAdvS adv s = {s = adv.s ++ "," ++ s.s} ;
lin SSubjS s1 subj s2 = {s = s1.s ++ subj.s ++ s2.s} ;
lin RelS s rs = {s = s.s ++ "," ++ rs.s} ;
lin ImpVP vp = {s = vp.imperative ! Sg} ;
lin AdvImp adv imp = {s = adv.s ++ imp.s} ;
lin EmbedS s = s ;
lin EmbedQS qs = qs ;
lin SlashVP np vp = {s = np.s ! Nom ++ vp.s} ;
lin AdvSlash slash adv = {s = slash.s ++ adv.s} ;
lin SlashPrep cl prep = {s = cl.s ++ prep.s} ;
lin SlashVS np vs slash = {s = np.s ! Nom ++ vs.s ++ slash.s} ;
}
+101 -7
View File
@@ -1,8 +1,102 @@
concrete StructuralHye of Structural = CatHye ** open ResHye, ParadigmsHye in {
lin i_Pron = mkPron "ես" Sg P1 ;
lin youSg_Pron = mkPron "դու" Sg P2 ;
lin he_Pron, she_Pron, it_Pron = mkPron "նա" Sg P3 ;
lin we_Pron = mkPron "մեք" Pl P1 ;
lin youPl_Pron = mkPron "դուք" Pl P2 ;
lin they_Pron = mkPron "նոքա" Pl P3 ;
concrete StructuralHye of Structural = CatHye ** open Prelude, ResHye, ParadigmsHye in {
oper
postPrep : Str -> Case -> Prep = \s,c -> lin Prep {s=s;c=c;isPre=False} ;
simpleNP : Str -> Number -> Person -> NP = \s,n,p -> lin NP {s=\\_ => s;a={n=n;p=p}} ;
casePron : (nom,dat,ablat,instr,loc,poss : Str) -> Number -> Person -> Pron =
\nom,dat,ablat,instr,loc,poss,n,p -> lin Pron {
s=table {Nom=>nom;Dat=>dat;Ablat=>ablat;Instr=>instr;Loc=>loc};
empty=poss;a={n=n;p=p}
} ;
lin i_Pron = casePron "ես" "ինձ" "ինձնից" "ինձնով" "ինձ մոտ" "իմ" Sg P1 ;
lin youSg_Pron = casePron "դու" "քեզ" "քեզնից" "քեզնով" "քեզ մոտ" "քո" Sg P2 ;
lin he_Pron, she_Pron, it_Pron = casePron "նա" "նրան" "նրանից" "նրանով" "նրա մոտ" "նրա" Sg P3 ;
lin we_Pron = casePron "մենք" "մեզ" "մեզնից" "մեզնով" "մեզ մոտ" "մեր" Pl P1 ;
lin youPl_Pron = casePron "դուք" "ձեզ" "ձեզնից" "ձեզնով" "ձեզ մոտ" "ձեր" Pl P2 ;
lin youPol_Pron = casePron "Դուք" "Ձեզ" "Ձեզնից" "Ձեզնով" "Ձեզ մոտ" "Ձեր" Pl P2 ;
lin they_Pron = casePron "նրանք" "նրանց" "նրանցից" "նրանցով" "նրանց մոտ" "նրանց" Pl P3 ;
lin and_Conj = mkConj "և" ;
lin or_Conj = mkConj "կամ" ;
lin both7and_DConj = mkConj "և՛" ;
lin either7or_DConj = mkConj "կամ" ;
lin if_then_Conj = mkConj "ապա" ;
lin but_PConj = mkPConj "բայց" ;
lin therefore_PConj = mkPConj "հետևաբար" ;
lin otherwise_PConj = mkPConj "այլապես" ;
lin in_Prep = postPrep [] Loc ;
lin on_Prep = postPrep "վրա" Dat ;
lin to_Prep = postPrep [] Dat ;
lin from_Prep = postPrep [] Ablat ;
lin with_Prep = postPrep [] Instr ;
lin without_Prep = postPrep "առանց" Dat ;
lin for_Prep = postPrep "համար" Dat ;
lin during_Prep = postPrep "ընթացքում" Dat ;
lin after_Prep = postPrep "հետո" Ablat ;
lin before_Prep = postPrep "առաջ" Ablat ;
lin under_Prep = postPrep "տակ" Dat ;
lin above_Prep = postPrep "վերևում" Dat ;
lin behind_Prep = postPrep "հետևում" Dat ;
lin between_Prep = postPrep "միջև" Dat ;
lin through_Prep = postPrep "միջով" Dat ;
lin by8agent_Prep = postPrep "կողմից" Dat ;
lin by8means_Prep = postPrep [] Instr ;
lin possess_Prep = postPrep [] Dat ;
lin part_Prep = postPrep [] Ablat ;
lin except_Prep = postPrep "բացի" Ablat ;
lin this_Quant = mkQuant "այս" ;
lin that_Quant = mkQuant "այդ" ;
lin no_Quant = mkQuant "ոչ մի" ;
lin every_Det = mkDet "ամեն" Sg ;
lin few_Det = mkDet "քիչ" Pl ;
lin many_Det = mkDet "շատ" Pl ;
lin much_Det = mkDet "շատ" Sg ;
lin someSg_Det = mkDet "որոշ" Sg ;
lin somePl_Det = mkDet "որոշ" Pl ;
lin all_Predet = mkPredet "բոլոր" ;
lin only_Predet = mkPredet "միայն" ;
lin most_Predet = mkPredet "մեծ մասը" ;
lin not_Predet = mkPredet "ոչ" ;
lin very_AdA = mkAdA "շատ" ;
lin too_AdA = mkAdA "չափազանց" ;
lin almost_AdA = mkAdA "գրեթե" ;
lin almost_AdN = mkAdN "գրեթե" ;
lin at_least_AdN = mkAdN "առնվազն" ;
lin at_most_AdN = mkAdN "առավելագույնը" ;
lin here_Adv = mkAdv "այստեղ" ;
lin there_Adv = mkAdv "այնտեղ" ;
lin everywhere_Adv = mkAdv "ամենուր" ;
lin somewhere_Adv = mkAdv "ինչ-որ տեղ" ;
lin always_AdV = mkAdV "միշտ" ;
lin quite_Adv = mkAdv "բավականին" ;
lin when_Subj = mkSubj "երբ" ;
lin if_Subj = mkSubj "եթե" ;
lin because_Subj = mkSubj "որովհետև" ;
lin although_Subj = mkSubj "թեև" ;
lin that_Subj = mkSubj "որ" ;
lin whatSg_IP = mkIP "ինչ" ;
lin whatPl_IP = mkIP "ինչեր" ;
lin whoSg_IP = mkIP "ով" ;
lin whoPl_IP = mkIP "ովքեր" ;
lin which_IQuant = mkIQuant "որ" ;
lin how_IAdv = mkIAdv "ինչպես" ;
lin when_IAdv = mkIAdv "երբ" ;
lin where_IAdv = mkIAdv "որտեղ" ;
lin why_IAdv = mkIAdv "ինչու" ;
lin how8many_IDet = mkIDet "քանի" ;
lin how8much_IAdv = mkIAdv "որքան" ;
lin as_CAdv = mkCAdv "այնքան" ;
lin more_CAdv = mkCAdv "ավելի" ;
lin less_CAdv = mkCAdv "պակաս" ;
lin can_VV, can8know_VV = mkVV (mkV "կարողանալ") ;
lin must_VV = mkVV (mkV "պարտավորվել") ;
lin want_VV = mkVV (mkV "ցանկանալ") ;
lin have_V2 = mkV2 (mkV "ունենալ") ;
lin everybody_NP = simpleNP "բոլորը" Pl P3 ;
lin everything_NP = simpleNP "ամեն ինչ" Sg P3 ;
lin somebody_NP = simpleNP "ինչ-որ մեկը" Sg P3 ;
lin something_NP = simpleNP "ինչ-որ բան" Sg P3 ;
lin nobody_NP = simpleNP "ոչ ոք" Sg P3 ;
lin nothing_NP = simpleNP "ոչինչ" Sg P3 ;
lin please_Voc = mkVoc "խնդրում եմ" ;
lin yes_Utt = {s="այո"} ;
lin no_Utt = {s="ոչ"} ;
}
+75 -19
View File
@@ -1,4 +1,35 @@
concrete VerbHye of Verb = CatHye ** open Prelude,ResHye in {
concrete VerbHye of Verb = CatHye ** open Prelude, ResHye, ParadigmsHye in {
oper
compl : Compl -> NP -> Str = \c,np -> case c.isPre of {
True => c.s ++ np.s ! c.c;
False => np.s ! c.c ++ c.s
} ;
toVP : Verb -> VP = \v -> lin VP {
s=v.s; conditional=v.conditional; converb=v.converb; imperative=v.imperative;
passive=v.passive; past=v.past; participle=v.participle; subjunctive=v.subjunctive
} ;
appendVP : VP -> Str -> VP = \v,x -> lin VP {
s=v.s ++ x;
conditional=\\a,p,n => v.conditional ! a ! p ! n ++ x;
converb={imperfective=v.converb.imperfective ++ x; futCon1=v.converb.futCon1 ++ x;
futCon2=v.converb.futCon2 ++ x; negative=v.converb.negative ++ x;
perfective=v.converb.perfective ++ x; simultaneous=v.converb.simultaneous ++ x};
imperative=\\n => v.imperative ! n ++ x; passive=v.passive ++ x;
past=\\p,n => v.past ! p ! n ++ x;
participle=\\p => v.participle ! p ++ x;
subjunctive=\\a,p,n => v.subjunctive ! a ! p ! n ++ x
} ;
prependVP : Str -> VP -> VP = \x,v -> lin VP {
s=x ++ v.s;
conditional=\\a,p,n => x ++ v.conditional ! a ! p ! n;
converb={imperfective=x ++ v.converb.imperfective; futCon1=x ++ v.converb.futCon1;
futCon2=x ++ v.converb.futCon2; negative=x ++ v.converb.negative;
perfective=x ++ v.converb.perfective; simultaneous=x ++ v.converb.simultaneous};
imperative=\\n => x ++ v.imperative ! n; passive=x ++ v.passive;
past=\\p,n => x ++ v.past ! p ! n;
participle=\\p => x ++ v.participle ! p;
subjunctive=\\a,p,n => x ++ v.subjunctive ! a ! p ! n
} ;
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;
@@ -12,24 +43,49 @@ concrete VerbHye of Verb = CatHye ** open Prelude,ResHye in {
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 ComplSlash vp np = {s = compl vp.c2 np ++ vp.s;
conditional = \\a,p,n => compl vp.c2 np
++ vp.conditional ! a ! p ! n;
converb = {imperfective = compl vp.c2 np
++ vp.converb.imperfective;
futCon1 = compl vp.c2 np ++ vp.converb.futCon1;
futCon2 = compl vp.c2 np ++ vp.converb.futCon2;
negative = compl vp.c2 np ++ vp.converb.negative;
perfective = compl vp.c2 np
++ vp.converb.perfective;
simultaneous = compl vp.c2 np
++ vp.converb.simultaneous};
imperative = \\n => compl vp.c2 np ++ vp.imperative ! n;
passive = compl vp.c2 np ++ vp.passive;
past = \\p,n => compl vp.c2 np ++ vp.past ! p ! n;
participle = \\p => compl vp.c2 np ++ vp.participle ! p;
subjunctive = \\a,p,n => compl vp.c2 np
++ vp.subjunctive ! a ! p ! n} ;
lin SlashV2a v = v ;
lin UseV v = v ;
lin ComplVS v s = appendVP (toVP v) s.s ;
lin ComplVQ v qs = appendVP (toVP v) qs.s ;
lin ComplVA v ap = appendVP (toVP v) (ap.s ! Indef ! Nom ! Sg) ;
lin Slash2V3 v np = lin VPSlash (v ** {
s = compl v.c2 np ++ v.s; c2 = v.c3
}) ;
lin Slash3V3 v np = lin VPSlash (v ** {
s = compl v.c3 np ++ v.s; c2 = v.c2
}) ;
lin SlashV2S v s = lin VPSlash (v ** {s = v.s ++ s.s; c2=v.c2}) ;
lin SlashV2Q v qs = lin VPSlash (v ** {s = v.s ++ qs.s; c2=v.c2}) ;
lin SlashV2A v ap = lin VPSlash (v ** {
s = v.s ++ ap.s ! Indef ! Nom ! Sg; c2=v.c2
}) ;
lin UseComp comp = prependVP comp.s (toVP (mkV "լինել")) ;
lin UseCopula = toVP (mkV "լինել") ;
lin ExtAdvVP vp adv = appendVP vp ("," ++ adv.s) ;
lin AdVVP adv vp = prependVP adv.s vp ;
lin AdvVPSlash vp adv = lin VPSlash (vp ** {s = vp.s ++ adv.s}) ;
lin AdVVPSlash adv vp = lin VPSlash (vp ** {s = adv.s ++ vp.s}) ;
lin VPSlashPrep vp prep = lin VPSlash (vp ** {causative=vp.s;c2=prep}) ;
lin CompAP ap = {s = ap.s ! Indef ! Nom ! Sg} ;
lin CompNP np = {s = np.s ! Nom} ;
lin CompAdv adv = adv ;
lin CompCN cn = {s = cn.s ! Indef ! Nom ! Sg} ;
}