a number of functions added by Codex

This commit is contained in:
Krasimir Angelov
2026-05-21 16:39:56 +02:00
parent a890a1aad5
commit 19ba581f0e
17 changed files with 507 additions and 90 deletions

View File

@@ -55,7 +55,7 @@ concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in {
-- : AP -> SC -> AP ; -- good that she is here
SentAP ap sc = ap ** {
compl = \\n => ap.compl ! n ++ SOFT_BIND ++ "," ++ "hogy" ++ sc.s ;
compl = \\n => ap.compl ! n ++ sc.s ;
} ;
-- An adjectival phrase can be modified by an *adadjective*, such as "very".

View File

@@ -3,7 +3,11 @@ concrete AdverbHun of Adverb = CatHun ** open ResHun, ParamHun, ParadigmsHun, Pr
lin
-- : A -> Adv ;
--PositAdvAdj adj = { } ;
PositAdvAdj adj = {
s = let a : Str = adj.s ! Posit ! SgNom
in a ++ BIND ++ "an" ;
isPre = False ;
} ;
-- : CAdv -> A -> NP -> Adv ; -- more warmly than John
-- ComparAdvAdj cadv a np = { } ;
@@ -19,7 +23,7 @@ lin
-- Adverbs can be modified by 'adadjectives', just like adjectives.
--AdAdv : AdA -> Adv -> Adv ; -- very quickly
-- AdAdv ada adv = adv **
AdAdv ada adv = adv ** {s = ada.s ++ adv.s} ;
-- Like adverbs, adadjectives can be produced by adjectives.
-- : A -> AdA ; -- extremely
@@ -27,7 +31,10 @@ lin
-- Subordinate clauses can function as adverbs.
-- : Subj -> S -> Adv ;
-- SubjS subj s =
SubjS subj s = {
s = subj.s ++ s.s ;
isPre = False ;
} ;
-- Comparison adverbs also work as numeral adverbs.

View File

@@ -1,4 +1,4 @@
concrete ConstructionHun of Construction = CatHun ** open ParadigmsHun in {
concrete ConstructionHun of Construction = CatHun ** open ParadigmsHun, ResHun in {
lincat
Timeunit = N ;
@@ -6,6 +6,16 @@ lincat
Monthday = NP ;
Month = N ;
Year = NP ;
lin
has_age_VP card = useV (copula ** {
s = \\vf => case vf of {
VPres P3 _ => [] ;
_ => copula.s ! vf
}
}) ** {
adv = card.s ! Indep ++ "éves"
} ;
{-
lin

View File

@@ -3,7 +3,17 @@
concrete ExtendHun of Extend = CatHun
-- ** ExtendFunctor - []
-- with (Grammar=GrammarHun)
** open Prelude, ResHun, NounHun in {
** open Prelude, ResHun, NounHun, VerbHun, AdjectiveHun in {
lincat
VPS = {s : Person => Number => Str} ;
VPI = SS ;
VPS2 = {s : ObjDef => Person => Number => Str ; c2 : Case} ;
[VPS2] = {s1,s2 : ObjDef => Person => Number => Str ; c2 : Case} ;
VPI2 = {s : ObjDef => Str ; c2 : Case} ;
[VPI2] = {s1,s2 : ObjDef => Str ; c2 : Case} ;
RNP = NounPhrase ;
RNPList = {s1,s2 : Possessor => Case => Str ; agr : Person*Number ; g : Gender ; postmod : Str} ;
lin
TPastSimple = {s = []} ** {t = Past} ; --# notpresent
@@ -28,6 +38,201 @@ lin
UseDAPMasc,
UseDAPFem = \dap -> DetNP dap ** {g = Human} ;
MkVPS t pol vp = {
s = \\p,n =>
t.s ++ pol.s ++ if_then_Pol pol.p [] "nem" ++
case t.t of {
Past => vp.s ! VPast p n ;
Fut => futureAux Indef p n ++ vp.s ! VInf ;
_ => vp.s ! VPres p n
} ++ vp.obj ++ vp.adv
} ;
PredVPS np vps = {
s = linNP np ++ vps.s ! np.agr.p1 ! np.agr.p2
} ;
MkVPI vp = {s = infVP vp} ;
MkVPS2 t pol vps = {
s = \\od,p,n =>
t.s ++ pol.s ++ if_then_Pol pol.p [] "nem" ++
case t.t of {
Past => vps.s ! od ! VPast p n ;
Fut => futureAux od p n ++ vps.s ! od ! VInf ;
_ => vps.s ! od ! VPres p n
} ++ vps.adv ;
c2 = vps.c2
} ;
ComplVPS2 vps np = {
s = \\p,n => vps.s ! np.objdef ! p ! n ++ np.s ! NoPoss ! vps.c2 ++ np.postmod
} ;
ReflVPS2 vps rnp = {
s = \\p,n => vps.s ! rnp.objdef ! p ! n ++ rnp.s ! NoPoss ! vps.c2 ++ rnp.postmod
} ;
BaseVPS2 x y = {
s1 = x.s ;
s2 = y.s ;
c2 = y.c2
} ;
ConsVPS2 x xs = {
s1 = \\od,p,n => x.s ! od ! p ! n ++ bindComma ++ xs.s1 ! od ! p ! n ;
s2 = xs.s2 ;
c2 = xs.c2
} ;
ConjVPS2 conj xs = {
s = \\od,p,n => xs.s1 ! od ! p ! n ++ conj.s2 ++ xs.s2 ! od ! p ! n ;
c2 = xs.c2
} ;
MkVPI2 vps = {
s = \\_ => infVPSlash vps ;
c2 = vps.c2
} ;
ComplVPI2 vpi np = {
s = vpi.s ! np.objdef ++ np.s ! NoPoss ! vpi.c2 ++ np.postmod
} ;
BaseVPI2 x y = {
s1 = x.s ;
s2 = y.s ;
c2 = y.c2
} ;
ConsVPI2 x xs = {
s1 = \\od => x.s ! od ++ bindComma ++ xs.s1 ! od ;
s2 = xs.s2 ;
c2 = xs.c2
} ;
ConjVPI2 conj xs = {
s = \\od => xs.s1 ! od ++ conj.s2 ++ xs.s2 ! od ;
c2 = xs.c2
} ;
PresPartAP vp = emptyAP ** {
s = \\_,_ => vp.obj ++ vp.adv ++ vp.s ! VPresPart
} ;
EmbedPresPart vp = {s = infVP vp} ;
PastPartAP vps = emptyAP ** {
s = \\_,_ => vps.adv ++ vps.s ! Indef ! VAdvPart
} ;
PastPartAgentAP vps np = emptyAP ** {
s = \\_,_ =>
vps.adv ++ vps.s ! Indef ! VAdvPart
++ applyAdp (caseAdp Nom "által") np
} ;
PassVPSlash vps = passiveVP vps [] ;
PassAgentVPSlash vps np =
passiveVP vps (applyAdp (caseAdp Nom "által") np) ;
ProgrVPSlash vps = vps ;
ComplBareVS vs s = useV vs ** {
adv = s.s
} ;
ReflRNP vps rnp = insertObj vps rnp ;
ReflPron = indeclNP "magát" ** {objdef = Def ; g = Human} ;
ReflPoss num cn = DetCN (DetQuant DefArt num) cn ;
PredetRNP predet rnp = rnp ** {
s = \\p,c => predet.s ++ rnp.s ! p ! c
} ;
ReflA2RNP a2 rnp =
let ap : AP = ComplA2 a2 rnp in ap ;
PossPronRNP pron num cn rnp =
let det : Determiner = DetQuant (PossPron pron) num
in emptyNP ** cn ** det ** {
s = \\_,c =>
rnp.s ! NoPoss ! Nom
++ caseFromPossStem cn det c
++ cn.compl ! det.n ! c ;
agr = <P3,det.n> ;
objdef = Def ;
g = NonHuman
} ;
Base_rr_RNP x y = {
s1 = x.s ;
s2 = y.s ;
agr = y.agr ;
g = y.g ;
postmod = []
} ;
Base_nr_RNP x y = {
s1 = x.s ;
s2 = y.s ;
agr = y.agr ;
g = y.g ;
postmod = []
} ;
Base_rn_RNP x y = {
s1 = x.s ;
s2 = y.s ;
agr = y.agr ;
g = y.g ;
postmod = []
} ;
ConjRNP conj xs = emptyNP ** {
s = \\p,c => xs.s1 ! p ! c ++ conj.s2 ++ xs.s2 ! p ! c ;
agr = <P3,conj.n> ;
objdef = Def ;
g = xs.g ;
postmod = [] ;
empty = []
} ;
GerundCN vp =
let gn : Str = infVP vp
in {
s = \\_ => gn ;
h = H_a ;
g = NonHuman ;
compl = \\_,_ => [] ;
postmod = []
} ;
GerundNP vp = MassNP (GerundCN vp) ;
GerundAdv vp = {
s = infVP vp ;
isPre = False
} ;
WithoutVP vp = {
s = infVP vp ++ "nélkül" ;
isPre = False
} ;
ByVP vp = {
s = infVP vp ++ "által" ;
isPre = False
} ;
InOrderToVP vp = {
s = infVP vp ++ "céljából" ;
isPre = False
} ;
iFem_Pron = pronTable ! <P1,Sg> ** {g = Human} ;
theyFem_Pron = pronTable ! <P3,Pl> ** {g = Human} ;
theyNeutr_Pron = pronTable ! <P3,Pl> ;
@@ -38,4 +243,15 @@ lin
youPolPlFem_Pron = pronTable ! <P2,Pl> ** {g = Human} ;
youPolPl_Pron = pronTable ! <P2,Pl> ** {g = Human} ;
oper
passiveVP : VPSlash -> Str -> VP = \vps,agent ->
lin VP (useV (copula ** {
s = \\vf => case vf of {
VPres P3 _ => [] ;
_ => copula.s ! vf
}
}) ** {
adv = vps.adv ++ vps.s ! Indef ! VAdvPart ++ agent
}) ;
} ;

View File

@@ -44,4 +44,49 @@ concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun, VerbHun, NounHun, S
SelfNP : NP -> NP ; -- the president himself (is at home)
-}
lin
ExistNP np = existNP np [] ;
ExistNPAdv np adv = existNP np adv.s ;
ExistIP ip = {
s = \\t,a,p =>
ip.s ! NoPoss ! Nom
++ if_then_Pol p [] "nem"
++ copula.s ! case t of {
Past => VPast P3 ip.agr.p2 ;
_ => VPres P3 ip.agr.p2
}
} ;
ExistIPAdv ip adv = {
s = \\t,a,p =>
ip.s ! NoPoss ! Nom
++ adv.s
++ if_then_Pol p [] "nem"
++ copula.s ! case t of {
Past => VPast P3 ip.agr.p2 ;
_ => VPres P3 ip.agr.p2
}
} ;
ProgrVP vp = vp ;
ImpPl1 vp = {
s = "próbáljunk" ++ infVP vp
} ;
oper
existNP : NounPhrase -> Str -> ResHun.ClSlash = \np,adv -> {
s = \\t,_,p =>
if_then_Pol p [] "nem"
++ copula.s ! case t of {
Past => VPast P3 np.agr.p2 ;
_ => VPres P3 np.agr.p2
}
++ linNP np
++ adv ;
c2 = Acc
} ;
}

View File

@@ -1,7 +1,46 @@
--# -path=.:prelude:../abstract:../common
concrete IrregHun of IrregHunAbs = CatHun ** open ParadigmsHun in {
lin
eszem_V = mkV "eszem" "eszel" "eszik" "eszünk" "esztek" "esznek"
áll_V = mkV "állok" "állsz" "áll" "állunk" "álltok" "állnak"
"álltam" "álltál" "állt" "álltunk" "álltatok" "álltak"
"állni" "álló" "állva" ;
átugrik_V = mkV "átugrom" "átugrasz" "átugrik" "átugrunk" "átugrotok" "átugranak"
"átugrottam" "átugrottál" "átugrott" "átugrottunk" "átugrottatok" "átugrottak"
"átugrani" "átugrikó" "átugrikva" ;
bovelkedik_V = mkV "bővelkedem" "bővelkedsz" "bővelkedik" "bővelkedünk" "bővelkedtek" "bővelkednek"
"bővelkedtem" "bővelkedtél" "bővelkedett" "bővelkedtünk" "bővelkedtetek" "bővelkedtek"
"bővelkedni" "bővelkedő" "bővelkedve" ;
csatlakozik_V = mkV "csatlakozom" "csatlakozol" "csatlakozik" "csatlakozunk" "csatlakoztok" "csatlakoznak"
"csatlakoztam" "csatlakoztál" "csatlakozott" "csatlakoztunk" "csatlakoztatok" "csatlakoztak"
"csatlakozni" "csatlakozó" "csatlakozva" ;
csökken_V = mkV "csökkenek" "csökkensz" "csökken" "csökkenünk" "csökkentek" "csökkennek"
"csökkentem" "csökkentél" "csökkent" "csökkentünk" "csökkentetek" "csökkentek"
"csökkenni" "csökkenő" "csökkenve" ;
dolgozik_V = mkV "dolgozom" "dolgozol" "dolgozik" "dolgozunk" "dolgoztok" "dolgoznak"
"dolgoztam" "dolgoztál" "dolgozott" "dolgoztunk" "dolgoztatok" "dolgoztak"
"dolgozni" "dolgozó" "dolgozva" ;
elvet_V = mkV "elvetek" "elvetsz" "elvet" "elvetünk" "elvettek" "elvetnek"
"elvetettem" "elvetettél" "elvetett" "elvetettünk" "elvetettetek" "elvetettek"
"elvetni" "elvető" "elvetve" ;
eszik_V = mkV "eszem" "eszel" "eszik" "eszünk" "esztek" "esznek"
"ettem" "ettél" "evett" "ettünk" "ettetek" "ettek"
"enni" ;
"enni" "evő" "éve" ;
fut_V = mkV "futok" "futsz" "fut" "futunk" "futtok" "futnak"
"futottam" "futottál" "futott" "futottunk" "futottatok" "futottak"
"futni" "futó" "futva" ;
jár_V = mkV "járok" "jársz" "jár" "járunk" "jártok" "járnak"
"jártam" "jártál" "járt" "jártunk" "jártatok" "jártak"
"járni" "járó" "járva" ;
küld_V = mkV "küldök" "küldesz" "küld" "küldünk" "küldötök" "küldenek"
"küldtem" "küldtél" "küldött" "küldtünk" "küldtetek" "küldtek"
"küldeni" "küldő" "küldve" ;
meglátogat_V = mkV "meglátogatok" "meglátogatsz" "meglátogat" "meglátogatunk" "meglátogattok" "meglátogatnak"
"meglátogattam" "meglátogattál" "meglátogatott" "meglátogattunk" "meglátogattatok" "meglátogattak"
"meglátogatni" "meglátogató" "meglátogatva" ;
tud_V = mkV "tudok" "tudsz" "tud" "tudunk" "tudtok" "tudnak"
"tudtam" "tudtál" "tudott" "tudtunk" "tudtatok" "tudtak"
"tudni" "tudó" "tudva" ;
úszik_V = mkV "úszom" "úszol" "úszik" "úszunk" "úsztok" "úsznak"
"úsztam" "úsztál" "úszott" "úsztunk" "úsztatok" "úsztak"
"úszni" "úszó" "úszva" ;
}

View File

@@ -1,4 +1,17 @@
abstract IrregHunAbs = Cat ** {
fun
eszem_V : V ;
áll_V : V ;
átugrik_V : V ;
bovelkedik_V : V ;
csatlakozik_V : V ;
csökken_V : V ;
dolgozik_V : V ;
elvet_V : V ;
eszik_V : V ;
fut_V : V ;
jár_V : V ;
küld_V : V ;
meglátogat_V : V ;
tud_V : V ;
úszik_V : V ;
}

View File

@@ -105,7 +105,7 @@ lin door_N = mkN "ajtó" "ajtót" ;
lin ear_N = mkN "fül" "fület";
lin earth_N = mkN "föld" "földet";
lin eat_V2 = mkV2 eszem_V ;
lin eat_V2 = mkV2 eszik_V ;
lin egg_N = mkN "tojás" "tojást" ;
lin empty_A = mkA "üres" ;
lin enemy_N = mkN "ellenség" "ellenséget" ;

View File

@@ -144,10 +144,10 @@ concrete NounHun of Noun = CatHun ** open
-- : Numeral -> Card ;
NumNumeral num = num ;
{-
-- : AdN -> Card -> Card ;
AdNum adn card = card ** { s = adn.s ++ card.s } ;
AdNum adn card = card ** { s = \\p => adn.s ++ card.s ! p } ;
{-
-- : Digits -> Ord ;
OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
@@ -200,7 +200,9 @@ concrete NounHun of Noun = CatHun ** open
} ;
-- : N2 -> NP -> CN ;
-- ComplN2 n2 np =
ComplN2 n2 np = (UseN n2) ** {
compl = \\n,c => np.s ! NoPoss ! Dat ++ np.postmod
} ;
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
-- ComplN3 n3 np =
@@ -234,7 +236,9 @@ concrete NounHun of Noun = CatHun ** open
-- to decide. Sentential complements are defined in VerbHun.
-- : CN -> SC -> CN ; -- question where she sleeps
-- SentCN cn sc = cn ** { } ;
SentCN cn sc = cn ** {
compl = \\n,c => cn.compl ! n ! c ++ sc.s
} ;
--2 Apposition
@@ -253,8 +257,9 @@ concrete NounHun of Noun = CatHun ** open
} ;
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
-- PartNP cn np = cn ** {
-- } ;
PartNP cn np = cn ** {
compl = \\n,c => cn.compl ! n ! c ++ np.s ! NoPoss ! Nom ++ np.postmod
} ;
--3 Conjoinable determiners and ones with adjectives

View File

@@ -230,12 +230,12 @@ oper
-- mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** {
-- s = \\vf => nore + hada.s ! vf} ;
mkV : (x1,_,_,_,_,_,x7 : Str) -> V = \sg1,sg2,sg3,pl1,pl2,pl3,inf ->
lin V (mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf) ;
mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,x13 : Str) -> V =
\sg1,sg2,sg3,pl1,pl2,pl3,pastSg1,pastSg2,pastSg3,pastPl1,pastPl2,pastPl3,inf ->
lin V (mkVerbFullPast sg1 sg2 sg3 pl1 pl2 pl3
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
inf) ;
lin V (mkVerbPres sg1 sg2 sg3 pl1 pl2 pl3 inf) ;
mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> V =
\sg1,sg2,sg3,pl1,pl2,pl3,pastSg1,pastSg2,pastSg3,pastPl1,pastPl2,pastPl3,inf,ppart,apart ->
lin V (mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
inf ppart apart) ;
} ;
copula = lin V ResHun.copula ;
@@ -287,6 +287,7 @@ oper
mkV3 = overload {
mkV3 : (plain : Str) -> V3 = \v3 -> lin V3 (mkVerb3 v3) ;
mkV3 : V -> V3 = \v -> lin V3 (v2tov3 (vtov2 v)) ;
} ;
mkPrep = overload {

View File

@@ -200,7 +200,9 @@ param
VForm =
VInf
| VPres Person Number
| VPast Person Number ;
| VPast Person Number
| VPresPart
| VAdvPart ;
--------------------------------------------------------------------------------
-- Clauses

View File

@@ -6,11 +6,11 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in {
UttS s = s ;
UttQS qs = qs ;
UttIAdv iadv = iadv ;
{-
UttImpSg pol imp =
{s = pol.s ++ imp.s ! Sg ! pol.p} ;
UttImpPl pol imp =
UttImpPol = UttImpSg ;
-}
{s = pol.s ++ imp.s ! Pl ! pol.p} ;
UttImpPol = UttImpPl ;
UttIP,
UttNP = \np -> {s = linNP np} ;
UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ;

View File

@@ -1,40 +1,49 @@
concrete QuestionHun of Question = CatHun ** open
Prelude, ResHun, ParadigmsHun, (NH=NounHun) in {
Prelude, ResHun, ParadigmsHun, (NH=NounHun), (VH=VerbHun) in {
-- A question can be formed from a clause ('yes-no question') or
-- with an interrogative.
{-
lincat
QVP = VerbPhrase ;
lin
-- : Cl -> QCl ;
QuestCl =
QuestCl cl = cl ;
-- : IP -> VP -> QCl ;
QuestVP ip vp =
QuestVP ip vp = predVP ip vp ;
-- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls =
QuestSlash ip cls = {
s = \\t,a,p => ip.s ! NoPoss ! cls.c2 ++ cls.s ! t ! a ! p
} ;
-- : IAdv -> Cl -> QCl ; -- why does John walk
QuestIAdv iadv cls =
QuestIAdv iadv cls = {
s = \\t,a,p => iadv.s ++ cls.s ! t ! a ! p
} ;
-- : IComp -> NP -> QCl ; -- where is John?
QuestIComp icomp np =
QuestIComp icomp np = {
s = \\_,_,p =>
icomp.s ++ if_then_Pol p [] "nem" ++ linNP np
} ;
-- Interrogative pronouns can be formed with interrogative
-- determiners, with or without a noun.
-- : IDet -> CN -> IP ; -- which five songs
IdetCN idet cn = {…} ** NH.DetCN idet cn ;
IdetCN idet cn = NH.DetCN idet cn ;
-- : IDet -> IP ; -- which five
IdetIP idet = {…} ** NH.DetNP idet ;
IdetIP idet = NH.DetNP idet ;
-- They can be modified with adverbs.
-- : IP -> Adv -> IP ; -- who in Paris
--AdvIP = NH.AdvNP ;
AdvIP = NH.AdvNP ;
-- Interrogative quantifiers have number forms and can take number modifiers.
@@ -43,12 +52,14 @@ concrete QuestionHun of Question = CatHun ** open
-- Interrogative adverbs can be formed prepositionally.
-- : Prep -> IP -> IAdv ; -- with whom
PrepIP prep ip = ;
PrepIP prep ip = {s = applyAdp prep ip} ;
-- They can be modified with other adverbs.
-- : IAdv -> Adv -> IAdv ; -- where in Paris
-- AdvIAdv iadv adv =
AdvIAdv iadv adv = {
s = iadv.s ++ adv.s
} ;
-- Interrogative complements to copulas can be both adverbs and
-- pronouns.
@@ -57,21 +68,16 @@ concrete QuestionHun of Question = CatHun ** open
CompIAdv iadv = iadv ; -- where (is it)
-- : IP -> IComp ;
CompIP ip = {s = ip.s ! Abs} ; -- who (is it)
CompIP ip = {s = ip.s ! NoPoss ! Nom} ; -- who (is it)
-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.
-- Wh questions with two or more question words require a new, special category.
cat
QVP ; -- buy what where
fun
ComplSlashIP : VPSlash -> IP -> QVP ; -- buys what
AdvQVP : VP -> IAdv -> QVP ; -- lives where
AddAdvQVP : QVP -> IAdv -> QVP ; -- buys what where
QuestQVP : IP -> QVP -> QCl ; -- who buys what where
-}
ComplSlashIP vps ip = VH.insertObj vps ip ;
AdvQVP vp iadv = vp ** {adv = vp.adv ++ iadv.s} ;
AddAdvQVP qvp iadv = qvp ** {adv = qvp.adv ++ iadv.s} ;
QuestQVP ip qvp = predVP ip qvp ;
}

View File

@@ -489,11 +489,17 @@ oper
pastPl1 : Str = stem + pastHf ! <P1,Pl> ! h ;
pastPl2 : Str = stem + pastHf ! <P2,Pl> ! h ;
pastPl3 : Str = stem + pastHf ! <P3,Pl> ! h ;
in mkVerbFullPast sg1 sg2 sg3 pl1 pl2 pl3
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
inf ;
ppart : Str = case sg3 of {
x + "o" + y@("g"|"l") => x+y+"ó" ;
_ + ("ér"|"éz"|"ít") => sg3 + "ő" ;
_ => sg3 + "ó"
} ;
apart : Str = sg3 + harm "va" "ve" ! h
in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
inf ppart apart ;
mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb =
mkVerbPres : (x1,_,_,_,_,_,x7 : Str) -> Verb =
\sg1,sg2,sg3,pl1,pl2,pl3,inf ->
let h : Harm = getHarm sg3 ;
pastSg1 : Str = sg3 + endingsPastIndef ! <P1,Sg> ! h ;
@@ -502,12 +508,18 @@ oper
pastPl1 : Str = sg3 + endingsPastIndef ! <P1,Pl> ! h ;
pastPl2 : Str = sg3 + endingsPastIndef ! <P2,Pl> ! h ;
pastPl3 : Str = sg3 + endingsPastIndef ! <P3,Pl> ! h ;
in mkVerbFullPast sg1 sg2 sg3 pl1 pl2 pl3
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
inf ;
ppart : Str = case sg3 of {
x + "o" + y@("g"|"l") => x+y+"ó" ;
_ + ("ér"|"éz"|"ít") => sg3 + "ő" ;
_ => sg3 + "ó"
} ;
apart : Str = sg3 + harm "va" "ve" ! h
in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3
pastSg1 pastSg2 pastSg3 pastPl1 pastPl2 pastPl3
inf ppart apart ;
mkVerbFullPast : (x1,_,_,_,_,_,_,_,_,_,_,_,x13 : Str) -> Verb =
\sg1,sg2,sg3,pl1,pl2,pl3,pastSg1,pastSg2,pastSg3,pastPl1,pastPl2,pastPl3,inf -> {
mkVerbFull : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Verb =
\sg1,sg2,sg3,pl1,pl2,pl3,pastSg1,pastSg2,pastSg3,pastPl1,pastPl2,pastPl3,inf,ppart,apart -> {
s = table {
VInf => inf ;
VPres P1 Sg => sg1 ;
@@ -521,12 +533,14 @@ oper
VPast P3 Sg => pastSg3 ;
VPast P1 Pl => pastPl1 ;
VPast P2 Pl => pastPl2 ;
VPast P3 Pl => pastPl3
VPast P3 Pl => pastPl3 ;
VPresPart => ppart ;
VAdvPart => apart
} ;
sc = SCNom
} ;
copula : Verb = mkVerbFullPast
copula : Verb = mkVerbFull
"vagyok"
"vagy"
"van"
@@ -539,7 +553,9 @@ oper
"voltunk"
"voltatok"
"voltak"
"lenni" ;
"lenni"
"levő"
"léve" ;
megvan : Verb = copula ** {
s = \\vf => "meg" + copula.s ! vf ;
@@ -571,6 +587,20 @@ oper
insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = vp.adv ++ adv.s} ;
insertAdvSlash : VPSlash -> SS -> VPSlash = \vps,adv -> vps ** {adv = vps.adv ++ adv.s} ;
infVP : VerbPhrase -> Str = \vp ->
vp.obj ++ vp.adv ++ vp.s ! VInf ;
infVPSlash : VPSlash -> Str = \vps ->
vps.adv ++ vps.s ! Indef ! VInf ;
verbStemFromInf : Str -> Str = \inf ->
case inf of {
stem + "ani" => stem ;
stem + "eni" => stem ;
stem + "ni" => stem ;
_ => inf
} ;
--------------------------------------------------------------------------------
-- Cl, S

View File

@@ -16,11 +16,19 @@ lin
--2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ;
SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = []}) ;
{-
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** insertAdv adv cls ;
-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** {
s = \\t,a,p => cls.s ! t ! a ! p ++ adv.s
} ;
-- : Cl -> Prep -> ClSlash ; -- (with whom) he walks
SlashPrep cl prep = cl ** {
c2 = prep.c ;
s = \\t,a,p => cl.s ! t ! a ! p ++ prep.s
} ;
{-
-- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
-- SlashVS np vs ss = {} ;
@@ -31,20 +39,20 @@ lin
} ;
--2 Imperatives
-- : VP -> Imp ;
ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ;
--2 Embedded sentences
-- : S -> SC ;
EmbedS s = {s = s.s ! True} ; -- choose subordinate
-- : QS -> SC ;
-- EmbedQS qs = { } ;
-- : VP -> SC ;
EmbedVP vp = {s = infVP vp} ;
-}
-- : VP -> Imp ;
ImpVP vp = {
s = \\num,pol =>
if_then_Pol pol [] "ne"
++ vp.s ! VPres P2 num
++ vp.obj
++ vp.adv
} ;
-- : Adv -> Imp -> Imp ;
AdvImp adv imp = {
s = \\num,pol => adv.s ++ imp.s ! num ! pol
} ;
--2 Sentences
-- : S -> SC ;

View File

@@ -131,11 +131,44 @@ lin under_Prep = nomAdp "alatt" ;
youPl_Pron = pronTable ! <P2,Pl> ** {g = Human} ;
they_Pron = pronTable ! <P3,Pl> ** {g = Human} ;
--lin whatPl_IP = ;
--lin whatSg_IP = :
--lin whoPl_IP = ;
--lin whoSg_IP = ;
lin whatPl_IP = emptyNP ** {
s = \\_ => caseTable "mi" "mit" "minek"
"mibe" "miben" "miből"
"mihez" "minél" "mitől"
"mire" "min" "miről"
"miért" "mivel" "mivé" ;
agr = <P3,Pl> ;
objdef = Def
} ;
lin whatSg_IP = emptyNP ** {
s = \\_ => caseTable "mi" "mit" "minek"
"mibe" "miben" "miből"
"mihez" "minél" "mitől"
"mire" "min" "miről"
"miért" "mivel" "mivé" ;
agr = <P3,Sg> ;
objdef = Def
} ;
lin whoPl_IP = emptyNP ** {
s = \\_ => caseTable "ki" "kit" "kinek"
"kibe" "kiben" "kiből"
"kihez" "kinél" "kitől"
"kire" "kin" "kiről"
"kiért" "kivel" "kivé" ;
agr = <P3,Pl> ;
objdef = Def ;
g = Human
} ;
lin whoSg_IP = emptyNP ** {
s = \\_ => caseTable "ki" "kit" "kinek"
"kibe" "kiben" "kiből"
"kihez" "kinél" "kitől"
"kire" "kin" "kiről"
"kiért" "kivel" "kivé" ;
agr = <P3,Pl> ;
objdef = Def ;
g = Human
} ;
-------
-- Subj

View File

@@ -58,11 +58,12 @@ lin
-- : V2Q -> QS -> VPSlash ; -- ask (him) who came
SlashV2Q v2q qs = ;
-}
-- : V2A -> AP -> VPSlash ; -- paint (it) red
SlashV2A v2a ap = useVc v2a ** {
aComp = \\_ => (CompAP ap).aComp ! Sg3 Masc
adv = ap.s ! Sg ! Nom ++ ap.compl ! Sg
} ;
-}
-- : VPSlash -> NP -> VP
ComplSlash = insertObj ;
{-
@@ -93,15 +94,16 @@ lin
-- : VP -> Adv -> VP ; -- sleep , even though ...
ExtAdvVP vp adv = vp ** { } ;
-}
-- : AdV -> VP -> VP ; -- always sleep
AdVVP adv vp = vp ** { } ;
AdVVP adv vp = vp ** {
s = \\vf => adv.s ++ vp.s ! vf
} ;
-- : AdV -> VPSlash -> VPSlash ; -- always use (it)
AdVVPSlash adv vps = vps ** { } ;
-- : VP -> Prep -> VPSlash ; -- live in (it)
VPSlashPrep vp prep =
-}
AdVVPSlash adv vps = vps ** {
s = \\o,vf => adv.s ++ vps.s ! o ! vf
} ;
--2 Complements to copula