Extensions by Codex

This commit is contained in:
Krasimir Angelov
2026-09-29 16:28:48 +02:00
parent dd7fdb137e
commit b4d6caeb1d
17 changed files with 296 additions and 10 deletions
+8
View File
@@ -23,4 +23,12 @@ concrete AdjectiveSlv of Adjective = CatSlv ** open ResSlv in {
} ; } ;
AdvAP ap adv = {s = \\spec,g,c,n => ap.s ! spec ! g ! c ! n ++ adv.s} ; AdvAP ap adv = {s = \\spec,g,c,n => ap.s ! spec ! g ! c ! n ++ adv.s} ;
ComplA2 a np = {
s = \\spec,g,c,n => a.s ! APosit (agender2gender g) n c ++ a.c.s ++ np.s ! a.c.c
} ;
UseA2 a = {s = \\_,g,c,n => a.s ! APosit (agender2gender g) n c} ;
SentAP ap sc = ap ** {s = \\sp,g,c,n => ap.s ! sp ! g ! c ! n ++ sc.s} ;
ComparA a np = {
s = \\_,g,c,n => a.s ! ACompar (agender2gender g) n c ++ "kot" ++ np.s ! Nom
} ;
} }
+4
View File
@@ -2,5 +2,9 @@ concrete AdverbSlv of Adverb = CatSlv ** open ResSlv in {
lin lin
PrepNP prep np = {s = prep.s ++ np.s ! prep.c} ; PrepNP prep np = {s = prep.s ++ np.s ! prep.c} ;
PositAdvAdj a = {s = a.s ! APosit Neut Sg Nom} ;
PositAdAAdj a = {s = a.s ! APosit Neut Sg Nom} ;
AdAdv ada adv = {s = ada.s ++ adv.s} ;
SubjS subj s = {s = subj.s ++ s.s} ;
} }
+11
View File
@@ -3,12 +3,19 @@ concrete CatSlv of Cat = CommonX ** open ResSlv, (P=ParamX), Prelude in {
lincat lincat
-- Sentence -- Sentence
Cl = {s : P.Tense => P.Anteriority => P.Polarity => Str} ; Cl = {s : P.Tense => P.Anteriority => P.Polarity => Str} ;
S, QS, SSlash = {s : Str} ;
Imp = {s : P.Polarity => Gender => Number => Str} ; Imp = {s : P.Polarity => Gender => Number => Str} ;
ClSlash = {s : P.Tense => P.Anteriority => P.Polarity => Str ; c2 : Prep} ; ----AR ClSlash = {s : P.Tense => P.Anteriority => P.Polarity => Str ; c2 : Prep} ; ----AR
-- Question -- Question
QCl = {s : P.Tense => P.Anteriority => P.Polarity => Str} ; QCl = {s : P.Tense => P.Anteriority => P.Polarity => Str} ;
IP = {s : Case => Str; a : Agr} ; ----AR IP = {s : Case => Str; a : Agr} ; ----AR
IComp = {s : Str} ;
IDet, IQuant = {s : Str} ;
RCl = {s : Agr => P.Tense => P.Anteriority => P.Polarity => Str} ;
RS = {s : Agr => Str} ;
RP = {s : AGender => Case => Number => Str} ;
-- Verb -- Verb
VP = ResSlv.VP ; VP = ResSlv.VP ;
@@ -25,9 +32,13 @@ lincat
Pron = {s : Case => Str; poss : Gender => Case => Number => Str; a : Agr} ; Pron = {s : Case => Str; poss : Gender => Case => Number => Str; a : Agr} ;
Det = {s : Gender => Case => Str; spec : Species; n : NumAgr} ; Det = {s : Gender => Case => Str; spec : Species; n : NumAgr} ;
Predet = {s : Str} ;
Num = {s : Gender => Case => Str ; n : NumAgr} ; Num = {s : Gender => Case => Str ; n : NumAgr} ;
Card = {s : Gender => Case => Str ; n : NumAgr} ; Card = {s : Gender => Case => Str ; n : NumAgr} ;
Quant = {s : Gender => Case => Number => Str; spec : Species} ; Quant = {s : Gender => Case => Number => Str; spec : Species} ;
Ord = {s : Gender => Case => Number => Str} ;
DAP = {s : Species => AGender => Case => Number => Str; n : NumAgr} ;
ACard = {s : Str} ;
-- Numeral -- Numeral
Numeral = {s : Gender => Case => Str ; n : NumAgr} ; Numeral = {s : Gender => Case => Str ; n : NumAgr} ;
+7
View File
@@ -42,10 +42,17 @@ concrete ConjunctionSlv of Conjunction =
s2 = xs.s2 ; s2 = xs.s2 ;
g = xs.g g = xs.g
} ; } ;
ConjS conj xs = {s=xs.s1++conj.s++xs.s2} ;
BaseS a b = {s1=a.s;s2=b.s} ;
ConsS a xs = {s1=a.s++","++xs.s1;s2=xs.s2} ;
ConjAdv conj xs = {s=xs.s1++conj.s++xs.s2} ;
BaseAdv a b = {s1=a.s;s2=b.s} ;
ConsAdv a xs = {s1=a.s++","++xs.s1;s2=xs.s2} ;
lincat lincat
[NP] = {s1,s2 : Case => Str; a : Agr} ; [NP] = {s1,s2 : Case => Str; a : Agr} ;
[AP] = {s1,s2 : Species => AGender => Case => Number => Str} ; [AP] = {s1,s2 : Species => AGender => Case => Number => Str} ;
[CN] = {s1,s2 : Species => Case => Number => Str; g : AGender} ; [CN] = {s1,s2 : Species => Case => Number => Str; g : AGender} ;
[S], [Adv] = {s1,s2 : Str} ;
} }
+10 -1
View File
@@ -1,5 +1,5 @@
concrete ConstructionSlv of Construction = CatSlv ** concrete ConstructionSlv of Construction = CatSlv **
open ParadigmsSlv, ResSlv in { open ParadigmsSlv, ResSlv, Prelude in {
flags flags
coding=utf8; coding=utf8;
@@ -7,10 +7,19 @@ flags
lincat lincat
Weekday = N ; Weekday = N ;
Month = N ; Month = N ;
Year, Monthday = {s : Str} ;
lin lin
weekdayN w = w ; weekdayN w = w ;
monthN m = m ; monthN m = m ;
ready_VP = {s=copula;s2=\\a=>(mkA "pripravljen").s!APosit a.g a.n Nom;isCop=True;refl=[]} ;
has_age_VP card = {s=copula;s2=\\a=>card.s!Masc!Nom++"let star";isCop=True;refl=[]} ;
yearAdv y = {s="leta"++y.s} ;
intYear i = {s=i.s} ;
intMonthday i = {s=i.s} ;
cup_of_CN np = {s=\\_,c,n=>(mkN "skodelica").s!c!n++np.s!Gen;g=AFem} ;
n_units_AP card unit adj = {s=\\_,g,c,n=>card.s!(agender2gender g)!c++unit.s!Indef!Gen!Pl++adj.s!APosit(agender2gender g)n c} ;
n_units_of_NP card unit np = {s=\\c=>card.s!Masc!c++unit.s!Indef!Gen!Pl++np.s!Gen;a=np.a;isPron=False} ;
lin lin
monday_Weekday = mkN "ponedeljek" "ponedeljka" "ponedeljku" "ponedeljek" "ponedeljku" "ponedeljkom" "ponedeljka" "ponedeljkov" "ponedeljkoma" "ponedeljka" "ponedeljkih" "ponedeljkoma" "ponedeljki" "ponedeljkov" "ponedeljkom" "ponedeljke" "ponedeljkih" "ponedeljki" masculine ; monday_Weekday = mkN "ponedeljek" "ponedeljka" "ponedeljku" "ponedeljek" "ponedeljku" "ponedeljkom" "ponedeljka" "ponedeljkov" "ponedeljkoma" "ponedeljka" "ponedeljkih" "ponedeljkoma" "ponedeljki" "ponedeljkov" "ponedeljkom" "ponedeljke" "ponedeljkih" "ponedeljki" masculine ;
+91 -1
View File
@@ -1,9 +1,99 @@
--# -path=.:../abstract:../common:prelude --# -path=.:../abstract:../common:prelude
concrete ExtendSlv of Extend = CatSlv ** open ResSlv, ParadigmsSlv, GrammarSlv in { concrete ExtendSlv of Extend = CatSlv ** open ResSlv, ParadigmsSlv, GrammarSlv, (P=ParamX), Prelude in {
lincat
VPS = {s : Agr => Str} ;
[VPS] = {s1,s2 : Agr => Str} ;
VPI = {s : Agr => Str} ;
[VPI] = {s1,s2 : Agr => Str} ;
VPS2 = VPSlash ;
[VPS2] = {s1,s2 : Agr => Str; c2 : Prep} ;
VPI2 = VPSlash ;
[VPI2] = {s1,s2 : Agr => Str; c2 : Prep} ;
[Comp] = {s1,s2 : Agr => Str} ;
[Imp] = {s1,s2 : P.Polarity => Gender => Number => Str} ;
RNP = {s : Agr => Case => Str} ;
RNPList = {s1,s2 : Agr => Case => Str} ;
lin lin
UttAdV adv = {s = adv.s} ; UttAdV adv = {s = adv.s} ;
GenModNP num np cn = {
s = \\c => np.s ! Gen ++ cn.s ! Indef ! c ! (numAgr2num ! num.n);
a={g=agender2gender cn.g;n=numAgr2num ! num.n;p=P3}; isPron=False
} ;
CompBareCN cn = {s = \\a => cn.s ! Indef ! Nom ! a.n} ;
EmptyRelSlash cl = {s=\\_,t,a,p => cl.s!t!a!p} ;
MkVPS t p vp = {s = \\a => predV False vp.isCop vp.refl vp.s ! t.t ! p.p ! a ++ vp.s2 ! a} ;
BaseVPS x y = {s1=x.s;s2=y.s} ;
ConsVPS x xs = {s1=\\a => x.s ! a ++ "," ++ xs.s1 ! a;s2=xs.s2} ;
ConjVPS conj xs = {s=\\a => xs.s1 ! a ++ conj.s ++ xs.s2 ! a} ;
PredVPS np vps = {s=np.s ! Nom ++ vps.s ! np.a} ;
SQuestVPS np vps = {s=np.s ! Nom ++ vps.s ! np.a} ;
QuestVPS ip vps = {s=ip.s ! Nom ++ vps.s ! ip.a} ;
RelVPS rp vps = {s=\\a => rp.s ! inanimateGender a.g ! Nom ! a.n ++ vps.s ! a} ;
MkVPI vp = {s=\\a => vp.s ! P.Pos ! VInf ++ vp.refl ++ vp.s2 ! a} ;
BaseVPI x y = {s1=x.s;s2=y.s} ;
ConsVPI x xs = {s1=\\a => x.s ! a ++ "," ++ xs.s1 ! a;s2=xs.s2} ;
ConjVPI conj xs = {s=\\a => xs.s1 ! a ++ conj.s ++ xs.s2 ! a} ;
ComplVPIVV vv vpi = {
s=\\p,vf => ne ! p ++ vv.s ! vf;s2=\\a => vpi.s ! a;isCop=False;refl=[]
} ;
PresPartAP vp = {s=\\_,g,c,n => vp.s ! P.Pos ! VPastPart (agender2gender g) n ++ vp.s2 ! {g=agender2gender g;n=n;p=P3}} ;
PastPartAP vp = {s=\\_,g,_,n => vp.s ! P.Pos ! VPastPart (agender2gender g) n ++ vp.s2 ! {g=agender2gender g;n=n;p=P3}} ;
PastPartAgentAP vp np = {s=\\_,g,_,n => vp.s ! P.Pos ! VPastPart (agender2gender g) n ++ vp.s2 ! {g=agender2gender g;n=n;p=P3} ++ "od" ++ np.s ! Gen} ;
PassVPSlash vp = {s=copula;s2=\\a => vp.s ! P.Pos ! VPastPart a.g a.n ++ vp.s2 ! a;isCop=True;refl=[]} ;
PassAgentVPSlash vp np = {s=copula;s2=\\a => vp.s ! P.Pos ! VPastPart a.g a.n ++ vp.s2 ! a ++ "od" ++ np.s ! Gen;isCop=True;refl=[]} ;
ProgrVPSlash vp = vp ;
ComplBareVS v s = {s=\\p,vf => ne ! p ++ v.s ! vf;s2=\\_ => v.p ++ s.s;isCop=False;refl=v.refl} ;
ComplSlashPartLast vp np = ComplSlash vp np ;
UttVPShort vp = {s=vp.s ! P.Pos ! VImper2 Sg ++ vp.s2 ! {g=Masc;n=Sg;p=P2}} ;
CompoundN a b = b ** {s=\\c,n => b.s ! c ! n ++ a.s ! Gen ! Sg} ;
CompoundAP n a = {s=\\_,g,c,num => n.s ! Instr ! Sg ++ a.s ! APosit (agender2gender g) num c} ;
GerundCN vp = {s=\\_,_,_ => vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Neut;n=Sg;p=P3};g=ANeut} ;
GerundNP vp = {s=\\_ => vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Neut;n=Sg;p=P3};a={g=Neut;n=Sg;p=P3};isPron=False} ;
GerundAdv vp = {s=vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Neut;n=Sg;p=P3}} ;
ByVP vp = {s="z" ++ vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Neut;n=Sg;p=P3}} ;
InOrderToVP vp = {s="da bi" ++ vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Neut;n=Sg;p=P3}} ;
ApposNP a b = a ** {s=\\c => a.s ! c ++ "," ++ b.s ! c} ;
PositAdVAdj a = {s=a.s ! APosit Neut Sg Nom} ;
ReflPron = {s=\\_,c => reflexive ! c} ;
ReflPoss num cn = {s=\\a,c => (mkA "svoj").s ! APosit a.g (numAgr2num ! num.n) c ++ cn.s ! Indef ! c ! (numAgr2num ! num.n)} ;
PredetRNP pred r = {s=\\a,c => pred.s ++ r.s ! a ! c} ;
AdvRNP np prep r = {s=\\a,c => np.s ! c ++ prep.s ++ r.s ! a ! prep.c} ;
AdvRVP vp prep r = vp ** {s2=\\a => vp.s2 ! a ++ prep.s ++ r.s ! a ! prep.c} ;
AdvRAP ap prep r = ap ** {s=\\sp,g,c,n => ap.s ! sp ! g ! c ! n ++ prep.s ++ r.s ! {g=agender2gender g;n=n;p=P3} ! prep.c} ;
PossPronRNP pron num cn r = {
s=\\c => pron.poss ! agender2gender cn.g ! c ! (numAgr2num ! num.n) ++ cn.s ! Indef ! c ! (numAgr2num ! num.n) ++ r.s ! pron.a ! Gen;
a={g=agender2gender cn.g;n=numAgr2num ! num.n;p=P3};isPron=False
} ;
Base_rr_RNP a b = {s1=a.s;s2=b.s} ;
Base_nr_RNP a b = {s1=\\_,c=>a.s!c;s2=b.s} ;
Base_rn_RNP a b = {s1=a.s;s2=\\_,c=>b.s!c} ;
Cons_rr_RNP a xs = {s1=\\x,c=>a.s!x!c++","++xs.s1!x!c;s2=xs.s2} ;
Cons_nr_RNP a xs = {s1=\\x,c=>a.s!c++","++xs.s1!x!c;s2=xs.s2} ;
ConjRNP conj xs = {s=\\a,c => xs.s1!a!c ++ conj.s ++ xs.s2!a!c} ;
UseDAP dap = {s=\\c=>dap.s!Indef!(AMasc Inanimate)!c!(numAgr2num!dap.n);a={g=Masc;n=numAgr2num!dap.n;p=P3};isPron=False} ;
UseDAPMasc dap = UseDAP dap ;
UseDAPFem dap = {s=\\c=>dap.s!Indef!AFem!c!(numAgr2num!dap.n);a={g=Fem;n=numAgr2num!dap.n;p=P3};isPron=False} ;
CompS s = {s=\\_=>s.s} ;
CompQS s = {s=\\_=>s.s} ;
CompVP ant pol vp = {s=\\a=>vp.s!pol.p!VInf++vp.s2!a} ;
ConjImp conj xs = {s=\\p,g,n=>xs.s1!p!g!n++conj.s++xs.s2!p!g!n} ;
BaseImp a b = {s1=a.s;s2=b.s} ;
ConsImp a xs = {s1=\\p,g,n=>a.s!p!g!n++","++xs.s1!p!g!n;s2=xs.s2} ;
ConjComp conj xs = {s=\\a=>xs.s1!a++conj.s++xs.s2!a} ;
BaseComp a b = {s1=a.s;s2=b.s} ;
ConsComp a xs = {s1=\\x=>a.s!x++","++xs.s1!x;s2=xs.s2} ;
iFem_Pron = mkPron "jàz" "méne" "méne" "méni" "méni" ("menój"|"máno") iFem_Pron = mkPron "jàz" "méne" "méne" "méni" "méni" ("menój"|"máno")
"mój" "mòjega" "mòjemu" ("mòj"|"mòjega") "mòjem" "mòjim" "mój" "mòjega" "mòjemu" ("mòj"|"mòjega") "mòjem" "mòjim"
"mòja" "mòjih" "mòjima" "mòja" "mòjih" "mòjima" "mòja" "mòjih" "mòjima" "mòja" "mòjih" "mòjima"
+1 -1
View File
@@ -8,7 +8,7 @@ concrete GrammarSlv of Grammar =
NumeralSlv, NumeralSlv,
SentenceSlv, SentenceSlv,
QuestionSlv, QuestionSlv,
{- RelativeSlv,-} RelativeSlv,
ConjunctionSlv, ConjunctionSlv,
PhraseSlv, PhraseSlv,
TextX - [Pol,PPos,PNeg], TextX - [Pol,PPos,PNeg],
+8 -1
View File
@@ -1,6 +1,6 @@
----AR BEGIN the whole IdiomSlv ----AR BEGIN the whole IdiomSlv
concrete IdiomSlv of Idiom = CatSlv ** concrete IdiomSlv of Idiom = CatSlv **
open ParadigmsSlv, ResSlv, Prelude in { open ParadigmsSlv, ResSlv, (P=ParamX), Prelude in {
lin lin
ExistNP np = ExistNP np =
@@ -11,6 +11,13 @@ concrete IdiomSlv of Idiom = CatSlv **
refl = [] refl = []
} ; } ;
ExistNPAdv np adv = mkClause [] np.a False {
s=copula; s2=\\_ => np.s ! Nom ++ adv.s; isCop=True; refl=[]
} ;
ImpersCl vp = mkClause [] {g=Neut;n=Sg;p=P3} False vp ;
ProgrVP vp = vp ;
ImpPl1 vp = {s = vp.s ! P.Pos ! VImper2 Pl ++ vp.s2 ! {g=Masc;n=Pl;p=P1}} ;
} }
+4
View File
@@ -31,4 +31,8 @@ lin InLN ln = {
s = "v" ++ ln.s ! Loc s = "v" ++ ln.s ! Loc
} ; } ;
lin AdjLN ap ln = ln ** {
s = \\c => ap.s ! Indef ! ln.g ! c ! ln.n ++ ln.s ! c
} ;
} }
+56
View File
@@ -35,12 +35,26 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv,Prelude in {
isPron = False -- KA: guessed isPron = False -- KA: guessed
} ; } ;
PredetNP pred np = np ** {
s = \\c => pred.s ++ np.s ! c
} ;
ExtAdvNP np adv = AdvNP np adv ;
RelNP np rs = np ** {s = \\c => np.s ! c ++ "," ++ rs.s ! np.a} ;
DetQuant quant num = { DetQuant quant num = {
s = \\g,c => quant.s ! g ! c ! (numAgr2num ! num.n) ++ num.s ! g ! c; s = \\g,c => quant.s ! g ! c ! (numAgr2num ! num.n) ++ num.s ! g ! c;
spec = quant.spec ; spec = quant.spec ;
n = num.n ; n = num.n ;
} ; } ;
DetQuantOrd quant num ord = {
s = \\g,c => quant.s ! g ! c ! (numAgr2num ! num.n) ++ num.s ! g ! c ++
ord.s ! g ! c ! (numAgr2num ! num.n) ;
spec = quant.spec ; n = num.n
} ;
DetNP det = { DetNP det = {
s = det.s ! Masc ; s = det.s ! Masc ;
a = {g=Masc; n=case det.n of {UseNum n=>n; UseGen=>Pl}; p=P3} ; a = {g=Masc; n=case det.n of {UseNum n=>n; UseGen=>Pl}; p=P3} ;
@@ -68,6 +82,15 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv,Prelude in {
n = decimal.n n = decimal.n
} ; } ;
AdNum adn card = card ** {s = \\g,c => adn.s ++ card.s ! g ! c} ;
OrdDigits digits = {s = \\_,_,_ => digits.s ++ BIND ++ "."} ;
OrdNumeral numeral = {s = \\g,c,_ => numeral.s ! g ! c} ;
OrdSuperl a = {s = \\g,c,n => "naj" ++ BIND ++ a.s ! APosit g n c} ;
OrdNumeralSuperl numeral a = {
s = \\g,c,n => numeral.s ! g ! c ++ "naj" ++ BIND ++ a.s ! APosit g n c
} ;
DefArt = { DefArt = {
s = \\_,_,_ => "" ; s = \\_,_,_ => "" ;
spec = Def spec = Def
@@ -92,4 +115,37 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv,Prelude in {
} ; } ;
AdvCN cn ad = {s = \\spec,c,n => cn.s ! spec ! c ! n ++ ad.s ; g = cn.g} ; AdvCN cn ad = {s = \\spec,c,n => cn.s ! spec ! c ! n ++ ad.s ; g = cn.g} ;
ComplN2 n np = {
s = \\_,c,num => n.s ! c ! num ++ n.c.s ++ np.s ! n.c.c ; g = n.g
} ;
ComplN3 n np = n ** {s = \\c,num => n.s ! c ! num ++ n.c.s ++ np.s ! n.c.c} ;
UseN2 n = {s = \\_ => n.s; g = n.g} ;
Use2N3 n = n ;
Use3N3 n = n ;
RelCN cn rs = cn ** {
s = \\sp,c,n => cn.s ! sp ! c ! n ++ rs.s ! {g=agender2gender cn.g;n=n;p=P3}
} ;
SentCN cn sc = cn ** {s = \\sp,c,n => cn.s ! sp ! c ! n ++ sc.s} ;
ApposCN cn np = cn ** {s = \\sp,c,n => cn.s ! sp ! c ! n ++ np.s ! c} ;
PossNP cn np = cn ** {s = \\sp,c,n => cn.s ! sp ! c ! n ++ np.s ! Gen} ;
PartNP cn np = cn ** {s = \\sp,c,n => cn.s ! sp ! c ! n ++ "od" ++ np.s ! Gen} ;
CountNP det np = {
s = \\c => det.s ! np.a.g ! c ++ "od" ++ np.s ! Gen ;
a = {g=np.a.g;n=numAgr2num ! det.n;p=P3}; isPron=False
} ;
DetDAP det = {
s = \\_,g,c,_ => det.s ! agender2gender g ! c; n = det.n
} ;
AdjDAP dap ap = dap ** {
s = \\sp,g,c,n => dap.s ! sp ! g ! c ! n ++ ap.s ! sp ! g ! c ! n
} ;
QuantityNP decimal mu = {
s = \\_ => decimal.s ++ mu.s;
a = {g=Fem;n=numAgr2num ! decimal.n;p=P3}; isPron=False
} ;
} }
+6
View File
@@ -146,7 +146,13 @@ lin pot110 = {s=\\g => table {
} ; } ;
pot3as4 x = x ; pot3as4 x = x ;
pot41 = {s=\\_,_=>"milijon";n=UseGen} ;
pot4 x = {s=\\g,c=>x.s!g!c++"milijonov";n=UseGen} ;
pot4plus x y = {s=\\g,c=>x.s!g!c++"milijonov"++y.s!g!c;n=UseGen} ;
pot4as5 x = x ; pot4as5 x = x ;
pot51 = {s=\\_,_=>"milijarda";n=UseGen} ;
pot5 x = {s=\\g,c=>x.s!g!c++"milijard";n=UseGen} ;
pot5plus x y = {s=\\g,c=>x.s!g!c++"milijard"++y.s!g!c;n=UseGen} ;
oper mkDigit : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Gender => Case => Str; oper mkDigit : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Gender => Case => Str;
mkDigit nomMasc nomFem nomNeut accMasc accFem accNeut mkDigit nomMasc nomFem nomNeut accMasc accFem accNeut
+10
View File
@@ -35,6 +35,9 @@ oper
} ; } ;
compoundN = overload { compoundN = overload {
compoundN : A -> N -> N = \adj,noun -> noun ** {
s = \\c,n => adj.s ! APosit (agender2gender noun.g) n c ++ noun.s ! c ! n
} ;
compoundN : N -> Str -> N = \noun,adv -> noun ** {s = \\c,n => noun.s ! c ! n ++ adv} ; compoundN : N -> Str -> N = \noun,adv -> noun ** {s = \\c,n => noun.s ! c ! n ++ adv} ;
} ; } ;
@@ -296,6 +299,13 @@ oper
particleV : V -> Str -> V = \v,p -> v ** {p = p} ; particleV : V -> Str -> V = \v,p -> v ** {p = p} ;
compoundV = overload {
compoundV : V -> Str -> V = \v,compl -> v ** {p = compl} ;
compoundV : Str -> V -> V = \compl,v -> v ** {
s = \\vf => compl ++ v.s ! vf
} ;
} ;
-- Regular verbs are formed from two forms. Infinitive and 3rd person singular presens. -- Regular verbs are formed from two forms. Infinitive and 3rd person singular presens.
regV : (_,_ : Str) -> V = \hoditi,hodi -> regV : (_,_ : Str) -> V = \hoditi,hodi ->
+3 -2
View File
@@ -6,8 +6,8 @@ concrete PhraseSlv of Phrase = CatSlv ** open Prelude, ResSlv, (P=ParamX) in {
UttS s = s ; UttS s = s ;
UttQS qs = qs ; UttQS qs = qs ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Sg} ; UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Sg} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Sg} ; UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Pl} ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Sg} ; UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Masc ! Pl} ;
UttNP np = {s = np.s ! Nom} ; UttNP np = {s = np.s ! Nom} ;
UttVP vp = {s = vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Masc; n=Sg; p=P3}} ; UttVP vp = {s = vp.s ! P.Pos ! VInf ++ vp.s2 ! {g=Masc; n=Sg; p=P3}} ;
@@ -24,5 +24,6 @@ concrete PhraseSlv of Phrase = CatSlv ** open Prelude, ResSlv, (P=ParamX) in {
NoPConj = {s = []} ; NoPConj = {s = []} ;
NoVoc = {s = []} ; NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! Nom} ;
} }
+6
View File
@@ -9,6 +9,12 @@ lin
QuestIComp icomp np = mkClause icomp.s np.a np.isPron {s = copula ; s2 = \\_ => [] ; isCop = True ; refl = []} ; QuestIComp icomp np = mkClause icomp.s np.a np.isPron {s = copula ; s2 = \\_ => [] ; isCop = True ; refl = []} ;
CompIAdv a = a ; CompIAdv a = a ;
CompIP p = ss (p.s ! Nom) ; CompIP p = ss (p.s ! Nom) ;
AdvIAdv i a = ss (i.s ++ a.s) ;
AdvIP ip a = ip ** {s=\\c=>ip.s!c++a.s} ;
PrepIP prep ip = {s=prep.s++ip.s!prep.c} ;
IdetQuant q num = {s=q.s++num.s!Masc!Nom} ;
IdetCN det cn = {s=\\c=>det.s++cn.s!Indef!c!Pl;a={g=agender2gender cn.g;n=Pl;p=P3}} ;
IdetIP det = {s=\\_=>det.s;a={g=Neut;n=Pl;p=P3}} ;
------AR END ------AR END
+15
View File
@@ -0,0 +1,15 @@
concrete RelativeSlv of Relative = CatSlv ** open ResSlv, Prelude in {
lin
IdRP = {s = \\_,_,_ => "ki"} ;
RelVP rp vp = {
s = \\a,t,ant,p => rp.s ! inanimateGender a.g ! Nom ! a.n ++
predV False vp.isCop vp.refl vp.s ! t ! p ! a ++ vp.s2 ! a
} ;
RelSlash rp cl = {
s = \\a,t,ant,p => rp.s ! inanimateGender a.g ! cl.c2.c ! a.n ++ cl.s ! t ! ant ! p
} ;
RelCl cl = {s = \\_,t,a,p => "kar" ++ cl.s ! t ! a ! p} ;
FunRP prep np rp = {
s = \\g,c,n => prep.s ++ np.s ! prep.c ++ rp.s ! g ! c ! n
} ;
}
+8 -1
View File
@@ -18,6 +18,13 @@ lin
ExtAdvS a s = {s = a.s ++ bindComma ++ s.s} ; ExtAdvS a s = {s = a.s ++ bindComma ++ s.s} ;
AdvS a s = {s = a.s ++ s.s} ; AdvS a s = {s = a.s ++ s.s} ;
SSubjS a subj b = {s = a.s ++ subj.s ++ b.s} ;
EmbedS s = s ;
EmbedQS s = s ;
PredSCVP sc vp = mkClause sc.s {g=Neut;n=Sg;p=P3} False vp ;
AdvImp adv imp = {s = \\p,g,n => adv.s ++ imp.s ! p ! g ! n} ;
UseRCl t p rcl = {s=\\a => t.s ++ p.s ++ rcl.s!a!t.t!t.a!p.p} ;
AdvSlash cls adv = cls ** {s=\\t,a,p=>cls.s!t!a!p++adv.s} ;
SlashPrep cl prep = cl ** {c2=prep} ;
} }
+46 -1
View File
@@ -1,4 +1,4 @@
concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, Prelude in { concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, ParadigmsSlv, Prelude in {
lin lin
UseV v = UseV v =
@@ -8,6 +8,25 @@ concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, Prelude in {
refl = v.refl refl = v.refl
} ; } ;
ComplVV v vp = {
s = \\p,vf => ne ! p ++ v.s ! vf;
s2 = \\a => vp.s ! Pos ! VInf ++ vp.refl ++ vp.s2 ! a;
isCop=False; refl=[]
} ;
ComplVS v s = {
s = \\p,vf => ne ! p ++ v.s ! vf;
s2 = \\_ => v.p ++ "da" ++ s.s; isCop=False; refl=v.refl
} ;
ComplVQ v q = {
s = \\p,vf => ne ! p ++ v.s ! vf;
s2 = \\_ => q.s; isCop=False; refl=[]
} ;
ComplVA v ap = {
s = \\p,vf => ne ! p ++ v.s ! vf;
s2 = \\a => v.p ++ ap.s ! Indef ! inanimateGender a.g ! Nom ! a.n;
isCop=False; refl=v.refl
} ;
SlashV2a v = SlashV2a v =
{ s = \\p,vform => ne ! p ++ v.s ! vform ; { s = \\p,vform => ne ! p ++ v.s ! vform ;
s2 = \\a => v.p ; ----AR: +p particle s2 = \\a => v.p ; ----AR: +p particle
@@ -16,6 +35,25 @@ concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, Prelude in {
refl = v.refl refl = v.refl
} ; } ;
SlashV2V v vp = {
s=\\p,vf => ne ! p ++ v.s ! vf;
s2=\\a => v.p ++ vp.s ! Pos ! VInf ++ vp.refl ++ vp.s2 ! a;
c2=mkPrep [] accusative; isCop=False; refl=v.refl
} ;
SlashV2S v s = {
s=\\p,vf => ne ! p ++ v.s ! vf; s2=\\_ => v.p ++ "da" ++ s.s;
c2=mkPrep [] accusative; isCop=False; refl=v.refl
} ;
SlashV2Q v q = {
s=\\p,vf => ne ! p ++ v.s ! vf; s2=\\_ => v.p ++ q.s;
c2=mkPrep [] accusative; isCop=False; refl=v.refl
} ;
SlashV2A v ap = {
s=\\p,vf => ne ! p ++ v.s ! vf;
s2=\\a => v.p ++ ap.s ! Indef ! inanimateGender a.g ! Acc ! a.n;
c2=mkPrep [] accusative; isCop=False; refl=v.refl
} ;
--Check these V3-slashes AE --Check these V3-slashes AE
Slash2V3 v np = Slash2V3 v np =
{ s = \\p,vform => ne ! p ++ v.s ! vform ; { s = \\p,vform => ne ! p ++ v.s ! vform ;
@@ -53,6 +91,11 @@ concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, Prelude in {
} ; } ;
AdvVP vp adv = insertObj (\\_ => adv.s) vp ; AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
ExtAdvVP vp adv = AdvVP vp adv ;
AdVVP adv vp = vp ** {s2 = \\a => adv.s ++ vp.s2 ! a} ;
AdvVPSlash vp adv = vp ** {s2 = \\a => vp.s2 ! a ++ adv.s} ;
AdVVPSlash adv vp = vp ** {s2 = \\a => adv.s ++ vp.s2 ! a} ;
VPSlashPrep vp prep = vp ** {c2=prep} ;
CompAP ap = { CompAP ap = {
s = \\agr => ap.s ! Indef ! inanimateGender agr.g ! Nom ! agr.n s = \\agr => ap.s ! Indef ! inanimateGender agr.g ! Nom ! agr.n
@@ -60,5 +103,7 @@ concrete VerbSlv of Verb = CatSlv ** open ResSlv, ParamX, Prelude in {
CompAdv adv = {s = \\agr => adv.s} ; ----AR CompAdv adv = {s = \\agr => adv.s} ; ----AR
CompNP np = {s = \\agr => np.s ! Nom} ; ----AR CompNP np = {s = \\agr => np.s ! Nom} ; ----AR
CompCN cn = {s = \\agr => cn.s ! Indef ! Nom ! agr.n} ;
UseCopula = {s=copula;s2=\\_=>[];isCop=True;refl=[]} ;
} }