forked from GitHub/gf-rgl
Merge branch 'master' into master
This commit is contained in:
@@ -65,7 +65,7 @@ lin
|
||||
-- Unfortunately, we cannot use a similar trick for the source (*Põltsamaast vs Põltsamaalt).
|
||||
distance_N3 = mkN3 (mkN "kaugus") celative (casePrep terminative) ;
|
||||
doctor_N = mkN "arst" ;
|
||||
dog_N = mkN "koer" "koera" "koera" ;
|
||||
dog_N = mkN "koer" "koera" "koera" "koerasse" "koerte" "koeri" ;
|
||||
door_N = mkN "uks" "ukse" "ust" "uksesse" "uste" "uksi" ;
|
||||
drink_V2 = mkV2 (mkV "jooma") cpartitive ;
|
||||
easy_A2V = mkA2 (mkA (mkN "lihtne" "lihtsa" "lihtsat" "lihtsasse" "lihtsate" "lihtsaid")) callative ;
|
||||
|
||||
@@ -50,11 +50,13 @@ concrete CatGer of Cat =
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = {s : Adjf => Number => Case => Str ;
|
||||
rc : Number => Str ; -- Frage , [rc die ich gestellt habe]
|
||||
ext : Str ; -- Frage , [sc wo sie schläft])
|
||||
adv : Str ; -- Frage [a von Max]
|
||||
g : Gender} ;
|
||||
CN = {
|
||||
s : Adjf => Number => Case => Str ;
|
||||
rc : Number => Str ; -- Frage , [rc die ich gestellt habe]
|
||||
ext : Str ; -- Frage , [sc wo sie schläft]
|
||||
adv : Str ; -- Haus [adv auf dem Hügel]
|
||||
g : Gender
|
||||
} ;
|
||||
NP = ResGer.NP ;
|
||||
Pron = {s : NPForm => Str ; a : Agr} ;
|
||||
Det, DAP = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ;
|
||||
@@ -86,10 +88,10 @@ concrete CatGer of Cat =
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
|
||||
V, VA, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ;
|
||||
VV = Verb ** {isAux : Bool} ;
|
||||
V2, VA, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
|
||||
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; ctrl : Control} ;
|
||||
V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ;
|
||||
V2V = Verb ** {c2 : Preposition ; isAux : Bool ; objCtrl : Bool} ;
|
||||
V3 = Verb ** {c2, c3 : Preposition} ;
|
||||
|
||||
A = {s : Degree => AForm => Str} ;
|
||||
@@ -113,7 +115,7 @@ concrete CatGer of Cat =
|
||||
ClSlash = \cls -> cls.s ! MIndic ! Pres ! Simul ! Pos ! Main ++ cls.c2.s ;
|
||||
|
||||
VP = \vp -> useInfVP False vp ;
|
||||
VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ;
|
||||
VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ++ vps.ext;
|
||||
|
||||
AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ;
|
||||
A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ;
|
||||
|
||||
@@ -42,13 +42,13 @@ lin
|
||||
where_go_QCl np = mkQCl (lin IAdv (ss "wohin")) (mkCl np (mkVP L.go_V)) ;
|
||||
where_come_from_QCl np = mkQCl (lin IAdv (ss "woher")) (mkCl np (mkVP L.come_V)) ;
|
||||
|
||||
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "her") ;
|
||||
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "her") ;
|
||||
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "von hier") ;
|
||||
go_here_VP = mkVP (mkVP L.go_V) (ParadigmsGer.mkAdv "her") ;
|
||||
come_here_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "her") ;
|
||||
come_from_here_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "von hier") ;
|
||||
|
||||
go_there_VP = mkVP (mkVP L.go_V) (mkAdv "hin") ;
|
||||
come_there_VP = mkVP (mkVP L.come_V) (mkAdv "hin") ;
|
||||
come_from_there_VP = mkVP (mkVP L.come_V) (mkAdv "von dort") ;
|
||||
go_there_VP = mkVP (mkVP L.go_V) (ParadigmsGer.mkAdv "hin") ;
|
||||
come_there_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "hin") ;
|
||||
come_from_there_VP = mkVP (mkVP L.come_V) (ParadigmsGer.mkAdv "von dort") ;
|
||||
|
||||
lincat
|
||||
Weekday = N ;
|
||||
|
||||
@@ -147,8 +147,8 @@ lin
|
||||
|
||||
lin
|
||||
NoDefinition t = {s=t.s};
|
||||
MkDefinition t d = {s="<p><b>Definierung:</b>"++t.s++d.s++"</p>"};
|
||||
MkDefinitionEx t d e = {s="<p><b>Definierung:</b>"++t.s++d.s++"</p><p><b>Beispiel:</b>"++e.s++"</p>"};
|
||||
MkDefinition t d = {s="<p><b>Definition:</b>"++t.s++d.s++"</p>"};
|
||||
MkDefinitionEx t d e = {s="<p><b>Definition:</b>"++t.s++d.s++"</p><p><b>Beispiel:</b>"++e.s++"</p>"};
|
||||
|
||||
MkDocument d i e = ss (i.s1 ++ d.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph
|
||||
MkTag i = ss i.t ;
|
||||
|
||||
@@ -35,9 +35,8 @@ lin
|
||||
ConjVPI = conjunctDistrTable Bool ;
|
||||
|
||||
ComplVPIVV v vpi =
|
||||
-- insertInf (vpi.s ! v.isAux) (
|
||||
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
|
||||
predVGen v.isAux v) ; ----
|
||||
insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22
|
||||
(predVGen v.isAux v) ;
|
||||
|
||||
BaseVPS = twoTable2 Order Agr ;
|
||||
ConsVPS = consrTable2 Order Agr comma ;
|
||||
@@ -70,37 +69,46 @@ lin
|
||||
m = tm.m ;
|
||||
subj = [] ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
haben = verb.inf2 ;
|
||||
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
||||
-- obj1 = (vp.nn ! agr).p1 ;
|
||||
-- obj = (vp.nn ! agr).p2 ;
|
||||
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
|
||||
extra = vp.ext ;
|
||||
infE : Str = -- HL 30/6/2019
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Simul,True> => inf ; --# notpresent
|
||||
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
|
||||
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_,Anter,True> => inf ; --# notpresent
|
||||
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
|
||||
inffin : Str =
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
||||
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_,Anter,True> --# notpresent
|
||||
=> verb.fin ++ inf ; -- double inf --# notpresent
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
} ;
|
||||
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||
<_,Anter,True> => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
<Pres,_,_> =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
; --# notpresent
|
||||
_ => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||
} ;
|
||||
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
|
||||
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
|
||||
}
|
||||
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||
|
||||
@@ -12,16 +12,9 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
MkVPI vp = {s = \\b => useInfVP b vp} ;
|
||||
ConjVPI = conjunctDistrTable Bool ;
|
||||
|
||||
ComplVPIVV v vpi =
|
||||
-- insertInf (vpi.s ! v.isAux) (
|
||||
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
|
||||
predVGen v.isAux v) ; ----
|
||||
{-
|
||||
insertExtrapos vpi.p3 (
|
||||
insertInf vpi.p2 (
|
||||
insertObj vpi.p1 (
|
||||
predVGen v.isAux v))) ;
|
||||
-}
|
||||
ComplVPIVV v vpi =
|
||||
insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22
|
||||
(predVGen v.isAux v) ;
|
||||
|
||||
PPzuAdv cn = {s = case cn.g of {
|
||||
Masc | Neutr => "zum" ;
|
||||
@@ -33,8 +26,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
moegen_VV = auxVV mögen_V ;
|
||||
|
||||
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
|
||||
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
|
||||
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
|
||||
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
|
||||
|
||||
CompIQuant iq = {s = table {Ag g n p => iq.s ! n ! g ! Nom} ; ext = ""} ;
|
||||
|
||||
@@ -43,8 +36,6 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
DetNPMasc det = {
|
||||
s = \\c => det.sp ! Masc ! c ; ---- genders
|
||||
a = agrP3 det.n ;
|
||||
-- isPron = False ;
|
||||
-- isLight = True ;
|
||||
w = WLight ;
|
||||
ext, rc = []
|
||||
} ;
|
||||
@@ -52,8 +43,6 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
DetNPFem det = {
|
||||
s = \\c => det.sp ! Fem ! c ; ---- genders
|
||||
a = agrP3 det.n ;
|
||||
-- isPron = False ;
|
||||
-- isLight = True ;
|
||||
w = WLight ;
|
||||
ext, rc = []
|
||||
} ;
|
||||
@@ -66,37 +55,40 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
} ;
|
||||
|
||||
PassVPSlash vp =
|
||||
let c = case <vp.c2.c,vp.c2.isPrep> of {
|
||||
<NPC Acc,False> => NPC Nom ;
|
||||
_ => vp.c2.c}
|
||||
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
|
||||
{subjc = vp.c2 ** {c= c}} ;
|
||||
-- regulates passivised object: accusative objects -> nom; all others: same case
|
||||
-- this also gives "mit dir wird gerechnet" ;
|
||||
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
||||
let c = case <vp.c2.c,vp.c2.isPrep> of {
|
||||
<NPC Acc,False> => NPC Nom ;
|
||||
_ => vp.c2.c}
|
||||
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
|
||||
{ c1 = vp.c2 ** {c = c}} ;
|
||||
-- regulates passivised object: accusative objects -> nom; all others: same case
|
||||
-- this also gives "mit dir wird gerechnet" ;
|
||||
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
||||
|
||||
PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
||||
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
||||
|
||||
Pass3V3 v = -- HL 7/19
|
||||
let bekommenPass : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen")
|
||||
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) ** { subjc = PrepNom ; c2 = v.c2 } ;
|
||||
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) **
|
||||
{ c1 = PrepNom ; c2 = v.c2 ; objCtrl = False } ;
|
||||
|
||||
PastPartAP vp = {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ vp.inf.s ++
|
||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = []
|
||||
PastPartAP vp =
|
||||
let a = agrP3 Sg in {
|
||||
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2
|
||||
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = vp.ext
|
||||
} ;
|
||||
|
||||
PastPartAgentAP vp np =
|
||||
let agent = appPrepNP P.von_Prep np
|
||||
in {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ agent ++
|
||||
vp.inf.s ++
|
||||
vp.c2.s ++ --- junk if not TV
|
||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
PastPartAgentAP vp np =
|
||||
let a = agrP3 Sg ;
|
||||
agent = appPrepNP P.von_Prep np
|
||||
in {
|
||||
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3
|
||||
++ vp.a2 ++ agent ++ vp.inf.inpl.p2
|
||||
++ vp.c2.s -- junk if not TV
|
||||
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = []
|
||||
@@ -138,37 +130,46 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
m = tm.m ;
|
||||
subj = [] ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
haben = verb.inf2 ;
|
||||
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
||||
-- obj1 = (vp.nn ! agr).p1 ;
|
||||
-- obj = (vp.nn ! agr).p2 ;
|
||||
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
|
||||
extra = vp.ext ;
|
||||
infE : Str = -- HL 30/6/2019
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Simul,True> => inf ; --# notpresent
|
||||
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
|
||||
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_,Anter,True> => inf ; --# notpresent
|
||||
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
|
||||
inffin : Str =
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
||||
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_,Anter,True> --# notpresent
|
||||
=> verb.fin ++ inf ; -- double inf --# notpresent
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
} ;
|
||||
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||
<_,Anter,True> => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
<Pres,_,_> =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
; --# notpresent
|
||||
_ => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||
} ;
|
||||
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
|
||||
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
|
||||
}
|
||||
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||
@@ -182,67 +183,78 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
ReflPoss num cn = {s = \\a,c => num.s ! cn.g ! c ++ possPron a num.n cn.g c ++ cn.s ! adjfCase Strong c ! num.n ! c} ;
|
||||
|
||||
ReflPron = { s = ResGer.reflPron } ; -- reflexively used personal pronoun, with special forms in P3 Sg
|
||||
|
||||
-- In P1,P2 we might use "selbst" to define a (stronger) reflexive pronoun instead: -- HL 3/2022
|
||||
-- du kennst mich vs. ich kenne mich selbst
|
||||
-- er kennt ihn vs. er kennt sich (selbst)
|
||||
-- sie kennen sich (selbst) =/= sie kennen einander
|
||||
-- Likewise, instead of ReflPoss we might define a reflexive possessive pronoun:
|
||||
-- du kennst meine Fehler vs. ich kenne meine eigenen Fehler
|
||||
-- er|sie|es kennt seine|ihre Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler
|
||||
oper
|
||||
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ;
|
||||
|
||||
reflPossPron : Agr -> Number -> Gender -> Case -> Str =
|
||||
let eigen = adjForms "eigen" "eigen" in
|
||||
\a,n,g,c -> possPron a n g c ++ (eigen ! (AMod (gennum g n) c)) ;
|
||||
|
||||
-- implementation of some of the relevant Foc rules from Extra
|
||||
|
||||
lincat
|
||||
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
||||
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
||||
|
||||
lin
|
||||
FocObj np cl =
|
||||
let n = appPrepNP cl.c2 np
|
||||
in mkFoc n cl ;
|
||||
let n = appPrepNP cl.c2 np in mkFoc n cl ;
|
||||
|
||||
FocAdv adv cl = mkFoc adv.s cl ;
|
||||
FocAdv adv cl = mkFoc adv.s cl ;
|
||||
|
||||
FocAP ap np =
|
||||
let adj = ap.s ! APred ;
|
||||
vp = predV sein_V ** {ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext};
|
||||
-- potentially not correct analysis for all examples
|
||||
-- works for:
|
||||
-- "treu ist sie ihm"
|
||||
-- "froh ist sie dass er da ist"
|
||||
-- "stolz ist sie auf ihn"
|
||||
subj = mkSubj np vp.subjc ;
|
||||
cl = mkClause subj.p1 subj.p2 vp
|
||||
in mkFoc adj cl ;
|
||||
FocAP ap np =
|
||||
let adj = ap.s ! APred ;
|
||||
vp = predV ResGer.sein_V ** {ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext};
|
||||
-- potentially not correct analysis for all examples
|
||||
-- works for:
|
||||
-- "treu ist sie ihm"
|
||||
-- "froh ist sie dass er da ist"
|
||||
-- "stolz ist sie auf ihn"
|
||||
subj = mkSubj np vp.c1 ;
|
||||
cl = mkClause subj.p1 subj.p2 vp
|
||||
in mkFoc adj cl ;
|
||||
|
||||
UseFoc t p f = {s = t.s ++ p.s ++ f.s ! t.m ! t.t ! t.a ! p.p} ;
|
||||
UseFoc t p f = {s = t.s ++ p.s ++ f.s ! t.m ! t.t ! t.a ! p.p} ;
|
||||
|
||||
|
||||
-- extra rules to get some of the "es" alternative linearisations
|
||||
|
||||
lin
|
||||
EsVV vv vp = predV vv ** {
|
||||
nn = \\a => let n = vp.nn ! a in <"es" ++ n.p1, n.p2, n.p3, n.p4, n.p5, n.p6> ;
|
||||
inf = vp.inf ** {s = vp.s.s ! (VInf True) ++ vp.inf.s} ; -- ich genieße es zu versuchen zu gehen; alternative word order could be produced by vp.inf ++ vp.s.s... (zu gehen zu versuchen)
|
||||
a1 = vp.a1 ;
|
||||
a2 = vp.a2 ;
|
||||
ext = vp.ext ;
|
||||
infExt = vp.infExt ;
|
||||
adj = vp.adj } ;
|
||||
|
||||
EsV2A v2a ap s = predV v2a ** {
|
||||
nn = \\_ => <"es",[],[],[],[],[]> ;
|
||||
adj = ap.s ! APred ;
|
||||
ext = "," ++ "dass" ++ s.s ! Sub} ;
|
||||
EsVV vv vp = -- HL 3/2022
|
||||
let inf = mkInf False Simul Pos vp ; -- False = force extraction
|
||||
objs : Agr => Str * Str * Str * Str = \\a => <"es",[],[],[]> ;
|
||||
vps = predV vv ** { nn = objs }
|
||||
in insertExtrapos vp.ext (
|
||||
insertInf inf vps) ;
|
||||
|
||||
EsV2A v2a ap s = predV v2a ** {
|
||||
nn = \\_ => <"es",[],[],[]> ;
|
||||
adj = ap.s ! APred ;
|
||||
ext = "," ++ conjThat ++ s.s ! Sub} ;
|
||||
|
||||
-- "es wird gelacht"; generating formal sentences
|
||||
|
||||
lincat
|
||||
FClause = ResGer.VP ** {subj : ResGer.NP} ;
|
||||
|
||||
FClause = ResGer.VP ** {subj : ResGer.NP} ;
|
||||
|
||||
lin
|
||||
VPass v =
|
||||
let vp = predV werdenPass ;
|
||||
in vp ** {
|
||||
subj = esSubj ;
|
||||
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
|
||||
VPass v =
|
||||
let vp = predV werdenPass
|
||||
in vp ** {subj = esSubj ;
|
||||
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
|
||||
|
||||
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
||||
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
||||
|
||||
FtoCl cl =
|
||||
let subj = mkSubj cl.subj cl.subjc
|
||||
let subj = mkSubj cl.subj cl.c1
|
||||
in DisToCl subj.p1 subj.p2 cl ;
|
||||
|
||||
|
||||
@@ -251,16 +263,14 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
mkFoc : Str -> Cl -> Foc = \focus, cl ->
|
||||
lin Foc {s = \\m,t,a,p => focus ++ cl.s ! m ! t ! a ! p ! Inv} ;
|
||||
|
||||
esSubj : NP = lin NP {
|
||||
s = \\_ => "es" ;
|
||||
rc, ext = [] ;
|
||||
a = Ag Neutr Sg P3 ;
|
||||
-- isLight = True ;
|
||||
-- isPron = True
|
||||
w = WPron
|
||||
} ;
|
||||
esSubj : CatGer.NP = lin NP {
|
||||
s = \\_ => "es" ;
|
||||
rc, ext = [] ;
|
||||
a = Ag Neutr Sg P3 ;
|
||||
w = WPron
|
||||
} ;
|
||||
|
||||
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
||||
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
||||
let vps = useVP vp in {
|
||||
s = \\m,t,a,b,o =>
|
||||
let
|
||||
@@ -273,20 +283,23 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
obj1 = (vp.nn ! agr).p1 ;
|
||||
obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ;
|
||||
compl = obj1 ++ neg ++ vp.adj ++ obj2 ++ vp.a2 ; -- adj added
|
||||
inf = vp.inf.s ++ verb.inf ; -- not used for linearisation of Main/Inv
|
||||
inf = vp.inf.inpl.p2 ++ verb.inf ; -- not used for linearisation of Main/Inv
|
||||
infExt = vp.inf.extr ! agr ;
|
||||
extra = vp.ext ;
|
||||
inffin : Str =
|
||||
inffin : Str =
|
||||
case <a,vp.isAux> of {
|
||||
<Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
}
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
|
||||
Inv => verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
|
||||
Sub => compl ++ vp.infExt ++ inffin ++ extra }
|
||||
Main => subj ++ verb.fin ++ compl ++ infExt ++ verb.inf ++ extra ++ vp.inf.inpl.p2 ;
|
||||
Inv => verb.fin ++ compl ++ infExt ++ verb.inf ++ extra ++ vp.inf.inpl.p2 ; -- vp.inf.s ;
|
||||
Sub => compl ++ infExt ++ inffin ++ extra }
|
||||
} ;
|
||||
|
||||
-- this function is not entirely satisfactory as largely
|
||||
-- though not entirely duplicating mkClause in ResGer
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,13 +4,12 @@ abstract ExtraGerAbs = Extra [
|
||||
VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP,
|
||||
Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP,
|
||||
Foc,FocObj,FocAdv,FocAP,UseFoc,
|
||||
RNP,ReflRNP,ReflPoss
|
||||
RNP,ReflRNP,ReflPoss,ReflPron
|
||||
] ** {
|
||||
flags coding=utf8;
|
||||
|
||||
cat
|
||||
FClause ; -- formal clause
|
||||
|
||||
fun
|
||||
PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche
|
||||
TImpfSubj : Tense ; -- ich möchte... --# notpresent
|
||||
@@ -27,4 +26,5 @@ abstract ExtraGerAbs = Extra [
|
||||
FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc.
|
||||
|
||||
Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ concrete IdiomGer of Idiom = CatGer **
|
||||
} ;
|
||||
|
||||
ImpP3 np vp = {
|
||||
s = (mkClause ((mkSubj np vp.subjc).p1) np.a vp).s !
|
||||
s = (mkClause ((mkSubj np vp.c1).p1) np.a vp).s !
|
||||
MConjunct ! Pres ! Simul ! Pos ! Inv
|
||||
} ;
|
||||
|
||||
|
||||
@@ -607,17 +607,17 @@ mkV2 : overload {
|
||||
|
||||
mkV2V = overload { -- default: object-control
|
||||
mkV2V : V -> V2V
|
||||
= \v -> dirV2 v ** {isAux = False ; ctrl = ObjC ; lock_V2V = <>} ;
|
||||
= \v -> dirV2 v ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ; -- ermahne jmdn, sich zu waschen
|
||||
mkV2V : V -> Prep -> V2V
|
||||
= \v,p -> prepV2 v p ** {isAux = False ; ctrl = ObjC ; lock_V2V = <>} ;
|
||||
= \v,p -> prepV2 v p ** {isAux = False ; objCtrl = True ; lock_V2V = <>} ;
|
||||
} ;
|
||||
auxV2V = overload {
|
||||
auxV2V : V -> V2V
|
||||
= \v -> dirV2 v ** {isAux = True ; ctrl = ObjC ; lock_V2V = <>} ;
|
||||
= \v -> dirV2 v ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ; -- lasse jmdn sich waschen
|
||||
auxV2V : V -> Prep -> V2V
|
||||
= \v,p -> prepV2 v p ** {isAux = True ; ctrl = ObjC ; lock_V2V = <>} ;
|
||||
= \v,p -> prepV2 v p ** {isAux = True ; objCtrl = True ; lock_V2V = <>} ;
|
||||
} ;
|
||||
subjV2V v = v ** {ctrl = SubjC} ;
|
||||
subjV2V v = v ** {objCtrl = False} ;
|
||||
|
||||
mkV2A = overload {
|
||||
mkV2A : V -> V2A
|
||||
|
||||
@@ -50,7 +50,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in {
|
||||
s = \\m,t,a,p =>
|
||||
let
|
||||
vp = predV sein_V ** {ext = icomp.ext};
|
||||
subj = mkSubj np vp.subjc ;
|
||||
subj = mkSubj np vp.c1 ;
|
||||
cls = (mkClause subj.p1 subj.p2 vp).s ! m ! t ! a ! p ;
|
||||
why = icomp.s ! np.a
|
||||
in table {
|
||||
|
||||
@@ -101,14 +101,14 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
|
||||
--2 For $Verb$
|
||||
|
||||
param VForm =
|
||||
param VForm =
|
||||
VInf Bool -- True = with the particle "zu"
|
||||
| VFin Bool VFormFin -- True = prefix glued to verb
|
||||
| VImper Number -- prefix never glued
|
||||
| VPresPart AForm -- prefix always glued
|
||||
| VPastPart AForm ;
|
||||
|
||||
param VFormFin =
|
||||
param VFormFin =
|
||||
VPresInd Number Person
|
||||
| VPresSubj Number Person
|
||||
| VImpfInd Number Person --# notpresent
|
||||
@@ -124,10 +124,6 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
|
||||
param VType = VAct | VRefl Case ;
|
||||
|
||||
-- Implicit subject of embedded vp equals subject resp. object of matrix verb v:V2V:
|
||||
|
||||
param Control = SubjC | ObjC | NoC ; -- NoC : verb without infinite vp-complement
|
||||
|
||||
-- The order of a sentence depends on whether it is used as a main
|
||||
-- clause, inverted, or subordinate.
|
||||
|
||||
@@ -258,7 +254,7 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
-- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted
|
||||
a : Agr ;
|
||||
-- isLight : Bool ; -- light NPs come before negation in simple clauses (expensive)
|
||||
-- isPron : Bool } ; -- needed to put accPron before datPron
|
||||
-- isPron : Bool ; -- needed to put accPron before datPron
|
||||
w : Weight } ;
|
||||
|
||||
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
|
||||
@@ -546,22 +542,23 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
} ;
|
||||
|
||||
VP : Type = {
|
||||
s : Verb ; -- HL 6/2019: <refl|pron,NP,PP,AP|CN|Adv,ObjInf,EmbedInfs>
|
||||
nn : Agr => Str * Str * Str * Str -- <sich|ihr,deine Frau,an sie,gut,
|
||||
* Str * Str ; -- splitInfExt: (rate) dir, dich zu bemühen mir zu helfen>
|
||||
a1 : Str ; -- adv before negation, adV
|
||||
a2 : Str ; -- heute = adv
|
||||
adj : Str ; -- adjectival complement ("ich finde dich schön")
|
||||
isAux : Bool ; -- is a double infinitive
|
||||
inf : {s:Str ; isAux:Bool ; ctrl:Control} ; -- infinitival complement of VV or V2V
|
||||
ext : Str ; -- dass sie kommt
|
||||
infExt : Str ; -- infinitival complements of inf
|
||||
-- e.g. ich hoffe [ihr zu helfen] zu versuchen
|
||||
subjc : Preposition -- case of subject
|
||||
s : Verb ; -- HL 6/2019: <refl|pron,NP,PP,AP|CN|Adv>
|
||||
nn : Agr => Str * Str * Str * Str ; -- <sich|ihr,deine Frau,an sie,gut>
|
||||
a1 : Str ; -- was: adV inserted before negation, unused?
|
||||
a2 : Str ; -- adverb
|
||||
adj : Str ; -- adjectival complement of V(2)A, e.g. ich finde dich schön
|
||||
isAux : Bool ; -- is a double infinitive?, e.g. müssen:VV, lassen:V2V
|
||||
ext : Str ; -- sentential complement of V(2)S, V(2)Q, e.g. dass|ob sie kommt
|
||||
inf : {inpl: (Agr => Str)*Str ; -- infinitival complement of V(2)V HL 3/2022
|
||||
extr: (Agr => Str)} ; -- e.g. ihn [] versuchen (lasse) [, ihr zu helfen]
|
||||
c1 : Preposition -- case of subject
|
||||
} ;
|
||||
|
||||
VPSlash = VP ** {c2 : Preposition ;
|
||||
objCtrl : Bool } ; -- True = embedded reflexives agree with object
|
||||
VPSlash = VP ** {c2 : Preposition ; objCtrl : Bool} ; -- HL 3/2019 objCtr added
|
||||
|
||||
-- objCtrl distinguishes object-control from subject-control verb v:V2V in VP.s:
|
||||
-- if True, reflexives in vp.inf and vp.nn have to agree with c2-object (added
|
||||
-- by ComplSlash), else with subject (added by mkClause).
|
||||
|
||||
useVP : VP -> VPC = \vp ->
|
||||
let
|
||||
@@ -604,11 +601,12 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
Cond => vf True (wuerde a) vinf [] ; --# notpresent
|
||||
Pres => vf b (vfin b m t a) [] []
|
||||
} ;
|
||||
VPFinite m t Anter => case t of { --# notpresent
|
||||
Pres | Past => vf True (hat m t a) vpart [] ; --# notpresent
|
||||
VPFinite m t Anter => case t of {
|
||||
Past => vf True (hat m t a) vpart [] ; --# notpresent
|
||||
Fut => vf True (wird m a) vpart haben ; --# notpresent
|
||||
Cond => vf True (wuerde a) vpart haben --# notpresent
|
||||
} ; --# notpresent
|
||||
Cond => vf True (wuerde a) vpart haben ; --# notpresent
|
||||
Pres => vf True (hat m t a) vpart []
|
||||
} ;
|
||||
VPImperat False => vf False (verb.s ! VImper (numberAgr a)) [] [] ;
|
||||
VPImperat True => vf False (verb.s ! VFin False (VPresSubj Pl P3)) [] [] ;
|
||||
VPInfinit Anter => vf True [] (vpart ++ haben) [] ; --# notpresent
|
||||
@@ -616,31 +614,23 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
}
|
||||
} ;
|
||||
|
||||
predV : Verb -> VPSlash = predVGen False ;
|
||||
predV : Verb -> VP = predVGen False ;
|
||||
|
||||
predVc : Verb ** {c2 : Preposition} -> VPSlash = \v ->
|
||||
predV v ** {c2 = v.c2 ; objCtrl = False} ;
|
||||
|
||||
predVGen : Bool -> Verb -> VPSlash = \isAux, verb -> {
|
||||
s = {
|
||||
s = verb.s ;
|
||||
prefix = verb.prefix ;
|
||||
particle = verb.particle ;
|
||||
aux = verb.aux ;
|
||||
vtype = verb.vtype
|
||||
} ;
|
||||
predVGen : Bool -> Verb -> VP = \isAux, verb -> {
|
||||
s = verb ;
|
||||
a1,a2 : Str = [] ;
|
||||
nn : Agr => Str * Str * Str * Str * Str * Str = case verb.vtype of {
|
||||
VAct => \\_ => <[],[],[],[],[],[]> ;
|
||||
VRefl c => \\a => <reflPron ! a ! c,[],[],[],[],[]>
|
||||
nn : Agr => Str * Str * Str * Str = case verb.vtype of {
|
||||
VAct => \\_ => <[],[],[],[]> ;
|
||||
VRefl c => \\a => <reflPron ! a ! c,[],[],[]>
|
||||
} ;
|
||||
isAux = isAux ; ----
|
||||
inf = {s=[]; isAux=True; ctrl=NoC} ; -- default infinitive complement
|
||||
ext,infExt,adj : Str = [] ; -- (isAux=True => no endcomma)
|
||||
subjc = PrepNom ;
|
||||
-- Dummy values for subtyping.
|
||||
c2 = PrepNom ;
|
||||
objCtrl = False
|
||||
-- default infinitival complement:
|
||||
inf = {inpl = <\\_ => [], []>; extr = \\_ => []} ;
|
||||
ext,adj : Str = [] ;
|
||||
c1 = PrepNom
|
||||
} ;
|
||||
|
||||
auxPerfect : Verb -> VForm => Str = \verb ->
|
||||
@@ -702,100 +692,109 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
|
||||
-- IL 24/04/2018 Fixing the scope of reflexives
|
||||
objAgr : { a : Agr } -> VP -> VP = \obj,vp -> vp ** {
|
||||
nn = \\a => vp.nn ! obj.a } ;
|
||||
-- HL: if reflexive only: <vp.nn.p1 ! np.a, vp.nn.p1 ! a, ..>
|
||||
nn = \\a => vp.nn ! obj.a ;
|
||||
inf = {inpl = <\\a => vp.inf.inpl.p1 ! obj.a, vp.inf.inpl.p2> ; -- HL 3/2022
|
||||
extr = \\a => vp.inf.extr ! obj.a} } ; -- HL 3/2022
|
||||
|
||||
-- Extending a verb phrase with new constituents.
|
||||
|
||||
insertObj : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp -> -- obj:Comp A|Adv|CN
|
||||
vp ** { nn = \\a => let vpnn = vp.nn ! a
|
||||
in <vpnn.p1, vpnn.p2, vpnn.p3, obj ! a ++ vpnn.p4, vpnn.p5, vpnn.p6> } ;
|
||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> -- obj:Comp A|Adv|CN
|
||||
vp ** { nn = \\a => let vpnn = vp.nn ! a in
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3, obj ! a ++ vpnn.p4> } ;
|
||||
|
||||
insertObjc : (Agr => Str) -> VPSlash -> VPSlash = \obj,vp ->
|
||||
insertObj obj vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl } ;
|
||||
|
||||
insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp ->
|
||||
let c = case prep.c of { NPC cc => cc ; _ => Nom } ;
|
||||
obj : Agr => Str = \\_ => appPrepNP prep np ;
|
||||
obj = appPrepNP prep np ;
|
||||
in vp ** {
|
||||
nn = \\a => -- HL 11/6/19: rough objNP order: (p5,p6 = splitInfExt)
|
||||
let vpnn = vp.nn ! a in -- vfin < accPron < refl < (gen|dat)Pron < nonPronNP < neg < prepNP < vinf|comp
|
||||
{- less expensive if isLight is removed from NPs:
|
||||
case <np.isPron,prep.isPrep,c> of {
|
||||
-- (assuming v.c2=acc) nonPron: dat < acc|gen (acc < gen not enforced)
|
||||
<True, False,Acc> => -- <es|ihn sich, np, pp, comp, _,_>
|
||||
<obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<True, False,_ > => -- <sich ihm, np, pp, comp>
|
||||
<vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<False,False,Dat> => -- <prons, dat ++ np, pp, comp>
|
||||
<vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<False,False,_ > => -- <prons, np ++ gen|acc, pp, comp>
|
||||
<vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<_, True,_ > => -- <prons, np, pp++pp, compl>
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6>
|
||||
}
|
||||
-}
|
||||
-- expensive: -- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp
|
||||
case <prep.isPrep, np.w, c> of {
|
||||
<True, _,_> => -- <prons, light, heavy++pp, compl,_,_>
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<False,WPron, Acc> => -- <ihn ++ sich, light, heavy, comp, _,_>
|
||||
<obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
nn = \\a =>
|
||||
let vpnn = vp.nn ! a in
|
||||
-- HL 11/6/19: rough object NP order (expensive):
|
||||
-- vfin < accPron < refl < (gen|dat)Pron < lightNP < neg < heavyNP|PP < vinf|comp
|
||||
case <prep.isPrep, np.w, c> of { -- 2 * 3 * 4 = 24 cases
|
||||
<True, _,_> => -- <prons, light, heavy++pp, compl>
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> ;
|
||||
<False,WPron, Acc> => -- <ihn ++ sich, light, heavy, comp>
|
||||
<obj ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||
<False,WPron, _ > => -- <sich ++ ihm|seiner, light, heavy, comp>
|
||||
<vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<False,WLight,Dat> => -- (assuming v.c2=acc) nonPron: dat < acc|gen
|
||||
<vpnn.p1 ++ obj, vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||
<False,WLight,Dat> => -- (assuming v.c2=acc) nonPron: dat < acc|gen
|
||||
-- <prons, dat ++ np, heavy, comp>
|
||||
<vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<vpnn.p1, obj ++ vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||
<False,WHeavy,Dat> => -- <prons, light, dat ++ np, comp>
|
||||
<vpnn.p1, vpnn.p2, obj ! a ++ vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<vpnn.p1, vpnn.p2, obj ++ vpnn.p3, vpnn.p4> ;
|
||||
<False,WLight,_ > => -- <prons, np ++ gen|acc, heavy, comp>
|
||||
<vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
<vpnn.p1, vpnn.p2 ++ obj, vpnn.p3, vpnn.p4> ;
|
||||
<False,WHeavy,_ > => -- <prons, light, dat ++ np, comp>
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4, vpnn.p5, vpnn.p6> }
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3 ++ obj, vpnn.p4> }
|
||||
} ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4)
|
||||
|
||||
insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron
|
||||
let prep = vp.c2 ;
|
||||
b = notB prep.isPrep ;
|
||||
c = case prep.c of { NPC cc => cc ; _ => Acc } ;
|
||||
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ;
|
||||
obj : Agr => Str = \\a => prep.s ++ reflPron ! a ! c ; -- HL: to test ReflVP: reflPronSelf
|
||||
in vp ** {
|
||||
nn = \\a =>
|
||||
let vpnn = vp.nn ! a in
|
||||
case b of {
|
||||
True => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
False => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> }
|
||||
case prep.isPrep of {
|
||||
False => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ;
|
||||
True => <vpnn.p1, obj ! a ++ vpnn.p2, vpnn.p3, vpnn.p4> }
|
||||
} ;
|
||||
|
||||
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { -- not used in RGL, so VP.a1 can be skipped
|
||||
insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { -- not used in Ger, so VP.a1 can be skipped
|
||||
a1 = adv ++ vp.a1 } ; -- cf. AdvVP(Slash),AdVVP(Slash)
|
||||
|
||||
insertAdv : Str -> VP -> VP = \adv,vp -> vp ** {
|
||||
a2 = vp.a2 ++ adv } ;
|
||||
|
||||
insertExtrapos : Str -> VPSlash -> VPSlash = \ext,vp -> vp ** {
|
||||
insertExtrapos : Str -> VP -> VP = \ext,vp -> vp ** {
|
||||
ext = vp.ext ++ ext } ;
|
||||
|
||||
insertInfExt : Str -> VPSlash -> VPSlash = \infExt,vp -> vp ** {
|
||||
infExt = vp.infExt ++ infExt } ;
|
||||
-- HL 3/2022: to do nested infinitival objects in ComplVV, SlashVV, SlashV2V
|
||||
-- embed <sich, helfen> into <ihn, lassen> = <ihn sich, helfen lassen>
|
||||
embedInf : (Agr => Str) * Str -> (Agr => Str) * Str -> (Agr => Str) * Str =
|
||||
\f,g -> <\\a => g.p1!a ++ f.p1!a, f.p2 ++ g.p2> ;
|
||||
|
||||
-- HL: to handle infExt in ComplVV and SlashVV, SlashV2V
|
||||
insertInfExtraObj : (Agr => Str) -> VPSlash -> VPSlash = \objs,vp -> vp ** {
|
||||
nn = \\a => let vpnn = vp.nn ! a in
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, objs ! a ++ vpnn.p5, vpnn.p6>
|
||||
} ;
|
||||
insertInfExtraInf : (Agr => Str) -> VPSlash -> VPSlash = \inf,vp -> vp ** {
|
||||
nn = \\a => let vpnn = vp.nn ! a in
|
||||
<vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6 ++ inf ! a>
|
||||
} ;
|
||||
-- Futur-II: (ich werde) ihn dir ++ haben ++ helfen lassen
|
||||
insertInf : {inpl:(Agr => Str)*Str ; extr:(Agr => Str)} -> VP -> VP =
|
||||
\inf,vp -> vp ** {inf = {inpl = embedInf inf.inpl vp.inf.inpl ;
|
||||
extr = \\agr => vp.inf.extr!agr ++ inf.extr!agr}} ;
|
||||
|
||||
insertInf : {s:Str;isAux:Bool;ctrl:Control} -> VPSlash -> VPSlash = \inf,vp -> vp ** {
|
||||
inf = {s = inf.s ++ vp.inf.s ; isAux = inf.isAux ; ctrl=inf.ctrl} } ;
|
||||
glueInpl : (Agr => Str)*Str -> (Agr => Str) =
|
||||
\inplace -> \\agr => (inplace.p1!agr ++ inplace.p2) ;
|
||||
|
||||
insertAdj : Str -> Str * Str -> Str -> VPSlash -> VPSlash = \adj,c,ext,vp -> vp ** {
|
||||
-- HL 3/22: extract infzu-complement, leave inf-complement in-place
|
||||
mkInf : Bool -> Anteriority -> Polarity -> VP ->
|
||||
{inpl : (Agr => Str) * Str ; extr : (Agr => Str)} =
|
||||
\isAux,ant,pol,vp ->
|
||||
let
|
||||
vpi = infVP isAux ant pol vp ;
|
||||
topInpl = <vpi.objs, vpi.pred> ;
|
||||
emptyInpl : (Agr => Str) * Str = <\\_ => [], []> ;
|
||||
comma = bindComma
|
||||
in
|
||||
case <isAux,vp.isAux> of {
|
||||
<True,True> -- 1: {s=will, inpl=<(sich, waschen) können>, extr = []}
|
||||
=> {inpl = embedInf vpi.inpl topInpl ;
|
||||
extr = \\agr => vpi.extr!agr} ;
|
||||
<True,False> -- 2: {s=will; inpl=<[], versuchen>, extr = sich zu waschen}
|
||||
=> {inpl = topInpl ;
|
||||
extr = \\agr => (glueInpl vpi.inpl)!agr ++ vpi.extr!agr} ;
|
||||
<False,True> -- 3: {s=wagt; inpl=<[], []>, extr = (sich, waschen) zu wollen}
|
||||
=> {inpl = emptyInpl ;
|
||||
extr = let moved = embedInf vpi.inpl topInpl
|
||||
in \\agr => comma ++ (glueInpl moved)!agr ++ vpi.extr!agr} ;
|
||||
<False,False> -- 4: {s=wagt, inpl=<[], []>, extr = zu versuchen, (sich zu waschen)}
|
||||
=> {inpl = emptyInpl ;
|
||||
extr = \\agr => comma ++ (glueInpl topInpl)!agr ++ vpi.extr!agr}
|
||||
} ;
|
||||
|
||||
insertAdj : Str -> Str * Str -> Str -> VP -> VP = \adj,c,ext,vp -> vp ** {
|
||||
nn = \\a =>
|
||||
let vpnn = vp.nn ! a in <vpnn.p1, vpnn.p2 ++ c.p1, -- der Frau treu
|
||||
vpnn.p3, vpnn.p4, vpnn.p5, vpnn.p6> ;
|
||||
vpnn.p3, vpnn.p4> ;
|
||||
adj = vp.adj ++ adj ++ c.p2 ; -- neugierig auf das Buch
|
||||
ext = vp.ext ++ ext} ;
|
||||
|
||||
@@ -809,7 +808,8 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
s : Mood => Tense => Anteriority => Polarity => Order => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> let vps = useVP vp in {
|
||||
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp ->
|
||||
let vps = useVP vp in {
|
||||
s = \\m,t,a,b,o =>
|
||||
let
|
||||
ord = case o of {
|
||||
@@ -817,55 +817,39 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
_ => False
|
||||
} ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
haben = verb.inf2 ;
|
||||
neg = negation ! b ;
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||
-- leave inf-complement of +auxV(2)V in place,
|
||||
infObjs = (vp.inf.inpl.p1)!agr ;
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
-- leave inf-complement of +auxV(2)V in place,
|
||||
-- extract infzu-complement of -auxV(2)V: (ComplVV, SlashV2V)
|
||||
infExt : Str * Str = case vp.inf.isAux of
|
||||
{ True => <(vp.nn!agr).p6,[]> ; _ => <[],(vp.nn!agr).p6> } ;
|
||||
extra = infExt.p2 ++ vp.ext ;
|
||||
infCompls = -- () tun | ihn (es tun) lassen | ihm [es zu tun] versprechen
|
||||
(vp.nn ! agr).p5 ++ infExt.p1 ++ vp.inf.s ;
|
||||
comma = case orB vp.isAux (case vp.inf.ctrl of { NoC => True ; _ => False }) of {
|
||||
True => [] ; _ => bindComma} ;
|
||||
inf : Str =
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
-- haben () tun wollen |
|
||||
-- ihn haben (es tun) lassen wollen () |
|
||||
-- ihm haben () versprechen wollen (, es zu tun)
|
||||
(vp.nn ! agr).p5 ++ verb.inf2 ++ infExt.p1 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_, Anter,True> => --# notpresent
|
||||
-- tun wollen [] | ihn (es tun) lassen wollen [] |
|
||||
-- ihm () versprechen wollen [] (, es zu tun)
|
||||
infCompls ++ verb.inf ++ verb.inf2 ; --# notpresent
|
||||
<Fut|Cond,Simul,True> => --# notpresent
|
||||
infCompls ++ verb.inf ++ verb.inf2 ; --# notpresent
|
||||
<Fut|Cond,Anter,False> => --# notpresent
|
||||
-- gebeten haben , es zu tun () | gebeten haben , ihn (es tun) zu lassen
|
||||
verb.inf ++ verb.inf2 ++ comma ++ infCompls ; --# notpresent
|
||||
_ => verb.inf2 ++ verb.inf ++ comma ++ infCompls } ;
|
||||
inffin : Str =
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
||||
=> (vp.nn ! agr).p5 ++ verb.fin --# notpresent
|
||||
++ verb.inf2 ++ infExt.p1 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<Pres|Past,Anter,True> --# notpresent
|
||||
=> (vp.nn ! agr).p5 ++ infExt.p1 ++ verb.fin --# notpresent
|
||||
++ vp.inf.s ++ verb.inf ++ verb.inf2 ; -- double inf --# notpresent
|
||||
<_, _ ,True>
|
||||
=> infCompls ++ verb.inf ++ verb.inf2 ++ verb.fin ; -- or just auxiliary vp
|
||||
<_, _ ,False>
|
||||
=> verb.inf ++ verb.inf2 ++ verb.fin ++ comma ++ infCompls
|
||||
} ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||
<_,Anter,True> => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
_ =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ versucht/[] +[]+ hat/versuchte
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
} ;
|
||||
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ inf ++ extra ;
|
||||
Sub => subj ++ compl ++ inffin ++ extra
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -886,34 +870,60 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
es wird nicht besser
|
||||
-}
|
||||
|
||||
infVP : Bool -> VP -> ((Agr => Str) * Str * Str * Str) =
|
||||
\isAux, vp -> let vps = useVP vp in
|
||||
infVP = overload {
|
||||
infVP : Bool -> VP -> ((Agr => Str) * Str * Str * Str)
|
||||
= infVP_orig ; -- from gf-3.9,
|
||||
infVP : Bool -> Anteriority -> Polarity -> VP
|
||||
-> { objs:(Agr => Str) ; pred:Str; inpl:(Agr=>Str)*Str ; extr:(Agr=>Str) }
|
||||
= infVP_ant ; -- admit infinitive in Anter anteriority and Neg polarity
|
||||
} ;
|
||||
|
||||
infVP_orig : Bool -> VP -> ((Agr => Str) * Str * Str * Str) =
|
||||
\isAux, vp -> let vps = useVP vp ;
|
||||
infExt = vp.inf.extr ! agrP3 Sg -- HL 3/22
|
||||
in
|
||||
<
|
||||
\\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.a2,
|
||||
vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos
|
||||
vp.inf.s,
|
||||
vp.infExt ++ vp.ext
|
||||
vp.inf.inpl.p2, -- ! HL
|
||||
infExt ++ vp.ext
|
||||
> ;
|
||||
|
||||
useInfVP : Bool -> VP -> Str = \isAux,vp ->
|
||||
let vpi = infVP isAux vp in
|
||||
vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ;
|
||||
infVP_ant : Bool -> Anteriority -> Polarity -> VP -- HL 3/22
|
||||
-> { objs:(Agr => Str) ; pred:Str ; inpl:(Agr=>Str)*Str ; extr:(Agr=>Str) } =
|
||||
\isAux, ant, pol, vp -> let vps = useVP vp in
|
||||
{
|
||||
objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
|
||||
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
|
||||
pred = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
|
||||
-- inplace and extracted parts of vp.inf:
|
||||
inpl = vp.inf.inpl ;
|
||||
extr = vp.inf.extr
|
||||
} ;
|
||||
|
||||
infzuVP : Bool -> Control -> Anteriority -> Polarity -> VP -- HL
|
||||
-> { objs:(Agr => Str) ; pred:{s:Str;isAux:Bool;ctrl:Control} ; inf:Str ; ext:Str } =
|
||||
\isAux, ctrl, ant, pol, vp -> let vps = useVP vp in
|
||||
infVPSlash : Bool -> Anteriority -> Polarity -> VPSlash -- HL 3/22
|
||||
-> { objs:(Agr => Str) ; pred:Str; inpl:(Agr=>Str)*Str ; extr:(Agr=>Str) } =
|
||||
\isAux, ant, pol, vp -> let vps = useVP vp in
|
||||
{ objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3
|
||||
++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP
|
||||
pred = { s = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
|
||||
isAux = vp.isAux ; ctrl = ctrl } ;
|
||||
inf = vp.inf.s ;
|
||||
ext = vp.ext
|
||||
} ;
|
||||
pred = vp.inf.inpl.p2 ++ vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ;
|
||||
-- inplace and extracted parts of vp.inf:
|
||||
inpl = <vp.inf.inpl.p1, []> ; -- move the predicate part to pred
|
||||
extr = vp.inf.extr
|
||||
} ** {c2 = vp.c2 ; objCtrl = vp.objCtrl} ;
|
||||
|
||||
-- for CatGer.linref VP and Verb.embedVP:
|
||||
useInfVP : Bool -> VP -> Str = \isAux,vp ->
|
||||
-- let vpi = infVP isAux vp in
|
||||
-- vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ;
|
||||
let vpi = infVP isAux Simul Pos vp ; -- HL 3/2022
|
||||
agr : Agr = (Ag Masc Sg P3) ;
|
||||
glue : (Agr => Str)*Str -> Str = \i -> i.p1!agr ++ i.p2
|
||||
in
|
||||
glue (embedInf vpi.inpl <vpi.objs, vpi.pred>) ++ vpi.extr!agr ++ vp.ext ;
|
||||
|
||||
-- The nominative case is not used as reflexive, but defined here
|
||||
-- so that we can reuse this in personal pronouns.
|
||||
-- The missing Sg "ihrer" shows that a dependence on gender would
|
||||
-- be needed.
|
||||
|
||||
reflPron : Agr => Case => Str = table {
|
||||
Ag _ Sg P1 => caselist "ich" "mich" "mir" "meiner" ;
|
||||
@@ -984,12 +994,10 @@ resource ResGer = ParamX ** open Prelude in {
|
||||
} ;
|
||||
|
||||
-- Function that allows the construction of non-nominative subjects.
|
||||
mkSubj : NP -> Preposition -> Str * Agr = \np, subjc ->
|
||||
mkSubj : NP -> Preposition -> Str * Agr = \np, prep ->
|
||||
let
|
||||
sub = subjc ;
|
||||
agr = case sub.c of { NPC Nom => np.a ; _ => Ag Masc Sg P3 } ;
|
||||
subj = appPrepNP sub np
|
||||
agr = case prep.c of { NPC Nom => np.a ; _ => Ag Masc Sg P3 } ;
|
||||
subj = appPrepNP prep np
|
||||
in <subj , agr> ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
PredVP np vp =
|
||||
let subj = mkSubj np vp.subjc
|
||||
in mkClause subj.p1 subj.p2 vp ;
|
||||
PredVP np vp =
|
||||
let subj = mkSubj np vp.c1
|
||||
in mkClause subj.p1 subj.p2 vp ;
|
||||
|
||||
{- applies verb's subject case to subject ;
|
||||
forces 3rd person sg agreement for any non-nom subjects -->
|
||||
@@ -26,16 +26,16 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
||||
} ;
|
||||
agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter
|
||||
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
|
||||
inf = vp.inf.s ++ verb.inf ; -- HL .nn
|
||||
inf = vp.inf.inpl.p2 ++ verb.inf ; -- HL .s/.inpl.p2
|
||||
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
|
||||
in
|
||||
-- verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
||||
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
||||
} ;
|
||||
|
||||
SlashVP np vp =
|
||||
let subj = mkSubj np vp.subjc
|
||||
in mkClause subj.p1 subj.p2 vp ** {c2 = vp.c2} ;
|
||||
SlashVP np vp =
|
||||
let subj = mkSubj np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
|
||||
in mkClause subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
|
||||
|
||||
AdvSlash slash adv = {
|
||||
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
|
||||
|
||||
@@ -15,37 +15,20 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
||||
insertInf vpi.p2 (
|
||||
insertObjc vpi.p1 vps))) ;
|
||||
-}
|
||||
-- HL 7/19
|
||||
ComplVV v vp = -- will|wage (es ([]|zu) tun [] | ihn [es tun] ([]|zu) lassen
|
||||
|
||||
ComplVV v vp = -- HL 3/22: leave inf-complement in-place, extract infzu-complement
|
||||
let
|
||||
vps = predVGen v.isAux v ;
|
||||
vpi = infzuVP v.isAux SubjC Simul Pos vp ;
|
||||
-- { objs: ihm ; pred: []/zu versprechen, objInf: sich/es zu tun }
|
||||
-- (ich) vfin:werde (ihm ([]/zu) versprechen) vinf:(wollen/gewagt haben) (, es zu tun)
|
||||
-- (ich) vfin:werde (ihn (es tun) lassen)/[] vinf:(wollen/gewagt haben) []/(, ihn (es tun) zu lassen)
|
||||
extInfzu = case <vp.isAux,vp.inf.isAux> of {<True,False> => (vp.nn!(Ag Masc Sg P3)).p6 ; _ => []} ;
|
||||
comma = case vp.inf.ctrl of { NoC => [] ; _ => bindComma} ; -- es (zu) tun
|
||||
embeddedInf : Agr => Str =
|
||||
case <vp.isAux,vp.inf.isAux> of { -- vv + vp + [embeddedInf]
|
||||
-- will [es lesen] können | will ihn [es lesen] lassen
|
||||
<True,True> => \\agr => (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ;
|
||||
-- will ihn [euch (extInfzu) bitten] lassen
|
||||
<True,False> => \\agr => (vp.nn!agr).p5 ++ vpi.inf ; -- ++ (vp.nn!agr).p6 => extInfzu
|
||||
-- will es lesen [] | will ihn bitten [, es zu lesen] | will ihn bitten [, sie es lesen zu lassen]
|
||||
<False,True> => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ;
|
||||
-- will ihn bitten [, ihr zu helfen, es zu lesen]
|
||||
<False,False> => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 }
|
||||
vps = predVGen v.isAux v ; -- e.g. will.isAux=True | wagt.isAux=False
|
||||
inf = mkInf v.isAux Simul Pos vp
|
||||
in
|
||||
insertExtrapos (extInfzu ++ vpi.ext) ( -- vps.ext <- vp's extracted embedded infzu + vp's object-sentence
|
||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
||||
insertInfExtraInf embeddedInf vps))) ;
|
||||
insertExtrapos vp.ext (
|
||||
insertInf inf vps) ;
|
||||
|
||||
ComplVS v s =
|
||||
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ;
|
||||
ComplVQ v q =
|
||||
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ;
|
||||
ComplVA v ap = insertAdj (v.c2.s ++ ap.s ! APred) ap.c ap.ext (predV v) ; -- changed
|
||||
ComplVA v ap = insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ;
|
||||
|
||||
SlashV2a v = (predVc v) ;
|
||||
|
||||
@@ -53,9 +36,9 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
||||
Slash3V3 v np = insertObjNP np v.c3 (predVc v) ;
|
||||
|
||||
SlashV2S v s =
|
||||
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predVc v) ;
|
||||
insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2; objCtrl = False} ;
|
||||
SlashV2Q v q =
|
||||
insertExtrapos (comma ++ q.s ! QIndir) (predVc v) ;
|
||||
insertExtrapos (comma ++ q.s ! QIndir) (predV v) ** {c2 = v.c2; objCtrl = False} ;
|
||||
{-
|
||||
SlashV2V v vp =
|
||||
let
|
||||
@@ -66,28 +49,26 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
||||
insertInfExt vpi.p3 (
|
||||
insertInf vpi.p2 (
|
||||
insertObjc vpi.p1 vps))) ;
|
||||
|
||||
-}
|
||||
SlashV2V v vp = -- jmdn bitten, (\agr => sich!agr das Buch zu merken) HL 7/19
|
||||
SlashV2V v vp = -- (jmdn) bitten, sich zu waschen | sich waschen lassen HL 7/19
|
||||
let
|
||||
vps = (predVGen v.isAux v) ** { c2 = v.c2 ; objCtrl = case v.ctrl of {ObjC => True ; _ => False}} ;
|
||||
vpi = infzuVP v.isAux v.ctrl Simul Pos vp ;
|
||||
comma : Str = case <vp.isAux,vp.inf.ctrl> of { <True,_> | <_,NoC> => [] ; _ => bindComma} ;
|
||||
embeddedInf : Agr => Str = case vp.inf.isAux of {
|
||||
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- ihn es lesen (zu) lassen
|
||||
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- ihn (zu) bitten , es zu lesen
|
||||
vps = predVGen v.isAux v ; -- e.g. verspricht|bittet.isAux=False | läßt.isAux=True
|
||||
inf = mkInf v.isAux Simul Pos vp
|
||||
in
|
||||
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
|
||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
||||
insertInfExtraInf embeddedInf vps))) ;
|
||||
insertExtrapos vp.ext (
|
||||
insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ;
|
||||
|
||||
SlashV2A v ap =
|
||||
insertAdj (ap.s ! APred) ap.c ap.ext (predVc v) ;
|
||||
insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ;
|
||||
|
||||
ComplSlash vps np =
|
||||
let vp = insertObjNP np vps.c2 vps ;
|
||||
-- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np.
|
||||
in case vps.objCtrl of { True => objAgr np vp ; _ => vp } ;
|
||||
-- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np.
|
||||
-- HL 3/22 better before inserting np, using objCtrl
|
||||
let vp = case vps.objCtrl of { True => objAgr np vps ; _ => vps }
|
||||
** { c2 = vps.c2 ; objCtrl = vps.objCtrl } ;
|
||||
in insertObjNP np vps.c2 vp ;
|
||||
|
||||
{-
|
||||
SlashVV v vp =
|
||||
let
|
||||
@@ -95,26 +76,34 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
||||
vps = predVGen v.isAux v ** {c2 = vp.c2 } ;
|
||||
in vps **
|
||||
insertExtrapos vpi.p3 (
|
||||
insertInf {s=vpi.p2;isAux=vp.isAux;ctrl=SubjC} ( -- insertInf vpi.p2 (
|
||||
insertInf vpi.p2 (
|
||||
insertObj vpi.p1 vps)) ;
|
||||
-}
|
||||
SlashVV v vp = -- will|hoffe ((zu) lesen | ihr (zu) geben | (zu) bitten, es zu lesen)
|
||||
|
||||
-- SlashVV v vps is like ComplVV v vp, but infinite vps should not be extracted
|
||||
SlashVV v vp = -- HL 3/2022
|
||||
let
|
||||
vps = (predVGen v.isAux v) ** { c2 = vp.c2 } ;
|
||||
vpi = infzuVP v.isAux SubjC Simul Pos vp ; -- (zu) (lesen | ihr geben | bitten, es zu lesen)
|
||||
comma : Str = case <vp.isAux,vp.inf.ctrl> of { <True,_> | <_,NoC> => [] ; _ => bindComma} ;
|
||||
embeddedInf : Agr => Str = case vp.inf.isAux of {
|
||||
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- es lesen (zu) lassen
|
||||
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- (zu) bitten, es zu lesen
|
||||
vps = predVGen v.isAux v ; -- e.g. will.isAux=True | wagt.isAux=False
|
||||
vpi = infVPSlash v.isAux Simul Pos vp ; -- differs from infVP !
|
||||
inf : {inpl: (Agr => Str) * Str ; extr : (Agr => Str)} =
|
||||
let
|
||||
topInpl = <vpi.objs, vpi.pred> ;
|
||||
emptyInpl : (Agr => Str) * Str = <\\_ => [], []> ;
|
||||
in
|
||||
case <v.isAux,vp.isAux> of {
|
||||
<False,True> -- wagt lesen zu wollen
|
||||
=> {inpl = emptyInpl ;
|
||||
extr = let moved = (embedInf vpi.inpl topInpl)
|
||||
in \\agr => (glueInpl moved)!agr ++ (vpi.extr!agr)} ;
|
||||
_ => -- wagt zu lesen zu versuchen
|
||||
-- will lesen können | will zu lesen wagen
|
||||
{inpl = embedInf vpi.inpl topInpl ; extr = vpi.extr}
|
||||
} ;
|
||||
in
|
||||
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
|
||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
||||
insertInfExtraInf embeddedInf vps))) ;
|
||||
insertExtrapos vp.ext (
|
||||
insertInf inf vps) ** {c2 = vp.c2 ; objCtrl = vp.objCtrl};
|
||||
|
||||
-- {- HL 8/19: this slightly modified SlashV2VNP is expensive even with NP.w:Weight
|
||||
|
||||
-- order of embedded objects wrong:
|
||||
{- -- order of embedded objects wrong:
|
||||
-- Lang> p "the woman that you beg me to listen to" | l
|
||||
-- the woman that you beg me to listen to
|
||||
-- die Frau , der ihr mich zuzuhören bittet
|
||||
@@ -123,19 +112,25 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
||||
SlashV2VNP v np vp =
|
||||
let
|
||||
vpi = infVP v.isAux vp ;
|
||||
vps = predVGen v.isAux v ** {c2 = vp.c2} ; -- objCtrl = ?
|
||||
vps = predVGen v.isAux v ** {c2 = vp.c2} ;
|
||||
in vps **
|
||||
insertExtrapos vpi.p3 (
|
||||
insertInf {s=vpi.p2;isAux=v.isAux;ctrl=v.ctrl} ( -- insertInf vpi.p2
|
||||
insertInf vpi.p2 (
|
||||
insertObj vpi.p1 (
|
||||
insertObj (\\_ => appPrepNP v.c2 np) vps))) ;
|
||||
|
||||
-- HL: version with infzuVP in tests/german/TestLangGer.gf, too expensive
|
||||
-}
|
||||
-- expensive: + SlashV2VNP 503.884.800 (2880,540), reaches memory limit with SlashVV
|
||||
-- does not work for nested uses: the nn-levels are confused HL 3/22
|
||||
|
||||
SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22
|
||||
insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ;
|
||||
|
||||
|
||||
UseComp comp =
|
||||
insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used
|
||||
-- adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs?
|
||||
-- "ich bin nicht alt" "ich bin nicht Doris"
|
||||
-- "ich bin nicht alt" "ich bin nicht Doris"
|
||||
|
||||
UseCopula = predV sein_V ;
|
||||
|
||||
@@ -162,7 +157,10 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in {
|
||||
-- (\\k => usePrepC k (\c -> reflPron ! a ! c))) vp ;
|
||||
ReflVP vp = insertObjRefl vp ; -- HL, 19/06/2019
|
||||
|
||||
PassV2 v = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ;
|
||||
PassV2 v = -- acc object -> nom subject; all others: same PCase
|
||||
let c = case <v.c2.c, v.c2.isPrep> of {
|
||||
<NPC Acc, False> => NPC Nom ; _ => v.c2.c}
|
||||
in insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } ;
|
||||
|
||||
{- HL: The construction VPSlashPrep : VP -> Prep -> VPSlash does not exist
|
||||
in German. In abstract/Verb.gf, the example
|
||||
|
||||
@@ -13,11 +13,7 @@ concrete PhraseMay of Phrase = CatMay ** open Prelude, ResMay in {
|
||||
UttVP vp = {s = linVP vp} ;
|
||||
UttAP ap = { s = ap.s } ;
|
||||
{-
|
||||
UttImpSg pol imp =
|
||||
UttImpPl pol imp =
|
||||
UttImpPol = UttImpSg ;
|
||||
|
||||
UttVP vp = {s = } ;
|
||||
UttAdv adv = {s = } ;
|
||||
UttCN n = {s = } ;
|
||||
UttCard n = {s = } ;
|
||||
|
||||
@@ -90,6 +90,7 @@ oper
|
||||
linDet : Determiner -> Str = \det -> det.pr ++ det.s ;
|
||||
|
||||
-- add field in determiner for kedua-dua numbers
|
||||
|
||||
Determiner : Type = Quant ** {
|
||||
pr : Str ; -- prefix for numbers
|
||||
n : NumType ; -- number as in 5 (noun in singular), Sg or Pl
|
||||
|
||||
@@ -55,10 +55,8 @@ lin and_Conj = {s2 = "dan" ; s1 = [] ; n = Pl} ;
|
||||
-----------------
|
||||
-- *Det and Quant
|
||||
|
||||
|
||||
lin how8many_IDet = mkIdet "berapa" "berapa banyak" "" Sg True;
|
||||
lin every_Det = mkDet "semua" "semua" Sg ; -- to check
|
||||
|
||||
{-}
|
||||
lin all_Predet = {s = ""} ;
|
||||
lin not_Predet = { s = "" } ;
|
||||
|
||||
55
src/zulu/AdjectiveZul.gf
Executable file
55
src/zulu/AdjectiveZul.gf
Executable file
@@ -0,0 +1,55 @@
|
||||
concrete AdjectiveZul of Adjective = CatZul ** open ResZul, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
PositA adj = adj ;
|
||||
|
||||
-- ComparA a np = {
|
||||
-- s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! npNom ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
-- UseComparA a = {
|
||||
-- s = \\_ => a.s ! AAdj Compar Nom ;
|
||||
-- isPre = a.isPre
|
||||
-- } ;
|
||||
--
|
||||
-- AdjOrd ord = {
|
||||
-- s = \\_ => ord.s ! Nom ;
|
||||
-- isPre = True
|
||||
-- } ;
|
||||
--
|
||||
-- CAdvAP ad ap np = {
|
||||
-- s = \\a => ad.s ! Pos ++ ap.s ! a ++ ad.p ++ np.s ! npNom ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- ComplA2 a np = {
|
||||
-- s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- ReflA2 a = {
|
||||
-- s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- SentAP ap sc = {
|
||||
-- s = \\a => ap.s ! a ++ sc.s ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
|
||||
AdAP ada ap = {
|
||||
s = \\a => ap.s!a ++ ada.s ;
|
||||
b = ap.b ;
|
||||
empty = ap.empty ;
|
||||
t = AdjType
|
||||
} ;
|
||||
|
||||
-- UseA2 a = {
|
||||
-- s = \\_ => a.s ! AAdj Posit Nom ;
|
||||
-- isPre = True
|
||||
-- } ;
|
||||
--
|
||||
-- AdvAP ap adv = {s = \\a => ap.s ! a ++ adv.s ; isPre = False} ;
|
||||
|
||||
}
|
||||
27
src/zulu/AdverbZul.gf
Executable file
27
src/zulu/AdverbZul.gf
Executable file
@@ -0,0 +1,27 @@
|
||||
concrete AdverbZul of Adverb = CatZul ** open ResZul, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {
|
||||
s = "ka" ++BIND++ a.s!AF1 ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
-- ComparAdvAdj cadv a np = {
|
||||
-- s = cadv.s ! Pos ++ a.s ! AAdv ++ cadv.p ++ np.s ! npNom
|
||||
-- } ;
|
||||
-- ComparAdvAdjS cadv a s = {
|
||||
-- s = cadv.s ! Pos ++ a.s ! AAdv ++ cadv.p ++ s.s
|
||||
-- } ;
|
||||
--
|
||||
-- PrepNP prep np = {s = preOrPost prep.isPre prep.s (np.s ! NPAcc)} ;
|
||||
--
|
||||
-- AdAdv = cc2 ;
|
||||
-- PositAdAAdj a = {s = a.s ! AAdv} ;
|
||||
|
||||
-- SubjS subj s = {
|
||||
-- s = subj.s ++ s.subjs ;
|
||||
-- reqLocS = False
|
||||
-- } ;
|
||||
|
||||
-- AdnCAdv cadv = {s = cadv.s ! Pos ++ cadv.p} ;
|
||||
|
||||
}
|
||||
143
src/zulu/BackwardZul.gf
Executable file
143
src/zulu/BackwardZul.gf
Executable file
@@ -0,0 +1,143 @@
|
||||
concrete BackwardZul of Backward = CatZul ** open ResZul,Prelude,ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
-- A repository of obsolete constructs, needed for backward compatibility.
|
||||
-- They create spurious ambiguities if used in combination with Lang.
|
||||
|
||||
-- from Verb 19/4/2008
|
||||
|
||||
ComplV2 v2 np = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = (VFIndic MainCl p t) ;
|
||||
tp = tensePref vform v2.r v2.syl ; -- [] / zo- / zuku-
|
||||
oc = objConc np.agr v2.r v2.syl ; -- [] / m -
|
||||
longform = case np.heavy of {
|
||||
True => False ;
|
||||
False => True
|
||||
} ;
|
||||
r = v2.s!(rform (VFIndic MainCl p t) longform) ; -- bona / boni
|
||||
obj = np.s!NFull -- [] / inkomo
|
||||
in case np.proDrop of {
|
||||
True => tp ++ oc ++ r ++ obj ;
|
||||
False => tp ++ r ++ obj
|
||||
} ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = (VFIndic RelCl p t) ;
|
||||
rc = relConc vform a v2.r ; -- o- / onga-
|
||||
tp = tensePref vform v2.r v2.syl ; -- [] / zo- / zuku-
|
||||
oc = objConc np.agr v2.r v2.syl ; -- [] / m -
|
||||
longform = case np.heavy of {
|
||||
True => False ;
|
||||
False => True
|
||||
} ;
|
||||
r = v2.s!(rform vform longform) ; -- bona / boni
|
||||
obj = np.s!NFull -- [] / inkomo
|
||||
in case np.proDrop of {
|
||||
True => rc ++ tp ++ oc ++ r ++ obj ;
|
||||
False => rc ++ tp ++ r ++ obj
|
||||
}
|
||||
} ;
|
||||
iadv, advs, comp = [] ;
|
||||
ap_comp = \\_ => [] ;
|
||||
hasComp = np.heavy ;
|
||||
r = v2.r ;
|
||||
syl = v2.syl ;
|
||||
vptype = VNPCompl
|
||||
} ;
|
||||
|
||||
-- ComplV3 v3 np1 np2 = v3 ** {
|
||||
-- -- s = v3.s ;
|
||||
-- oc = case np1.proDrop of {
|
||||
-- True => objConc np1.agr v3.r v3.syl ;
|
||||
-- False => []
|
||||
-- } ;
|
||||
-- comp = case np1.proDrop of {
|
||||
-- True => case v3.voice of {
|
||||
-- Active => np2.s ! NFull ++ np2.desc ;
|
||||
-- Passive => (cop_pref np2.agr) ++BIND++ np2.s ! NFull ++ np2.desc
|
||||
-- } ;
|
||||
-- False => case v3.voice of {
|
||||
-- Active => np1.s ! NFull ++ np1.desc ++ np2.s ! NFull ++ np2.desc ;
|
||||
-- Passive => (cop_pref np1.agr) ++BIND++ np1.s ! NFull ++ np1.desc ++ np2.s ! NFull ++ np2.desc
|
||||
-- }
|
||||
-- } ;
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- -- r = v3.r ;
|
||||
-- -- syl = v3.syl ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- vptype = VNPCompl ;
|
||||
-- comp_agr = np1.agr ; -- this could be anything...
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- ap_bool = False ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
-- ComplV2V v np vp =
|
||||
-- insertObj (\\a => infVP v.isAux vp False Simul CPos a)
|
||||
-- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
||||
-- ComplV2S v np s =
|
||||
-- insertObj (\\_ => conjThat ++ s.s)
|
||||
-- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
||||
-- ComplV2Q v np q =
|
||||
-- insertObj (\\_ => q.s ! QIndir)
|
||||
-- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
||||
-- ComplV2A v np ap =
|
||||
-- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
||||
--
|
||||
-- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
||||
--
|
||||
-- -- from Sentence 19/4/2008
|
||||
--
|
||||
-- SlashV2 np v2 =
|
||||
-- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
|
||||
--
|
||||
-- SlashVVV2 np vv v2 =
|
||||
-- mkClause (np.s ! Nom) np.a
|
||||
-- (insertObj (\\a => infVP vv.isAux (predV v2) False Simul CPos a) (predVV vv)) **
|
||||
-- {c2 = v2.c2} ;
|
||||
--
|
||||
-- -- from Noun 19/4/2008
|
||||
--
|
||||
-- NumInt n = {s = n.s ; n = Pl} ;
|
||||
-- OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED
|
||||
--
|
||||
-- DetSg quant ord = {
|
||||
-- s = quant.s ! Sg ++ ord.s ;
|
||||
-- n = Sg
|
||||
-- } ;
|
||||
--
|
||||
-- DetPl quant num ord = {
|
||||
-- s = quant.s ! num.n ++ num.s ++ ord.s ;
|
||||
-- n = num.n
|
||||
-- } ;
|
||||
--
|
||||
-- NoNum = {s = []; n = Pl } ;
|
||||
--
|
||||
-- DefArt = {s = \\_ => artDef} ;
|
||||
--
|
||||
-- IndefArt = {
|
||||
-- s = table {
|
||||
-- Sg => artIndef ;
|
||||
-- Pl => []
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- MassDet = {s = \\_ => []} ;
|
||||
--
|
||||
--
|
||||
--
|
||||
-- -- from Structural 19/4/2008
|
||||
--
|
||||
-- that_NP = regNP "that" Sg ;
|
||||
-- these_NP = regNP "these" Pl ;
|
||||
-- this_NP = regNP "this" Sg ;
|
||||
-- those_NP = regNP "those" Pl ;
|
||||
|
||||
}
|
||||
15
src/zulu/CatExtZul.gf
Executable file
15
src/zulu/CatExtZul.gf
Executable file
@@ -0,0 +1,15 @@
|
||||
concrete CatExtZul of CatExt = open ResZul,Prelude,ParamX in {
|
||||
|
||||
lincat
|
||||
Loc = { s : CType => Agr => Polarity => BasicTense => Str } ;
|
||||
LocN = { s : Str } ;
|
||||
QuantStem = { s : Agr => Str } ;
|
||||
RelStem = { s : Str } ;
|
||||
VAux = { s : Str ; at : AuxType } ;
|
||||
ConjN = { s : Str } ;
|
||||
IAdj = { s : AForm => Str } ;
|
||||
-- INAdv = { s : Str ; postIAdv : Bool } ;
|
||||
|
||||
Postdet = { s : Agr => Str } ;
|
||||
|
||||
}
|
||||
168
src/zulu/CatZul.gf
Executable file
168
src/zulu/CatZul.gf
Executable file
@@ -0,0 +1,168 @@
|
||||
concrete CatZul of Cat = CommonX - [Temp,Tense,Adv,IAdv] **
|
||||
open ResZul, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
-- for now, no anteriority
|
||||
Temp = { s : Str ; t : BasicTense } ;
|
||||
|
||||
-- Tensed/Untensed
|
||||
S = { s : Str } ;
|
||||
QS = { s : Str ; qword_pre : Str ; qword_post : Str } ;
|
||||
RS = { s : Agr => Str } ;
|
||||
-- SSlash = {s : Str ; c2 : Str} ;
|
||||
|
||||
-- Sentence
|
||||
|
||||
Cl = {
|
||||
s : Polarity => BasicTense => Str
|
||||
} ;
|
||||
-- ClSlash = {
|
||||
-- s : ResZul.Tense => Anteriority => CPolarity => Order => Str ;
|
||||
-- c2 : Str
|
||||
-- } ;
|
||||
Imp = { s : Polarity => Str } ;
|
||||
|
||||
-- Question
|
||||
|
||||
QCl = {
|
||||
s : Polarity => BasicTense => Str ;
|
||||
-- potqcl : Polarity => Str ;
|
||||
qword_pre : Str ;
|
||||
qword_post : Str
|
||||
} ;
|
||||
-- IP = {s : NPCase => Str ; n : Number} ;
|
||||
IComp = { s : Str ; postIComp : Bool } ; -- possibly needs parameter for comp type
|
||||
-- IDet = {s : Str ; n : Number} ;
|
||||
-- IQuant = {s : Number => Str} ;
|
||||
|
||||
-- Relative
|
||||
|
||||
RCl = { s : Agr => Polarity => BasicTense => Str } ;
|
||||
RP = { s : Str } ;
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = {
|
||||
s : CType => Agr => Polarity => BasicTense => Bool => Str ; -- TODO: mood
|
||||
-- oc : Str ;
|
||||
comp : Str ;
|
||||
iadv : Str ;
|
||||
advs : Str ;
|
||||
hasComp : Bool ;
|
||||
r : RInit ;
|
||||
syl : Syl ;
|
||||
-- asp : Aspect ;
|
||||
-- asp_pref : VForm => Str ;
|
||||
vptype : VPType ;
|
||||
-- comp_agr : Agr ;
|
||||
-- ap_comp : AForm => Str -- ;
|
||||
-- aux_root : Str ;
|
||||
-- hasAux : Bool
|
||||
} ;
|
||||
|
||||
-- VPSlash = {
|
||||
-- s : RForm => Str ;
|
||||
-- oc : Str ;
|
||||
-- comp : Str ;
|
||||
-- hasComp : Bool ;
|
||||
-- r : RInit ;
|
||||
-- syl : Syl ;
|
||||
-- asp : Aspect ;
|
||||
-- asp_pref : VForm => Str ;
|
||||
-- vptype : VPType ;
|
||||
-- comp_agr : Agr ;
|
||||
-- ap_comp : AForm => Str ;
|
||||
-- aux_root : Str ;
|
||||
-- hasAux : Bool
|
||||
-- } ;
|
||||
|
||||
-- Comp = {
|
||||
-- s : AForm => Str ;
|
||||
-- r : RInit ;
|
||||
-- agr : Agr ;
|
||||
-- asp : Aspect ;
|
||||
-- asp_pref : VForm => Str ;
|
||||
-- comptype : VPType
|
||||
-- } ;
|
||||
|
||||
-- Adjective
|
||||
|
||||
AP = { s : AForm => Str ; empty : Str ; t : AType } ;
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = {
|
||||
s : Number => NForm => Str ;
|
||||
-- mod : Number => Str ;
|
||||
c : ClassGender ;
|
||||
empty : Str ;
|
||||
emph : Bool
|
||||
} ;
|
||||
|
||||
NP = {
|
||||
empty : Str ;
|
||||
s : NForm => Str ;
|
||||
agr : Agr ;
|
||||
i : RInit ;
|
||||
proDrop : Bool ; -- used when NP is object
|
||||
isPron : Bool ; -- used to choose correct between Full/Reduced
|
||||
heavy : Bool -- has object/adv/qword
|
||||
} ;
|
||||
|
||||
-- Pronoun
|
||||
Pron = { s : NForm => Str ; agr : Agr ; empty : Str ; proDrop : Bool } ;
|
||||
-- DAP
|
||||
Det = { s : Str ; n : Number } ;
|
||||
Predet = { s : Agr => Str ; hasDem : Bool } ;
|
||||
-- Ord = { s : Case => Str } ;
|
||||
Num = { s: Str ; n : Number } ;
|
||||
-- Card = {s,sp : Bool => Case => Str ; n : Number} ;
|
||||
-- ACard = {s : Case => Str ; n : Number} ;
|
||||
Quant = { s : Str ; dist : Distance } ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
-- Numeral = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||
-- Digits = {s : CardOrd => Case => Str ; n : Number ; tail : DTail} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
Conj = { s : RInit => Str ; fix : Bool } ;
|
||||
Subj = {s : Str} ;
|
||||
-- Adv = { s : Str ; asp : Aspect ; reqLocS : Bool } ;
|
||||
-- Prep = {s : Str; isPre : Bool} ;
|
||||
-- CAdv = {s : Polarity => Str; p : Str} ;
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
V,V2,VA,VS,V3 = {
|
||||
s : RForm => Str ;
|
||||
r : RInit ;
|
||||
syl : Syl ;
|
||||
voice : Voice
|
||||
} ;
|
||||
-- VQ = Verb ;
|
||||
-- V2Q, V2S = Verb ** {c2 : Str} ;
|
||||
-- V2A,V3 = Verb ** {c2, c3 : Str} ;
|
||||
-- V = {s : VVForm => Str ; p : Str ; typ : VVType} ;
|
||||
-- V2V = Verb ** {c2,c3 : Str ; typ : VVType} ;
|
||||
|
||||
A = { s : AForm => Str ; empty : Str ; t : AType } ;
|
||||
-- A2 = {s : AForm => Str ; c2 : Str ; isPre : Bool} ;
|
||||
|
||||
N, N2, N3, PN = {
|
||||
s : Number => NForm => Str ;
|
||||
c : ClassGender ;
|
||||
-- sem : SemanticType ;
|
||||
empty : Str
|
||||
} ;
|
||||
-- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ;
|
||||
-- N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ;
|
||||
|
||||
Adv = { s : Str ; reqLocS : Bool } ;
|
||||
|
||||
IAdv = { s : Str ; postIAdv : Bool } ;
|
||||
|
||||
}
|
||||
85
src/zulu/ChunkFunctor.gf
Executable file
85
src/zulu/ChunkFunctor.gf
Executable file
@@ -0,0 +1,85 @@
|
||||
incomplete concrete ChunkFunctor of Chunk = Cat, Symbol [Symb] ** { --, Extensions [VPS,VPI] **
|
||||
open
|
||||
Syntax, Extensions,
|
||||
Prelude in {
|
||||
|
||||
lincat
|
||||
Chunks = {s : Str} ;
|
||||
Chunk = {s : Str};
|
||||
|
||||
VC = V ;
|
||||
|
||||
lin
|
||||
OneChunk c = c ;
|
||||
PlusChunk c cs = cc2 c cs ;
|
||||
|
||||
ChunkPhr c = ss ("*" ++ c.s) | c ;
|
||||
|
||||
lin
|
||||
AP_Chunk ap = mkUtt ap ;
|
||||
AdA_Chunk ada = ada ;
|
||||
Adv_Chunk adv = adv ;
|
||||
AdV_Chunk adv = adv ;
|
||||
AdN_Chunk adn = adn ;
|
||||
S_Chunk s = mkUtt s ;
|
||||
SSlash_Chunk s = mkUtt <lin S s : S> ;
|
||||
QS_Chunk qs = mkUtt qs ;
|
||||
CN_Pl_Chunk cn = mkUtt (Syntax.mkNP aPl_Det cn) ;
|
||||
CN_Sg_Chunk cn = mkUtt cn ;
|
||||
---- CN_Pl_Gen_Chunk cn = ss (cn.s ! Pl ! Gen) ;
|
||||
---- CN_Sg_Gen_Chunk cn = ss (cn.s ! Sg ! Gen) ;
|
||||
Conj_Chunk conj = ss conj.s2 ; ----
|
||||
Det_Chunk det = mkUtt (Syntax.mkNP det) ;
|
||||
IAdv_Chunk iadv = iadv ;
|
||||
IP_Chunk ip = mkUtt ip ;
|
||||
NP_Nom_Chunk np = mkUtt np ;
|
||||
---- NP_Acc_Chunk np = ss (np.s ! NPAcc) ;
|
||||
---- NP_Gen_Chunk np = ss (np.s ! NCase Gen) | ss (np.s ! NPNomPoss) ;
|
||||
Numeral_Nom_Chunk num = mkUtt (Syntax.mkNP (Syntax.mkDet num)) ;
|
||||
---- Numeral_Gen_Chunk num = ss (num.s ! NCard ! Gen) ;
|
||||
---- Ord_Nom_Chunk ord = ss (ord.s ! Nom) ;
|
||||
---- Ord_Gen_Chunk ord = ss (ord.s ! Gen) ;
|
||||
Predet_Chunk predet = mkUtt (Syntax.mkNP predet emptyNP) ;
|
||||
Prep_Chunk prep = mkAdv prep emptyNP ; ----
|
||||
---- RP_Nom_Chunk rp = ss (rp.s ! RC Neutr (NCase Nom)) ;
|
||||
---- RP_Acc_Chunk rp = ss (rp.s ! RPrep Masc) ; ----
|
||||
---- RP_Gen_Chunk rp = ss (rp.s ! RC Neutr (NCase Gen)) ;
|
||||
Subj_Chunk subj = subj ;
|
||||
--- PConj_Chunk pconj = pconj ;
|
||||
|
||||
VPS_Chunk vps = mkUtt (E.PredVPS emptyNP vps) ;
|
||||
-- VPI_Chunk : VPI -> Chunk ;
|
||||
|
||||
|
||||
V2_V,
|
||||
VA_V,
|
||||
VQ_V,
|
||||
VS_V,
|
||||
---- VV_V,
|
||||
V3_V,
|
||||
V2A_V,
|
||||
V2Q_V,
|
||||
V2S_V,
|
||||
V2V_V
|
||||
= \v -> <lin V v : V> ;
|
||||
|
||||
UseVC t p vc = E.MkVPS t p (mkVP vc) ;
|
||||
|
||||
Symb_Chunk s = lin Utt s ;
|
||||
|
||||
fullstop_Chunk = sbSS "." ;
|
||||
exclmark_Chunk = sbSS "!" ;
|
||||
questmark_Chunk = sbSS "?" ;
|
||||
comma_Chunk = sbSS "," ;
|
||||
colon_Chunk = sbSS ":" ;
|
||||
semicolon_Chunk = sbSS ";" ;
|
||||
quote_Chunk = variants {sbSS "\"" ; ss ("\"" ++ SOFT_BIND) } ;
|
||||
lpar_Chunk = ss ("(" ++ SOFT_BIND) ;
|
||||
rpar_Chunk = sbSS ")" ;
|
||||
dash_Chunk = sbSS "-" ;
|
||||
|
||||
oper
|
||||
emptyNP : NP = Syntax.mkNP (P.mkPN []) ;
|
||||
|
||||
sbSS : Str -> SS = \s -> ss (SOFT_BIND ++ s) ;
|
||||
}
|
||||
307
src/zulu/ChunkZul.gf
Executable file
307
src/zulu/ChunkZul.gf
Executable file
@@ -0,0 +1,307 @@
|
||||
concrete ChunkZul of Chunk = CatZul, SymbolZul [Symb] **
|
||||
-- ChunkFunctor - [Det_Chunk]
|
||||
-- with (Syntax = SyntaxZul) ** --, (Extensions = ExtensionsZul) **
|
||||
open
|
||||
-- SyntaxZul, Prelude, (E = ExtensionsZul),
|
||||
Prelude, ResZul, ParamX,
|
||||
(R = ResZul), (P = ParadigmsZul) in {
|
||||
|
||||
lincat
|
||||
Chunks = {s : Str} ;
|
||||
Chunk = {s : Str};
|
||||
Chunk_CN = {s: Str} ;
|
||||
|
||||
VC = V ;
|
||||
|
||||
lin
|
||||
OneChunk c = c ;
|
||||
PlusChunk c cs = cc2 c cs ;
|
||||
|
||||
CN_Chunker c = c ;
|
||||
|
||||
ChunkPhr c = ss ("*" ++ c.s) | c ;
|
||||
|
||||
AP_Chunk ap = { s = ap_vars ap } ;
|
||||
-- AdA_Chunk : AdA -> Chunk ;
|
||||
Adv_Chunk adv = { s = adv_vars adv.s } ;
|
||||
-- AdV_Chunk : AdV -> Chunk ;
|
||||
-- AdN_Chunk : AdN -> Chunk ;
|
||||
S_Chunk s = { s = variants { s.s!Princ ; s.s!Part ; s.subjs ; s.pots!Princ ; s.pots!Part } } ;
|
||||
-- SSlash_Chunk : SSlash -> Chunk ;
|
||||
QS_Chunk s = { s = s.qword_pre ++ s.s ++ s.qword_post } ;
|
||||
-- CN_Pl_Chunk : CN -> Chunk ;
|
||||
CN_Sg_Chunk cn = {
|
||||
s = cn.s!Sg!Full ++ cn.mod!Sg
|
||||
} ;
|
||||
CN_Pl_Chunk cn = {
|
||||
s = cn.s!Pl!Full ++ cn.mod!Pl
|
||||
} ;
|
||||
-- CN_Pl_Gen_Chunk : CN -> Chunk ;
|
||||
-- CN_Sg_Gen_Chunk : CN -> Chunk ;
|
||||
-- Conj_Chunk : Conj -> Chunk ;
|
||||
-- Det_Chunk : Det -> Chunk ; -- needed if article form is different from NP form, e.g. English a/an
|
||||
-- IAdv_Chunk : IAdv -> Chunk ;
|
||||
-- IP_Chunk : IP -> Chunk ;
|
||||
NP_Nom_Chunk np = {
|
||||
s = case np.isPron of {
|
||||
False => variants {
|
||||
np.predet_pre ++ np.dem ++ np.s!Full ++ np.mod ++ np.predet_post ;
|
||||
np.predet_pre ++ np.dem ++ np.s!Reduced ++ np.mod ++ np.predet_post -- ; -- [anginoni] nkomo
|
||||
-- np.predet_pre ++ np.dem ++ np.s!Reduced ++ np.mod ++ np.predet_post ;
|
||||
-- np.predet_pre ++ dem_pron!Dem2!np.agr ++ np.s!Reduced ++ np.mod ++ np.predet_post ;
|
||||
-- np.predet_pre ++ dem_pron!Dem3!np.agr ++ np.s!Reduced ++ np.mod ++ np.predet_post ;
|
||||
-- np.predet_pre ++ np.dem ++ np.s!Full ++ np.mod ++ np.predet_post ; -- meant to catch pronouns
|
||||
-- np.predet_pre ++ dem_pron!Dem2!np.agr ++ np.s!Full ++ np.mod ++ np.predet_post ; -- meant to catch pronouns
|
||||
-- np.predet_pre ++ dem_pron!Dem3!np.agr ++ np.s!Full ++ np.mod ++ np.predet_post ; -- meant to catch pronouns
|
||||
-- np.predet_pre ++ np.dem ++ np.s!Loc ++ np.mod ++ np.predet_post
|
||||
} ;
|
||||
True => case np.proDrop of {
|
||||
False => np.predet_pre ++ np.dem ++ np.s!Full ++ np.mod ++ np.predet_post ;
|
||||
True => np.predet_pre ++ np.dem ++ np.s!Reduced ++ np.mod ++ np.predet_post
|
||||
}
|
||||
}
|
||||
} ;
|
||||
-- NP_Acc_Chunk : NP -> Chunk ;
|
||||
NP_Gen_Chunk np = {
|
||||
s = poss_concord_agr!agr_vars!np.i ++BIND++ np.s!Poss ++ np.dem ++ np.mod ++ np.predet_pre ++ np.predet_post
|
||||
} ;
|
||||
-- Numeral_Nom_Chunk : Numeral -> Chunk ;
|
||||
-- Numeral_Gen_Chunk : Numeral -> Chunk ;
|
||||
-- Ord_Nom_Chunk : Ord -> Chunk ;
|
||||
-- Ord_Gen_Chunk : Ord -> Chunk ;
|
||||
-- Predet_Chunk : Predet -> Chunk ;
|
||||
-- Prep_Chunk : Prep -> Chunk ;
|
||||
-- RP_Nom_Chunk : RP -> Chunk ;
|
||||
-- RP_Gen_Chunk : RP -> Chunk ;
|
||||
-- RP_Acc_Chunk : RP -> Chunk ;
|
||||
-- Subj_Chunk : Subj -> Chunk ;
|
||||
-- IComp_Chunk icomp = { } ;
|
||||
-- --- PConj_Chunk : PConj -> Chunk ;
|
||||
-- N_Sg_Chunk n = { s = variants { n.s!Sg!Full ; n.s!Sg!Reduced } } ;
|
||||
-- N_Pl_Chunk n = { s = variants { n.s!Pl!Full ; n.s!Pl!Reduced } } ;
|
||||
N_Sg_Chunk n = { s = n.s!Sg!Full } ;
|
||||
N_Pl_Chunk n = { s = n.s!Pl!Full } ;
|
||||
--
|
||||
-- VPS_Chunk : VPS -> Chunk ;
|
||||
-- VPI_Chunk : VPI -> Chunk ;
|
||||
--
|
||||
-- -- verbs lifted to one cat
|
||||
--
|
||||
-- V2_V : V2 -> VC ;
|
||||
-- VA_V : VA -> VC ;
|
||||
-- VQ_V : VQ -> VC ;
|
||||
-- VS_V : VS -> VC ;
|
||||
-- VV_V : VV -> VC ;
|
||||
--
|
||||
-- V3_V : V3 -> VC ;
|
||||
-- V2A_V : V2A -> VC ;
|
||||
-- V2Q_V : V2Q -> VC ;
|
||||
-- V2S_V : V2S -> VC ;
|
||||
-- V2V_V : V2V -> VC ;
|
||||
--
|
||||
-- UseVC : Temp -> Pol -> VC -> VPS ;
|
||||
--
|
||||
-- -- for unknown words that are not names
|
||||
--
|
||||
Symb_Chunk symb = { s = symb.s } ;
|
||||
--
|
||||
-- -- syncategorematic chunks
|
||||
-- refl_SgP1_Chunk,
|
||||
-- refl_SgP2_Chunk,
|
||||
-- refl_SgP3_Chunk,
|
||||
-- refl_PlP1_Chunk,
|
||||
-- refl_PlP2_Chunk,
|
||||
-- refl_PlP3_Chunk : Chunk ;
|
||||
-- neg_Chunk : Chunk ;
|
||||
-- copula_Chunk : Chunk ;
|
||||
-- copula_neg_Chunk : Chunk ;
|
||||
-- copula_inf_Chunk : Chunk ;
|
||||
-- past_copula_Chunk : Chunk ;
|
||||
-- past_copula_neg_Chunk : Chunk ;
|
||||
-- future_Chunk : Chunk ;
|
||||
-- future_neg_Chunk : Chunk ;
|
||||
-- cond_Chunk : Chunk ;
|
||||
-- cond_neg_Chunk : Chunk ;
|
||||
-- perfect_Chunk : Chunk ;
|
||||
-- perfect_neg_Chunk : Chunk ;
|
||||
-- past_perfect_Chunk : Chunk ;
|
||||
-- past_perfect_neg_Chunk : Chunk ;
|
||||
|
||||
-- fullstop_Chunk = sbSS "." ;
|
||||
-- exclmark_Chunk = sbSS "!" ;
|
||||
-- questmark_Chunk = sbSS "?" ;
|
||||
-- comma_Chunk = sbSS "," ;
|
||||
-- colon_Chunk = sbSS ":" ;
|
||||
-- semicolon_Chunk = sbSS ";" ;
|
||||
-- quote_Chunk = variants {sbSS "\"" ; ss ("\"" ++ SOFT_BIND) } ;
|
||||
-- lpar_Chunk = ss ("(" ++ SOFT_BIND) ;
|
||||
-- rpar_Chunk = sbSS ")" ;
|
||||
dash_Chunk = sbSS "-" ;
|
||||
|
||||
oper
|
||||
-- emptyNP = lin NP {
|
||||
-- empty = [] ;
|
||||
-- s = table {
|
||||
-- Full => [] ; Reduced => []
|
||||
-- } ;
|
||||
-- loc = [] ;
|
||||
-- desc = [] ;
|
||||
-- agr = agr_vars ;
|
||||
-- isPron = True ;
|
||||
-- reqLocS = False
|
||||
-- } ;
|
||||
sbSS : Str -> SS = \s -> ss (SOFT_BIND ++ s) ;
|
||||
|
||||
adv_vars : Str -> Str = \s -> variants {
|
||||
s ;
|
||||
rel_adv_vars s ;
|
||||
poss_adv_vars s
|
||||
} ;
|
||||
|
||||
rel_adv_vars : Str -> Str = \s -> variants {
|
||||
relConc!(Third C1_2 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C1_2 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C1a_2a Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C1a_2a Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C3_4 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C3_4 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C5_6 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C5_6 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C7_8 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C7_8 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C9_10 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C9_10 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C11_10 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C11_10 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C9_6 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C9_6 Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Third C14 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C15 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Third C17 Sg)!RelC ++BIND++ s ;
|
||||
relConc!(First Sg)!RelC ++BIND++ s ;
|
||||
relConc!(First Pl)!RelC ++BIND++ s ;
|
||||
relConc!(Second Sg)!RelC ++BIND++ s ;
|
||||
relConc!(Second Pl)!RelC ++BIND++ s
|
||||
} ;
|
||||
|
||||
poss_adv_vars : Str -> Str = \s -> variants {
|
||||
poss_conc_adv (Third C1_2 Sg) s ;
|
||||
poss_conc_adv (Third C1_2 Pl) s ;
|
||||
poss_conc_adv (Third C1a_2a Sg) s ;
|
||||
poss_conc_adv (Third C1a_2a Pl) s ;
|
||||
poss_conc_adv (Third C3_4 Sg) s ;
|
||||
poss_conc_adv (Third C3_4 Pl) s ;
|
||||
poss_conc_adv (Third C5_6 Sg) s ;
|
||||
poss_conc_adv (Third C5_6 Pl) s ;
|
||||
poss_conc_adv (Third C7_8 Sg) s ;
|
||||
poss_conc_adv (Third C7_8 Pl) s ;
|
||||
poss_conc_adv (Third C9_10 Sg) s ;
|
||||
poss_conc_adv (Third C9_10 Pl) s ;
|
||||
poss_conc_adv (Third C11_10 Sg) s ;
|
||||
poss_conc_adv (Third C9_6 Sg) s ;
|
||||
poss_conc_adv (Third C11_10 Pl) s ;
|
||||
poss_conc_adv (Third C9_6 Pl) s ;
|
||||
poss_conc_adv (Third C14 Sg) s ;
|
||||
poss_conc_adv (Third C15 Sg) s ;
|
||||
poss_conc_adv (Third C17 Sg) s ;
|
||||
poss_conc_adv (First Sg) s ;
|
||||
poss_conc_adv (First Pl) s ;
|
||||
poss_conc_adv (Second Sg) s ;
|
||||
poss_conc_adv (Second Pl) s
|
||||
} ;
|
||||
|
||||
poss_conc_adv : Agr -> Str -> Str = \a,s -> case a of {
|
||||
Third c n => (poss_concord!c!n!RC) ++BIND++ "s" ++BIND++ s ;
|
||||
First n => (poss_concord!C1_2!n!RC) ++BIND++ "s" ++BIND++ s ;
|
||||
Second n => (poss_concord!C1_2!n!RC) ++BIND++ "s" ++BIND++ s
|
||||
} ;
|
||||
|
||||
agr_vars : Agr = variants {
|
||||
Third C1_2 Sg ;
|
||||
Third C1_2 Pl ;
|
||||
Third C1a_2a Sg ;
|
||||
Third C1a_2a Pl ;
|
||||
Third C3_4 Sg ;
|
||||
Third C3_4 Pl ;
|
||||
Third C5_6 Sg ;
|
||||
Third C5_6 Pl ;
|
||||
Third C7_8 Sg ;
|
||||
Third C7_8 Pl ;
|
||||
Third C9_10 Sg ;
|
||||
Third C9_10 Pl ;
|
||||
Third C11_10 Sg ;
|
||||
Third C11_10 Pl ;
|
||||
Third C9_6 Sg ;
|
||||
Third C9_6 Pl ;
|
||||
Third C14 Sg ;
|
||||
Third C15 Sg ;
|
||||
Third C17 Sg ;
|
||||
First Sg ;
|
||||
First Pl ;
|
||||
Second Sg ;
|
||||
Second Pl
|
||||
} ;
|
||||
|
||||
ap_vars : AP -> Str = \ap -> variants {
|
||||
ap_form Pos (Third C1_2 Sg) ap ;
|
||||
ap_form Pos (Third C1_2 Pl) ap ;
|
||||
ap_form Pos (Third C1a_2a Sg) ap ;
|
||||
ap_form Pos (Third C1a_2a Pl) ap ;
|
||||
ap_form Pos (Third C3_4 Sg) ap ;
|
||||
ap_form Pos (Third C3_4 Pl) ap ;
|
||||
ap_form Pos (Third C5_6 Sg) ap ;
|
||||
ap_form Pos (Third C5_6 Pl) ap ;
|
||||
ap_form Pos (Third C7_8 Sg) ap ;
|
||||
ap_form Pos (Third C7_8 Pl) ap ;
|
||||
ap_form Pos (Third C9_10 Sg) ap ;
|
||||
ap_form Pos (Third C9_10 Pl) ap ;
|
||||
ap_form Pos (Third C11_10 Sg) ap ;
|
||||
ap_form Pos (Third C11_10 Pl) ap ;
|
||||
ap_form Pos (Third C9_6 Sg) ap ;
|
||||
ap_form Pos (Third C9_6 Pl) ap ;
|
||||
ap_form Pos (Third C14 Sg) ap ;
|
||||
ap_form Pos (Third C15 Sg) ap ;
|
||||
ap_form Pos (Third C17 Sg) ap ;
|
||||
ap_form Pos (First Sg) ap ;
|
||||
ap_form Pos (First Pl) ap ;
|
||||
ap_form Pos (Second Sg) ap ;
|
||||
ap_form Pos (Second Pl) ap ;
|
||||
|
||||
ap_form Neg (Third C1_2 Sg) ap ;
|
||||
ap_form Neg (Third C1_2 Pl) ap ;
|
||||
ap_form Neg (Third C1a_2a Sg) ap ;
|
||||
ap_form Neg (Third C1a_2a Pl) ap ;
|
||||
ap_form Neg (Third C3_4 Sg) ap ;
|
||||
ap_form Neg (Third C3_4 Pl) ap ;
|
||||
ap_form Neg (Third C5_6 Sg) ap ;
|
||||
ap_form Neg (Third C5_6 Pl) ap ;
|
||||
ap_form Neg (Third C7_8 Sg) ap ;
|
||||
ap_form Neg (Third C7_8 Pl) ap ;
|
||||
ap_form Neg (Third C9_10 Sg) ap ;
|
||||
ap_form Neg (Third C9_10 Pl) ap ;
|
||||
ap_form Neg (Third C11_10 Sg) ap ;
|
||||
ap_form Neg (Third C11_10 Pl) ap ;
|
||||
ap_form Neg (Third C9_6 Sg) ap ;
|
||||
ap_form Neg (Third C9_6 Pl) ap ;
|
||||
ap_form Neg (Third C14 Sg) ap ;
|
||||
ap_form Neg (Third C15 Sg) ap ;
|
||||
ap_form Neg (Third C17 Sg) ap ;
|
||||
ap_form Neg (First Sg) ap ;
|
||||
ap_form Neg (First Pl) ap ;
|
||||
ap_form Neg (Second Sg) ap ;
|
||||
ap_form Neg (Second Pl) ap
|
||||
} ;
|
||||
|
||||
ap_form : Polarity -> Agr -> AP -> Str = \pol,agr,ap ->
|
||||
let
|
||||
agr = agr_vars ;
|
||||
-- adjf = case ap.b of {
|
||||
-- True => (aformN agr) ;
|
||||
-- -- True => AF2 ;
|
||||
-- False => AF1
|
||||
-- }
|
||||
adjf = variants { AF1 ; AF2 ; AF3 } ;
|
||||
in
|
||||
relAdjAgrLookup!pol!agr ++BIND++ ap.s!adjf ;
|
||||
|
||||
}
|
||||
17
src/zulu/CompatibilityZul.gf
Executable file
17
src/zulu/CompatibilityZul.gf
Executable file
@@ -0,0 +1,17 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete CompatibilityZul of Compatibility = CatZul ** open Prelude, ResZul in {
|
||||
|
||||
-- from Noun 19/4/2008
|
||||
|
||||
-- lin
|
||||
-- NumInt n = {s,sp = \\_ => addGenitiveS n.s ; n = Pl ; hasCard = True} ;
|
||||
-- OrdInt n = {s = \\c => n.s ++ (regGenitiveS "th")!c } ;
|
||||
--
|
||||
-- oper
|
||||
-- -- Note: this results in a space before 's, but there's
|
||||
-- -- not mauch we can do about that.
|
||||
-- addGenitiveS : Str -> Case => Str = \s ->
|
||||
-- table { Gen => s ++ "'s"; _ => s } ;
|
||||
|
||||
}
|
||||
119
src/zulu/ConjunctionZul.gf
Executable file
119
src/zulu/ConjunctionZul.gf
Executable file
@@ -0,0 +1,119 @@
|
||||
concrete ConjunctionZul of Conjunction =
|
||||
CatZul ** open ResZul, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
-- should deal correctly with futhi, not with na-
|
||||
-- ConjS conj ss = {
|
||||
-- s = \\dm => ss.s1!dm ++ conj.s!RC ++ ss.s2!dm ;
|
||||
-- subjs = ss.subjs1 ++ conj.s!RC ++ ss.subjs2 ;
|
||||
-- pots = \\dm => ss.pots1!dm ++ conj.s!RC ++ ss.pots2!dm
|
||||
-- } ;
|
||||
--
|
||||
-- ConjAdv = conjunctDistrSS ;
|
||||
-- ConjAdV = conjunctDistrSS ;
|
||||
|
||||
-- ConjAdv conj advs = ;
|
||||
|
||||
-- ConjNP conj nps =
|
||||
-- let
|
||||
-- np2_loose = nps.s2!Full ;
|
||||
-- np2_fixed = nps.s2!Reduced
|
||||
-- in {
|
||||
-- empty = [] ;
|
||||
-- s = \\f =>
|
||||
-- nps.s1!f ++ np1.desc
|
||||
-- ++
|
||||
-- (link_conj
|
||||
-- (conj.s!(nominit!np2.agr))
|
||||
-- (np2_loose)
|
||||
-- (np2_fixed)
|
||||
-- conj.fix) ++
|
||||
-- np2.desc ;
|
||||
-- loc = np1.loc ++
|
||||
-- np1.desc ++
|
||||
-- (link_conj
|
||||
-- (conj.s!(locinit!np2.agr))
|
||||
-- np2.loc
|
||||
-- np2.loc
|
||||
-- conj.fix) ++
|
||||
-- np2.desc ;
|
||||
-- desc = [] ;
|
||||
-- agr = np2.agr ;
|
||||
-- isPron = False ;
|
||||
-- reqLocS = np1.reqLocS
|
||||
-- } ;
|
||||
|
||||
-- ConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
||||
-- isPre = ss.isPre
|
||||
-- } ;
|
||||
--
|
||||
-- ConjRS conj ss = conjunctDistrTable Agr conj ss ** {
|
||||
-- c = ss.c
|
||||
-- } ;
|
||||
--
|
||||
-- ConjIAdv = conjunctDistrSS ;
|
||||
--
|
||||
-- ConjCN co ns = conjunctDistrTable2 Number Case co ns ** {g = Neutr} ; --- gender?
|
||||
--
|
||||
-- ConjDet c xs = let cxs = (conjunctDistrSS c xs).s in {s = cxs ; sp = \\_,_,_ => cxs ++ "one" ; hasNum = False ; n = xs.n} ;
|
||||
--
|
||||
-- -- These fun's are generated from the list cat's.
|
||||
--
|
||||
-- BaseS = twoSS ;
|
||||
-- ConsS = consrSS comma ;
|
||||
-- BaseAdv x y = twoSS ** { reqLocS = x.reqLocS } ;
|
||||
-- ConsAdv x y = consrSS comma x y ** { reqLocS = x.reqLocS } ;
|
||||
-- BaseAdV = twoSS ;
|
||||
-- ConsAdV = consrSS comma ;
|
||||
BaseNP x y = twoTable NForm x y ** {
|
||||
agr = conjAgr x.agr y.agr ;
|
||||
empty = x.empty ++ y.empty ;
|
||||
loc = x.loc
|
||||
} ;
|
||||
ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
-- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
||||
-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||
-- BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
||||
-- ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ;
|
||||
-- BaseIAdv = twoSS ;
|
||||
-- ConsIAdv = consrSS comma ;
|
||||
-- BaseCN = twoTable2 Number Case ;
|
||||
-- ConsCN = consrTable2 Number Case comma ;
|
||||
-- BaseDAP x y = twoSS x y ** {n = y.n} ; --- the last number decides: one big and two small cars
|
||||
-- ConsDAP x xs = consrSS comma x xs ** {n = xs.n} ;
|
||||
|
||||
lincat
|
||||
[S] = {
|
||||
s1 : DMood => Str ;
|
||||
subjs1 : Str ;
|
||||
pots1 : DMood => Str ;
|
||||
s2 : DMood => Str ;
|
||||
subjs2 : Str ;
|
||||
pots2 : DMood => Str
|
||||
} ;
|
||||
-- [Adv] = {s1,s2 : Str} ;
|
||||
-- [AdV] = {s1,s2 : Str} ;
|
||||
-- [IAdv] = {s1,s2 : Str} ;
|
||||
-- [NP] = {s1,s2 : NPCase => Str ; a : Agr} ;
|
||||
-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
||||
-- [RS] = {s1,s2 : Agr => Str ; c : NPCase} ;
|
||||
-- [CN] = {s1,s2 : Number => Case => Str} ;
|
||||
-- [DAP] = {s1,s2 : Str ; n : Number} ;
|
||||
|
||||
oper
|
||||
conjAgr : Agr -> Agr = \a1,a2 -> case <a1,a2> of {
|
||||
<First _,First _> => First Pl ;
|
||||
<First _,Second _> => First Pl ;
|
||||
<First _,Third _ _> => First Pl ;
|
||||
<Second _,First _> => First Pl ;
|
||||
<Second _,Second _> => Second Pl ;
|
||||
<Second _,Third _ _> => Second Pl ;
|
||||
<Third _ _,First _> => First Pl ;
|
||||
<Third _ _,Second _> => Second Pl ;
|
||||
<Third c1 _,Third c2 _> => Third c1 Pl
|
||||
} ;
|
||||
|
||||
}
|
||||
222
src/zulu/ConstructionZul.gf
Executable file
222
src/zulu/ConstructionZul.gf
Executable file
@@ -0,0 +1,222 @@
|
||||
--# -path=.:../abstract
|
||||
|
||||
concrete ConstructionZul of Construction = CatZul **
|
||||
open SyntaxZul, SymbolicZul, ParadigmsZul, (L = LexiconZul), (E = ExtendZul), (G = GrammarZul), (R = ResZul), (Sy = SyntaxZul), (S = StructuralZul), Prelude in {
|
||||
|
||||
|
||||
-- lin
|
||||
-- hungry_VP = mkVP (mkA "hungry") ;
|
||||
-- thirsty_VP = mkVP (mkA "thirsty") ;
|
||||
-- tired_VP = mkVP (mkA "tired") ;
|
||||
-- scared_VP = mkVP (mkA "scared") ;
|
||||
-- ill_VP = mkVP (mkA "ill") ;
|
||||
-- ready_VP = mkVP (mkA "ready") ;
|
||||
--
|
||||
-- has_age_VP card = mkVP (mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> L.year_N))) L.old_A) ;
|
||||
--
|
||||
-- have_name_Cl x y = mkCl (mkNP (E.GenNP x) L.name_N) (lin NP y) ;
|
||||
-- married_Cl x y = mkCl (lin NP x) L.married_A2 (lin NP y) | mkCl (mkNP and_Conj (lin NP x) (lin NP y)) (mkA "married") ;
|
||||
--
|
||||
-- what_name_QCl x = mkQCl (mkIComp whatSg_IP) (mkNP (E.GenNP x) L.name_N) ;
|
||||
-- how_old_QCl x = mkQCl (E.ICompAP (mkAP L.old_A)) (lin NP x) ;
|
||||
-- how_far_QCl x = mkQCl (E.IAdvAdv (ss "far")) (lin NP x) ;
|
||||
--
|
||||
-- -- some more things
|
||||
-- weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
|
||||
--
|
||||
-- is_right_VP = mkVP (ParadigmsZul.mkA "right") ;
|
||||
-- is_wrong_VP = mkVP (ParadigmsZul.mkA "wrong") ;
|
||||
--
|
||||
-- n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
||||
-- ---- n_units_of_NP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
||||
-- n_unit_CN card unit cn = mkCN (invarA ((mkUtt card).s ++ (mkUtt unit).s)) cn ;
|
||||
--
|
||||
-- bottle_of_CN np = mkCN (lin N2 (mkN2 "bottle")) (lin NP np) ;
|
||||
-- cup_of_CN np = mkCN (lin N2 (mkN2 "cup")) (lin NP np) ;
|
||||
-- glass_of_CN np = mkCN (lin N2 (mkN2 "glass")) (lin NP np) ;
|
||||
--
|
||||
-- few_X_short_of_Y np x y =
|
||||
-- let
|
||||
-- xs : Str = x.s ! R.Pl ! R.Nom ;
|
||||
-- a_y : Str = (mkNP a_Det y).s ! R.NCase R.Nom ;
|
||||
-- in
|
||||
-- mkS (mkCl np (mkAdv ("a few" ++ xs ++ "short of" ++ a_y))) ;
|
||||
-- {-
|
||||
-- -- spatial deixis and motion verbs
|
||||
--
|
||||
-- where_go_QCl np = mkQCl where_IAdv (mkCl np (mkVP L.go_V)) ;
|
||||
-- where_come_from_QCl np = mkQCl from_where_IAdv (mkCl np (mkVP L.go_V)) ;
|
||||
--
|
||||
-- go_here_VP = mkVP (mkVP L.go_V) S.here_Adv ;
|
||||
-- come_here_VP = mkVP (mkVP L.come_V) S.here_Adv ;
|
||||
-- come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "from here") ;
|
||||
--
|
||||
-- go_there_VP = mkVP (mkVP L.go_V) S.there_Adv ;
|
||||
-- come_there_VP = mkVP (mkVP L.come_V) S.there_Adv ;
|
||||
-- come_from_there_VP = mkVP (mkVP L.come_V) (mkAdv "from there") ;
|
||||
--
|
||||
-- --TODO "where did X come from" instead of "from where did X come"
|
||||
-- oper from_where_IAdv : IAdv = lin IAdv (ss "from where") ;
|
||||
--
|
||||
-- -}
|
||||
--
|
||||
--
|
||||
-- lincat
|
||||
-- Timeunit = N ;
|
||||
-- Hour = {s : Str ; am : Bool} ;
|
||||
-- Weekday = N ;
|
||||
-- Monthday = NP ;
|
||||
-- Month = N ;
|
||||
-- Year = NP ;
|
||||
--
|
||||
-- lin
|
||||
-- timeunitAdv n time =
|
||||
-- let n_card : Card = n ;
|
||||
-- n_hours_NP : NP = mkNP n_card time ;
|
||||
-- in Sy.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
|
||||
--
|
||||
-- timeunitRange l u time = {s = l.s ! True ! R.Nom ++ to_Prep.s ++ u.s ! True ! R.Nom ++ time.s ! R.Pl ! R.Nom} ;
|
||||
--
|
||||
-- oneHour = mkHour "1" True ;
|
||||
-- twoHour = mkHour "2" True ;
|
||||
-- threeHour = mkHour "3" True ;
|
||||
-- fourHour = mkHour "4" True ;
|
||||
-- fiveHour = mkHour "5" True ;
|
||||
-- sixHour = mkHour "6" True ;
|
||||
-- sevenHour = mkHour "7" True ;
|
||||
-- eightHour = mkHour "8" True ;
|
||||
-- nineHour = mkHour "9" True ;
|
||||
-- tenHour = mkHour "10" True ;
|
||||
-- elevenHour = mkHour "11" True ;
|
||||
-- twelveHour = mkHour "12" False ;
|
||||
-- thirteenHour = mkHour "1" False ;
|
||||
-- fourteenHour = mkHour "2" False ;
|
||||
-- fifteenHour = mkHour "3" False ;
|
||||
-- sixteenHour = mkHour "4" False ;
|
||||
-- seventeenHour = mkHour "5" False ;
|
||||
-- eighteenHour = mkHour "6" False ;
|
||||
-- nineteenHour = mkHour "7" False ;
|
||||
-- twentyHour = mkHour "8" False ;
|
||||
-- twentyOneHour = mkHour "9" False ;
|
||||
-- twentyTwoHour = mkHour "10" False ;
|
||||
-- twentyThreeHour = mkHour "11" False ;
|
||||
-- twentyFourHour = mkHour "12" True ;
|
||||
--
|
||||
-- timeHour h = Sy.mkAdv at_Prep (symb (h.s ++ ampm ! h.am)) ;
|
||||
-- timeHourMinute h m = let
|
||||
-- min = m.s ! True ! R.Nom
|
||||
-- in
|
||||
-- Sy.mkAdv at_Prep (symb (h.s ++ min ++ ampm ! h.am)) ;
|
||||
--
|
||||
-- oper
|
||||
-- mkHour : Str -> Bool -> {s : Str ; am : Bool} ;
|
||||
-- mkHour n am = Sy.mkUtt (Sy.mkCard n) ** {am = am} ;
|
||||
--
|
||||
-- at_Prep : Prep ;
|
||||
-- at_Prep = mkPrep "at" ;
|
||||
--
|
||||
-- ampm : Bool => Str ;
|
||||
-- ampm = table {True => "a.m." ; False => "p.m."} ;
|
||||
--
|
||||
-- lin
|
||||
-- weekdayPunctualAdv w = SyntaxZul.mkAdv on_Prep (mkNP w) ; -- on Sunday
|
||||
-- weekdayHabitualAdv w = SyntaxZul.mkAdv on_Prep (mkNP aPl_Det w) ; -- on Sundays
|
||||
-- weekdayNextAdv w = SyntaxZul.mkAdv (mkPrep "next") (mkNP w) ; -- next Sunday
|
||||
-- weekdayLastAdv w = SyntaxZul.mkAdv (mkPrep "last") (mkNP w) ; -- last Sunday
|
||||
--
|
||||
-- monthAdv m = SyntaxZul.mkAdv in_Prep (mkNP m) ;
|
||||
-- yearAdv y = SyntaxZul.mkAdv in_Prep y ;
|
||||
-- dayMonthAdv d m = ParadigmsZul.mkAdv ("on" ++ d.s ! R.NPAcc ++ m.s ! R.Sg ! R.Nom) ; -- on 17 May
|
||||
-- monthYearAdv m y = SyntaxZul.mkAdv in_Prep (mkNP (mkCN m y)) ; -- in May 2012
|
||||
-- dayMonthYearAdv d m y = ParadigmsZul.mkAdv ("on" ++ d.s ! R.NPAcc ++ m.s ! R.Sg ! R.Nom ++ y.s ! R.NPAcc) ; -- on 17 May 2013
|
||||
--
|
||||
-- intYear = symb ;
|
||||
-- intMonthday = symb ;
|
||||
--
|
||||
-- lincat Language = N ;
|
||||
--
|
||||
-- lin InLanguage l = SyntaxZul.mkAdv in_Prep (mkNP l) ;
|
||||
--
|
||||
-- lin
|
||||
-- weekdayN w = w ;
|
||||
-- monthN m = m ;
|
||||
--
|
||||
-- weekdayPN w = mkPN w ;
|
||||
-- monthPN m = mkPN m ;
|
||||
--
|
||||
-- languageCN l = mkCN l ;
|
||||
-- languageNP l = mkNP l ;
|
||||
--
|
||||
--
|
||||
-- oper mkLanguage : Str -> N = \s -> mkN s ;
|
||||
--
|
||||
-- ----------------------------------------------
|
||||
-- ---- lexicon of special names
|
||||
--
|
||||
-- lin second_Timeunit = mkN "second" ;
|
||||
-- lin minute_Timeunit = mkN "minute" ;
|
||||
-- lin hour_Timeunit = mkN "hour" ;
|
||||
-- lin day_Timeunit = mkN "day" ;
|
||||
-- lin week_Timeunit = mkN "week" ;
|
||||
-- lin month_Timeunit = mkN "month" ;
|
||||
-- lin year_Timeunit = mkN "year" ;
|
||||
--
|
||||
-- lin monday_Weekday = mkN "Monday" ;
|
||||
-- lin tuesday_Weekday = mkN "Tuesday" ;
|
||||
-- lin wednesday_Weekday = mkN "Wednesday" ;
|
||||
-- lin thursday_Weekday = mkN "Thursday" ;
|
||||
-- lin friday_Weekday = mkN "Friday" ;
|
||||
-- lin saturday_Weekday = mkN "Saturday" ;
|
||||
-- lin sunday_Weekday = mkN "Sunday" ;
|
||||
--
|
||||
-- lin january_Month = mkN "January" ;
|
||||
-- lin february_Month = mkN "February" ;
|
||||
-- lin march_Month = mkN "March" ;
|
||||
-- lin april_Month = mkN "April" ;
|
||||
-- lin may_Month = mkN "May" ;
|
||||
-- lin june_Month = mkN "June" ;
|
||||
-- lin july_Month = mkN "July" ;
|
||||
-- lin august_Month = mkN "August" ;
|
||||
-- lin september_Month = mkN "September" ;
|
||||
-- lin october_Month = mkN "October" ;
|
||||
-- lin november_Month = mkN "November" ;
|
||||
-- lin december_Month = mkN "December" ;
|
||||
--
|
||||
-- lin afrikaans_Language = mkLanguage "Afrikaans" ;
|
||||
-- lin amharic_Language = mkLanguage "Amharic" ;
|
||||
-- lin arabic_Language = mkLanguage "Arabic" ;
|
||||
-- lin bulgarian_Language = mkLanguage "Bulgarian" ;
|
||||
-- lin catalan_Language = mkLanguage "Catalan" ;
|
||||
-- lin chinese_Language = mkLanguage "Chinese" ;
|
||||
-- lin danish_Language = mkLanguage "Danish" ;
|
||||
-- lin dutch_Language = mkLanguage "Dutch" ;
|
||||
-- lin english_Language = mkLanguage "English" ;
|
||||
-- lin estonian_Language = mkLanguage "Estonian" ;
|
||||
-- lin finnish_Language = mkLanguage "Finnish" ;
|
||||
-- lin french_Language = mkLanguage "French" ;
|
||||
-- lin german_Language = mkLanguage "German" ;
|
||||
-- lin greek_Language = mkLanguage "Greek" ;
|
||||
-- lin hebrew_Language = mkLanguage "Hebrew" ;
|
||||
-- lin hindi_Language = mkLanguage "Hindi" ;
|
||||
-- lin japanese_Language = mkLanguage "Japanese" ;
|
||||
-- lin italian_Language = mkLanguage "Italian" ;
|
||||
-- lin latin_Language = mkLanguage "Latin" ;
|
||||
-- lin latvian_Language = mkLanguage "Latvian" ;
|
||||
-- lin maltese_Language = mkLanguage "Maltese" ;
|
||||
-- lin nepali_Language = mkLanguage "Nepali" ;
|
||||
-- lin norwegian_Language = mkLanguage "Norwegian" ;
|
||||
-- lin persian_Language = mkLanguage "Persian" ;
|
||||
-- lin polish_Language = mkLanguage "Polish" ;
|
||||
-- lin punjabi_Language = mkLanguage "Punjabi" ;
|
||||
-- lin romanian_Language = mkLanguage "Romanian" ;
|
||||
-- lin russian_Language = mkLanguage "Russian" ;
|
||||
-- lin sindhi_Language = mkLanguage "Sindhi" ;
|
||||
-- lin spanish_Language = mkLanguage "Spanish" ;
|
||||
-- lin swahili_Language = mkLanguage "Swahili" ;
|
||||
-- lin swedish_Language = mkLanguage "Swedish" ;
|
||||
-- lin thai_Language = mkLanguage "Thai" ;
|
||||
-- lin turkish_Language = mkLanguage "Turkish" ;
|
||||
-- lin urdu_Language = mkLanguage "Urdu" ;
|
||||
|
||||
|
||||
}
|
||||
190
src/zulu/DocumentationZul.gf
Executable file
190
src/zulu/DocumentationZul.gf
Executable file
@@ -0,0 +1,190 @@
|
||||
--# -path=.:../abstract:../common
|
||||
concrete DocumentationZul of Documentation = CatZul ** open
|
||||
ResZul,
|
||||
HTML in {
|
||||
|
||||
lincat
|
||||
Inflection = {t : Str; s1,s2 : Str} ;
|
||||
Definition = {s : Str} ;
|
||||
Document = {s : Str} ;
|
||||
Tag = {s : Str} ;
|
||||
|
||||
-- lin
|
||||
-- InflectionN, InflectionN2, InflectionN3 = \noun -> {
|
||||
-- t = "n" ;
|
||||
-- s1 = heading1 ("Noun" ++ case noun.g of {
|
||||
-- Neutr => "";
|
||||
-- Masc => "(masc)";
|
||||
-- Fem => "(fem)"
|
||||
-- }) ;
|
||||
-- s2 = frameTable (
|
||||
-- tr (th "" ++ th "nom" ++ th "gen") ++
|
||||
-- tr (th "sg" ++ td (noun.s ! Sg ! Nom) ++ td (noun.s ! Sg ! Gen)) ++
|
||||
-- tr (th "pl" ++ td (noun.s ! Pl ! Nom) ++ td (noun.s ! Pl ! Gen))
|
||||
-- )
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionA, InflectionA2 = \adj -> {
|
||||
-- t = "a" ;
|
||||
-- s1 = heading1 "Adjective" ;
|
||||
-- s2 = frameTable (
|
||||
-- tr (th "" ++ th "nom" ++ th "gen") ++
|
||||
-- tr (th "posit" ++ td (adj.s ! AAdj Posit Nom) ++ td (adj.s ! AAdj Posit Gen)) ++
|
||||
-- tr (th "compar" ++ td (adj.s ! AAdj Compar Nom) ++ td (adj.s ! AAdj Compar Gen)) ++
|
||||
-- tr (th "superl" ++ td (adj.s ! AAdj Superl Nom) ++ td (adj.s ! AAdj Superl Gen))
|
||||
-- ) ++
|
||||
-- heading1 "Adverb" ++
|
||||
-- paragraph (adj.s ! AAdv)
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionAdv = \adv -> {
|
||||
-- t = "adv" ;
|
||||
-- s1= heading1 "Adverb" ;
|
||||
-- s2= paragraph (adv.s) ;
|
||||
-- s3= ""
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionPrep = \prep -> {
|
||||
-- t = "prep" ;
|
||||
-- s1= heading1 "Preposition" ;
|
||||
-- s2= paragraph (prep.s) ;
|
||||
-- s3= ""
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++ v.s ! VInf ++ v.p) ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV2 v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++ v.c2 ++
|
||||
-- pp "object") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV3 v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- v.c2 ++ pp "arg1" ++
|
||||
-- v.c3 ++ pp "arg2") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV2V v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- v.c2 ++ pp "object" ++
|
||||
-- v.c3 ++ case v.typ of {
|
||||
-- VVAux => pp "verb" ;
|
||||
-- VVInf => "to" ++ pp "verb" ;
|
||||
-- VVPresPart => pp "verb+ing"
|
||||
-- }) ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV2S v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- v.c2 ++ pp "object" ++
|
||||
-- "that" ++ pp "sentence") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV2Q v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- pp "question") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionV2A v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- v.c2 ++ pp "object" ++
|
||||
-- pp "adjective") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionVV v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VVF VInf ++ v.p ++
|
||||
-- case v.typ of {
|
||||
-- VVAux => pp "verb" ;
|
||||
-- VVInf => "to" ++ pp "verb" ;
|
||||
-- VVPresPart => pp "verb+ing"
|
||||
-- }) ;
|
||||
-- s2= frameTable (
|
||||
-- tr (th "infitive" ++ td (v.s ! VVF VInf)) ++
|
||||
-- tr (th "present" ++ td (v.s ! VVF VPres ++ " " ++ v.s ! VVPresNeg)) ++
|
||||
-- tr (th "past" ++ td (v.s ! VVF VPast ++ " " ++ v.s ! VVPastNeg)) ++ --# notpresent
|
||||
-- tr (th "past part." ++ td (v.s ! VVF VPPart)) ++
|
||||
-- tr (th "present part." ++ td (v.s ! VVF VPresPart))
|
||||
-- )
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionVS v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- "that" ++ pp "sentence") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionVQ v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- pp "question") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- InflectionVA v = {
|
||||
-- t = "v" ;
|
||||
-- s1= heading1 "Verb" ++
|
||||
-- paragraph (pp "subject" ++
|
||||
-- v.s ! VInf ++ v.p ++
|
||||
-- pp "adjective") ;
|
||||
-- s2= inflVerb v
|
||||
-- } ;
|
||||
--
|
||||
-- oper
|
||||
-- inflVerb : Verb -> Str = \verb ->
|
||||
-- frameTable (
|
||||
-- tr (th "infitive" ++ td (verb.s ! VInf)) ++
|
||||
-- tr (th "present" ++ td (verb.s ! VPres)) ++
|
||||
-- tr (th "past" ++ td (verb.s ! VPast)) ++ --# notpresent
|
||||
-- tr (th "past part." ++ td (verb.s ! VPPart)) ++
|
||||
-- tr (th "present part." ++ td (verb.s ! VPresPart))
|
||||
-- ) ;
|
||||
--
|
||||
-- pp : Str -> Str = \s -> "<"+s+">";
|
||||
--
|
||||
-- lin
|
||||
-- NoDefinition t = {s=t.s};
|
||||
-- MkDefinition t d = {s="<p><b>Definition:</b>"++t.s++d.s++"</p>"};
|
||||
-- MkDefinitionEx t d e = {s="<p><b>Definition:</b>"++t.s++d.s++"</p><p><b>Example:</b>"++e.s++"</p>"};
|
||||
--
|
||||
-- lin
|
||||
-- MkDocument d i e = {s = i.s1 ++ d.s ++ i.s2 ++ paragraph e.s} ;
|
||||
-- MkTag i = {s = i.t} ;
|
||||
|
||||
}
|
||||
367
src/zulu/ExtendZul.gf
Executable file
367
src/zulu/ExtendZul.gf
Executable file
@@ -0,0 +1,367 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
concrete ExtendZul of Extend =
|
||||
CatZul ** ExtendFunctor -
|
||||
[
|
||||
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
|
||||
AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP,
|
||||
BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2,
|
||||
MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV,
|
||||
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
|
||||
Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN,
|
||||
CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
|
||||
CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
|
||||
ExistsNP, ExistCN, ExistMassCN, ExistPluralCN,
|
||||
FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
|
||||
GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP, InOrderToVP, MkVPS, NominalizeVPSlashNP,
|
||||
PassAgentVPSlash, PassVPSlash, ProgrVPSlash, PastPartAP, PastPartAgentAP, PositAdVAdj, PredVPS, PredVPSVV, PredetRNP, PrepCN,
|
||||
EmbedSSlash, PredIAdvVP, PresPartAP, PurposeVP, ReflPoss, ReflPron, ReflRNP, SlashBareV2S, SlashV2V, StrandQuestSlash, StrandRelSlash,
|
||||
UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2
|
||||
]
|
||||
with
|
||||
(Grammar = GrammarZul) **
|
||||
|
||||
open
|
||||
GrammarZul,
|
||||
ResZul,
|
||||
Coordination,
|
||||
Prelude,
|
||||
-- MorphoZul,
|
||||
ParadigmsZul in {
|
||||
|
||||
lin
|
||||
|
||||
ProDrop pron = {
|
||||
s = pron.s ;
|
||||
agr = pron.agr ;
|
||||
empty = pron.empty ;
|
||||
proDrop = True
|
||||
} ;
|
||||
|
||||
|
||||
-- GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen ; isDef = True} ;
|
||||
-- GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
||||
-- GenRP nu cn = {
|
||||
-- s = \\c => "whose" ++ nu.s ! False ! Nom ++
|
||||
-- case c of {
|
||||
-- RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
|
||||
-- _ => cn.s ! nu.n ! Nom
|
||||
-- } ;
|
||||
-- a = RAg (agrP3 nu.n)
|
||||
-- } ;
|
||||
--
|
||||
-- GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
|
||||
-- GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
|
||||
--
|
||||
-- StrandQuestSlash ip slash =
|
||||
-- {s = \\t,a,b,q =>
|
||||
-- (mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||
-- };
|
||||
-- StrandRelSlash rp slash = {
|
||||
-- s = \\t,a,p,ag =>
|
||||
-- rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
||||
-- c = NPAcc
|
||||
-- } ;
|
||||
-- EmptyRelSlash slash = {
|
||||
-- s = \\t,a,p,_ => slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
||||
-- c = NPAcc
|
||||
-- } ;
|
||||
--
|
||||
-- DetNPMasc det = {
|
||||
-- s = det.sp ! Masc ! False ;
|
||||
-- a = agrgP3 det.n Masc
|
||||
-- } ;
|
||||
--
|
||||
-- DetNPFem det = {
|
||||
-- s = det.sp ! Fem ! False ;
|
||||
-- a = agrgP3 det.n Fem
|
||||
-- } ;
|
||||
--
|
||||
-- lincat
|
||||
-- VPS = {s : Agr => Str} ;
|
||||
-- [VPS] = {s1,s2 : Agr => Str} ;
|
||||
-- VPI = {s : VVType => Agr => Str} ;
|
||||
-- [VPI] = {s1,s2 : VVType => Agr => Str} ;
|
||||
--
|
||||
-- lin
|
||||
-- BaseVPS = twoTable Agr ;
|
||||
-- ConsVPS = consrTable Agr comma ;
|
||||
--
|
||||
-- BaseVPI = twoTable2 VVType Agr ;
|
||||
-- ConsVPI = consrTable2 VVType Agr comma ;
|
||||
--
|
||||
-- MkVPS t p vp = mkVPS (lin Temp t) (lin Pol p) (lin VP vp) ;
|
||||
-- ConjVPS c xs = conjunctDistrTable Agr c xs ;
|
||||
-- PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ;
|
||||
--
|
||||
--
|
||||
-- MkVPI vp = mkVPI (lin VP vp) ;
|
||||
-- ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ;
|
||||
-- ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
|
||||
--
|
||||
--
|
||||
-- -------- two-place verb conjunction
|
||||
--
|
||||
-- lincat
|
||||
-- VPS2 = {s : Agr => Str ; c2 : Str} ;
|
||||
-- [VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ;
|
||||
-- VPI2 = {s : VVType => Agr => Str ; c2 : Str} ;
|
||||
-- [VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ;
|
||||
--
|
||||
-- lin
|
||||
-- MkVPS2 t p vpsl = mkVPS (lin Temp t) (lin Pol p) (lin VP vpsl) ** {c2 = vpsl.c2} ;
|
||||
-- MkVPI2 vpsl = mkVPI (lin VP vpsl) ** {c2 = vpsl.c2} ;
|
||||
--
|
||||
-- BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
|
||||
-- ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ;
|
||||
--
|
||||
-- BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
|
||||
-- ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ;
|
||||
--
|
||||
--
|
||||
-- ConjVPS2 c xs = conjunctDistrTable Agr c xs ** {c2 = xs.c2} ;
|
||||
-- ConjVPI2 c xs = conjunctDistrTable2 VVType Agr c xs ** {c2 = xs.c2} ;
|
||||
--
|
||||
--
|
||||
-- ComplVPS2 vps2 np = {
|
||||
-- s = \\a => vps2.s ! a ++ vps2.c2 ++ np.s ! NPAcc
|
||||
-- } ;
|
||||
-- ComplVPI2 vpi2 np = {
|
||||
-- s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc
|
||||
-- } ;
|
||||
--
|
||||
-- oper
|
||||
-- mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
|
||||
-- s = \\a =>
|
||||
-- let
|
||||
-- verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
|
||||
-- verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
||||
-- in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
|
||||
-- } ;
|
||||
--
|
||||
-- mkVPI : VP -> VPI = \vp -> lin VPI {
|
||||
-- s = table {
|
||||
-- VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ;
|
||||
-- VVInf => \\a => "to" ++ vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ;
|
||||
-- VVPresPart => \\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- -----
|
||||
--
|
||||
-- lin
|
||||
-- ICompAP ap = {s = "how" ++ ap.s ! agrP3 Sg} ; ---- IComp should have agr!
|
||||
--
|
||||
-- IAdvAdv adv = {s = "how" ++ adv.s} ;
|
||||
--
|
||||
-- PresPartAP vp = {
|
||||
-- s = \\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext ;
|
||||
-- isPre = vp.isSimple -- depends on whether there are complements
|
||||
-- } ;
|
||||
--
|
||||
-- EmbedPresPart vp = {s = infVP VVPresPart vp False Simul CPos (agrP3 Sg)} ;
|
||||
--
|
||||
-- PastPartAP vp = {
|
||||
-- s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
|
||||
-- isPre = vp.isSimple -- depends on whether there are complements
|
||||
-- } ;
|
||||
-- PastPartAgentAP vp np = {
|
||||
-- s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ "by" ++ np.s ! NPAcc ++ vp.ext ;
|
||||
-- isPre = False
|
||||
-- } ;
|
||||
--
|
||||
-- GerundCN vp = {
|
||||
-- s = \\n,c => vp.ad ! AgP3Sg Neutr ++ vp.prp ++
|
||||
-- case <n,c> of {
|
||||
-- <Sg,Nom> => "" ;
|
||||
-- <Sg,Gen> => Predef.BIND ++ "'s" ;
|
||||
-- <Pl,Nom> => Predef.BIND ++ "s" ;
|
||||
-- <Pl,Gen> => Predef.BIND ++ "s'"
|
||||
-- } ++
|
||||
-- vp.p ++ vp.s2 ! AgP3Sg Neutr ++ vp.ext ;
|
||||
-- g = Neutr
|
||||
-- } ;
|
||||
--
|
||||
-- GerundNP vp =
|
||||
-- let a = AgP3Sg Neutr ---- agr
|
||||
-- in
|
||||
-- {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext ; a = a} ;
|
||||
--
|
||||
-- GerundAdv vp =
|
||||
-- let a = AgP3Sg Neutr
|
||||
-- in
|
||||
-- {s = vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext} ;
|
||||
--
|
||||
-- WithoutVP vp = {s = "without" ++ (GerundAdv (lin VP vp)).s} ;
|
||||
--
|
||||
-- InOrderToVP vp = {s = ("in order" | []) ++ infVP VVInf vp False Simul CPos (AgP3Sg Neutr)} ;
|
||||
--
|
||||
-- PurposeVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ; --- agr
|
||||
--
|
||||
-- ByVP vp = {s = "by" ++ (GerundAdv (lin VP vp)).s} ;
|
||||
--
|
||||
-- PredIAdvVP iadv vp = {s = \\t,a,p,q => iadv.s ++ infVP VVInf vp False Simul CPos (agrP3 Sg)} ;
|
||||
--
|
||||
-- EmbedSSlash s = {s = "what" ++ s.s ++ s.c2} ;
|
||||
--
|
||||
-- NominalizeVPSlashNP vpslash np =
|
||||
-- let vp : ResZul.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ;
|
||||
-- a = AgP3Sg Neutr
|
||||
-- in
|
||||
-- lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ;
|
||||
--
|
||||
--
|
||||
-- oper passVPSlash : VPSlash -> Str -> ResZul.VP =
|
||||
-- \vps,ag ->
|
||||
-- let
|
||||
-- be = predAux auxBe ;
|
||||
-- ppt = vps.ptp
|
||||
-- in {
|
||||
-- s = be.s ;
|
||||
-- p = [] ;
|
||||
-- prp = be.prp ;
|
||||
-- ptp = be.ptp ;
|
||||
-- inf = be.inf ;
|
||||
-- ad = \\_ => [] ;
|
||||
-- s2 = \\a => vps.ad ! a ++ ppt ++ vps.p ++ vps.s2 ! a ++ ag ++ vps.c2 ; ---- place of agent
|
||||
-- isSimple = False ;
|
||||
-- ext = vps.ext
|
||||
-- } ;
|
||||
--
|
||||
-- lin
|
||||
-- PassVPSlash vps = passVPSlash (lin VPS vps) [] ;
|
||||
-- PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ;
|
||||
-- ProgrVPSlash vp = insertObjc (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a)
|
||||
-- (predAux auxBe ** {c2 = vp.c2; gapInMiddle = vp.gapInMiddle; missingAdv = vp.missingAdv});
|
||||
--
|
||||
-- --- AR 7/3/2013
|
||||
-- ComplSlashPartLast vps np = case vps.gapInMiddle of {
|
||||
-- _ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps ---
|
||||
-- } ;
|
||||
--
|
||||
-- --- AR 22/5/2013
|
||||
-- ExistsNP np =
|
||||
-- mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
-- (insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ;
|
||||
--
|
||||
-- ExistCN cn =
|
||||
-- let
|
||||
-- pos = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
|
||||
-- neg = ExistNP (DetCN (DetQuant no_Quant NumSg) cn) ;
|
||||
-- in posNegClause pos neg ;
|
||||
-- ExistMassCN cn =
|
||||
-- let
|
||||
-- pos = ExistNP (MassNP cn) ;
|
||||
-- neg = ExistNP (DetCN (DetQuant no_Quant NumSg) cn) ;
|
||||
-- in posNegClause pos neg ;
|
||||
-- ExistPluralCN cn =
|
||||
-- let
|
||||
-- pos = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ;
|
||||
-- neg = ExistNP (DetCN (DetQuant no_Quant NumPl) cn) ;
|
||||
-- in posNegClause pos neg ;
|
||||
--
|
||||
--
|
||||
-- ComplBareVS v s = insertExtra s.s (predV v) ;
|
||||
-- SlashBareV2S v s = insertExtrac s.s (predVc v) ;
|
||||
--
|
||||
-- CompoundN noun cn = {
|
||||
-- s = variants {\\n,c => noun.s ! Sg ! Nom ++ cn.s ! n ! c ;
|
||||
-- \\n,c => noun.s ! Sg ! Nom ++ BIND++"-"++BIND ++ cn.s ! n ! c} ;
|
||||
-- g = cn.g
|
||||
-- } ;
|
||||
--
|
||||
-- CompoundAP noun adj = {
|
||||
-- s = variants {\\_ => noun.s ! Sg ! Nom ++ adj.s ! AAdj Posit Nom ;
|
||||
-- \\_ => noun.s ! Sg ! Nom ++ BIND++"-"++BIND ++ adj.s ! AAdj Posit Nom} ;
|
||||
-- isPre = True
|
||||
-- } ;
|
||||
--
|
||||
-- FrontExtPredVP np vp = {
|
||||
-- s = \\t,a,b,o =>
|
||||
-- let
|
||||
-- subj = np.s ! npNom ;
|
||||
-- agr = np.a ;
|
||||
-- verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||
-- compl = vp.s2 ! agr
|
||||
-- in
|
||||
-- case o of {
|
||||
-- ODir _ => vp.ext ++ frontComma ++ subj ++ verb.aux ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ verb.inf ++ vp.p ++ compl ;
|
||||
-- OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ verb.inf ++ vp.p ++ compl ++ vp.ext
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- InvFrontExtPredVP np vp = {
|
||||
-- s = \\t,a,b,o =>
|
||||
-- let
|
||||
-- subj = np.s ! npNom ;
|
||||
-- agr = np.a ;
|
||||
-- verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||
-- compl = vp.s2 ! agr
|
||||
-- in
|
||||
-- case o of {
|
||||
-- ODir _ => vp.ext ++ verb.aux ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ subj ++ verb.inf ++ vp.p ++ compl ;
|
||||
-- OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ! agr ++ verb.fin ++ verb.inf ++ vp.p ++ compl ++ vp.ext
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
--
|
||||
--
|
||||
-- lin
|
||||
-- AdAdV = cc2 ;
|
||||
--
|
||||
-- AdjAsCN ap = let cn = mkNoun "one" "one's" "ones" "ones'" ** {g = Neutr}
|
||||
-- in {
|
||||
-- s = \\n,c => preOrPost ap.isPre (ap.s ! agrgP3 n cn.g) (cn.s ! n ! c) ;
|
||||
-- g = cn.g
|
||||
-- } ;
|
||||
-- AdjAsNP ap = {
|
||||
-- s = \\c => ap.s ! agrgP3 Sg nonhuman ; ---- genitive case?
|
||||
-- a = agrgP3 Sg nonhuman
|
||||
-- } ;
|
||||
--
|
||||
-- PositAdVAdj a = {s = a.s ! AAdv} ;
|
||||
--
|
||||
-- lincat
|
||||
-- RNP = {s : Agr => Str} ;
|
||||
-- RNPList = {s1,s2 : Agr => Str} ;
|
||||
--
|
||||
-- lin
|
||||
-- ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
||||
-- ReflPron = {s = reflPron} ;
|
||||
-- ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||
-- PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;
|
||||
--
|
||||
-- ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ;
|
||||
--
|
||||
-- Base_rr_RNP x y = twoTable Agr x y ;
|
||||
-- Base_nr_RNP x y = twoTable Agr {s = \\a => x.s ! NPAcc} y ;
|
||||
-- Base_rn_RNP x y = twoTable Agr x {s = \\a => y.s ! NPAcc} ;
|
||||
-- Cons_rr_RNP x xs = consrTable Agr comma x xs ;
|
||||
-- Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
|
||||
--
|
||||
-- lin
|
||||
-- ApposNP np1 np2 = {s = \\c => np1.s ! c ++ comma ++ np2.s ! c; a = np1.a} ;
|
||||
--
|
||||
-- AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a} (UseComp (CompNP np)) ;
|
||||
--
|
||||
-- ---- TODO: RNPList construction
|
||||
--
|
||||
-- lin
|
||||
-- ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
|
||||
-- infVP v.typ vp False a.a p.p agr)
|
||||
-- (predVV v) ;
|
||||
--
|
||||
-- CompS s = {s = \\_ => "that" ++ s.s} ;
|
||||
-- CompQS qs = {s = \\_ => qs.s ! QIndir} ;
|
||||
-- CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
|
||||
-- infVP VVInf vp False ant.a p.p a} ;
|
||||
--
|
||||
-- -- quite specific for English anyway
|
||||
--
|
||||
-- UncontractedNeg = {s = [] ; p = CNeg False} ;
|
||||
-- UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
661
src/zulu/ExtraExtZul.gf
Executable file
661
src/zulu/ExtraExtZul.gf
Executable file
@@ -0,0 +1,661 @@
|
||||
concrete ExtraExtZul of ExtraExt =
|
||||
CatZul [NP,VP,CN,V,Temp,S,Cl,Adv,Pron,QCl,QS,A,RS,IAdv,IComp,Pol,Det,Quant,N,PN],
|
||||
CatExtZul
|
||||
** open ResZul,Prelude,ParamX in {
|
||||
|
||||
lin
|
||||
-- use with caution
|
||||
ProDrop pron = {
|
||||
s = table {
|
||||
NFull => case pron.proDrop of {
|
||||
True => "*" ++ pron.s!NFull ;
|
||||
False => pron.empty
|
||||
} ;
|
||||
nform => "*" ++ pron.s!nform
|
||||
} ;
|
||||
agr = pron.agr ;
|
||||
empty = pron.empty ;
|
||||
proDrop = True
|
||||
} ;
|
||||
|
||||
lin
|
||||
-- PotQS pol qcl = {
|
||||
-- s = pol.s ++ qcl.potqcl!pol.p!Princ ;
|
||||
-- qword_pre = qcl.qword_pre ;
|
||||
-- qword_post = qcl.qword_post
|
||||
-- } ;
|
||||
|
||||
-- SubjunctS s = { s = s.subjs } ;
|
||||
|
||||
-- AssocCop np = {
|
||||
-- s = \\_ => [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = np.s!Reduced ;
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- r = case np.proDrop of {
|
||||
-- True => RC ;
|
||||
-- False => initNP np.isPron np.agr
|
||||
-- } ;
|
||||
-- syl = SylMult ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- vptype = CopAssoc ;
|
||||
-- comp_agr = np.agr ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
--
|
||||
-- EqCop np = {
|
||||
-- s = \\_ => [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = np.s!Full ;
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- r = case np.isPron of {
|
||||
-- True => RC ;
|
||||
-- False => initNP np.isPron np.agr
|
||||
-- } ;
|
||||
-- syl = SylMult ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- vptype = CopEq ;
|
||||
-- comp_agr = np.agr ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
|
||||
-- UsePNPl pn = let
|
||||
-- agr = Third pn.c Pl
|
||||
-- in {
|
||||
-- empty,predet_pre,predet_post = pn.empty ;
|
||||
-- s = pn.s!Pl ;
|
||||
-- mod = pn.empty ;
|
||||
-- dem = pn.empty ;
|
||||
-- agr = agr ;
|
||||
-- i = nominit!agr ;
|
||||
-- proDrop = False ;
|
||||
-- isPron = False ;
|
||||
-- -- reqLocS = True ;
|
||||
-- qdef = Article Spec ;
|
||||
-- } ;
|
||||
|
||||
-- PNAsCN pn = pn ** { mod = \\_ => [] } ;
|
||||
|
||||
-- DemPron quant pron = let
|
||||
-- d = case quant.qdef of {
|
||||
-- Article _ => Dem1 ;
|
||||
-- Demonstrative d => d
|
||||
-- }
|
||||
-- in {
|
||||
-- empty,predet_pre,dem,predet_post = pron.empty ;
|
||||
-- -- dem = case quant.qdef of {
|
||||
-- -- Article _ => dem_pron!Dem1!pron.agr ;
|
||||
-- -- Demonstrative d => dem_pron!d!pron.agr
|
||||
-- -- } ;
|
||||
-- -- s = \\nform => quant.s ++ pron.s!nform ;
|
||||
-- s = table {
|
||||
-- Full => quant.s ++ dem_pron!d!pron.agr ++ pron.empty ;
|
||||
-- Reduced => quant.s ++ dem_pron!d!pron.agr ++ pron.empty ;
|
||||
-- Poss => quant.s ++ dem_pron!d!pron.agr ++ pron.empty ;
|
||||
-- Loc => quant.s ++ dem_pron!d!pron.agr ++ pron.empty
|
||||
-- } ;
|
||||
-- mod = pron.empty ;
|
||||
-- agr = pron.agr ;
|
||||
-- i = RC ;
|
||||
-- proDrop = False ;
|
||||
-- isPron = True ;
|
||||
-- -- reqLocS = True ;
|
||||
-- qdef = case quant.qdef of {
|
||||
-- Article _ => Demonstrative Dem1 ;
|
||||
-- Demonstrative d => Demonstrative d
|
||||
-- }
|
||||
-- } ;
|
||||
|
||||
-- EmphCN cn = {
|
||||
-- s = \\num,nform => pron_stem!(Third cn.c num) ++BIND++ "na" ++ cn.s!num!nform ;
|
||||
-- mod = cn.mod ;
|
||||
-- c = cn.c ;
|
||||
-- empty = cn.empty
|
||||
-- } ;
|
||||
--
|
||||
-- ContrastCN cn = {
|
||||
-- s = cn.s ;
|
||||
-- mod = \\num => pron_stem!(Third cn.c num) ++BIND++ "na" ++ cn.mod!num ;
|
||||
-- c = cn.c ;
|
||||
-- empty = cn.empty
|
||||
-- } ;
|
||||
|
||||
-- ApposCNCN cn1 cn2 = {
|
||||
-- s = cn1.s ;
|
||||
-- mod = \\n => cn1.mod!n ++ cn2.s!n!Full ++ cn2.mod!n ;
|
||||
-- c = cn1.c ;
|
||||
-- empty = cn1.empty ++ cn2.empty
|
||||
-- } ;
|
||||
|
||||
-- ApposNPN np n = let
|
||||
-- num = case np.agr of {
|
||||
-- First n => n ;
|
||||
-- Second n => n ;
|
||||
-- Third c n => n
|
||||
-- } ;
|
||||
-- in {
|
||||
-- empty = np.empty ;
|
||||
-- s = np.s;
|
||||
-- mod = np.mod ++ np.predet_post ++ n.s!num!Full ;
|
||||
-- dem = np.dem ;
|
||||
-- predet_pre = np.predet_pre ;
|
||||
-- predet_post = np.empty ;
|
||||
-- agr = Third n.c num ;
|
||||
-- i = np.i ;
|
||||
-- proDrop = np.proDrop ;
|
||||
-- isPron = np.isPron ;
|
||||
-- -- reqLocS = np.reqLocS ;
|
||||
-- qdef = np.qdef ;
|
||||
-- } ;
|
||||
|
||||
PossLocNP locn np = {
|
||||
empty = np.empty ;
|
||||
s = \\n,nform => locn.s ;
|
||||
mod = \\num => poss_concord!(C17)!Sg!np.i ++BIND++ (poss_NP np) ;
|
||||
c = C17 ;
|
||||
emph = False
|
||||
} ;
|
||||
|
||||
InstrNPAdv np =
|
||||
let
|
||||
pref = instrPref!(initNP np.isPron np.agr)
|
||||
in {
|
||||
s = pref ++BIND++ (np.s!NReduced) ;
|
||||
-- asp = Null ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
InstrAdvNPAdv adv np =
|
||||
let
|
||||
pref = instrPref!(initNP np.isPron np.agr)
|
||||
in {
|
||||
s = adv.s ++ pref ++BIND++ (np.s!NReduced) ;
|
||||
-- asp = adv.asp ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
LocNPAdv np = {
|
||||
s = np.s!NLoc ;
|
||||
-- asp = Null ;
|
||||
reqLocS = case np.isPron of {
|
||||
False => True ;
|
||||
True => False -- ki-
|
||||
} ;
|
||||
} ;
|
||||
|
||||
LocAdvNPAdv adv np = {
|
||||
s = adv.s ++ (np.s!NLoc) ;
|
||||
-- asp = adv.asp ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
-- locative kwa
|
||||
KwaNPAdv np = {
|
||||
-- s = "kwa" ++BIND++ (np.s!Reduced) ;
|
||||
s = (poss_concord_agr!(Third C17 Sg)!np.i) ++BIND++ (np.s!NReduced) ;
|
||||
-- asp = Null ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
-- -- NOTE: this seems to be a specific construction. Not yet found in Poulos+Msimang
|
||||
-- KwaAdvNPAdv adv np =
|
||||
-- let
|
||||
-- c = case np.agr of {
|
||||
-- (First _ | Second _) => C1_2 ; -- people class as default
|
||||
-- Third c _ => c
|
||||
-- } ;
|
||||
-- n = case np.agr of {
|
||||
-- (First Sg | Second Sg | Third _ Sg) => Sg ;
|
||||
-- (First Pl | Second Pl | Third _ Pl) => Pl
|
||||
-- }
|
||||
-- in
|
||||
-- {
|
||||
-- s = adv.s ++ poss_concord!C15!Sg!(initNP np.isPron np.agr) ++BIND++ np.s!Reduced ++ np.mod ++ np.predet_pre ++ np.predet_post ;
|
||||
-- -- asp = adv.asp ;
|
||||
-- reqLocS = False
|
||||
-- } ;
|
||||
|
||||
-- locative ku
|
||||
KuNPAdv np = {
|
||||
s = case np.isPron of {
|
||||
True => "ki" ;
|
||||
False => case (initNP np.isPron np.agr) of {
|
||||
-- RI => "ki" ;
|
||||
RO => "ko" ;
|
||||
RA => "kw" ;
|
||||
_ => "ku"
|
||||
}
|
||||
}
|
||||
++BIND++ (np.s!NReduced) ;
|
||||
-- asp = Null ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
KuAdvNPAdv adv np = {
|
||||
s = adv.s ++
|
||||
case np.proDrop of {
|
||||
True => "ki" ;
|
||||
False => case (initNP np.isPron np.agr) of {
|
||||
RI => "ki" ;
|
||||
RO => "ko" ;
|
||||
RA => "kw" ;
|
||||
_ => "ku"
|
||||
}
|
||||
}
|
||||
++BIND++ (np.s!NReduced) ;
|
||||
-- asp = Null ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
NaNPAdv np = {
|
||||
s = withPref ! (initNP np.isPron np.agr) ++BIND++ (np.s!NReduced) ;
|
||||
-- asp = Null ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
RelAdv adv = {
|
||||
s = \\a => relConcLookup!a!RC ++BIND++ adv.s
|
||||
} ;
|
||||
|
||||
-- ProgVP vp = {
|
||||
-- s = vp.s ;
|
||||
-- perfSuff = vp.perfSuff ;
|
||||
-- oc = vp.oc ;
|
||||
-- comp = vp.comp ;
|
||||
-- hasComp = vp.hasComp ;
|
||||
-- r = vp.r ;
|
||||
-- syl = vp.syl ;
|
||||
-- asp = Prog ;
|
||||
-- vptype = vp.vptype ;
|
||||
-- comp_agr = vp.comp_agr ;
|
||||
-- ap_comp = vp.ap_comp ;
|
||||
-- ap_bool = vp.ap_bool ;
|
||||
-- aux_root = vp.aux_root ;
|
||||
-- hasAux = vp.hasAux
|
||||
-- } ;
|
||||
|
||||
-- QuantRS quant = {
|
||||
-- s = \\a => relConcLookup!a!RC ++BIND++ quantConc!a ++BIND++ quant.s
|
||||
-- } ;
|
||||
--
|
||||
-- RelRS rel = {
|
||||
-- s = \\a => relConcLookup!a!RC ++BIND++ rel.s
|
||||
-- } ;
|
||||
|
||||
-- QuantCN quant cn = {
|
||||
-- empty = cn.empty ;
|
||||
-- s = \\num,nform =>
|
||||
-- let
|
||||
-- agr = Third cn.c num
|
||||
-- in
|
||||
-- case quant.isPost of {
|
||||
-- True => cn.s ! num ! nform ++ quantConc!agr ++BIND++ quant.s ;
|
||||
-- False => quantConc!agr ++BIND++ quant.s ++ cn.s ! num ! nform
|
||||
-- } ;
|
||||
-- c = cn.c
|
||||
-- } ;
|
||||
-- let
|
||||
-- cn_agr = Third cn.c quant.n
|
||||
-- in
|
||||
-- {
|
||||
-- empty = cn.empty ;
|
||||
-- s = \\p => case quant.isPost of {
|
||||
-- True => cn.s ! quant.n ! p ++ quantConc!cn_agr ++BIND++ quant.s ;
|
||||
-- False => quantConc!cn_agr ++BIND++ quant.s ++ cn.s ! quant.n ! p
|
||||
-- } ;
|
||||
-- loc = quantConc!cn_agr ++BIND++ quant.s ++ cn.loc ! quant.n ;
|
||||
-- desc = cn.desc ! quant.n ;
|
||||
-- det = cn.empty ;
|
||||
-- poss = poss_concord!cn.c!quant.n!(initNP False cn_agr) ++ cn.s ! quant.n ! Reduced ;
|
||||
-- agr = cn_agr ;
|
||||
-- proDrop = False ;
|
||||
-- isPron = False ;
|
||||
-- reqLocS = False ;
|
||||
-- qdef = Article Def
|
||||
-- } ;
|
||||
|
||||
NumAdjCN cn a = {
|
||||
s = \\num,nform => cn.s!num!nform ++ "na" ++BIND++ a.s!AF2 ;
|
||||
-- loc = cn.loc ;
|
||||
-- desc = \\num =>
|
||||
-- let
|
||||
-- agr = Third cn.c num ;
|
||||
-- in
|
||||
-- cn.desc ! num ++ "na" ++BIND++ a.s!AF2 ;
|
||||
c = cn.c ;
|
||||
empty = cn.empty ++ a.empty
|
||||
} ;
|
||||
|
||||
only_QuantStem = {
|
||||
s = table {
|
||||
Third C1_2 Sg => "yedwa" ;
|
||||
Third C1_2 Pl => "bodwa" ;
|
||||
Third C1a_2a Sg => "yedwa" ;
|
||||
Third C1a_2a Pl => "bodwa" ;
|
||||
Third C3_4 Sg => "wodwa" ;
|
||||
Third C3_4 Pl => "yodwa" ;
|
||||
Third C5_6 Sg => "lodwa" ;
|
||||
Third C5_6 Pl => "odwa" ;
|
||||
Third C7_8 Sg => "sodwa" ;
|
||||
Third C7_8 Pl => "zodwa" ;
|
||||
Third C9_10 Sg => "yodwa" ;
|
||||
Third C9_10 Pl => "zodwa" ;
|
||||
Third C11_10 Sg => "lodwa" ;
|
||||
Third C11_10 Pl => "zodwa" ;
|
||||
Third C9_6 Sg => "yodwa" ;
|
||||
Third C9_6 Pl => "odwa" ;
|
||||
Third C14 _ => "bodwa" ;
|
||||
Third C15 _ => "kodwa" ;
|
||||
Third C17 _ => "kodwa" ;
|
||||
First Sg => "ngedwa" ;
|
||||
First Pl => "sodwa" ;
|
||||
Second Sg => "wedwa" ;
|
||||
Second Pl => "nodwa"
|
||||
}
|
||||
} ;
|
||||
all_QuantStem = {
|
||||
s = table {
|
||||
Third C1_2 Sg => "wonke" ;
|
||||
Third C1_2 Pl => "bonke" ;
|
||||
Third C1a_2a Sg => "wonke" ;
|
||||
Third C1a_2a Pl => "bonke" ;
|
||||
Third C3_4 Sg => "wonke" ;
|
||||
Third C3_4 Pl => "yonke" ;
|
||||
Third C5_6 Sg => "lonke" ;
|
||||
Third C5_6 Pl => "onke" ;
|
||||
Third C7_8 Sg => "sonke" ;
|
||||
Third C7_8 Pl => "zonke" ;
|
||||
Third C9_10 Sg => "yonke" ;
|
||||
Third C9_10 Pl => "zonke" ;
|
||||
Third C11_10 Sg => "lonke" ;
|
||||
Third C11_10 Pl => "zonke" ;
|
||||
Third C9_6 Sg => "yonke" ;
|
||||
Third C9_6 Pl => "onke" ;
|
||||
Third C14 _ => "bonke" ;
|
||||
Third C15 _ => "konke" ;
|
||||
Third C17 _ => "konke" ;
|
||||
First Sg => "ngenke" ;
|
||||
First Pl => "sonke" ;
|
||||
Second Sg => "wenke" ;
|
||||
Second Pl => "nonke"
|
||||
}
|
||||
} ;
|
||||
-- all_pre_Predet = { s = "nke" ; isPost = False } ;
|
||||
painful_RelStem = { s = "buhlungu" } ;
|
||||
|
||||
-- TPerfPast = { s = [] ; t = Relative PerfTense PastTense } ;
|
||||
-- TPresPres = { s = [] ; t = PresTense } ;
|
||||
-- TPastPres = { s = [] ; t = Relative PastTense PresTense } ;
|
||||
-- TPastPerf = { s = [] ; t = Relative PastTense PerfTense } ;
|
||||
|
||||
PredNP np = cl_with_np_predicate np ;
|
||||
|
||||
-- IAdvQS np iadv = {
|
||||
-- s = case np.proDrop of {
|
||||
-- True => np.empty ;
|
||||
-- False => np.s ! Full ++ np.desc
|
||||
-- } ;
|
||||
-- qword_pre = case iadv.postIAdv of {
|
||||
-- False => let
|
||||
-- vform = VFIndic Princ Pos PresTense Null
|
||||
-- in
|
||||
-- (subjConc vform np.agr False) ++ iadv.s ;
|
||||
-- True => []
|
||||
-- } ;
|
||||
-- qword_post = case iadv.postIAdv of {
|
||||
-- True => let
|
||||
-- vform = VFIndic Princ Pos PresTense Null
|
||||
-- in
|
||||
-- (subjConc vform np.agr False) ++ iadv.s ;
|
||||
-- False => []
|
||||
-- } ;
|
||||
-- } ;
|
||||
|
||||
AdvQCl adv qcl = {
|
||||
s = \\p,t,m => qcl.s!p!t!m ++ adv.s ;
|
||||
potqcl = \\p,m => qcl.potqcl!p!m ++ adv.s ;
|
||||
qword_pre = qcl.qword_pre ;
|
||||
qword_post = qcl.qword_post
|
||||
} ;
|
||||
|
||||
ComplVAux vaux vp = {
|
||||
s = vp.s ;
|
||||
perfSuff = vp.perfSuff ;
|
||||
suff = vp.suff ;
|
||||
oc = vp.oc ;
|
||||
comp = vp.comp ;
|
||||
iadv = vp.iadv ;
|
||||
advs = vp.advs ;
|
||||
hasComp = vp.hasComp ;
|
||||
r = vp.r ;
|
||||
syl = vp.syl ;
|
||||
asp = vp.asp ;
|
||||
asp_pref = vp.asp_pref ;
|
||||
vptype = vp.vptype ;
|
||||
comp_agr = vp.comp_agr ;
|
||||
ap_comp = vp.ap_comp ;
|
||||
aux_root = vaux.s ;
|
||||
hasAux = True
|
||||
} ;
|
||||
|
||||
-- UseLocNP np = {
|
||||
-- s = [] ;
|
||||
-- perfSuff = [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = "s" ++BIND++ np.loc ++ np.desc ;
|
||||
-- hasComp = True ;
|
||||
-- r = nominit!np.agr ;
|
||||
-- syl = SylMult ;
|
||||
-- asp = Null ;
|
||||
-- vptype = CopIdent ;
|
||||
-- comp_agr = np.agr ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- ap_bool = False ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
|
||||
ConjNAdv conj s = {
|
||||
s = conj.s ++ s.s;
|
||||
-- asp = Null ;
|
||||
reqLocS = False
|
||||
} ;
|
||||
|
||||
where_ConjN = { s = "lapho" } ;
|
||||
|
||||
-- IAdvVP vp iadv = {
|
||||
-- s = vp.s ;
|
||||
-- -- perfSuff = vp.perfSuff ;
|
||||
-- -- suff = vp.suff ;
|
||||
-- -- oc = vp.oc ;
|
||||
-- iadv = vp.iadv ++ iadv.s ;
|
||||
-- comp = vp.comp ;
|
||||
-- advs = vp.advs ;
|
||||
-- hasComp = True ;
|
||||
-- r = vp.r ;
|
||||
-- -- syl = vp.syl ;
|
||||
-- -- asp = vp.asp ;
|
||||
-- -- asp_pref = vp.asp_pref ;
|
||||
-- vptype = vp.vptype -- ;
|
||||
-- -- comp_agr = vp.comp_agr ;
|
||||
-- -- ap_comp = vp.ap_comp ;
|
||||
-- -- aux_root = vp.aux_root ;
|
||||
-- -- hasAux = vp.hasAux
|
||||
-- } ;
|
||||
|
||||
it3_Pron = mkPron (Third C3_4 Sg) ;
|
||||
they4_Pron = mkPron (Third C3_4 Pl) ;
|
||||
it5_Pron = mkPron (Third C5_6 Sg) ;
|
||||
they6_Pron = mkPron (Third C5_6 Pl) ;
|
||||
it7_Pron = mkPron (Third C7_8 Sg) ;
|
||||
they8_Pron = mkPron (Third C7_8 Pl) ;
|
||||
it9_Pron = mkPron (Third C9_10 Sg) ;
|
||||
they10_Pron = mkPron (Third C9_10 Pl) ;
|
||||
it11_Pron = mkPron (Third C11_10 Sg) ;
|
||||
it14_Pron = mkPron (Third C14 Sg) ;
|
||||
it15_Pron = mkPron (Third C15 Sg) ;
|
||||
it17_Pron = mkPron (Third C17 Sg) ;
|
||||
|
||||
yonder_Quant = { s = [] ; dist = Dem3 } ;
|
||||
|
||||
at_which_IAdv np = {
|
||||
s = "nga" ++BIND++ atwhichPhiPref!np.agr ++BIND++ "phi" ++ (np.s!NFull) ;
|
||||
postIAdv = False
|
||||
} ;
|
||||
|
||||
what_IAdv = {s = BIND++"ni" ; postIAdv = True } ;
|
||||
|
||||
how_many_IAdj = regAdj "ngaki" ;
|
||||
|
||||
-- IAdjIAdv np iadj = {
|
||||
-- s = (np.s!Loc) ++ adjConcLookup!np.agr ++BIND++ iadj.s!(aformN np.agr) ;
|
||||
-- postIAdv = False
|
||||
-- } ;
|
||||
|
||||
how_IComp = { s = "njani" ; postIComp = False } ; -- -njani
|
||||
where_IComp = { s = "phi" ; postIComp = True } ; -- -phi
|
||||
how_much_IComp = { s = "ngakanani" ; postIComp = False } ; -- -ngakanani
|
||||
|
||||
how2_IAdv = {s = "anjani" ; postIAdv = False } ;
|
||||
how8much2_IAdv = {s = "angakanani" ; postIAdv = False } ;
|
||||
|
||||
phakathi_LocN = { s = "phakathi" ; empty = [] } ;
|
||||
phansi_LocN = { s = "phansi" ; empty = [] } ;
|
||||
phesheya_LocN = { s = "phesheya" ; empty = [] } ;
|
||||
phandle_LocN = { s = "phandle" ; empty = [] } ;
|
||||
phambili_LocN = { s = "phambili" ; empty = [] } ;
|
||||
phambi_LocN = { s = "phambi" ; empty = [] } ;
|
||||
phakade_LocN = { s = "phakade" ; empty = [] } ;
|
||||
phezulu_LocN = { s = "phezulu" ; empty = [] } ;
|
||||
|
||||
lapha_Loc = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = ap_cop_pref vform a RelType ; -- u-
|
||||
cop_base = "lapha"
|
||||
in
|
||||
case vform of {
|
||||
VFIndic _ Neg PresTense => (kho_cop vform a) ++ cop_base;
|
||||
VFIndic _ _ _ => pcp ++ cop_base
|
||||
} ;
|
||||
RelCl => \\a,p,t => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o- / onge-
|
||||
pcp = ap_cop_pref vform a RelType ; -- [] / zoba
|
||||
cop_base = "lapha" -- lapha
|
||||
in
|
||||
case vform of {
|
||||
VFIndic _ Neg PresTense => (kho_cop vform a) ++ cop_base;
|
||||
VFIndic _ _ _ => rcp ++ pcp ++ cop_base
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
khona_Loc = {
|
||||
s = \\c,a,p,t => kho_cop (VFIndic c p t) a ;
|
||||
} ;
|
||||
|
||||
kakhulu_Adv = { s = "kakhulu" ; reqLocS = False } ;
|
||||
|
||||
AdvQS adv qs = { s = adv.s ++ qs.s ; qword_pre = [] ; qword_post = [] } ;
|
||||
|
||||
-- Deverb15 v =
|
||||
-- let
|
||||
-- agr = Third C15 Sg ;
|
||||
-- in
|
||||
-- {
|
||||
-- s = \\_ => table {
|
||||
-- Full => case v.r of {
|
||||
-- RC => "uku"++BIND++(v.s!R_a) ;
|
||||
-- (RA|RE) => "ukw"++BIND++(v.s!R_a) ;
|
||||
-- _ => "uk"++BIND++(v.s!R_a)
|
||||
-- } ;
|
||||
-- Reduced => case v.r of {
|
||||
-- RC => "ku"++BIND++(v.s!R_a) ;
|
||||
-- (RA|RE) => "kw"++BIND++(v.s!R_a) ;
|
||||
-- _ => "k"++BIND++(v.s!R_a)
|
||||
-- } ;
|
||||
-- Poss => case v.r of {
|
||||
-- RC => "ku"++BIND++(v.s!R_a) ;
|
||||
-- (RA|RE) => "kw"++BIND++(v.s!R_a) ;
|
||||
-- _ => "k"++BIND++(v.s!R_a)
|
||||
-- } ;
|
||||
-- Loc => case v.r of {
|
||||
-- RC => "eku"++BIND++(v.s!R_e)++BIND++"ni" ;
|
||||
-- (RA|RE) => "ekw"++BIND++(v.s!R_e)++BIND++"ni" ;
|
||||
-- _ => "ek"++BIND++(v.s!R_e)++BIND++"ni"
|
||||
-- }
|
||||
-- } ;
|
||||
-- c = C15 ;
|
||||
-- empty = []
|
||||
-- } ;
|
||||
|
||||
oper
|
||||
-- qcl_np_iadv : NP -> IAdv -> {s : Polarity => ZTense => DMood => Str ; potqcl : Polarity => DMood => Str ; qword_pre : Str ; qword_post : Str } = \np,iadv -> {
|
||||
-- s = \\p,t,dm =>
|
||||
-- let
|
||||
-- subj = case np.proDrop of {
|
||||
-- True => np.empty ;
|
||||
-- False => np.s ! Full ++ np.desc
|
||||
-- } ;
|
||||
-- aux_tense = case t of {
|
||||
-- Absolute bt => bt ;
|
||||
-- Relative b1 b2 => b1
|
||||
-- } ;
|
||||
-- main_tense = case t of {
|
||||
-- Absolute bt => bt ;
|
||||
-- Relative b1 b2 => b2
|
||||
-- } ;
|
||||
-- vform_aux = VFIndic dm p aux_tense Null ;
|
||||
-- vform_main = VFIndic dm p main_tense Null ;
|
||||
-- aux = case t of {
|
||||
-- Absolute bt => [] ;
|
||||
-- Relative _ _ => relSubjConc aux_tense np.agr -- (subjConcLookup!np.agr!SC) ++BIND++ "b" ++BIND++ (vtermSuff vform_aux False)
|
||||
-- } ;
|
||||
-- in
|
||||
-- subj ++
|
||||
-- aux ++
|
||||
-- (subjConc vform_main np.agr False) ++
|
||||
-- iadv.s ;
|
||||
-- potqcl = \\p,dm =>
|
||||
-- let
|
||||
-- subj = case np.proDrop of {
|
||||
-- True => np.empty ;
|
||||
-- False => np.s ! Full ++ np.desc
|
||||
-- } ;
|
||||
-- vform_main = VFPot dm p Null ;
|
||||
-- in
|
||||
-- subj ++
|
||||
-- -- aux ++
|
||||
-- (subjConc vform_main np.agr False) ++
|
||||
-- (potPref vform_main) ++
|
||||
-- iadv.s ;
|
||||
-- qword_pre = [] ;
|
||||
-- qword_post = []
|
||||
-- } ;
|
||||
|
||||
cl_with_np_predicate : NP -> { s : Polarity => BasicTense => Str } = \np -> {
|
||||
-- advs = [] ;
|
||||
s = \\p,t =>
|
||||
let
|
||||
vform_main = VFIndic MainCl p t ;
|
||||
--pcp = pre_cop_pref vform_main np.agr ;
|
||||
cp = id_cop_pref np.agr ;
|
||||
cb = np.s!NFull
|
||||
in
|
||||
cp ++BIND++
|
||||
cb
|
||||
} ;
|
||||
|
||||
}
|
||||
22
src/zulu/GrammarZul.gf
Executable file
22
src/zulu/GrammarZul.gf
Executable file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarZul of Grammar =
|
||||
NounZul,
|
||||
VerbZul,
|
||||
AdjectiveZul,
|
||||
AdverbZul,
|
||||
NumeralZul,
|
||||
SentenceZul,
|
||||
QuestionZul,
|
||||
RelativeZul,
|
||||
ConjunctionZul,
|
||||
PhraseZul,
|
||||
TextX - [Temp,Adv,IAdv],
|
||||
StructuralZul,
|
||||
IdiomZul,
|
||||
TenseX [PPos,PNeg] -- - [Temp,Adv]
|
||||
** open ResZul, Prelude in {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
62
src/zulu/IdiomZul.gf
Executable file
62
src/zulu/IdiomZul.gf
Executable file
@@ -0,0 +1,62 @@
|
||||
concrete IdiomZul of Idiom = CatZul ** open Prelude, ResZul,ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
-- lin
|
||||
-- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
-- GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||
--
|
||||
-- CleftNP np rs = mkClause "it" (agrP3 Sg)
|
||||
-- (insertObj (\\_ => rs.s ! np.a)
|
||||
-- (insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
||||
--
|
||||
-- CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
||||
-- (insertObj (\\_ => conjThat ++ s.s)
|
||||
-- (insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
||||
--
|
||||
-- ExistNP np =
|
||||
-- mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
-- (insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
|
||||
--
|
||||
-- ExistIP ip =
|
||||
-- mkQuestion (ss (ip.s ! npNom))
|
||||
-- (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
||||
--
|
||||
-- ExistNPAdv np adv =
|
||||
-- mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
-- (insertObj (\\_ => np.s ! NPAcc ++ adv.s) (predAux auxBe)) ;
|
||||
--
|
||||
-- ExistIPAdv ip adv =
|
||||
-- mkQuestion (ss (ip.s ! npNom))
|
||||
-- (mkClause "there" (agrP3 ip.n) (insertObj (\\_ => adv.s) (predAux auxBe))) ;
|
||||
|
||||
-- ProgrVP vp = {
|
||||
-- s = vp.s ;
|
||||
-- perfSuff = vp.perfSuff ;
|
||||
-- oc = vp.oc ;
|
||||
-- comp = vp.comp ;
|
||||
-- hasComp = vp.hasComp ;
|
||||
-- r = vp.r ;
|
||||
-- syl = vp.syl ;
|
||||
-- asp = Prog ;
|
||||
-- asp_pref = \\vform => vp.asp_pref!vform ++ (progPref vform) ;
|
||||
-- vptype = vp.vptype ;
|
||||
-- comp_agr = vp.comp_agr ;
|
||||
-- ap_comp = vp.ap_comp ;
|
||||
-- ap_bool = vp.ap_bool ;
|
||||
-- aux_root = vp.aux_root ;
|
||||
-- hasAux = vp.hasAux
|
||||
-- } ;
|
||||
|
||||
-- ImpPl1 vp = {s = "let's" ++ infVP VVAux vp False Simul CPos (AgP1 Pl)} ;
|
||||
--
|
||||
-- ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp False Simul CPos np.a} ;
|
||||
--
|
||||
-- SelfAdvVP vp = insertObj reflPron vp ;
|
||||
-- SelfAdVVP vp = insertAdVAgr reflPron vp ;
|
||||
-- SelfNP np = {
|
||||
-- s = \\c => np.s ! c ++ reflPron ! np.a ;
|
||||
-- a = np.a
|
||||
-- } ;
|
||||
|
||||
}
|
||||
13
src/zulu/LangZul.gf
Executable file
13
src/zulu/LangZul.gf
Executable file
@@ -0,0 +1,13 @@
|
||||
--# -path=.:../abstract:../common:../api:../prelude
|
||||
|
||||
concrete LangZul of Lang =
|
||||
GrammarZul,
|
||||
LexiconZul
|
||||
-- ,ConstructionZul
|
||||
-- ,DocumentationZul --# notpresent
|
||||
-- ,MarkupZul - [stringMark]
|
||||
** {
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
379
src/zulu/LexiconZul.gf
Executable file
379
src/zulu/LexiconZul.gf
Executable file
@@ -0,0 +1,379 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconZul of Lexicon = CatZul **
|
||||
open ParadigmsZul, Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
-- lin
|
||||
-- airplane_N = regN "airplane" ;
|
||||
-- alas_Interj = ss "alas" ;
|
||||
-- answer_V2S = mkV2S (mkV "answer" "answered") toP ;
|
||||
-- apartment_N = regN "apartment" ;
|
||||
-- apple_N = regN "apple" ;
|
||||
-- art_N = regN "art" ;
|
||||
-- ask_V2Q = mkV2Q (regV "ask") noPrep ;
|
||||
-- baby_N = regN "baby" ;
|
||||
-- bad_A = mkADeg "bad" "worse" "worst" "badly" ;
|
||||
-- bank_N = regN "bank" ;
|
||||
-- beautiful_A = compoundADeg (regA "beautiful") ;
|
||||
-- become_VA = mkVA (irregV "become" "became" "become") ;
|
||||
-- beer_N = regN "beer" ;
|
||||
-- beg_V2V = mkV2V (regDuplV "beg") noPrep toP ;
|
||||
-- -- prevent_V2V = ingV2V (mkV "prevent") noPrep (mkPrep "from") ;
|
||||
-- -- make_V2V = mkV2V make_V noPrep noPrep ;
|
||||
-- big_A = duplADeg "big" ;
|
||||
-- bike_N = regN "bike" ;
|
||||
-- bird_N = regN "bird" ;
|
||||
-- black_A = regADeg "black" ;
|
||||
-- blue_A = regADeg "blue" ;
|
||||
-- boat_N = regN "boat" ;
|
||||
-- book_N = regN "book" ;
|
||||
-- boot_N = regN "boot" ;
|
||||
-- boss_N = mkN human (regN "boss") ;
|
||||
-- boy_N = mkN masculine (regN "boy") ;
|
||||
-- bread_N = regN "bread" ;
|
||||
-- break_V2 = dirV2 (irregV "break" "broke" "broken") ;
|
||||
-- broad_A = regADeg "broad" ;
|
||||
-- brother_N2 = mkN2 (mkN masculine (mkN "brother")) (mkPrep "of") ;
|
||||
-- brown_A = regADeg "brown" ;
|
||||
-- butter_N = regN "butter" ;
|
||||
-- buy_V2 = dirV2 (irregV "buy" "bought" "bought") ;
|
||||
-- camera_N = regN "camera" ;
|
||||
-- cap_N = regN "cap" ;
|
||||
-- car_N = regN "car" ;
|
||||
-- carpet_N = regN "carpet" ;
|
||||
-- cat_N = regN "cat" ;
|
||||
-- ceiling_N = regN "ceiling" ;
|
||||
-- chair_N = regN "chair" ;
|
||||
-- cheese_N = regN "cheese" ;
|
||||
-- child_N = mk2N "child" "children" ;
|
||||
-- church_N = regN "church" ;
|
||||
-- city_N = regN "city" ;
|
||||
-- clean_A = regADeg "clean" ;
|
||||
-- clever_A = mkA "clever" "cleverer" ;
|
||||
-- close_V2 = dirV2 (regV "close") ;
|
||||
-- coat_N = regN "coat" ;
|
||||
-- cold_A = regADeg "cold" ;
|
||||
-- come_V = (irregV "come" "came" "come") ;
|
||||
-- computer_N = regN "computer" ;
|
||||
-- country_N = regN "country" ;
|
||||
-- cousin_N = mkN human (regN "cousin") ;
|
||||
-- cow_N = regN "cow" ;
|
||||
-- die_V = (regV "die") ;
|
||||
-- dirty_A = regADeg "dirty" ;
|
||||
-- distance_N3 = mkN3 (regN "distance") fromP toP ;
|
||||
-- doctor_N = mkN human (regN "doctor") ;
|
||||
-- dog_N = regN "dog" ;
|
||||
-- door_N = regN "door" ;
|
||||
-- drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ;
|
||||
-- easy_A2V = mkA2V (regA "easy") forP ;
|
||||
-- eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ;
|
||||
-- empty_A = regADeg "empty" ;
|
||||
-- enemy_N = regN "enemy" ;
|
||||
-- factory_N = regN "factory" ;
|
||||
-- father_N2 = mkN2 (mkN masculine (mkN "father")) (mkPrep "of") ;
|
||||
-- fear_VS = mkVS (regV "fear") ;
|
||||
-- find_V2 = dirV2 (irregV "find" "found" "found") ;
|
||||
-- fish_N = mk2N "fish" "fish" ;
|
||||
-- floor_N = regN "floor" ;
|
||||
-- forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ;
|
||||
-- fridge_N = regN "fridge" ;
|
||||
-- friend_N = mkN human (regN "friend") ;
|
||||
-- fruit_N = mkN "fruit" "fruit" ; --- was: fruit, fruits before 7/12/2012
|
||||
-- fun_AV = mkAV (regA "fun") ;
|
||||
-- garden_N = regN "garden" ;
|
||||
-- girl_N = mkN feminine (regN "girl") ;
|
||||
-- glove_N = regN "glove" ;
|
||||
-- gold_N = regN "gold" ;
|
||||
-- good_A = mkADeg "good" "better" "best" "well" ;
|
||||
-- go_V = mk5V "go" "goes" "went" "gone" "going" ;
|
||||
-- green_A = regADeg "green" ;
|
||||
-- harbour_N = regN "harbour" ;
|
||||
-- hate_V2 = dirV2 (regV "hate") ;
|
||||
-- hat_N = regN "hat" ;
|
||||
-- hear_V2 = dirV2 (irregV "hear" "heard" "heard") ;
|
||||
-- hill_N = regN "hill" ;
|
||||
-- hope_VS = mkVS (regV "hope") ;
|
||||
-- horse_N = regN "horse" ;
|
||||
-- hot_A = duplADeg "hot" ;
|
||||
-- house_N = regN "house" ;
|
||||
-- important_A = compoundADeg (regA "important") ;
|
||||
-- industry_N = regN "industry" ;
|
||||
-- iron_N = regN "iron" ;
|
||||
-- king_N = mkN masculine (regN "king") ;
|
||||
-- know_V2 = dirV2 (irregV "know" "knew" "known") ;
|
||||
-- know_VQ = mkVQ (irregV "know" "knew" "known") ;
|
||||
-- know_VS = mkVS (irregV "know" "knew" "known") ;
|
||||
-- lake_N = regN "lake" ;
|
||||
-- lamp_N = regN "lamp" ;
|
||||
-- learn_V2 = dirV2 (regV "learn") ;
|
||||
-- leather_N = regN "leather" ;
|
||||
-- leave_V2 = dirV2 (irregV "leave" "left" "left") ;
|
||||
-- like_V2 = dirV2 (regV "like") ;
|
||||
-- listen_V2 = prepV2 (mkV "listen" "listened") toP ;
|
||||
-- live_V = (regV "live") ;
|
||||
-- long_A = regADeg "long" ;
|
||||
-- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
||||
-- love_N = regN "love" ;
|
||||
-- love_V2 = dirV2 (regV "love") ;
|
||||
-- man_N = mkN masculine (mk2N "man" "men") ;
|
||||
-- married_A2 = mkA2 (regA "married") toP ;
|
||||
-- meat_N = regN "meat" ;
|
||||
-- milk_N = regN "milk" ;
|
||||
-- moon_N = regN "moon" ;
|
||||
-- mother_N2 = mkN2 (mkN feminine (mkN "mother")) (mkPrep "of") ;
|
||||
-- mountain_N = regN "mountain" ;
|
||||
-- music_N = regN "music" ;
|
||||
-- narrow_A = regADeg "narrow" ;
|
||||
-- new_A = regADeg "new" ;
|
||||
-- newspaper_N = regN "newspaper" ;
|
||||
-- oil_N = regN "oil" ;
|
||||
-- old_A = regADeg "old" ;
|
||||
-- open_V2 = dirV2 (mkV "open" "opens" "opened" "opened" "opening") ;
|
||||
-- paint_V2A = mkV2A (regV "paint") ;
|
||||
-- paper_N = regN "paper" ;
|
||||
-- paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ;
|
||||
-- peace_N = regN "peace" ;
|
||||
-- pen_N = regN "pen" ;
|
||||
-- planet_N = regN "planet" ;
|
||||
-- plastic_N = regN "plastic" ;
|
||||
-- play_V2 = dirV2 (regV "play") ;
|
||||
-- policeman_N = mkN masculine (mkN "policeman" "policemen") ;
|
||||
-- priest_N = mkN human (regN "priest") ;
|
||||
-- probable_AS = mkAS (regA "probable") ;
|
||||
-- queen_N = mkN feminine (regN "queen") ;
|
||||
-- radio_N = regN "radio" ;
|
||||
-- rain_V0 = mkV0 (regV "rain") ;
|
||||
-- read_V2 = dirV2 (irregV "read" "read" "read") ;
|
||||
-- red_A = duplADeg "red" ;
|
||||
-- religion_N = regN "religion" ;
|
||||
-- restaurant_N = regN "restaurant" ;
|
||||
-- river_N = regN "river" ;
|
||||
-- rock_N = regN "rock" ;
|
||||
-- roof_N = regN "roof" ;
|
||||
-- rubber_N = regN "rubber" ;
|
||||
-- run_V = (irregDuplV "run" "ran" "run") ;
|
||||
-- say_VS = mkVS (irregV "say" "said" "said") ;
|
||||
-- school_N = regN "school" ;
|
||||
-- science_N = regN "science" ;
|
||||
-- sea_N = regN "sea" ;
|
||||
-- seek_V2 = dirV2 (irregV "seek" "sought" "sought") ;
|
||||
-- see_V2 = dirV2 (irregV "see" "saw" "seen") ;
|
||||
-- sell_V3 = dirV3 (irregV "sell" "sold" "sold") toP ;
|
||||
-- send_V3 = dirV3 (irregV "send" "sent" "sent") toP ;
|
||||
-- sheep_N = mk2N "sheep" "sheep" ;
|
||||
-- ship_N = regN "ship" ;
|
||||
-- shirt_N = regN "shirt" ;
|
||||
-- shoe_N = regN "shoe" ;
|
||||
-- shop_N = regN "shop" ;
|
||||
-- short_A = regADeg "short" ;
|
||||
-- silver_N = regN "silver" ;
|
||||
-- sister_N = mkN feminine (mkN "sister") ;
|
||||
-- sleep_V = (irregV "sleep" "slept" "slept") ;
|
||||
-- small_A = regADeg "small" ;
|
||||
-- snake_N = regN "snake" ;
|
||||
-- sock_N = regN "sock" ;
|
||||
-- speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ;
|
||||
-- star_N = regN "star" ;
|
||||
-- steel_N = regN "steel" ;
|
||||
-- stone_N = regN "stone" ;
|
||||
-- stove_N = regN "stove" ;
|
||||
-- student_N = mkN human (regN "student") ;
|
||||
-- stupid_A = mkA "stupid" ;
|
||||
-- sun_N = regN "sun" ;
|
||||
-- switch8off_V2 = dirV2 (partV (regV "switch") "off") ;
|
||||
-- switch8on_V2 = dirV2 (partV (regV "switch") "on") ;
|
||||
-- table_N = regN "table" ;
|
||||
-- talk_V3 = mkV3 (regV "talk") toP aboutP ;
|
||||
-- teacher_N = mkN human (regN "teacher") ;
|
||||
-- teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
|
||||
-- television_N = regN "television" ;
|
||||
-- thick_A = regADeg "thick" ;
|
||||
-- thin_A = duplADeg "thin" ;
|
||||
-- train_N = regN "train" ;
|
||||
-- travel_V = (regDuplV "travel") ;
|
||||
-- tree_N = regN "tree" ;
|
||||
-- ---- trousers_N = regN "trousers" ;
|
||||
-- ugly_A = mkA "ugly" ;
|
||||
-- understand_V2 = dirV2 (irregV "understand" "understood" "understood") ;
|
||||
-- university_N = regN "university" ;
|
||||
-- village_N = regN "village" ;
|
||||
-- wait_V2 = prepV2 (regV "wait") forP ;
|
||||
-- walk_V = (regV "walk") ;
|
||||
-- warm_A = regADeg "warm" ;
|
||||
-- war_N = regN "war" ;
|
||||
-- watch_V2 = dirV2 (regV "watch") ;
|
||||
-- water_N = regN "water" ;
|
||||
-- white_A = mkA "white" ;
|
||||
-- window_N = regN "window" ;
|
||||
-- wine_N = regN "wine" ;
|
||||
-- win_V2 = dirV2 (irregDuplV "win" "won" "won") ;
|
||||
-- woman_N = mkN feminine (mk2N "woman" "women") ;
|
||||
-- wonder_VQ = mkVQ (mkV "wonder" "wondered") ;
|
||||
-- wood_N = regN "wood" ;
|
||||
-- write_V2 = dirV2 (irregV "write" "wrote" "written") ;
|
||||
-- yellow_A = mkA "yellow" ;
|
||||
-- young_A = regADeg "young" ;
|
||||
--
|
||||
-- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ;
|
||||
-- now_Adv = mkAdv "now" ;
|
||||
-- already_Adv = mkAdv "already" ;
|
||||
-- song_N = regN "song" ;
|
||||
-- add_V3 = dirV3 (regV "add") toP ;
|
||||
-- number_N = regN "number" ;
|
||||
-- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ;
|
||||
-- stop_V = regDuplV "stop" ;
|
||||
-- jump_V = regV "jump" ;
|
||||
--
|
||||
-- left_Ord = mkOrd "left" ;
|
||||
-- right_Ord = mkOrd "right" ;
|
||||
-- far_Adv = mkAdv "far" ;
|
||||
-- correct_A = (regA "correct") ;
|
||||
-- dry_A = regA "dry" ;
|
||||
-- dull_A = regA "dull" ;
|
||||
-- full_A = regA "full" ;
|
||||
-- heavy_A = regA "heavy" ;
|
||||
-- near_A = regA "near" ;
|
||||
-- rotten_A = (regA "rotten") ;
|
||||
-- round_A = regA "round" ;
|
||||
-- sharp_A = regA "sharp" ;
|
||||
-- smooth_A = regA "smooth" ;
|
||||
-- straight_A = regA "straight" ;
|
||||
-- wet_A = regA "wet" ; ----
|
||||
-- wide_A = regA "wide" ;
|
||||
-- animal_N = regN "animal" ;
|
||||
-- ashes_N = regN "ash" ; -- FIXME: plural only?
|
||||
-- back_N = regN "back" ;
|
||||
-- bark_N = regN "bark" ;
|
||||
-- belly_N = regN "belly" ;
|
||||
-- blood_N = regN "blood" ;
|
||||
-- bone_N = regN "bone" ;
|
||||
-- breast_N = regN "breast" ;
|
||||
-- cloud_N = regN "cloud" ;
|
||||
-- day_N = regN "day" ;
|
||||
-- dust_N = regN "dust" ;
|
||||
-- ear_N = regN "ear" ;
|
||||
-- earth_N = regN "earth" ;
|
||||
-- egg_N = regN "egg" ;
|
||||
-- eye_N = regN "eye" ;
|
||||
-- fat_N = regN "fat" ;
|
||||
-- feather_N = regN "feather" ;
|
||||
-- fingernail_N = regN "fingernail" ;
|
||||
-- fire_N = regN "fire" ;
|
||||
-- flower_N = regN "flower" ;
|
||||
-- fog_N = regN "fog" ;
|
||||
-- foot_N = mk2N "foot" "feet" ;
|
||||
-- forest_N = regN "forest" ;
|
||||
-- grass_N = regN "grass" ;
|
||||
-- guts_N = regN "gut" ; -- FIXME: no singular
|
||||
-- hair_N = regN "hair" ;
|
||||
-- hand_N = regN "hand" ;
|
||||
-- head_N = regN "head" ;
|
||||
-- heart_N = regN "heart" ;
|
||||
-- horn_N = regN "horn" ;
|
||||
-- husband_N = mkN masculine (regN "husband") ;
|
||||
-- ice_N = regN "ice" ;
|
||||
-- knee_N = regN "knee" ;
|
||||
-- leaf_N = mk2N "leaf" "leaves" ;
|
||||
-- leg_N = regN "leg" ;
|
||||
-- liver_N = regN "liver" ;
|
||||
-- louse_N = mk2N "louse" "lice" ;
|
||||
-- mouth_N = regN "mouth" ;
|
||||
-- name_N = regN "name" ;
|
||||
-- neck_N = regN "neck" ;
|
||||
-- night_N = regN "night" ;
|
||||
-- nose_N = regN "nose" ;
|
||||
-- person_N = mkN human (regN "person") ;
|
||||
-- rain_N = regN "rain" ;
|
||||
-- road_N = regN "road" ;
|
||||
-- root_N = regN "root" ;
|
||||
-- rope_N = regN "rope" ;
|
||||
-- salt_N = regN "salt" ;
|
||||
-- sand_N = regN "sand" ;
|
||||
-- seed_N = regN "seed" ;
|
||||
-- skin_N = regN "skin" ;
|
||||
-- sky_N = regN "sky" ;
|
||||
-- smoke_N = regN "smoke" ;
|
||||
-- snow_N = regN "snow" ;
|
||||
-- stick_N = regN "stick" ;
|
||||
-- tail_N = regN "tail" ;
|
||||
-- tongue_N = regN "tongue" ;
|
||||
-- tooth_N = mk2N "tooth" "teeth" ;
|
||||
-- wife_N = mkN feminine (mk2N "wife" "wives") ;
|
||||
-- wind_N = regN "wind" ;
|
||||
-- wing_N = regN "wing" ;
|
||||
-- worm_N = regN "worm" ;
|
||||
-- year_N = regN "year" ;
|
||||
-- blow_V = IrregEng.blow_V ;
|
||||
-- breathe_V = dirV2 (regV "breathe") ;
|
||||
-- burn_V = IrregEng.burn_V ;
|
||||
-- dig_V = IrregEng.dig_V ;
|
||||
-- fall_V = IrregEng.fall_V ;
|
||||
-- float_V = regV "float" ;
|
||||
-- flow_V = regV "flow" ;
|
||||
-- fly_V = IrregEng.fly_V ;
|
||||
-- freeze_V = IrregEng.freeze_V ;
|
||||
-- give_V3 = mkV3 give_V noPrep noPrep ;
|
||||
-- laugh_V = regV "laugh" ;
|
||||
-- lie_V = IrregEng.lie_V ;
|
||||
-- play_V = regV "play" ;
|
||||
-- sew_V = IrregEng.sew_V ;
|
||||
-- sing_V = IrregEng.sing_V ;
|
||||
-- sit_V = IrregEng.sit_V ;
|
||||
-- smell_V = regV "smell" ;
|
||||
-- spit_V = IrregEng.spit_V ;
|
||||
-- stand_V = IrregEng.stand_V ;
|
||||
-- swell_V = IrregEng.swell_V ;
|
||||
-- swim_V = IrregEng.swim_V ;
|
||||
-- think_V = IrregEng.think_V ;
|
||||
-- turn_V = regV "turn" ;
|
||||
-- vomit_V = mkV "vomit" "vomited" ;
|
||||
--
|
||||
-- bite_V2 = dirV2 IrregEng.bite_V ;
|
||||
-- count_V2 = dirV2 (regV "count") ;
|
||||
-- cut_V2 = dirV2 IrregEng.cut_V ;
|
||||
-- fear_V2 = dirV2 (regV "fear") ;
|
||||
-- fight_V2 = dirV2 fight_V ;
|
||||
-- hit_V2 = dirV2 hit_V ;
|
||||
-- hold_V2 = dirV2 hold_V ;
|
||||
-- hunt_V2 = dirV2 (regV "hunt") ;
|
||||
-- kill_V2 = dirV2 (regV "kill") ;
|
||||
-- pull_V2 = dirV2 (regV "pull") ;
|
||||
-- push_V2 = dirV2 (regV "push") ;
|
||||
-- rub_V2 = dirV2 (regDuplV "rub") ;
|
||||
-- scratch_V2 = dirV2 (regV "scratch") ;
|
||||
-- split_V2 = dirV2 split_V ;
|
||||
-- squeeze_V2 = dirV2 (regV "squeeze") ;
|
||||
-- stab_V2 = dirV2 (regDuplV "stab") ;
|
||||
-- suck_V2 = dirV2 (regV "suck") ;
|
||||
-- throw_V2 = dirV2 throw_V ;
|
||||
-- tie_V2 = dirV2 (regV "tie") ;
|
||||
-- wash_V2 = dirV2 (regV "wash") ;
|
||||
-- wipe_V2 = dirV2 (regV "wipe") ;
|
||||
--
|
||||
-- -- other_A = regA "other" ;
|
||||
--
|
||||
-- grammar_N = regN "grammar" ;
|
||||
-- language_N = regN "language" ;
|
||||
-- rule_N = regN "rule" ;
|
||||
--
|
||||
-- -- added 4/6/2007
|
||||
-- john_PN = mkPN (mkN masculine (mkN "John")) ;
|
||||
-- question_N = regN "question" ;
|
||||
-- ready_A = regA "ready" ;
|
||||
-- reason_N = regN "reason" ;
|
||||
-- today_Adv = mkAdv "today" ;
|
||||
-- uncertain_A = regA "uncertain" ;
|
||||
--
|
||||
-- oper
|
||||
-- aboutP = mkPrep "about" ;
|
||||
-- atP = mkPrep "at" ;
|
||||
-- forP = mkPrep "for" ;
|
||||
-- fromP = mkPrep "from" ;
|
||||
-- inP = mkPrep "in" ;
|
||||
-- onP = mkPrep "on" ;
|
||||
-- toP = mkPrep "to" ;
|
||||
|
||||
} ;
|
||||
15
src/zulu/MarkupZul.gf
Executable file
15
src/zulu/MarkupZul.gf
Executable file
@@ -0,0 +1,15 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
concrete MarkupZul of Markup = CatZul, MarkHTMLX ** {
|
||||
|
||||
lin
|
||||
MarkupCN m cn = {s = \\n,c => appMark m (cn.s ! n ! c) ; g = cn.g} ;
|
||||
MarkupNP m np = {s = \\c => appMark m (np.s ! c) ; a = np.a} ;
|
||||
MarkupAP m ap = {s = \\a => appMark m (ap.s ! a) ; isPre = ap.isPre} ;
|
||||
MarkupAdv m adv = {s = appMark m adv.s} ;
|
||||
MarkupS m s = {s = appMark m s.s} ;
|
||||
MarkupUtt m utt = {s = appMark m utt.s} ;
|
||||
MarkupPhr m phr = {s = appMark m phr.s} ;
|
||||
MarkupText m txt = {s = appMark m txt.s} ;
|
||||
|
||||
}
|
||||
218
src/zulu/NounExtZul.gf
Normal file
218
src/zulu/NounExtZul.gf
Normal file
@@ -0,0 +1,218 @@
|
||||
concrete NounExtZul of NounExt = CatZul,CatExtZul ** open ResZul, Prelude, ParamX in {
|
||||
|
||||
lin
|
||||
|
||||
-- Quant is used for demonstratives, and QuantStem for all/only
|
||||
|
||||
PronPostdetNP pron postdet = {
|
||||
empty = pron.empty ;
|
||||
s = \\nform => pron.s!nform ++ postdet.s!pron.agr ;
|
||||
agr = pron.agr ;
|
||||
i = RC ;
|
||||
proDrop = pron.proDrop ;
|
||||
isPron = True ;
|
||||
heavy = True
|
||||
} ;
|
||||
|
||||
QuantPostdet q = {
|
||||
s = \\a => q.s!a
|
||||
} ;
|
||||
|
||||
DemPostdet q = {
|
||||
s = \\a => dem_pron!q.dist!a ++ q.s
|
||||
} ;
|
||||
|
||||
QuantDemPostdet q d = {
|
||||
s = \\a => q.s!a ++ dem_pron!d.dist!a ++ d.s
|
||||
} ;
|
||||
|
||||
DemQuantPostdet d q = {
|
||||
s = \\a => dem_pron!d.dist!a ++ q.s!a ++ d.s
|
||||
} ;
|
||||
|
||||
DetNum n = n ; -- ** { spec = Spec } ;
|
||||
|
||||
-- NonspecDet n = n ** { spec = Nonspec } ;
|
||||
|
||||
PostdetCN cn postdet det = let
|
||||
agr = Third cn.c det.n
|
||||
in {
|
||||
empty = cn.empty ;
|
||||
-- s = \\nform => cn.s!det.n!nform ++ cn.mod!det.n ++ postdet.s!agr ;
|
||||
s = \\nform => cn.s!det.n!nform ++ postdet.s!agr ++ det.s ;
|
||||
agr = agr ;
|
||||
i = nominit!agr ;
|
||||
proDrop = False ;
|
||||
isPron = False ;
|
||||
heavy = True
|
||||
} ;
|
||||
|
||||
RelN rs n = {
|
||||
empty = n.empty ;
|
||||
s = \\num,nform => rs.s!(Third n.c num) ++ n.s!num!nform ;
|
||||
-- mod = \\_ => [] ;
|
||||
c = n.c ;
|
||||
emph = False
|
||||
} ;
|
||||
|
||||
-- TODO : check mod
|
||||
ApposCN cn n = {
|
||||
s = \\num,nform => cn.s!num!nform ++ n.s!num!nform ;
|
||||
-- mod = \\num => n.s!num!Full ++ cn.mod!num ;
|
||||
c = cn.c ; -- takes agr of cn
|
||||
empty = cn.empty ;
|
||||
emph = cn.emph
|
||||
} ;
|
||||
|
||||
-- TODO : check mod
|
||||
ApposN cn n = {
|
||||
s = \\num,nform => cn.s!num!nform ++ n.s!num!nform ;
|
||||
-- mod = \\num => n.s!num!Full ++ cn.mod!num ;
|
||||
c = n.c ; -- takes agr of n
|
||||
empty = cn.empty ;
|
||||
emph = cn.emph
|
||||
} ;
|
||||
|
||||
PredetN predet n = {
|
||||
s = case predet.hasDem of {
|
||||
True => \\num => table {
|
||||
NFull | NReduced | NPoss => predet.s!(Third n.c num) ++ n.s!num!NReduced ;
|
||||
NLoc => "ku" ++BIND++ predet.s!(Third n.c num) ++ n.s!num!NReduced
|
||||
} ;
|
||||
False => \\num,nform => predet.s!(Third n.c num) ++ n.s!num!nform
|
||||
} ;
|
||||
-- mod = \\_ => [] ;
|
||||
c = n.c ;
|
||||
empty = n.empty ;
|
||||
emph = False
|
||||
};
|
||||
|
||||
QuantPredet q = {
|
||||
s = \\a => q.s!a ;
|
||||
hasDem = False
|
||||
} ;
|
||||
|
||||
DemPredet q = {
|
||||
s = \\a => dem_pron!q.dist!a ++ q.s ;
|
||||
hasDem = True
|
||||
} ;
|
||||
|
||||
QuantDemPredet q d = {
|
||||
s = \\a => q.s!a ++ dem_pron!d.dist!a ++ d.s ;
|
||||
hasDem = True
|
||||
} ;
|
||||
|
||||
EmphCN cn = {
|
||||
s = \\num => table {
|
||||
NFull => pron_stem!(Third cn.c num) ++BIND++ "na" ++ cn.s!num!NFull ;
|
||||
NReduced => pron_stem!(Third cn.c num) ++ cn.s!num!NFull ;
|
||||
NPoss => poss_pron_stem!(Third cn.c num) ++ cn.s!num!NFull ;
|
||||
NLoc => "ku" ++BIND++ pron_stem!(Third cn.c num) ++ cn.s!num!NFull
|
||||
} ;
|
||||
-- mod = cn.mod ;
|
||||
c = cn.c ;
|
||||
empty = cn.empty ;
|
||||
emph = True
|
||||
} ;
|
||||
|
||||
ContrastCN cn = {
|
||||
s = \\num,nform => cn.s!num!nform ++ pron_stem!(Third cn.c num) ++BIND++ "na" ;
|
||||
-- mod = \\num => pron_stem!(Third cn.c num) ++BIND++ "na" ++ cn.mod!num ;
|
||||
c = cn.c ;
|
||||
empty = cn.empty ;
|
||||
emph = cn.emph ;
|
||||
emph = cn.emph
|
||||
} ;
|
||||
|
||||
UsePNPl pn = let
|
||||
agr = Third pn.c Pl
|
||||
in {
|
||||
empty = pn.empty ;
|
||||
s = pn.s!Pl ;
|
||||
agr = agr ;
|
||||
i = nominit!agr ;
|
||||
proDrop = False ;
|
||||
isPron = False ;
|
||||
heavy = True
|
||||
} ;
|
||||
|
||||
Deverb15 v =
|
||||
let
|
||||
agr = Third C15 Sg ;
|
||||
in
|
||||
{
|
||||
s = \\_ => table {
|
||||
NFull => case v.r of {
|
||||
RC => "uku"++BIND++(v.s!R_a) ;
|
||||
(RA|RE) => "ukw"++BIND++(v.s!R_a) ;
|
||||
_ => "uk"++BIND++(v.s!R_a)
|
||||
} ;
|
||||
NReduced => case v.r of {
|
||||
RC => "ku"++BIND++(v.s!R_a) ;
|
||||
(RA|RE) => "kw"++BIND++(v.s!R_a) ;
|
||||
_ => "k"++BIND++(v.s!R_a)
|
||||
} ;
|
||||
NPoss => case v.r of {
|
||||
RC => "ku"++BIND++(v.s!R_a) ;
|
||||
(RA|RE) => "kw"++BIND++(v.s!R_a) ;
|
||||
_ => "k"++BIND++(v.s!R_a)
|
||||
} ;
|
||||
NLoc => case v.r of {
|
||||
RC => "eku"++BIND++(v.s!R_e)++BIND++"ni" ;
|
||||
(RA|RE) => "ekw"++BIND++(v.s!R_e)++BIND++"ni" ;
|
||||
_ => "ek"++BIND++(v.s!R_e)++BIND++"ni"
|
||||
}
|
||||
} ;
|
||||
c = C15 ;
|
||||
empty = []
|
||||
} ;
|
||||
|
||||
LocNP np = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = ap_cop_pref vform a RelType ; -- u- / uzoba / akazukuba
|
||||
cop_base = loc_n_cop_base np vform
|
||||
in
|
||||
case vform of {
|
||||
VFIndic _ Neg PresTense => (kho_cop vform a) ++ cop_base;
|
||||
VFIndic _ _ _ => pcp ++ cop_base
|
||||
} ;
|
||||
RelCl => \\a,p,t => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o- / onge-
|
||||
pcp = ap_cop_pref vform a RelType ; -- u- / uzoba / akazukuba
|
||||
cop_base = loc_n_cop_base np vform
|
||||
in
|
||||
case vform of {
|
||||
VFIndic _ Neg PresTense => (kho_cop vform a) ++ cop_base;
|
||||
VFIndic _ _ _ => rcp ++ pcp ++ cop_base
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
LocNLoc locn = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = ap_cop_pref vform a RelType ; -- u- / uzoba / akazukuba
|
||||
cop_base = locn.s
|
||||
in
|
||||
case vform of {
|
||||
VFIndic _ Neg PresTense => (kho_cop vform a) ++ cop_base;
|
||||
VFIndic _ _ _ => pcp ++ cop_base
|
||||
} ;
|
||||
RelCl => \\a,p,t => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o- / onge-
|
||||
pcp = ap_cop_pref vform a RelType ; -- u- / uzoba / akazukuba
|
||||
cop_base = locn.s
|
||||
in
|
||||
case vform of {
|
||||
VFIndic _ Neg PresTense => (kho_cop vform a) ++ cop_base;
|
||||
VFIndic _ _ _ => rcp ++ pcp ++ cop_base
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
}
|
||||
102
src/zulu/NounZul.gf
Executable file
102
src/zulu/NounZul.gf
Executable file
@@ -0,0 +1,102 @@
|
||||
concrete NounZul of Noun = CatZul ** open ResZul, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
-- TODO: check refactor
|
||||
DetCN det cn = let
|
||||
agr = Third cn.c det.n ;
|
||||
in {
|
||||
empty = cn.empty ;
|
||||
s = \\nform => det.s ++ cn.s ! det.n ! nform ;
|
||||
agr = agr ;
|
||||
i = case cn.emph of {
|
||||
False => nominit!agr ;
|
||||
True => RC
|
||||
} ;
|
||||
proDrop = False ;
|
||||
isPron = False ;
|
||||
heavy = True
|
||||
-- reqLocS = True ; -- TODO: change if a Det is ever added that has a non-empty string
|
||||
-- qdef = det.qdef ;
|
||||
} ;
|
||||
|
||||
-- TODO: check refactor
|
||||
UsePN pn = let
|
||||
agr = Third pn.c Sg ;
|
||||
in {
|
||||
empty = pn.empty ;
|
||||
s = pn.s!Sg ;
|
||||
agr = agr ;
|
||||
i = nominit!agr ;
|
||||
proDrop = False ;
|
||||
isPron = False ;
|
||||
heavy = True
|
||||
} ;
|
||||
|
||||
-- TODO: check refactor
|
||||
UsePron pron = {
|
||||
empty = pron.empty ;
|
||||
-- s = case pron.proDrop of {
|
||||
-- False => pron.s ;
|
||||
-- True => table {
|
||||
-- NFull => pron.empty ;
|
||||
-- NReduced => pron.s!NReduced ;
|
||||
-- NPoss => pron.s!NPoss ;
|
||||
-- NLoc => pron.s!NLoc
|
||||
-- }
|
||||
-- } ;
|
||||
s = pron.s ;
|
||||
agr = pron.agr ;
|
||||
i = RC ;
|
||||
proDrop = pron.proDrop ;
|
||||
isPron = True ;
|
||||
heavy = case pron.proDrop of {
|
||||
True => False ;
|
||||
False => True
|
||||
}
|
||||
} ;
|
||||
|
||||
-- PredetNP, PPartNP, AdvNP, ExtAdvNP : not implemented
|
||||
|
||||
-- TODO: refactor
|
||||
RelNP np rs = {
|
||||
empty = np.empty ;
|
||||
s = \\nform => np.s!nform ++ rs.s!np.agr ;
|
||||
agr = np.agr ;
|
||||
i = np.i ;
|
||||
proDrop = False ; -- probably right?
|
||||
isPron = np.isPron ;
|
||||
heavy = True
|
||||
} ;
|
||||
|
||||
-- DetNP, DetQuant, DetQuantOrd : not implemented
|
||||
|
||||
NumSg = { s = [] ; n = Sg } ;
|
||||
NumPl = { s = [] ; n = Pl } ;
|
||||
|
||||
-- NumCard, NumNumeral, AdNum, OrdNumeral, OrdSuperl, OrdNumeralSuperl : not implemented
|
||||
-- NumDigits, OrdDigits : not yet implemented
|
||||
|
||||
-- DefArt, IndefArt, MassNP, PossPron : not implemented
|
||||
|
||||
-- TODO: check refactor (no change?)
|
||||
UseN n = n ** { emph = False } ;
|
||||
|
||||
-- ComplN2, ComplN3, UseN2, Use2N3, Use3N3 : not implemented
|
||||
|
||||
-- AdjCN, RelCN, AdvCN, SentCN, ApposCN : not implemented
|
||||
|
||||
-- flashing of the lights / ukukhanya kwezibani
|
||||
-- TODO: check refactor (no change?)
|
||||
PossNP cn np = {
|
||||
empty = cn.empty ;
|
||||
s = \\num,nform => cn.s!num!nform ++ poss_concord!cn.c!num!np.i ++BIND++ np.s!NPoss;
|
||||
-- mod = \\num => cn.mod!num ++ poss_concord!cn.c!num!np.i ++BIND++ (poss_NP np) ;
|
||||
c = cn.c ;
|
||||
emph = cn.emph
|
||||
} ;
|
||||
|
||||
-- PartNP, CountNP, AdjDAP, DetDAP : not implemented
|
||||
|
||||
}
|
||||
95
src/zulu/NumeralZul.gf
Executable file
95
src/zulu/NumeralZul.gf
Executable file
@@ -0,0 +1,95 @@
|
||||
concrete NumeralZul of Numeral = CatZul [Numeral,Digits] ** open Prelude, ResZul in {
|
||||
|
||||
-- lincat
|
||||
-- Digit = {s : DForm => CardOrd => Case => Str} ;
|
||||
-- Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ;
|
||||
-- Sub100 = {s : CardOrd => Case => Str ; n : Number} ;
|
||||
-- Sub1000 = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||
-- Sub1000000 = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||
--
|
||||
-- lin num x = x ;
|
||||
-- lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in
|
||||
-- {s = \\f,o => case <f,o> of {
|
||||
-- <teen,NOrd> => regGenitiveS "twelfth" ;
|
||||
-- _ => two.s ! f ! o
|
||||
-- }
|
||||
-- } ;
|
||||
--
|
||||
-- lin n3 = mkNum "three" "thirteen" "thirty" "third" ;
|
||||
-- lin n4 = mkNum "four" "fourteen" "forty" "fourth" ;
|
||||
-- lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ;
|
||||
-- lin n6 = regNum "six" ;
|
||||
-- lin n7 = regNum "seven" ;
|
||||
-- lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ;
|
||||
-- lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ;
|
||||
--
|
||||
-- lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ;
|
||||
-- lin pot0 d = d ** {n = Pl} ;
|
||||
-- lin pot110 = regCardOrd "ten" ** {n = Pl} ;
|
||||
-- lin pot111 = regCardOrd "eleven" ** {n = Pl} ;
|
||||
-- lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||
-- lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||
-- lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||
-- lin pot1plus d e = {
|
||||
-- s = \\o,c => d.s ! ten ! NCard ! Nom ++ BIND ++ "-" ++ BIND ++ e.s ! unit ! o ! c ; n = Pl} ;
|
||||
-- lin pot1as2 n = {s = \\_ => n.s; n=n.n} ;
|
||||
-- lin pot2 d = {s = \\_,o,c => d.s ! unit ! NCard ! Nom ++ mkCard o "hundred" ! c} ** {n = Pl} ;
|
||||
-- lin pot2plus d e = {
|
||||
-- s = \\_,o,c => d.s ! unit ! NCard ! Nom ++ "hundred" ++ "and" ++ e.s ! o ! c ; n = Pl} ;
|
||||
-- lin pot2as3 n = n ;
|
||||
-- lin pot3 n = {
|
||||
-- s = \\d,o,c => n.s ! d ! NCard ! Nom ++ mkCard o "thousand" ! c ; n = Pl} ;
|
||||
-- lin pot3plus n m = {
|
||||
-- s = \\d,o,c => n.s ! d ! NCard ! Nom ++ "thousand" ++ m.s ! False ! o ! c; n = Pl} ;
|
||||
--
|
||||
-- -- numerals as sequences of digits
|
||||
--
|
||||
-- lincat
|
||||
-- Dig = TDigit ;
|
||||
--
|
||||
-- lin
|
||||
-- IDig d = d ** {tail = T1} ;
|
||||
--
|
||||
-- IIDig d i = {
|
||||
-- s = \\o,c => d.s ! NCard ! Nom ++ commaIf i.tail ++ i.s ! o ! c ;
|
||||
-- n = Pl ;
|
||||
-- tail = inc i.tail
|
||||
-- } ;
|
||||
--
|
||||
-- D_0 = mkDig "0" ;
|
||||
-- D_1 = mk3Dig "1" "1st" Sg ;
|
||||
-- D_2 = mk2Dig "2" "2nd" ;
|
||||
-- D_3 = mk2Dig "3" "3rd" ;
|
||||
-- D_4 = mkDig "4" ;
|
||||
-- D_5 = mkDig "5" ;
|
||||
-- D_6 = mkDig "6" ;
|
||||
-- D_7 = mkDig "7" ;
|
||||
-- D_8 = mkDig "8" ;
|
||||
-- D_9 = mkDig "9" ;
|
||||
--
|
||||
-- oper
|
||||
-- commaIf : DTail -> Str = \t -> case t of {
|
||||
-- T3 => BIND ++ "," ++ BIND ;
|
||||
-- _ => BIND
|
||||
-- } ;
|
||||
--
|
||||
-- inc : DTail -> DTail = \t -> case t of {
|
||||
-- T1 => T2 ;
|
||||
-- T2 => T3 ;
|
||||
-- T3 => T1
|
||||
-- } ;
|
||||
--
|
||||
-- mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
-- mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ;
|
||||
--
|
||||
-- mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
-- s = table {NCard => regGenitiveS c ; NOrd => regGenitiveS o} ;
|
||||
-- n = n
|
||||
-- } ;
|
||||
--
|
||||
-- TDigit = {
|
||||
-- n : Number ;
|
||||
-- s : CardOrd => Case => Str
|
||||
-- } ;
|
||||
|
||||
}
|
||||
1
src/zulu/OverloadZul.gf
Executable file
1
src/zulu/OverloadZul.gf
Executable file
@@ -0,0 +1 @@
|
||||
resource OverloadZul = Overload with (Grammar = GrammarZul) ;
|
||||
99
src/zulu/PChunkZul.gf
Normal file
99
src/zulu/PChunkZul.gf
Normal file
@@ -0,0 +1,99 @@
|
||||
concrete PChunkZul of PChunk = CatZul, CatExtZul, SymbolZul [Symb] **
|
||||
open
|
||||
Prelude, ResZul, ParamX,
|
||||
(R = ResZul), (P = ParadigmsZul) in {
|
||||
|
||||
lincat
|
||||
Chunks = {s : Str} ;
|
||||
Chunk = {s : Str};
|
||||
Chunk_AP, Chunk_Adv, Chunk_S, Chunk_RS, Chunk_QS, Chunk_CN, Chunk_NP, Chunk_N, Chunk_Symb = {s: Str} ;
|
||||
|
||||
VC = V ;
|
||||
|
||||
lin
|
||||
OneChunk c = c ;
|
||||
PlusChunk c cs = cc2 c cs ;
|
||||
ChunkPhr c = ss ("*" ++ c.s) | c ;
|
||||
|
||||
Adv_Chunker c = c ;
|
||||
S_Chunker c = c ;
|
||||
RS_Chunker c = c ;
|
||||
QS_Chunker c = c ;
|
||||
CN_Chunker c = c ;
|
||||
NP_Chunker c = c ;
|
||||
N_Chunker c = c ;
|
||||
Predet_Chunker c = c ;
|
||||
Postdet_Chunker c = c ;
|
||||
Symb_Chunker c = c ;
|
||||
|
||||
Adv_Chunk a = { s = a.s } ;
|
||||
S_Chunk s = { s = s.s } ;
|
||||
RS_Chunk rs = { s = rs.s!agr_vars } ;
|
||||
QS_Chunk s = { s = s.qword_pre ++ s.s ++ s.qword_post } ;
|
||||
CN_Sg_Chunk cn = {
|
||||
s = cn.s!Sg!NFull
|
||||
} ;
|
||||
CN_Pl_Chunk cn = {
|
||||
s = cn.s!Pl!NFull
|
||||
} ;
|
||||
NP_Nom_Chunk np = {
|
||||
s = variants {
|
||||
np.s!NFull ;
|
||||
np.s!NReduced
|
||||
}
|
||||
} ;
|
||||
NP_Gen_Chunk np = {
|
||||
s = poss_concord_agr!agr_vars!np.i ++BIND++ np.s!NPoss
|
||||
} ;
|
||||
Predet_Chunk predet = {
|
||||
s = predet.s!agr_vars
|
||||
} ;
|
||||
Postdet_Chunk postdet = {
|
||||
s = postdet.s!agr_vars
|
||||
} ;
|
||||
|
||||
-- for unknown words that are not names
|
||||
Symb_Chunk symb = { s = symb.s } ;
|
||||
|
||||
fullstop_Chunk = sbSS "." ;
|
||||
exclmark_Chunk = sbSS "!" ;
|
||||
questmark_Chunk = sbSS "?" ;
|
||||
comma_Chunk = sbSS "," ;
|
||||
colon_Chunk = sbSS ":" ;
|
||||
semicolon_Chunk = sbSS ";" ;
|
||||
quote_Chunk = variants {sbSS "\"" ; ss ("\"" ++ SOFT_BIND) } ;
|
||||
lpar_Chunk = ss ("(" ++ SOFT_BIND) ;
|
||||
rpar_Chunk = sbSS ")" ;
|
||||
dash_Chunk = sbSS "-" ;
|
||||
|
||||
oper
|
||||
|
||||
sbSS : Str -> SS = \s -> ss (SOFT_BIND ++ s) ;
|
||||
|
||||
agr_vars : Agr = variants {
|
||||
Third C1_2 Sg ;
|
||||
Third C1_2 Pl ;
|
||||
Third C1a_2a Sg ;
|
||||
Third C1a_2a Pl ;
|
||||
Third C3_4 Sg ;
|
||||
Third C3_4 Pl ;
|
||||
Third C5_6 Sg ;
|
||||
Third C5_6 Pl ;
|
||||
Third C7_8 Sg ;
|
||||
Third C7_8 Pl ;
|
||||
Third C9_10 Sg ;
|
||||
Third C9_10 Pl ;
|
||||
Third C11_10 Sg ;
|
||||
Third C11_10 Pl ;
|
||||
Third C9_6 Sg ;
|
||||
Third C9_6 Pl ;
|
||||
Third C14 Sg ;
|
||||
Third C15 Sg ;
|
||||
Third C17 Sg ;
|
||||
First Sg ;
|
||||
First Pl ;
|
||||
Second Sg ;
|
||||
Second Pl
|
||||
} ;
|
||||
|
||||
}
|
||||
180
src/zulu/ParadigmsZul.gf
Executable file
180
src/zulu/ParadigmsZul.gf
Executable file
@@ -0,0 +1,180 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 English Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2003--2005
|
||||
--
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoZul.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
--
|
||||
-- The structure of functions for each word class $C$ is the following:
|
||||
-- first we give a handful of patterns that aim to cover all
|
||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||
-- escape to construct the most irregular words of type $C$.
|
||||
-- However, this function should only seldom be needed: we have a
|
||||
-- separate module [``IrregZul`` ../../english/IrregZul.gf],
|
||||
-- which covers irregular verbss.
|
||||
|
||||
resource ParadigmsZul = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
-- MorphoZul,
|
||||
ResZul,
|
||||
CatZul,
|
||||
CatExtZul,
|
||||
ParamX
|
||||
in {
|
||||
--2 Parameters
|
||||
--
|
||||
-- -- To abstract over gender names, we define the following identifiers.
|
||||
--
|
||||
-- oper
|
||||
-- Gender : Type ;
|
||||
--
|
||||
-- human : Gender ;
|
||||
-- nonhuman : Gender ;
|
||||
-- masculine : Gender ; --%
|
||||
-- feminine : Gender ; --%
|
||||
--
|
||||
-- -- To abstract over number names, we define the following.
|
||||
--
|
||||
-- Number : Type ;
|
||||
--
|
||||
-- singular : Number ;
|
||||
-- plural : Number ;
|
||||
--
|
||||
-- -- To abstract over case names, we define the following.
|
||||
--
|
||||
-- Case : Type ; --%
|
||||
--
|
||||
-- nominative : Case ; --%
|
||||
-- genitive : Case ; --%
|
||||
--
|
||||
-- -- Prepositions are used in many-argument functions for rection.
|
||||
-- -- The resource category $Prep$ is used.
|
||||
--
|
||||
-- -- The number of a noun phrase can be extracted with the following
|
||||
-- -- function.
|
||||
--
|
||||
-- npNumber : NP -> Number ; -- exctract the number of a noun phrase
|
||||
--
|
||||
--
|
||||
-- --2 Nouns
|
||||
oper
|
||||
mkN = overload {
|
||||
mkN : (ngane : Str) -> ClassGender -> N = \n,c -> lin N (regNoun n c) ; -- "thing" nouns
|
||||
mkN : (nyaka,onyakeni,eminyakeni : Str) -> ClassGender -> N = \n,ls,lp,c -> lin N (semiRegNoun n ls lp c) ;
|
||||
mkN : (iso,amehlo,esweni,emehlweni : Str) -> ClassGender -> N = \ns,np,ls,lp,c -> lin N (mkNoun ns np ls lp c) ;
|
||||
} ;
|
||||
|
||||
mkPN = overload {
|
||||
mkPN : (John : Str) -> ClassGender -> N = \n,c -> lin N (regNoun n c) ; -- "thing" nouns
|
||||
mkPN : (nyaka,onyakeni,eminyakeni : Str) -> ClassGender -> N = \n,ls,lp,c -> lin N (semiRegNoun n ls lp c) ;
|
||||
mkPN : (iso,amehlo,esweni,emehlweni : Str) -> ClassGender -> N = \ns,np,ls,lp,c -> lin N (mkNoun ns np ls lp c) ;
|
||||
} ;
|
||||
|
||||
mkKwaPN = overload {
|
||||
mkKwaPN : (Zulu : Str) -> ClassGender -> PN = \n,c -> lin PN (kwaProperName n c) ;
|
||||
} ;
|
||||
|
||||
mkAdA = overload {
|
||||
mkAdA : (kakhulu : Str ) -> AdA = \a -> lin AdA (ss a) ;
|
||||
} ;
|
||||
|
||||
mkA = overload {
|
||||
mkA : (kahle : Str) -> A = \a -> lin A (regAdj a) ; -- regular adjective
|
||||
} ;
|
||||
|
||||
mkRelA = overload {
|
||||
mkRelA : (mnandi : Str) -> A = \a -> lin A (relAdj a) ; -- relative stem "adjective"
|
||||
} ;
|
||||
|
||||
-- mkEnumA = overload {
|
||||
-- mkEnumA : (mbe : Str) -> A = \a -> lin A (enumAdj a) ; -- relative stem "adjective"
|
||||
-- } ;
|
||||
|
||||
mkV = overload {
|
||||
mkV : (hamb : Str) -> V = \hamb -> lin V (regVerb hamb) ;
|
||||
mkV : (th,thi : Str) -> V = \th,thi -> lin V (th_Verb th thi) ;
|
||||
mkV : (guqubal,guqubala,guqubele : Str) -> V = \guqubal,guqubala,guqubele -> lin V (three_Verb guqubal guqubala guqubele) ;
|
||||
mkV : (guqubal,guqubala,guqubele,guqubele_2 : Str) -> V = \guqubal,guqubala,guqubele,guqubele_2 -> lin V (four_Verb guqubal guqubala guqubele guqubele_2) ;
|
||||
} ;
|
||||
|
||||
passV = overload {
|
||||
passV: Str -> V = \fakw -> lin V (passiveVerb fakw) ;
|
||||
} ;
|
||||
|
||||
passV2 = overload {
|
||||
passV2: Str -> V2 = \fakw -> lin V2 (passiveVerb fakw) ;
|
||||
} ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : (hamb : Str) -> V2 = \hamb -> lin V2 (regVerb hamb) ;
|
||||
mkV2 : (th,thi : Str) -> V2 = \th,thi -> lin V2 (th_Verb th thi) ;
|
||||
mkV2 : (guqubal,guqubala,guqubele : Str) -> V2 = \guqubal,guqubala,guqubele -> lin V2 (three_Verb guqubal guqubala guqubele) ;
|
||||
mkV2 : (guqubal,guqubala,guqubele,guqubele_2 : Str) -> V2 = \guqubal,guqubala,guqubele,guqubele_2 -> lin V2 (four_Verb guqubal guqubala guqubele guqubele_2) ;
|
||||
} ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : (phuz : Str) -> V3 = \phuz -> lin V3 (regVerb phuz) ;
|
||||
-- mkV2 : (phathw : Str) -> Voice -> V2 = \phathw,voice -> lin V2 (passiveVerb phathw voice) ;
|
||||
} ;
|
||||
|
||||
mkVA = overload {
|
||||
mkVA : (b : Str) -> VA = \b -> lin VA (regVerb b) ;
|
||||
} ;
|
||||
|
||||
mkVS = overload {
|
||||
mkVS : (cel : Str) -> VS = \cel -> lin VS (regVerb cel) ;
|
||||
} ;
|
||||
|
||||
mkVAux = overload {
|
||||
mkVAux : (hlale : Str) -> VAux = \hlale -> lin VAux {
|
||||
s = hlale ;
|
||||
at = PartAux
|
||||
}
|
||||
} ;
|
||||
|
||||
-- yourPl_Det = overload {
|
||||
-- yourPl_Det : Det = lin Det { s = "jou" ; n = Pl ; p = TPos } ;
|
||||
-- } ;
|
||||
--
|
||||
-- mkSgDet = overload {
|
||||
-- mkSgDet : Str -> Det = \s -> lin Det { s = s ; n = Sg ; p = TPos } ;
|
||||
-- } ;
|
||||
|
||||
-- mkPlDet = overload {
|
||||
-- mkPlDet : Str -> Det = \s -> lin Det { s = s ; n = Pl ; qdef = Article Def } ;
|
||||
-- } ;
|
||||
|
||||
-- -- mkVS = overload {
|
||||
-- -- mkVS : V -> VS = \weet -> lin VS { v = weet ; c = "dat" } ;
|
||||
-- -- } ;
|
||||
-- --
|
||||
-- -- mkVQ = overload {
|
||||
-- -- mkVQ : V -> VS = \wonder -> lin VS { v = wonder ; c = "of" } ;
|
||||
-- -- } ;
|
||||
|
||||
mkAdv = overload {
|
||||
mkAdv : Str -> Adv = \adv -> lin Adv (regAdv adv) ;
|
||||
-- mkAdv : Str -> Aspect -> Adv = \adv,asp -> lin Adv (aspAdv adv asp) ;
|
||||
} ;
|
||||
|
||||
mkIAdv = overload {
|
||||
mkIAdv : Str -> Bool -> IAdv = \adv,b -> lin IAdv { s = "ingabe" ; postIAdv = b } ;
|
||||
-- mkAdv : Str -> Aspect -> Adv = \adv,asp -> lin Adv (aspAdv adv asp) ;
|
||||
} ;
|
||||
|
||||
-- mkPredet = overload {
|
||||
-- mkPredet : Str -> Predet = \predet -> lin Predet { s = predet ; p = TPos } ;
|
||||
-- } ;
|
||||
} ;
|
||||
28
src/zulu/PhraseZul.gf
Executable file
28
src/zulu/PhraseZul.gf
Executable file
@@ -0,0 +1,28 @@
|
||||
concrete PhraseZul of Phrase = CatZul ** open Prelude, ResZul in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
--
|
||||
UttS sent = { s = sent.s } ;
|
||||
UttQS sent = { s = sent.qword_pre ++ sent.s ++ sent.qword_post } ;
|
||||
UttImpSg pol imp = { s = pol.s ++ imp.s!pol.p } ;
|
||||
-- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ;
|
||||
-- UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ;
|
||||
|
||||
-- UttIP ip = {s = ip.s ! npNom} ; --- Acc also
|
||||
-- UttIAdv iadv = iadv ;
|
||||
-- UttNP np = {s = np.s ! npNom} ;
|
||||
-- UttVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ;
|
||||
-- UttAdv adv = adv ;
|
||||
-- UttCN n = {s = n.s ! Sg ! Nom} ;
|
||||
-- UttCard n = {s = n.s ! False ! Nom} ;
|
||||
-- UttAP ap = {s = ap.s ! agrP3 Sg} ;
|
||||
-- UttInterj i = i ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
-- PConjConj conj = {s = conj.s2} ; ---
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
-- VocNP np = {s = frontComma ++ np.s ! npNom} ;
|
||||
|
||||
}
|
||||
110
src/zulu/QuestionZul.gf
Executable file
110
src/zulu/QuestionZul.gf
Executable file
@@ -0,0 +1,110 @@
|
||||
concrete QuestionZul of Question = CatZul ** open ResZul, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = \\p,t => cl.s!p!t ;
|
||||
-- potqcl = cl.potcl ;
|
||||
qword_pre = [] ;
|
||||
qword_post = variants { "na" ; [] } ;
|
||||
} ; -- guessing this will work...
|
||||
|
||||
-- QuestVP qp vp =
|
||||
-- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
|
||||
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
|
||||
--
|
||||
-- QuestSlash ip slash =
|
||||
-- {s = \\t,a,b,q =>
|
||||
-- (mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||
-- } ;
|
||||
-- --- changed AR 5/6/2016: uses stranding; pied-piping in ExtraZul
|
||||
|
||||
QuestIAdv iadv cl = qcl_iadv cl iadv ;
|
||||
|
||||
QuestIComp icomp np = {
|
||||
s = \\p,t =>
|
||||
let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pre_icomp = case icomp.postIComp of {
|
||||
False => (icomp_pref vform np.agr) ++ icomp.s ;
|
||||
True => []
|
||||
} ;
|
||||
post_icomp = case icomp.postIComp of {
|
||||
True => (icomp_pref vform np.agr) ++ icomp.s ;
|
||||
False => []
|
||||
}
|
||||
in
|
||||
pre_icomp ++ (np.s!NFull) ++ post_icomp ;
|
||||
qword_pre = [] ;
|
||||
qword_post = []
|
||||
} ;
|
||||
-- mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ;
|
||||
|
||||
|
||||
-- PrepIP p ip = {s = p.s ++ ip.s ! NPAcc} ;
|
||||
--
|
||||
-- AdvIP ip adv = {
|
||||
-- s = \\c => ip.s ! c ++ adv.s ;
|
||||
-- n = ip.n
|
||||
-- } ;
|
||||
--
|
||||
-- IdetCN idet cn = {
|
||||
-- s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ;
|
||||
-- n = idet.n
|
||||
-- } ;
|
||||
--
|
||||
-- IdetIP idet = {
|
||||
-- s = \\c => idet.s ;
|
||||
-- n = idet.n
|
||||
-- } ;
|
||||
--
|
||||
-- IdetQuant idet num = {
|
||||
-- s = idet.s ! num.n ++ num.s ! False ! Nom ;
|
||||
-- n = num.n
|
||||
-- } ;
|
||||
--
|
||||
-- AdvIAdv i a = ss (i.s ++ a.s) ;
|
||||
--
|
||||
-- CompIAdv a = a ;
|
||||
-- CompIP p = ss (p.s ! npNom) ;
|
||||
--
|
||||
-- lincat
|
||||
-- QVP = ResZul.VP ;
|
||||
-- lin
|
||||
-- ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ;
|
||||
-- AdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||
-- AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||
--
|
||||
-- QuestQVP qp vp =
|
||||
-- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
|
||||
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
|
||||
|
||||
oper
|
||||
-- qcl_iadv : Cl -> CatZul.IAdv -> {s : Polarity => ZTense => DMood => Str ; potqcl : Polarity => DMood => Str ; qword_pre : Str ; qword_post : Str } = \cl,iadv -> {
|
||||
-- s = case iadv.postIAdv of {
|
||||
-- False => \\p,t,m => cl.s!p!t!m ++ iadv.s ++ cl.advs ;
|
||||
-- True => \\p,t,m => cl.s!p!t!m ++ cl.advs
|
||||
-- } ;
|
||||
-- potqcl = cl.potcl ;
|
||||
-- qword_pre = case iadv.postIAdv of {
|
||||
-- False => [] ;
|
||||
-- True => iadv.s
|
||||
-- } ;
|
||||
-- qword_post = []
|
||||
-- } ;
|
||||
|
||||
qcl_iadv : Cl -> CatZul.IAdv -> {s : Polarity => BasicTense => Str ; qword_pre : Str ; qword_post : Str } = \cl,iadv -> {
|
||||
s = \\p,t => cl.s!p!t ;
|
||||
qword_pre = case iadv.postIAdv of {
|
||||
True => [] ;
|
||||
False => iadv.s
|
||||
} ;
|
||||
qword_post = case iadv.postIAdv of {
|
||||
False => [] ;
|
||||
True => iadv.s
|
||||
} ;
|
||||
} ;
|
||||
|
||||
}
|
||||
30
src/zulu/README.md
Executable file
30
src/zulu/README.md
Executable file
@@ -0,0 +1,30 @@
|
||||
# GF Zulu Resource Grammar
|
||||
|
||||
### Authors
|
||||
- Laurette Marais (lmarais@csir.co.za)
|
||||
- Laurette Pretorius (laurette.pretorius@gmail.org)
|
||||
|
||||
in collaboration with Lionel Posthumus
|
||||
|
||||
This work has been made possible by the [South African Centre for Digital Language Resource (SADiLaR)](https://www.sadilar.org).
|
||||
|
||||
## Introduction
|
||||
This resource grammar provides an implementation of the Zulu language by making use of the common abstract syntax and a custom extension. The goal is to strike a balance between adhering as closely as possible to the common abstract syntax, while providing as much transparency and efficiency as possible. One important aim is to enable parsing, which is not possible for large, inefficient grammars. The most common, and most challenging, syntax categories and functions have so far been implemented.
|
||||
|
||||
## Usage
|
||||
The file structure has been adapted slightly to accommodate the custom extension, as well as to provide the ability to compile the base grammar with different lexica.
|
||||
|
||||
| Compilable module | Lexicon | Description |
|
||||
| ----------------- | ------- | ----------- |
|
||||
| MonoLexLangZul.gf | MonoLexZul.gf | The base RG with a large lexicon containing Zulu roots and stems, using Zulu function names, eg. `hamb_V` |
|
||||
| MultiLexLangZul.gf | MultiLexZul.gf | The base RG with a lexicon of common Zulu roots and stems, using English function names, eg. `walk_V` |
|
||||
| MonoLexChunkZul.gf | MonoLexZul.gf | A chunk parsing enabled version of the RG with a large lexicon containing Zulu roots and stems, using Zulu function names, eg. `hamb_V` |
|
||||
| MultiLexChunkZul.gf | MultiLexZul.gf | A chunk parsing enabled version of the RG with a lexicon of common Zulu roots and stems, using English function names, eg. `walk_V` |
|
||||
| DevLexLangZul.gf | DevLexZul.gf | The base RG with a small development lexicon containing Zulu roots and stems, using Zulu function names, eg. `hamb_V` |
|
||||
|
||||
Compiler directives setting up the appropriate paths have been added, so these modules should be compilable as is:
|
||||
|
||||
`path/to/gf-rgl$ gf --make src/zulu/grammars/MonoLexLangZul.gf`
|
||||
|
||||
## Supporting resources
|
||||
Various supporting resources can be found at https://github.com/LauretteM/gf-zulu-resources
|
||||
147
src/zulu/RelativeZul.gf
Executable file
147
src/zulu/RelativeZul.gf
Executable file
@@ -0,0 +1,147 @@
|
||||
concrete RelativeZul of Relative = CatZul ** open ResZul,Prelude,ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
-- RelCl cl = {
|
||||
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! oDir ;
|
||||
-- c = npNom
|
||||
-- } ;
|
||||
|
||||
RelVP rp vp = case vp.vptype of {
|
||||
CopIdent => rcl_with_id_cop_predicate rp vp ;
|
||||
CopAssoc => rcl_with_ass_cop_predicate rp vp ;
|
||||
CopEq => rcl_with_eq_cop_predicate rp vp ;
|
||||
CopDescr => rcl_with_descr_predicate rp vp ;
|
||||
_ => rcl_with_verb_predicate rp vp
|
||||
} ;
|
||||
|
||||
-- -- Pied piping: "that we are looking at". Pied piping and empty
|
||||
-- -- relative are defined in $ExtraZul.gf$ ("at which we are looking",
|
||||
-- -- "we are looking at").
|
||||
--
|
||||
-- RelSlash rp slash = {
|
||||
-- s = \\t,a,p,ag =>
|
||||
-- rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
||||
-- c = NPAcc
|
||||
-- } ;
|
||||
--
|
||||
-- FunRP p np rp = {
|
||||
-- s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
|
||||
-- a = RAg np.a
|
||||
-- } ;
|
||||
|
||||
IdRP = { s = [] } ;
|
||||
|
||||
oper
|
||||
rcl_with_verb_predicate : RP -> VP -> { s : Agr => Polarity => BasicTense => Str } = \rp,vp -> {
|
||||
s = \\a,p,t =>
|
||||
let
|
||||
vform = VFIndic RelCl p t ;
|
||||
vow = case <vp.r,p,t> of {
|
||||
<RC,Pos,PresTense> => False ;
|
||||
<_,Pos,PresTense> => True ;
|
||||
<RC,_,PastTense> => False ;
|
||||
<_,_,PastTense> => True ;
|
||||
<_,_,_> => False
|
||||
} ;
|
||||
reqLF = case vp.hasComp of {
|
||||
True => False ;
|
||||
False => True
|
||||
} ;
|
||||
relsuf = case vp.hasComp of {
|
||||
True => [] ;
|
||||
False => relSuf vform
|
||||
} ;
|
||||
rcform = RelC ; -- case vform_main of {
|
||||
-- VFIndic Part Pos PastTense _ => RelCA ;
|
||||
-- VFIndic _ _ _ _ => RelC ;
|
||||
-- VFPot _ _ _ => RelC ;
|
||||
-- VFSubj _ => RelC
|
||||
-- } ;
|
||||
in
|
||||
-- naively only took out the subject
|
||||
rp.s
|
||||
-- ++ (negPref vform_main)
|
||||
-- -- ++ (exclSePref vform_main)
|
||||
-- ++ relConc!a!rcform ++BIND
|
||||
-- -- ++ (negPref2 vform_main)
|
||||
-- -- ++ (exclKaPref vform)
|
||||
-- ++ (tensePref vform)
|
||||
-- ++ vp.oc
|
||||
-- ++ vp.s!(rform vform_main reqLF)
|
||||
++ vp.s!RelCl!a!p!t!reqLF
|
||||
-- ++ relsuf
|
||||
++ vp.iadv
|
||||
++ vp.comp
|
||||
++ vp.advs
|
||||
} ;
|
||||
|
||||
rcl_with_id_cop_predicate : RP -> VP -> { s : Agr => Polarity => BasicTense => Str } = \rp,vp -> {
|
||||
s = \\a,p,t =>
|
||||
let
|
||||
vform_main = VFIndic RelCl p t ;
|
||||
pcp = relConcLookup!a!vp.r ++BIND ;
|
||||
-- cp = id_cop_pref vp.comp_agr ;
|
||||
cb = vp.comp ;
|
||||
in
|
||||
-- naively removed subject
|
||||
rp.s ++
|
||||
-- pcp ++
|
||||
vp.s!RelCl!a!p!t!False ++
|
||||
vp.iadv ++
|
||||
vp.advs
|
||||
} ;
|
||||
|
||||
rcl_with_ass_cop_predicate : RP -> VP -> { s : Agr => Polarity => BasicTense => Str } = \rp,vp -> {
|
||||
s = \\a,p,t =>
|
||||
let
|
||||
vform_main = VFIndic RelCl p t ;
|
||||
pcp = relConcLookup!a!vp.r ++BIND;
|
||||
-- cp = (assoc_cop_pref vp.comp_agr) ;
|
||||
-- cb = (withPref ! vp.r) ++ BIND ++ vp.comp ;
|
||||
-- asp = case vp.asp of {
|
||||
-- Prog => progPref vform_main ;
|
||||
-- _ => []
|
||||
-- } ;
|
||||
in
|
||||
-- naively removed subject
|
||||
rp.s ++
|
||||
-- pcp ++
|
||||
vp.s!RelCl!a!p!t!False ++
|
||||
vp.iadv ++
|
||||
vp.advs
|
||||
} ;
|
||||
|
||||
rcl_with_eq_cop_predicate : RP -> VP -> { s : Agr => Polarity => BasicTense => Str } = \rp,vp -> {
|
||||
s = \\a,p,t =>
|
||||
let
|
||||
vform_main = VFIndic RelCl p t ;
|
||||
pcp = relConcLookup!a!vp.r ++BIND;
|
||||
-- cb = (eqPref ! vp.r) ++ BIND ++ vp.comp ;
|
||||
in
|
||||
-- naively removed subject
|
||||
rp.s ++
|
||||
pcp ++
|
||||
vp.s!RelCl!a!p!t!False ++
|
||||
vp.iadv ++
|
||||
vp.advs
|
||||
} ;
|
||||
|
||||
rcl_with_descr_predicate : RP -> VP -> { s : Agr => Polarity => BasicTense => Str } = \rp,vp -> {
|
||||
s = \\a,p,t =>
|
||||
let
|
||||
vform_main = VFIndic RelCl p t ;
|
||||
pcp = pre_cop_pref vform_main a ;
|
||||
-- adjf = aformN a ;
|
||||
-- adjpref = relAdjAgrLookup!p!a ++BIND ;
|
||||
-- comp = vp.ap_comp!adjf ++ vp.comp
|
||||
in
|
||||
rp.s ++
|
||||
-- adjpref ++
|
||||
vp.s!RelCl!a!p!t!False
|
||||
++ vp.iadv ++ vp.advs
|
||||
} ;
|
||||
|
||||
}
|
||||
1848
src/zulu/ResZul.gf
Executable file
1848
src/zulu/ResZul.gf
Executable file
File diff suppressed because it is too large
Load Diff
256
src/zulu/SentenceZul.gf
Executable file
256
src/zulu/SentenceZul.gf
Executable file
@@ -0,0 +1,256 @@
|
||||
concrete SentenceZul of Sentence = CatZul ** open Prelude,ResZul,ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
PredVP np vp = case vp.vptype of {
|
||||
CopIdent => comp_pred np vp ;
|
||||
CopAssoc => comp_pred np vp ;
|
||||
CopDescr => comp_pred np vp ;
|
||||
CopLoc => comp_pred np vp ;
|
||||
CopEq => cl_with_eq_cop_predicate np vp ;
|
||||
-- VACompl => cl_with_ap_comp_predicate np vp ;
|
||||
AdvComp => cl_with_adv_comp_predicate np vp ;
|
||||
(NoComp | VNPCompl) =>
|
||||
let
|
||||
longform_suffix = case vp.hasComp of {
|
||||
True => False ;
|
||||
False => True
|
||||
}
|
||||
in {
|
||||
s = \\p,t => np.s!NFull ++ (verb_prefix vp p t np.agr) ++ vp.s!MainCl!np.agr!p!t!longform_suffix ++ vp.comp ++ vp.iadv ++ vp.advs ;
|
||||
} ;
|
||||
_ => cl_with_verb_predicate np vp
|
||||
} ;
|
||||
|
||||
-- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
||||
|
||||
ImpVP vp = let
|
||||
np = {
|
||||
empty = [] ;
|
||||
s = table {NFull|NReduced|NPoss|NLoc => []} ;
|
||||
-- loc = [] ;
|
||||
-- desc = [] ;
|
||||
-- det = [] ;
|
||||
agr = Second Sg ;
|
||||
i = nominit!(Second Sg) ;
|
||||
proDrop = True ;
|
||||
isPron = True ;
|
||||
heavy = False
|
||||
-- reqLocS = True ;
|
||||
-- qdef = Article Spec
|
||||
} ;
|
||||
impTense = PresTense
|
||||
in case vp.vptype of {
|
||||
VNPCompl => {
|
||||
s = table {
|
||||
Pos => vp.s!MainCl!np.agr!Pos!impTense!False ++ vp.comp ++ vp.iadv ++ vp.advs ;
|
||||
Neg => "unga" ++ vp.s!MainCl!np.agr!Neg!impTense!False ++ vp.comp ++ vp.iadv ++ vp.advs
|
||||
}
|
||||
} ;
|
||||
|
||||
CopIdent => {s = \\pol => (comp_pred np vp).s!pol!impTense } ;
|
||||
CopAssoc => {s = \\pol => (comp_pred np vp).s!pol!impTense } ;
|
||||
CopDescr => {s = \\pol => (comp_pred np vp).s!pol!impTense } ;
|
||||
CopEq => {s = \\pol => (cl_with_eq_cop_predicate np vp).s!pol!impTense } ;
|
||||
-- VACompl => {s = \\pol => (cl_with_ap_comp_predicate np vp).s!pol!impTense!Princ } ;
|
||||
AdvComp => {s = \\pol => (cl_with_adv_comp_predicate np vp).s!pol!impTense } ;
|
||||
_ => {s = \\pol => (imp_verb_predicate np vp).s!pol!impTense }
|
||||
} ;
|
||||
|
||||
-- SlashVP np vp =
|
||||
-- mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ;
|
||||
--
|
||||
-- AdvSlash slash adv = {
|
||||
-- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
|
||||
-- c2 = slash.c2
|
||||
-- } ;
|
||||
--
|
||||
-- SlashPrep cl prep = cl ** {c2 = prep.s} ;
|
||||
--
|
||||
-- SlashVS np vs slash =
|
||||
-- mkClause (np.s ! npNom) np.a
|
||||
-- (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) **
|
||||
-- {c2 = slash.c2} ;
|
||||
--
|
||||
-- EmbedS s = {s = conjThat ++ s.s} ;
|
||||
-- EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
-- EmbedVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ;
|
||||
|
||||
UseCl t p cl = {
|
||||
s = t.s ++ p.s ++ cl.s ! p.p ! t.t
|
||||
} ;
|
||||
UseQCl t p cl = {
|
||||
s = t.s ++ p.s ++ cl.s ! p.p ! t.t ;
|
||||
-- potqs = t.s ++ p.s ++ cl.potqcl ! p.p ! Princ ;
|
||||
qword_pre = cl.qword_pre ;
|
||||
qword_post = cl.qword_post
|
||||
} ;
|
||||
UseRCl temp pol rcl = {
|
||||
s = \\a => temp.s ++ pol.s ++ rcl.s!a!pol.p!temp.t ;
|
||||
} ;
|
||||
-- UseSlash t p cl = {
|
||||
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! oDir ;
|
||||
-- c2 = cl.c2
|
||||
-- } ;
|
||||
--
|
||||
-- AdvS a s = {s = a.s ++ s.s} ;
|
||||
-- ExtAdvS a s = {s = a.s ++ frontComma ++ s.s} ;
|
||||
--
|
||||
-- SSubjS a s b = {s = a.s ++ frontComma ++ s.s ++ b.s} ;
|
||||
--
|
||||
-- RelS s r = {s = s.s ++ frontComma ++ r.s ! agrP3 Sg} ;
|
||||
--
|
||||
-- oper
|
||||
-- ctr : CPolarity -> CPolarity = \x -> x ;
|
||||
-- --- ctr = contrNeg True ; -- contracted negations
|
||||
|
||||
oper
|
||||
|
||||
comp_pred : NP -> VP -> { s : Polarity => BasicTense => Str } = \np,vp -> {
|
||||
s = \\p,t =>
|
||||
let
|
||||
subj = np.s!NFull
|
||||
in
|
||||
subj ++
|
||||
vp.s!MainCl!np.agr!p!t!False
|
||||
++ vp.comp ++ vp.iadv ++ vp.advs
|
||||
} ;
|
||||
|
||||
imp_verb_predicate : NP -> VP -> { s : Polarity => BasicTense => Str } = \np,vp -> {
|
||||
s = \\p,t =>
|
||||
let
|
||||
subj = np.s!NFull ;
|
||||
vform_main = VFIndic MainCl p t ;
|
||||
in
|
||||
impPref p
|
||||
++ vp.s!MainCl!np.agr!p!t!False
|
||||
++ vp.iadv
|
||||
++ vp.comp
|
||||
++ vp.advs
|
||||
} ;
|
||||
|
||||
-- imp_verb_prefix : VP -> Polarity -> BasicTense -> Agr -> Str = \vp,p,t,agr ->
|
||||
-- let
|
||||
-- -- vow = case <vp.hasComp,vp.r,p,t> of {
|
||||
-- vow = case <vp.hasComp,p,t,vp.r> of {
|
||||
-- <False,Pos,PresTense,RC> => False ; -- force the compiler to understand the table
|
||||
-- <False,Pos,PresTense,_> => False ; -- long form ya
|
||||
--
|
||||
-- <_,_,PresTense,RC> => False ;
|
||||
-- <_,_,PresTense,_> => True ;
|
||||
-- -- <_,Pos,PerfTense,RC> => False ;
|
||||
-- -- <_,Pos,PerfTense,_> => True ;
|
||||
-- <_,_,PastTense,RC> => False ;
|
||||
-- <_,_,PastTense,_> => True ;
|
||||
-- <_,_,RemPastTense,RC> => False ;
|
||||
-- <_,_,RemPastTense,_> => True ;
|
||||
-- <_,_,_,_> => False
|
||||
-- } ;
|
||||
-- vform = VFIndic MainCl p t
|
||||
-- in
|
||||
-- (negPref vform)
|
||||
-- -- ++ (exclSePref vform_main)
|
||||
-- ++ (subjConc vform agr vow)
|
||||
-- -- ++ (negPref2 vform_main)
|
||||
-- -- ++ (tensePref vform)
|
||||
-- ;
|
||||
|
||||
cl_with_verb_predicate : NP -> VP -> { s : Polarity => BasicTense => Str } = \np,vp -> {
|
||||
s = \\p,t =>
|
||||
let
|
||||
subj = np.s!NFull ;
|
||||
vform_main = VFIndic MainCl p t ;
|
||||
longform_suffix = case vp.hasComp of {
|
||||
True => False ;
|
||||
False => True
|
||||
}
|
||||
in
|
||||
subj
|
||||
++ (verb_prefix vp p t np.agr)
|
||||
++ vp.s!MainCl!np.agr!p!t!longform_suffix
|
||||
++ vp.iadv
|
||||
++ vp.comp
|
||||
++ vp.advs
|
||||
} ;
|
||||
|
||||
verb_prefix : VP -> Polarity -> BasicTense -> Agr -> Str = \vp,p,t,agr ->
|
||||
let
|
||||
lfya = case <vp.hasComp,p,t,vp.r> of {
|
||||
<False,Pos,PresTense,RC> => "ya" ++BIND ;
|
||||
<False,Pos,PresTense,_> => "y" ++BIND ;
|
||||
<_,_,_> => []
|
||||
} ;
|
||||
-- vow = case <vp.hasComp,vp.r,p,t> of {
|
||||
vow = case <vp.hasComp,p,t,vp.r> of {
|
||||
<False,Pos,PresTense,RC> => False ; -- force the compiler to understand the table
|
||||
<False,Pos,PresTense,_> => False ; -- long form ya
|
||||
|
||||
<_,_,PresTense,RC> => False ;
|
||||
<_,_,PresTense,_> => True ;
|
||||
-- <_,Pos,PerfTense,RC> => False ;
|
||||
-- <_,Pos,PerfTense,_> => True ;
|
||||
<_,_,PastTense,RC> => False ;
|
||||
<_,_,PastTense,_> => True ;
|
||||
<_,_,RemPastTense,RC> => False ;
|
||||
<_,_,RemPastTense,_> => True ;
|
||||
<_,_,_,_> => False
|
||||
} ;
|
||||
vform = VFIndic MainCl p t
|
||||
in
|
||||
(negPref vform)
|
||||
-- ++ (exclSePref vform_main)
|
||||
++ (subjConc vform agr vow)
|
||||
-- ++ (negPref2 vform_main)
|
||||
++ lfya
|
||||
-- ++ (tensePref vform)
|
||||
;
|
||||
|
||||
-- TODO: aspect
|
||||
cl_with_eq_cop_predicate : NP -> VP -> { s : Polarity => BasicTense => Str } = \np,vp -> {
|
||||
s = \\p,t =>
|
||||
let
|
||||
vform_main = VFIndic MainCl p t ;
|
||||
subj = np.s!NFull ;
|
||||
pcp = pre_cop_pref vform_main np.agr ;
|
||||
-- cb = (eqPref ! vp.r) ++ BIND ++ vp.comp ;
|
||||
in
|
||||
subj ++
|
||||
-- pcp ++
|
||||
vp.s!MainCl!np.agr!p!t!False
|
||||
++ vp.comp ++ vp.iadv ++ vp.advs
|
||||
} ;
|
||||
|
||||
cl_with_adv_comp_predicate : NP -> VP -> { s : Polarity => BasicTense => Str } = \np,vp -> {
|
||||
s = \\p,t =>
|
||||
let
|
||||
subj = np.s!NFull ;
|
||||
vform_main = VFIndic MainCl p t ;
|
||||
vow = case <vp.r,p,t> of {
|
||||
<RC,Pos,PresTense> => False ;
|
||||
<_,Pos,PresTense> => True ;
|
||||
<_,_,_> => False
|
||||
} ;
|
||||
lfya = case <vp.hasComp,p,t> of {
|
||||
<False,Pos,PresTense> => "ya" ++BIND ;
|
||||
<_,_,_> => []
|
||||
} ;
|
||||
reqLF = case vp.hasComp of {
|
||||
True => False ;
|
||||
False => True
|
||||
}
|
||||
in
|
||||
subj ++
|
||||
-- ++ (negPref vform_main)
|
||||
-- -- ++ (exclSePref vform_main)
|
||||
-- ++ (subjConc vform_main np.agr vow)
|
||||
-- -- ++ (negPref2 vform_main)
|
||||
-- ++ lfya
|
||||
-- -- ++ (tensePref vform_main)
|
||||
-- ++ vp.comp
|
||||
vp.s!MainCl!np.agr!p!t!False
|
||||
++ vp.comp ++ vp.iadv ++ vp.advs
|
||||
} ;
|
||||
|
||||
}
|
||||
159
src/zulu/StructuralZul.gf
Executable file
159
src/zulu/StructuralZul.gf
Executable file
@@ -0,0 +1,159 @@
|
||||
concrete StructuralZul of Structural = CatZul **
|
||||
open
|
||||
-- MorphoZul,
|
||||
ResZul, ParadigmsZul, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
-- AdA
|
||||
-- almost_AdA = mkAdA "almost" ;
|
||||
-- so_AdA = mkAdA "so" ;
|
||||
-- too_AdA = mkAdA "too" ;
|
||||
very_AdA = mkAdA "kakhulu" ;
|
||||
|
||||
-- AdN
|
||||
-- almost_AdN = mkAdN "almost" ;
|
||||
-- at_least_AdN = mkAdN "at least" ;
|
||||
-- at_most_AdN = mkAdN "at most" ;
|
||||
|
||||
-- Adv
|
||||
-- everywhere_Adv = mkAdv "everywhere" ;
|
||||
-- here_Adv = mkAdv "here" ;
|
||||
-- here7to_Adv = mkAdv ["to here"] ;
|
||||
-- here7from_Adv = mkAdv ["from here"] ;
|
||||
-- quite_Adv = mkAdv "quite" ;
|
||||
-- somewhere_Adv = mkAdv "somewhere" ;
|
||||
-- there_Adv = mkAdv "there" ;
|
||||
-- there7to_Adv = mkAdv "there" ;
|
||||
-- there7from_Adv = mkAdv ["from there"] ;
|
||||
|
||||
-- AdV
|
||||
-- always_AdV = mkAdV "always" ;
|
||||
|
||||
-- CAdv
|
||||
-- less_CAdv = mkCAdv "less" "no less" "than" ;
|
||||
-- more_CAdv = mkCAdv "more" "no more" "than" ;
|
||||
-- as_CAdv = mkCAdv "as" "not as" "as" ;
|
||||
|
||||
-- Conj
|
||||
and_Conj = { s = \\_ => "futhi" ; fix = False } ;
|
||||
-- both7and_DConj = mkConj "both" "and";
|
||||
-- either7or_DConj = mkConj "either" "or" singular ;
|
||||
-- or_Conj = mkConj "or" singular ;
|
||||
-- if_then_Conj = mkConj "if" "then" singular ;
|
||||
|
||||
-- Det
|
||||
-- every_Det = mkDeterminerSpec singular "every" "everyone" "everything" False ;
|
||||
-- few_Det = mkDeterminer plural "few" ;
|
||||
-- many_Det = mkDeterminer plural "many" ;
|
||||
-- much_Det = mkDeterminer singular "much" ;
|
||||
-- someSg_Det = mkDeterminer singular "some" ;
|
||||
-- somePl_Det = mkDeterminer plural "some" ;
|
||||
|
||||
-- IAdv
|
||||
how_IAdv = {s = "kanjani" ; postIAdv = False } ;
|
||||
how8much_IAdv = {s = "kangakanani" ; postIAdv = False } ;
|
||||
-- when_IAdv = ss "when" ;
|
||||
-- where_IAdv = ss "where" ;
|
||||
-- why_IAdv = ss "why" ;
|
||||
|
||||
-- IDet
|
||||
-- how8many_IDet = mkDeterminer plural ["how many"] ;
|
||||
-- whichPl_IDet = mkDeterminer plural ["which"] ;
|
||||
-- whichSg_IDet = mkDeterminer singular ["which"] ;
|
||||
|
||||
-- IP
|
||||
-- whatPl_IP = mkIP "what" "what" "what's" plural ;
|
||||
-- whatSg_IP = mkIP "what" "what" "what's" singular ;
|
||||
-- whoPl_IP = mkIP "who" "whom" "whose" plural ;
|
||||
-- whoSg_IP = mkIP "who" "whom" "whose" singular ;
|
||||
|
||||
-- IQuant
|
||||
-- which_IQuant = {s = \\_ => "which"} ;
|
||||
|
||||
-- NP
|
||||
-- everybody_NP = regNP "everybody" singular ;
|
||||
-- everything_NP = regNP "everything" singular ;
|
||||
-- somebody_NP = regNP "somebody" singular ;
|
||||
-- something_NP = regNP "something" singular ;
|
||||
-- nobody_NP = regNP "nobody" singular ;
|
||||
-- nothing_NP = regNP "nothing" singular ;
|
||||
|
||||
-- PConj
|
||||
-- but_PConj = ss "but" ;
|
||||
-- otherwise_PConj = ss "otherwise" ;
|
||||
-- therefore_PConj = ss "therefore" ;
|
||||
|
||||
-- Predet
|
||||
-- all_Predet = { s = "nke" ; isPost = True } ;
|
||||
-- most_Predet = ss "most" ;
|
||||
-- only_Predet = { s = "dwa" ; isPost = True } ;
|
||||
-- not_Predet = { s : Str ; n : Number ; isPost : Bool }
|
||||
|
||||
-- Prep
|
||||
-- above_Prep = mkPrep "above" ;
|
||||
-- after_Prep = mkPrep "after" ;
|
||||
-- before_Prep = mkPrep "before" ;
|
||||
-- behind_Prep = mkPrep "behind" ;
|
||||
-- between_Prep = mkPrep "between" ;
|
||||
-- by8agent_Prep = mkPrep "by" ;
|
||||
-- by8means_Prep = mkPrep "by" ;
|
||||
-- during_Prep = mkPrep "during" ;
|
||||
-- for_Prep = mkPrep "for" ;
|
||||
-- from_Prep = mkPrep "from" ;
|
||||
-- in8front_Prep = mkPrep ["in front of"] ;
|
||||
-- in_Prep = mkPrep "in" ;
|
||||
-- on_Prep = mkPrep "on" ;
|
||||
-- part_Prep = mkPrep "of" ;
|
||||
-- possess_Prep = mkPrep "of" ;
|
||||
-- through_Prep = mkPrep "through" ;
|
||||
-- to_Prep = mkPrep "to" ;
|
||||
-- under_Prep = mkPrep "under" ;
|
||||
-- without_Prep = mkPrep "without" ;
|
||||
-- with_Prep = mkPrep "with" ;
|
||||
-- except_Prep = mkPrep "except" ;
|
||||
|
||||
-- Pron
|
||||
i_Pron = mkPron (First Sg) ;
|
||||
we_Pron = mkPron (First Pl) ;
|
||||
|
||||
youSg_Pron = mkPron (Second Sg) ;
|
||||
youPl_Pron = mkPron (Second Pl) ;
|
||||
|
||||
he_Pron = mkPron (Third C1_2 Sg) ;
|
||||
it_Pron = mkPron (Third C3_4 Sg) ;
|
||||
she_Pron = mkPron (Third C1_2 Sg) ;
|
||||
they_Pron = mkPron (Third C1_2 Pl) ;
|
||||
|
||||
-- youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ;
|
||||
|
||||
-- Quant (we use this category for demonstratives only)
|
||||
that_Quant = { s = [] ; dist = Dem2 } ;
|
||||
this_Quant = { s = [] ; dist = Dem1 } ;
|
||||
-- no_Quant = mkQuant "no" "no" "none" "none" ;
|
||||
|
||||
-- Subj
|
||||
-- although_Subj = ss "although" ;
|
||||
-- because_Subj = ss "because" ;
|
||||
-- if_Subj = ss "if" ;
|
||||
-- when_Subj = ss "when" ;
|
||||
-- that_Subj = ss "that" ;
|
||||
|
||||
-- Utt
|
||||
-- no_Utt = ss "no" ;
|
||||
-- yes_Utt = ss "yes" ;
|
||||
language_title_Utt = ss "Zulu" ;
|
||||
|
||||
-- Voc
|
||||
-- please_Voc = ss "please" ;
|
||||
|
||||
-- V2
|
||||
-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
|
||||
|
||||
-- VV
|
||||
-- can8know_VV
|
||||
-- can_VV
|
||||
-- must_VV
|
||||
|
||||
}
|
||||
45
src/zulu/SymbolZul.gf
Executable file
45
src/zulu/SymbolZul.gf
Executable file
@@ -0,0 +1,45 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SymbolZul of Symbol = CatZul ** open Prelude, ResZul in {
|
||||
|
||||
-- lin
|
||||
-- SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
-- IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
-- FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
-- NumPN i = {s = i.s ! False ; g = Neutr} ;
|
||||
-- CNIntNP cn i = {
|
||||
-- s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! npcase2case c ;
|
||||
-- a = agrgP3 Sg cn.g
|
||||
-- } ;
|
||||
-- CNSymbNP det cn xs = {
|
||||
-- s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! npcase2case c ;
|
||||
-- a = agrgP3 det.n cn.g
|
||||
-- } ;
|
||||
-- CNNumNP cn i = {
|
||||
-- s = \\c => cn.s ! Sg ! Nom ++ i.s ! False ! npcase2case c ;
|
||||
-- a = agrgP3 Sg cn.g
|
||||
-- } ;
|
||||
--
|
||||
-- SymbS sy = sy ;
|
||||
--
|
||||
-- SymbNum sy = { s,sp = \\_ => addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
||||
-- SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
||||
--
|
||||
lincat
|
||||
|
||||
Symb = { s : Str } ;
|
||||
-- [Symb] = SS ;
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
|
||||
-- BaseSymb = infixSS "and" ;
|
||||
-- ConsSymb = infixSS frontComma ;
|
||||
--
|
||||
-- oper
|
||||
-- -- Note: this results in a space before 's, but there's
|
||||
-- -- not mauch we can do about that.
|
||||
-- addGenitiveS : Str -> Case => Str = \s ->
|
||||
-- table { Gen => s ++ BIND ++ "'s"; _ => s } ;
|
||||
|
||||
}
|
||||
9
src/zulu/TempExtZul.gf
Executable file
9
src/zulu/TempExtZul.gf
Executable file
@@ -0,0 +1,9 @@
|
||||
concrete TempExtZul of TempExt = CatZul ** open ResZul in {
|
||||
|
||||
lin
|
||||
TPresTemp = { s = [] ; t = PresTense } ;
|
||||
TPastTemp = { s = [] ; t = PastTense } ;
|
||||
TFutTemp = { s = [] ; t = FutTense } ;
|
||||
TRemFutTemp = { s = [] ; t = RemFutTense } ;
|
||||
TRemPastTemp = { s = [] ; t = RemPastTense } ;
|
||||
}
|
||||
106
src/zulu/TerminologyZul.gf
Executable file
106
src/zulu/TerminologyZul.gf
Executable file
@@ -0,0 +1,106 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
concrete TerminologyZul of Terminology = CatZul ** open
|
||||
ResZul,
|
||||
ParadigmsZul,
|
||||
(G = GrammarZul),
|
||||
(S = SyntaxZul),
|
||||
(L = LexiconZul),
|
||||
Prelude
|
||||
in {
|
||||
|
||||
|
||||
-- lincat
|
||||
-- Category = G.N ;
|
||||
-- ParameterType = G.N ;
|
||||
-- Parameter = G.N ;
|
||||
-- Modifier = G.A ;
|
||||
--
|
||||
-- lin
|
||||
-- noun_Category = mkN "noun" ;
|
||||
-- adjective_Category = mkN "adjective" ;
|
||||
-- verb_Category = mkN "verb" ;
|
||||
-- adverb_Category = mkN "adverb" ;
|
||||
-- preposition_Category = mkN "preposition" ;
|
||||
-- numeral_Category = mkN "numeral" ;
|
||||
-- pronoun_Category = mkN "pronoun" ;
|
||||
-- determiner_Category = mkN "determiner" ;
|
||||
-- article_Category = mkN "article" ;
|
||||
--
|
||||
-- gender_ParameterType = mkN "Gender" ;
|
||||
-- finite_form_ParameterType = mkN "finite form" ;
|
||||
-- nominal_form_ParameterType = mkN "nominal form" ;
|
||||
--
|
||||
-- singular_Parameter = mkN "singular" ;
|
||||
-- plural_Parameter = mkN "plural" ;
|
||||
--
|
||||
-- masculine_Parameter = mkN "masculine" ;
|
||||
-- feminine_Parameter = mkN "feminine" ;
|
||||
-- neuter_Parameter = mkN "neuter" ;
|
||||
-- uter_Parameter = mkN "uter" ;
|
||||
--
|
||||
-- nominative_Parameter = mkN "nominative" ;
|
||||
-- genitive_Parameter = mkN "genitive" ;
|
||||
-- dative_Parameter = mkN "dative" ;
|
||||
-- accusative_Parameter = mkN "accusative" ;
|
||||
--
|
||||
-- partitive_Parameter = mkN "partitive" ;
|
||||
-- translative_Parameter = mkN "translative" ;
|
||||
-- essive_Parameter = mkN "essive" ;
|
||||
-- inessive_Parameter = mkN "inessive" ;
|
||||
-- elative_Parameter = mkN "elative" ;
|
||||
-- illative_Parameter = mkN "illative" ;
|
||||
-- adessive_Parameter = mkN "adessive" ;
|
||||
-- ablative_Parameter = mkN "ablative" ;
|
||||
-- allative_Parameter = mkN "allative" ;
|
||||
-- abessive_Parameter = mkN "abessive" ;
|
||||
-- comitative_Parameter = mkN "comitative" ;
|
||||
-- instructive_Parameter = mkN "instructive" ;
|
||||
--
|
||||
-- active_Parameter = mkN "active" ;
|
||||
-- passive_Parameter = mkN "passive" ;
|
||||
-- middle_Parameter = mkN "middle" ;
|
||||
--
|
||||
-- imperative_Parameter = mkN "imperative" ;
|
||||
-- indicative_Parameter = mkN "indicative" ;
|
||||
-- conjunctive_Parameter = mkN "conjunctive" ;
|
||||
-- infinitive_Parameter = mkN "infinitive" ;
|
||||
--
|
||||
-- definite_Parameter = mkN "definite" ;
|
||||
-- indefinite_Parameter = mkN "indefinite" ;
|
||||
--
|
||||
-- present_Parameter = mkN "present" ;
|
||||
-- past_Parameter = mkN "past" ;
|
||||
-- future_Parameter = mkN "future" ;
|
||||
-- conditional_Parameter = mkN "conditional" ;
|
||||
-- potential_Parameter = mkN "potential" ;
|
||||
-- perfect_Parameter = mkN "perfect" ;
|
||||
-- imperfect_Parameter = mkN "imperfect" ;
|
||||
-- supine_Parameter = mkN "supine" ;
|
||||
-- agent_Parameter = mkN "agent" ;
|
||||
-- simple_past_Parameter = mkN "simple past" ;
|
||||
--
|
||||
-- participle_Parameter = mkN "participle" ;
|
||||
-- aux_verb_Parameter = mkN "auxiliary" ;
|
||||
-- gerund_Parameter = mkN "Gerund" ;
|
||||
--
|
||||
-- positive_Parameter = mkN "positive" ;
|
||||
-- comparative_Parameter = mkN "comparative" ;
|
||||
-- superlative_Parameter = mkN "superlative" ;
|
||||
-- predicative_Parameter = mkN "predicative" ;
|
||||
-- negative_Parameter = mkN "negative" ;
|
||||
--
|
||||
-- short_Parameter = mkN "short" ; --- adjective
|
||||
-- long_Parameter = mkN "long" ;
|
||||
--
|
||||
-- strong_Parameter = mkN "strong" ; --- adjective
|
||||
-- weak_Parameter = mkN "weak" ;
|
||||
--
|
||||
-- nounHeading n = ss (n.s ! Sg ! Nom) ;
|
||||
-- nounPluralHeading n = ss (n.s ! Pl ! Nom) ;
|
||||
--
|
||||
-- exampleGr_N = mkN "example" ;
|
||||
-- formGr_N = mkN "form" ;
|
||||
|
||||
|
||||
}
|
||||
152
src/zulu/VerbExtZul.gf
Normal file
152
src/zulu/VerbExtZul.gf
Normal file
@@ -0,0 +1,152 @@
|
||||
concrete VerbExtZul of VerbExt = CatZul,CatExtZul ** open ResZul, Prelude, ParamX in {
|
||||
|
||||
lin
|
||||
|
||||
CopAP ap = {
|
||||
s = case ap.t of {
|
||||
AdjType => table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = ap_cop_pref vform a AdjType ; -- u- / uzoba / ube- / waye- / wayenge-
|
||||
adjpref = adjPref a vform ; -- m-
|
||||
cop_base = ap.s!(aformN a) -- khulu
|
||||
in
|
||||
pcp ++ adjpref ++ cop_base ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o-
|
||||
pcp = ap_cop_pref vform a AdjType ; -- [] / -nge- / zoba / -be- / -benge- -waye- / -wayenge-
|
||||
adjpref = adjPref a vform ; -- m-
|
||||
cop_base = ap.s!(aformN a) -- khulu
|
||||
in
|
||||
rcp ++ pcp ++ adjpref ++ cop_base
|
||||
} ;
|
||||
RelType => table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = ap_cop_pref vform a RelType ; -- u-
|
||||
cop_base = ap.s!AF1 -- qotho
|
||||
in
|
||||
pcp ++ cop_base ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o-
|
||||
pcp = ap_cop_pref vform a RelType ; -- [] / -nge- / zoba / -benge-
|
||||
cop_base = ap.s!AF1 -- qotho
|
||||
in
|
||||
rcp ++ pcp ++ cop_base
|
||||
}
|
||||
} ;
|
||||
comp, iadv, advs = [] ;
|
||||
hasComp = True ;
|
||||
r = RC ; -- should not be used
|
||||
syl = SylMult ;
|
||||
vptype = CopDescr
|
||||
} ;
|
||||
|
||||
CopNP np = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = (id_pre_cop_pref vform a) ; -- u- / uzoba / akazukuba
|
||||
cp = (id_cop_pref np.agr) ; -- ng-
|
||||
cop_base = np.s!NFull -- umfundi
|
||||
in
|
||||
pcp ++ cp ++ cop_base ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o-
|
||||
pcp = (id_pre_cop_pref vform a) ; -- [] / zoba / zukuba
|
||||
cp = (id_cop_pref np.agr) ; -- ng-
|
||||
cop_base = np.s!NFull -- umfundi
|
||||
in
|
||||
rcp ++ pcp ++ cp ++ cop_base
|
||||
} ;
|
||||
comp, iadv, advs = [] ;
|
||||
hasComp = np.heavy ;
|
||||
r = RC ; -- should not be used
|
||||
syl = SylMult ;
|
||||
vptype = CopIdent
|
||||
} ;
|
||||
|
||||
CopNPAssoc np = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
pcp = (assoc_pre_cop_pref vform a) ; -- u- / uzoba
|
||||
cp = (assoc_cop_pref p np.agr) ; -- ne-
|
||||
cop_base = np.s!NReduced -- moto
|
||||
in
|
||||
pcp ++ cp ++ cop_base ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rcp = (relConcCop vform a RC) ; -- o-
|
||||
pcp = (assoc_pre_cop_pref vform a) ; -- [] / zoba
|
||||
cp = (assoc_cop_pref p np.agr) ; -- ne
|
||||
cop_base = np.s!NReduced -- moto
|
||||
in
|
||||
rcp ++ pcp ++ cp ++ cop_base
|
||||
} ;
|
||||
comp, iadv, advs = [] ;
|
||||
hasComp = np.heavy ;
|
||||
r = RC ; -- should not be used
|
||||
syl = SylMult ;
|
||||
vptype = CopAssoc
|
||||
} ;
|
||||
|
||||
ComplV2Nonspec v2 np = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
tp = tensePref vform v2.r v2.syl ;
|
||||
oc = objConc np.agr v2.r v2.syl ;
|
||||
longform = case np.heavy of {
|
||||
True => False ;
|
||||
False => True
|
||||
} ;
|
||||
r = v2.s!(rform (VFIndic MainCl p t) longform) ;
|
||||
obj = case p of {
|
||||
Pos => np.s!NFull ;
|
||||
Neg => np.s!NReduced
|
||||
} ;
|
||||
in case np.proDrop of {
|
||||
True => tp ++ oc ++ r ++ obj ;
|
||||
False => tp ++ r ++ obj
|
||||
} ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = (VFIndic RelCl p t) ;
|
||||
rc = relConc vform a v2.r ;
|
||||
tp = tensePref vform v2.r v2.syl ;
|
||||
oc = objConc np.agr v2.r v2.syl ;
|
||||
longform = case np.heavy of {
|
||||
True => False ;
|
||||
False => True
|
||||
} ;
|
||||
r = v2.s!(rform vform longform) ;
|
||||
obj = case p of {
|
||||
Pos => np.s!NFull ;
|
||||
Neg => np.s!NReduced
|
||||
} ;
|
||||
in case np.proDrop of {
|
||||
True => rc ++ tp ++ oc ++ r ++ obj ;
|
||||
False => rc ++ tp ++ r ++ obj
|
||||
}
|
||||
} ;
|
||||
iadv, advs, comp = [] ;
|
||||
ap_comp = \\_ => [] ;
|
||||
hasComp = np.heavy ;
|
||||
r = v2.r ;
|
||||
syl = v2.syl ;
|
||||
vptype = VNPCompl
|
||||
} ;
|
||||
|
||||
CopLoc loc = {
|
||||
s = \\c,a,p,t,l => loc.s!c!a!p!t ;
|
||||
comp,advs,iadv = [] ;
|
||||
hasComp = True ;
|
||||
r = RC ;
|
||||
syl = SylMult ;
|
||||
vptype = CopLoc
|
||||
} ;
|
||||
|
||||
}
|
||||
315
src/zulu/VerbZul.gf
Executable file
315
src/zulu/VerbZul.gf
Executable file
@@ -0,0 +1,315 @@
|
||||
concrete VerbZul of Verb = CatZul ** open ResZul, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV v = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t,l => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
tp = tensePref vform v.r v.syl ; -- [] / zo- / zuku-
|
||||
r = v.s!(rform (VFIndic MainCl p t) l) -- hamba
|
||||
-- rest of verb prefix built later (eg no "ya" with certain question words)
|
||||
in tp ++ r ;
|
||||
RelCl => \\a,p,t,l => let
|
||||
vform = VFIndic RelCl p t ;
|
||||
rc = relConc vform a v.r ; -- o-
|
||||
tp = tensePref vform v.r v.syl ; -- [] / zo- / zuku-
|
||||
r = v.s!(rform vform l) ; -- hamba
|
||||
suf = case l of {
|
||||
True => relSuf vform ;
|
||||
False => []
|
||||
} ;
|
||||
in rc ++ tp ++ r ++ suf
|
||||
} ;
|
||||
iadv, advs, comp = [] ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
hasComp = False ;
|
||||
r = v.r ;
|
||||
syl = v.syl ;
|
||||
vptype = NoComp
|
||||
} ;
|
||||
|
||||
-- ComplVV v vp = insertObj (\\a => infVP v.typ vp False Simul CPos a) (predVV v) ; ---- insertExtra?
|
||||
|
||||
-- ComplVS vs s = vs ** {
|
||||
-- -- s = vs.s ;
|
||||
-- oc = [] ;
|
||||
-- comp = s.subjs ;
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- -- r = vs.r ;
|
||||
-- -- syl = vs.syl ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- vptype = VSCompl ;
|
||||
-- comp_agr = First Sg ; -- this could be anything...
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
|
||||
-- --- ComplVS v s = insertObj (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predV v) ;
|
||||
-- ComplVQ v q = insertExtra (q.s ! QIndir) (predV v) ;
|
||||
|
||||
-- ComplVA va ap = va ** {
|
||||
-- -- s = va.s ;
|
||||
-- oc = [] ;
|
||||
-- comp = \\_ => [] ;
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- -- r = va.r ;
|
||||
-- -- syl = va.syl ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- vptype = VACompl ;
|
||||
-- comp_agr = First Sg ; -- this could be anything...
|
||||
-- ap_comp = ap.s ;
|
||||
-- ap_bool = ap.b ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
|
||||
|
||||
-- SlashV2a v = v ** {
|
||||
-- oc = [] ;
|
||||
-- comp = [] ;
|
||||
-- -- iadv = [] ;
|
||||
-- -- advs = [] ;
|
||||
-- hasComp = False ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- vptype = VNPCompl ;
|
||||
-- comp_agr = First Sg ; -- this could be anything...
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False -- ;
|
||||
-- -- missing_np1 = True
|
||||
-- } ;
|
||||
-- Slash2V3 v np =
|
||||
-- insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predVc v ** {c2 = v.c3 ; gapInMiddle = False}) ;
|
||||
-- Slash3V3 v np =
|
||||
-- insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ----
|
||||
-- SlashV2V v vp = insertObjc (\\a => v.c3 ++ infVP v.typ vp False Simul CPos a) (predVc v) ;
|
||||
-- SlashV2S v s = insertExtrac (conjThat ++ s.s) (predVc v) ; ---- insertExtra?
|
||||
-- --- SlashV2S v s = insertObjc (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predVc v) ;
|
||||
-- SlashV2Q v q = insertExtrac (q.s ! QIndir) (predVc v) ;
|
||||
-- SlashV2A v ap = insertObjc (\\a => v.c3 ++ ap.s ! a) (predVc v) ; ----
|
||||
|
||||
-- TODO: this simply adds the new np to the end of vp.comp; to be expanded beyond V2 using missing_np1
|
||||
-- ComplSlash vp np = {
|
||||
-- oc = case np.proDrop of {
|
||||
-- True => objConc np.agr vp.r vp.syl ;
|
||||
-- False => np.empty
|
||||
-- } ;
|
||||
-- comp = np.s!Full ;
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = case np.proDrop of {
|
||||
-- True => False ;
|
||||
-- False => True
|
||||
-- } ;
|
||||
-- s = vp.s ;
|
||||
-- r = vp.r ;
|
||||
-- syl = vp.syl ;
|
||||
-- asp = vp.asp ;
|
||||
-- asp_pref = vp.asp_pref ;
|
||||
-- vptype = VNPCompl ;
|
||||
-- comp_agr = np.agr ;
|
||||
-- ap_comp = vp.ap_comp ;
|
||||
-- aux_root = vp.aux_root ;
|
||||
-- hasAux = vp.hasAux
|
||||
-- } ;
|
||||
|
||||
-- UseComp comp = case comp.comptype of {
|
||||
-- CopDescr => {
|
||||
-- s = \\_ => [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = [] ; -- doesn't matter
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- r = comp.r ; -- adjectives don't typically start on vowels
|
||||
-- syl = SylMult ;
|
||||
-- asp = comp.asp ;
|
||||
-- asp_pref = comp.asp_pref ;
|
||||
-- vptype = comp.comptype ;
|
||||
-- comp_agr = comp.agr ; -- this could be anything...
|
||||
-- ap_comp = comp.s ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
-- CopIdent => {
|
||||
-- s = \\_ => [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = comp.s!AF1 ; -- doesn't matter
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- r = comp.r ;
|
||||
-- syl = SylMult ;
|
||||
-- asp = comp.asp ;
|
||||
-- asp_pref = comp.asp_pref ;
|
||||
-- vptype = comp.comptype ;
|
||||
-- comp_agr = comp.agr ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
-- AdvComp => {
|
||||
-- s = \\_ => [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = [] ;
|
||||
-- iadv = [] ;
|
||||
-- advs = comp.s!AF1 ;
|
||||
-- hasComp = True ;
|
||||
-- r = comp.r ; -- probably works...
|
||||
-- syl = SylMult ;
|
||||
-- asp = comp.asp ;
|
||||
-- asp_pref = comp.asp_pref ;
|
||||
-- vptype = comp.comptype ;
|
||||
-- comp_agr = comp.agr ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- } ;
|
||||
-- -- the default tries to treat the comp as a NP type
|
||||
-- _ => {
|
||||
-- s = \\_ => [] ;
|
||||
-- oc = [] ;
|
||||
-- comp = comp.s!AF1 ; -- doesn't matter
|
||||
-- iadv = [] ;
|
||||
-- advs = [] ;
|
||||
-- hasComp = True ;
|
||||
-- r = comp.r ;
|
||||
-- syl = SylMult ;
|
||||
-- asp = comp.asp ;
|
||||
-- asp_pref = comp.asp_pref ;
|
||||
-- vptype = comp.comptype ;
|
||||
-- comp_agr = comp.agr ;
|
||||
-- ap_comp = \\_ => [] ;
|
||||
-- aux_root = [] ;
|
||||
-- hasAux = False
|
||||
-- }
|
||||
-- } ;
|
||||
|
||||
AdvVP vp adv = vp ** { advs = vp.advs ++ adv.s ; hasComp = True } ;
|
||||
-- {
|
||||
-- s = vp.s ;
|
||||
-- oc = vp.oc ;
|
||||
-- comp = vp.comp ;
|
||||
-- iadv = vp.iadv ;
|
||||
-- advs = vp.advs ++ adv.s ;
|
||||
-- hasComp = vp.hasComp ;
|
||||
-- r = vp.r ;
|
||||
-- syl = vp.syl ;
|
||||
-- asp = vp.asp ;
|
||||
-- asp_pref = vp.asp_pref ;
|
||||
-- vptype = vp.vptype ;
|
||||
-- comp_agr = vp.comp_agr ;
|
||||
-- ap_comp = vp.ap_comp ;
|
||||
-- aux_root = vp.aux_root ;
|
||||
-- hasAux = vp.hasAux
|
||||
-- } ;
|
||||
|
||||
-- ExtAdvVP vp adv = insertObj (\\_ => frontComma ++ adv.s ++ finalComma) vp ;
|
||||
-- AdVVP adv vp = insertAdV adv.s vp ;
|
||||
--
|
||||
-- AdvVPSlash vp adv = vp ** insertObj (\\_ => adv.s) vp ;
|
||||
-- AdVVPSlash adv vp = vp ** insertAdV adv.s vp ;
|
||||
--
|
||||
-- ReflVP v = insertObjPre (\\a => v.c2 ++ reflPron ! a) v ;
|
||||
--
|
||||
-- PassV2 v = insertObj (\\_ => v.s ! VPPart ++ v.p) (predAux auxBe) ;
|
||||
--
|
||||
-- ---b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to"
|
||||
|
||||
-- CompAP ap = {
|
||||
-- s = ap.s ;
|
||||
-- r = RC ;
|
||||
-- agr = First Sg ; -- this could be anything...
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- comptype = CopDescr
|
||||
-- } ;
|
||||
--
|
||||
-- CompNP np = {
|
||||
-- s = \\nform => np.s!nform ; -- TODO: refactor
|
||||
-- r = initNP np.isPron np.agr ;
|
||||
-- agr = np.agr ;
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ;
|
||||
-- comptype = CopIdent
|
||||
-- } ;
|
||||
--
|
||||
-- CompAdv adv = {
|
||||
-- s = \\_ => case adv.reqLocS of {
|
||||
-- True => "s" ++BIND ;
|
||||
-- False => []
|
||||
-- } ++ adv.s ;
|
||||
-- r = RC ; -- probably works...
|
||||
-- agr = First Sg ; -- this could be anything...
|
||||
-- asp = Null ;
|
||||
-- asp_pref = \\_ => [] ; -- TODO: check
|
||||
-- comptype = AdvComp
|
||||
-- } ;
|
||||
|
||||
-- CompCN cn = {s = \\a => case (fromAgr a).n of {
|
||||
-- Sg => artIndef ++ cn.s ! Sg ! Nom ;
|
||||
-- Pl => cn.s ! Pl ! Nom
|
||||
-- }
|
||||
-- } ;
|
||||
|
||||
-- UseCopula = predAux auxBe ;
|
||||
--
|
||||
-- VPSlashPrep vp p = vp ** {c2 = p.s ; gapInMiddle = False; missingAdv = True } ;
|
||||
|
||||
-- oper
|
||||
-- insert_np : VPSlash -> NP -> VP = \vp,np -> {
|
||||
-- s = vp.s ;
|
||||
-- perfSuff = vp.perfSuff ;
|
||||
-- oc = case np.proDrop of {
|
||||
-- True => objConc np.agr v2.r v2.syl ;
|
||||
-- False => np.empty
|
||||
-- } ;
|
||||
-- comp = case np.proDrop of {
|
||||
-- True => vp.comp ;
|
||||
-- False => vp.comp ++ np.s ! Full ++ np.desc
|
||||
-- } ;
|
||||
-- hasComp = True ;
|
||||
-- r = vp.r ;
|
||||
-- syl = vp.syl ;
|
||||
-- asp = vp.asp ;
|
||||
-- asp_pref = vp.asp_pref ;
|
||||
-- vptype = VNPCompl ;
|
||||
-- comp_agr = np.agr ; -- this could be anything...
|
||||
-- ap_comp = vp.ap_comp ;
|
||||
-- ap_bool = vp.ap_bool ;
|
||||
-- aux_root = vp.aux_root ;
|
||||
-- hasAux = vp.hasAux
|
||||
-- } ;
|
||||
|
||||
oper
|
||||
v_prefix : RInit -> Bool -> Agr -> Polarity -> BasicTense -> Str = \r,c,a,p,t ->
|
||||
let
|
||||
vow = case <r,p,t> of {
|
||||
<RC,Pos,PresTense> => False ;
|
||||
<_,Pos,PresTense> => True ;
|
||||
<_,_,_> => False
|
||||
} ;
|
||||
lfya = case <c,p,t> of {
|
||||
<False,Pos,PresTense> => "ya" ++BIND ;
|
||||
<_,_,_> => []
|
||||
} ;
|
||||
vform_main = VFIndic MainCl p t
|
||||
in
|
||||
(negPref vform_main)
|
||||
-- ++ (exclSePref vform_main)
|
||||
++ (subjConc vform_main a vow)
|
||||
-- ++ (negPref2 vform_main)
|
||||
++ lfya
|
||||
-- ++ (tensePref vform_main)
|
||||
;
|
||||
}
|
||||
15
src/zulu/abstract_ext/CatExt.gf
Executable file
15
src/zulu/abstract_ext/CatExt.gf
Executable file
@@ -0,0 +1,15 @@
|
||||
abstract CatExt = {
|
||||
|
||||
cat
|
||||
Loc ;
|
||||
LocN ;
|
||||
QuantStem ;
|
||||
RelStem ;
|
||||
VAux ;
|
||||
ConjN ; -- Nguni conjunction
|
||||
IAdj ; -- how many
|
||||
-- INAdv ; -- which/-phi?
|
||||
|
||||
Postdet ;
|
||||
|
||||
}
|
||||
133
src/zulu/abstract_ext/ExtraExt.gf
Executable file
133
src/zulu/abstract_ext/ExtraExt.gf
Executable file
@@ -0,0 +1,133 @@
|
||||
abstract ExtraExt =
|
||||
Cat [NP,VP,CN,V,Temp,S,Cl,Adv,Pron,QCl,QS,A,RS,IAdv,IComp,Pol,Det,Quant,N,PN],
|
||||
CatExt ** {
|
||||
|
||||
fun
|
||||
ProDrop : Pron -> Pron ; -- unstressed subject pronoun becomes empty: "am tired"
|
||||
|
||||
fun
|
||||
-- PotQS : Pol -> QCl -> QS ;
|
||||
-- SubjunctS : S -> Utt ;
|
||||
|
||||
-- AssocCop : NP -> VP ;
|
||||
-- EqCop : NP -> VP ;
|
||||
|
||||
-- UsePNPl : PN -> NP ;
|
||||
-- PNAsCN : PN -> CN ;
|
||||
|
||||
-- DemPron : Quant -> Pron -> NP ;
|
||||
|
||||
-- EmphCN : CN -> CN ; --
|
||||
-- ContrastCN : CN -> CN ;
|
||||
-- ApposNPN : NP -> N -> NP ;
|
||||
-- ContrastNP : NP -> NP ;
|
||||
|
||||
-- DescrNP : CN -> NP -> CN ;
|
||||
-- PossLocNP : CN -> NP -> CN ;
|
||||
-- PossPronZul : CN -> Pron -> CN ; -- of you (yours)
|
||||
-- RelV : CN -> V -> Temp -> Pol -> CN ; -- lights that flash
|
||||
|
||||
PossLocNP : LocN -> NP -> CN ;
|
||||
|
||||
InstrNPAdv : NP -> Adv ; -- ngokuhlinzwa
|
||||
InstrAdvNPAdv : Adv -> NP -> Adv ; -- cishe ngehora
|
||||
LocNPAdv : NP -> Adv ; -- emahoreni
|
||||
LocAdvNPAdv : Adv -> NP -> Adv ; -- cishe emahoreni
|
||||
KwaNPAdv : NP -> Adv ; -- kwa-Laurette
|
||||
-- KwaAdvNPAdv : Adv -> NP -> Adv ; -- ngaphezu kwamahora amabili adlule
|
||||
KuNPAdv : NP -> Adv ; -- kwixesha [elingangeyure enye egqithileyo]
|
||||
KuAdvNPAdv : Adv -> NP -> Adv ; -- ngaphezu kwamahora amabili adlule
|
||||
NaNPAdv : NP -> Adv ;
|
||||
|
||||
-- InstrAdvNP : NP -> NP -> NP ; -- questions about your pregnancy
|
||||
|
||||
-- RelAdv : Adv -> RS ;
|
||||
|
||||
-- ProgVP : VP -> VP ;
|
||||
|
||||
-- QuantRS : QuantStem -> RS ; -- elilodwa
|
||||
-- RelRS : RelStem -> RS ; -- elibuhlungu
|
||||
|
||||
-- QuantCN : QuantStem -> CN -> CN ; -- izindlu zonke
|
||||
|
||||
-- NumAdjCN : CN -> A -> CN ;
|
||||
|
||||
only_QuantStem : QuantStem ;
|
||||
all_QuantStem : QuantStem ;
|
||||
-- all_pre_QuantStem : QuantStem ;
|
||||
-- all_pre_Predet : Predet ;
|
||||
|
||||
-- painful_RelStem : RelStem ;
|
||||
-- sharp_RelStem : RelStem ;
|
||||
|
||||
-- TPerfPast : Temp ;
|
||||
-- TPastPast : Temp ;
|
||||
-- TPresPres : Temp ;
|
||||
-- TPastPres : Temp ;
|
||||
-- TPastPerf : Temp ;
|
||||
-- TPerfPerf : Temp ;
|
||||
|
||||
-- PredNP : NP -> Cl ;
|
||||
-- IAdvQS : NP -> INAdv -> QS ; -- where is the wine? iwayini liphi?
|
||||
-- IAdvQCl : NP -> INAdv -> QCl ; -- where is the wine? iwayini liphi?
|
||||
|
||||
-- AdvQCl : Adv -> QCl -> QCl ;
|
||||
|
||||
-- ComplVAux : VAux -> VP -> VP ;
|
||||
|
||||
ConjNAdv : ConjN -> S -> Adv ; -- lapho kunobuhlungu khona
|
||||
|
||||
where_ConjN : ConjN ;
|
||||
|
||||
IAdvVP : VP -> IAdv -> VP ; -- kushisa kangakanani eGoli
|
||||
|
||||
it3_Pron : Pron ;
|
||||
they4_Pron : Pron ;
|
||||
it5_Pron : Pron ;
|
||||
they6_Pron : Pron ;
|
||||
it7_Pron : Pron ;
|
||||
they8_Pron : Pron ;
|
||||
it9_Pron : Pron ;
|
||||
they10_Pron : Pron ;
|
||||
it11_Pron : Pron ;
|
||||
it14_Pron : Pron ;
|
||||
it15_Pron : Pron ;
|
||||
it17_Pron : Pron ;
|
||||
|
||||
yonder_Quant : Quant ;
|
||||
|
||||
at_which_IAdv : NP -> IAdv ;
|
||||
what_IAdv : IAdv ;
|
||||
|
||||
-- about_NP_Adv : NP -> Adv ;
|
||||
|
||||
how_many_IAdj : IAdj ;
|
||||
|
||||
-- IAdjIAdv : NP -> IAdj -> IAdv ;
|
||||
|
||||
how_IComp : IComp ; -- -njani
|
||||
where_IComp : IComp ; -- -phi
|
||||
how_much_IComp : IComp ; -- -ngakanani
|
||||
|
||||
how2_IAdv : IAdv ;
|
||||
how8much2_IAdv : IAdv ;
|
||||
|
||||
phakathi_LocN : LocN ;
|
||||
phansi_LocN : LocN ;
|
||||
phesheya_LocN : LocN ;
|
||||
phandle_LocN : LocN ;
|
||||
phambili_LocN : LocN ;
|
||||
phambi_LocN : LocN ;
|
||||
phakade_LocN : LocN ;
|
||||
phezulu_LocN : LocN ;
|
||||
|
||||
lapha_Loc : Loc ;
|
||||
khona_Loc : Loc ;
|
||||
|
||||
kakhulu_Adv : Adv ;
|
||||
|
||||
-- Deverb15 : V -> N ;
|
||||
|
||||
-- AdvQS : IAdv -> S -> QS ; -- maybe it is a pain that burns 2020-01-15: consider that this should rather be dealt with using QuestIAdv)
|
||||
|
||||
}
|
||||
47
src/zulu/abstract_ext/NounExt.gf
Normal file
47
src/zulu/abstract_ext/NounExt.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
abstract NounExt = Cat,CatExt ** {
|
||||
|
||||
fun
|
||||
|
||||
-- Quant is used for demonstratives, and QuantStem for all/only
|
||||
|
||||
PronPostdetNP : Pron -> Postdet -> NP ;
|
||||
|
||||
QuantPostdet : QuantStem -> Postdet ;
|
||||
|
||||
DemPostdet : Quant -> Postdet ;
|
||||
|
||||
QuantDemPostdet : QuantStem -> Quant -> Postdet ;
|
||||
|
||||
DemQuantPostdet : Quant -> QuantStem -> Postdet ;
|
||||
|
||||
DetNum : Num -> Det ;
|
||||
|
||||
PostdetCN : CN -> Postdet -> Det -> NP ;
|
||||
|
||||
RelN : RS -> N -> CN ;
|
||||
|
||||
ApposCN : CN -> N -> CN ; -- (takes agr of CN)
|
||||
|
||||
ApposN : CN -> N -> CN ; -- (takes agr of N)
|
||||
|
||||
PredetN : Predet -> N -> CN ;
|
||||
|
||||
QuantPredet : QuantStem -> Predet ;
|
||||
|
||||
DemPredet : Quant -> Predet ;
|
||||
|
||||
QuantDemPredet : QuantStem -> Quant -> Predet ;
|
||||
|
||||
EmphCN : CN -> CN ; -- prepends emphatic pronoun
|
||||
|
||||
ContrastCN : CN -> CN ; -- inserts contrastive pronoun
|
||||
|
||||
UsePNPl : PN -> NP ;
|
||||
|
||||
Deverb15 : V -> N ;
|
||||
|
||||
LocNP : NP -> Loc ;
|
||||
|
||||
LocNLoc : LocN -> Loc ;
|
||||
|
||||
}
|
||||
66
src/zulu/abstract_ext/PChunk.gf
Normal file
66
src/zulu/abstract_ext/PChunk.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
abstract PChunk = Cat, CatExt, Symbol [Symb] ** {
|
||||
|
||||
cat
|
||||
Chunks ;
|
||||
Chunk ;
|
||||
Chunk_AP ;
|
||||
Chunk_Adv ;
|
||||
Chunk_S ;
|
||||
Chunk_RS ;
|
||||
Chunk_QS ;
|
||||
Chunk_CN ;
|
||||
Chunk_NP ;
|
||||
Chunk_N ;
|
||||
Chunk_Predet ;
|
||||
Chunk_Postdet ;
|
||||
Chunk_Symb ;
|
||||
VC ;
|
||||
|
||||
fun
|
||||
OneChunk : Chunk -> Chunks ;
|
||||
PlusChunk : Chunk -> Chunks -> Chunks ;
|
||||
ChunkPhr : Chunks -> Phr ;
|
||||
|
||||
-- AP_Chunker : Chunk_AP -> Chunk ;
|
||||
Adv_Chunker : Chunk_Adv -> Chunk ;
|
||||
S_Chunker : Chunk_S -> Chunk ;
|
||||
RS_Chunker : Chunk_RS -> Chunk ;
|
||||
QS_Chunker : Chunk_QS -> Chunk ;
|
||||
CN_Chunker : Chunk_CN -> Chunk ;
|
||||
NP_Chunker : Chunk_NP -> Chunk ;
|
||||
N_Chunker : Chunk_N -> Chunk ;
|
||||
Predet_Chunker : Chunk_Predet -> Chunk ;
|
||||
Postdet_Chunker : Chunk_Postdet -> Chunk ;
|
||||
Symb_Chunker : Chunk_Symb -> Chunk ;
|
||||
|
||||
-- AP_Chunk : AP -> Chunk_AP ;
|
||||
Adv_Chunk : Adv -> Chunk_Adv ;
|
||||
S_Chunk : S -> Chunk_S ;
|
||||
RS_Chunk : RS -> Chunk_RS ;
|
||||
QS_Chunk : QS -> Chunk_QS ;
|
||||
CN_Pl_Chunk : CN -> Chunk_CN ;
|
||||
CN_Sg_Chunk : CN -> Chunk_CN ;
|
||||
NP_Nom_Chunk : NP -> Chunk_NP ;
|
||||
NP_Gen_Chunk : NP -> Chunk_NP ;
|
||||
Predet_Chunk : Predet -> Chunk_Predet ;
|
||||
Postdet_Chunk : Postdet -> Chunk_Postdet ;
|
||||
-- N_Sg_Chunk : N -> Chunk_N ;
|
||||
-- N_Pl_Chunk : N -> Chunk_N ;
|
||||
|
||||
-- for unknown words that are not names
|
||||
|
||||
Symb_Chunk : Symb -> Chunk_Symb ;
|
||||
|
||||
-- chunks for punctuation marks
|
||||
fullstop_Chunk : Chunk ;
|
||||
exclmark_Chunk : Chunk ;
|
||||
questmark_Chunk : Chunk ;
|
||||
comma_Chunk : Chunk ;
|
||||
colon_Chunk : Chunk ;
|
||||
semicolon_Chunk : Chunk ;
|
||||
quote_Chunk : Chunk ;
|
||||
lpar_Chunk : Chunk ;
|
||||
rpar_Chunk : Chunk ;
|
||||
dash_Chunk : Chunk ;
|
||||
|
||||
}
|
||||
9
src/zulu/abstract_ext/TempExt.gf
Executable file
9
src/zulu/abstract_ext/TempExt.gf
Executable file
@@ -0,0 +1,9 @@
|
||||
abstract TempExt = Cat ** {
|
||||
|
||||
fun
|
||||
TPresTemp : Temp ;
|
||||
TPastTemp : Temp ;
|
||||
TFutTemp : Temp ;
|
||||
TRemFutTemp : Temp ;
|
||||
TRemPastTemp : Temp ;
|
||||
}
|
||||
17
src/zulu/abstract_ext/VerbExt.gf
Normal file
17
src/zulu/abstract_ext/VerbExt.gf
Normal file
@@ -0,0 +1,17 @@
|
||||
abstract VerbExt = Cat,CatExt ** {
|
||||
|
||||
fun
|
||||
|
||||
CopAP : AP -> VP ;
|
||||
CopNP : NP -> VP ;
|
||||
CopNPAssoc : NP -> VP ;
|
||||
CopLoc : Loc -> VP ;
|
||||
|
||||
-- BecomeAP : AP -> VP ;
|
||||
-- BecomeNP : NP -> VP ;
|
||||
-- BecomeNPAssoc : NP -> VP ;
|
||||
-- BecomeLoc : Loc -> VP ;
|
||||
|
||||
ComplV2Nonspec : V2 -> NP -> VP ;
|
||||
|
||||
}
|
||||
3
src/zulu/grammar_ext/DevLexLang.gf
Executable file
3
src/zulu/grammar_ext/DevLexLang.gf
Executable file
@@ -0,0 +1,3 @@
|
||||
abstract DevLexLang = NguniLang, DevLex ** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
5
src/zulu/grammar_ext/DevLexLangZul.gf
Executable file
5
src/zulu/grammar_ext/DevLexLangZul.gf
Executable file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:..:../../abstract:../../common:../../prelude:../abstract_ext:../lexica
|
||||
|
||||
concrete DevLexLangZul of DevLexLang =
|
||||
NguniLangZul,
|
||||
DevLexZul ** {} ;
|
||||
3
src/zulu/grammar_ext/MonoLexChunk.gf
Executable file
3
src/zulu/grammar_ext/MonoLexChunk.gf
Executable file
@@ -0,0 +1,3 @@
|
||||
abstract MonoLexChunk = NguniChunk,MonoLex ** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
5
src/zulu/grammar_ext/MonoLexChunkZul.gf
Executable file
5
src/zulu/grammar_ext/MonoLexChunkZul.gf
Executable file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:..:../../abstract:../../common:../../prelude:../abstract_ext:../lexica
|
||||
|
||||
concrete MonoLexChunkZul of MonoLexChunk =
|
||||
NguniChunkZul,
|
||||
MonoLexZul ** {} ;
|
||||
3
src/zulu/grammar_ext/MonoLexLang.gf
Executable file
3
src/zulu/grammar_ext/MonoLexLang.gf
Executable file
@@ -0,0 +1,3 @@
|
||||
abstract MonoLexLang = NguniLang,MonoLex ** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
5
src/zulu/grammar_ext/MonoLexLangZul.gf
Executable file
5
src/zulu/grammar_ext/MonoLexLangZul.gf
Executable file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:..:../../abstract:../../common:../../prelude:../abstract_ext:../lexica
|
||||
|
||||
concrete MonoLexLangZul of MonoLexLang =
|
||||
NguniLangZul,
|
||||
MonoLexZul ** {} ;
|
||||
3
src/zulu/grammar_ext/MultiLexChunk.gf
Normal file
3
src/zulu/grammar_ext/MultiLexChunk.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract MultiLexChunk = NguniChunk,MultiLex ** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
5
src/zulu/grammar_ext/MultiLexChunkZul.gf
Normal file
5
src/zulu/grammar_ext/MultiLexChunkZul.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:..:../../abstract:../../common:../../prelude:../abstract_ext:../lexica
|
||||
|
||||
concrete MultiLexChunkZul of MultiLexChunk =
|
||||
NguniChunkZul,
|
||||
MultiLexZul ** {} ;
|
||||
3
src/zulu/grammar_ext/MultiLexLang.gf
Normal file
3
src/zulu/grammar_ext/MultiLexLang.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract MultiLexLang = NguniLang,MultiLex ** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
5
src/zulu/grammar_ext/MultiLexLangZul.gf
Normal file
5
src/zulu/grammar_ext/MultiLexLangZul.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:..:../../abstract:../../common:../../prelude:../abstract_ext:../lexica
|
||||
|
||||
concrete MultiLexLangZul of MultiLexLang =
|
||||
NguniLangZul,
|
||||
MultiLexZul ** {} ;
|
||||
17
src/zulu/grammar_ext/NguniChunk.gf
Executable file
17
src/zulu/grammar_ext/NguniChunk.gf
Executable file
@@ -0,0 +1,17 @@
|
||||
--1 Lang: a Test Module for the Resource Grammar
|
||||
|
||||
abstract NguniChunk =
|
||||
NguniGrammar,
|
||||
Backward[ComplV2,ComplV3],
|
||||
ExtraExt,
|
||||
NounExt,
|
||||
VerbExt,
|
||||
-- MonoLexAbs,
|
||||
PChunk,
|
||||
Symbol - [Symb]
|
||||
-- ,Construction --- could be compiled here, but not in concretes, as they call Syntax and Grammar
|
||||
-- ,Documentation --# notpresent
|
||||
-- ,Markup - [stringMark]
|
||||
** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
20
src/zulu/grammar_ext/NguniChunkZul.gf
Executable file
20
src/zulu/grammar_ext/NguniChunkZul.gf
Executable file
@@ -0,0 +1,20 @@
|
||||
--# -path=.:../abstract:../common:../api:../prelude
|
||||
|
||||
concrete NguniChunkZul of NguniChunk =
|
||||
NguniGrammarZul,
|
||||
BackwardZul[ComplV2,ComplV3],
|
||||
ExtraExtZul,
|
||||
NounExtZul,
|
||||
VerbExtZul,
|
||||
-- MonoLexZul,
|
||||
PChunkZul,
|
||||
SymbolZul - [Symb]
|
||||
-- TempZul
|
||||
-- ,ConstructionZul
|
||||
-- ,DocumentationZul --# notpresent
|
||||
-- ,MarkupZul - [stringMark]
|
||||
** {
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
20
src/zulu/grammar_ext/NguniGrammar.gf
Executable file
20
src/zulu/grammar_ext/NguniGrammar.gf
Executable file
@@ -0,0 +1,20 @@
|
||||
-- All functions are explicitly inherited, in order to allow useful probabilities
|
||||
|
||||
abstract NguniGrammar =
|
||||
Noun [DetCN, UsePron, DetQuant, NumSg, NumPl, IndefArt, DefArt, UseN, AdjCN, RelCN, PossNP,UsePN, RelNP, PredetNP, MassNP], -- MassNP,AdvCN, AdvNP,
|
||||
Verb [UseV, ComplVS, ComplVA, SlashV2a, UseComp, AdvVP, CompAP, CompNP, CompAdv, ComplSlash],
|
||||
Adjective [PositA, AdAP],
|
||||
Adverb [PositAdvAdj, SubjS],
|
||||
-- Numeral,
|
||||
Sentence [PredVP, ImpVP, UseCl, UseQCl, UseRCl],
|
||||
Question [QuestCl, QuestIAdv, QuestIComp],
|
||||
Relative [RelVP, IdRP],
|
||||
-- Conjunction,
|
||||
Phrase [PhrUtt, UttS, UttQS, UttImpSg, NoPConj, NoVoc],
|
||||
Text - [Temp,Adv,IAdv],
|
||||
Structural [and_Conj,how_IAdv,how8much_IAdv,i_Pron,youSg_Pron,he_Pron,she_Pron,we_Pron,youPl_Pron,they_Pron,this_Quant,that_Quant,all_Predet,only_Predet,very_AdA],
|
||||
-- Idiom,
|
||||
Tense [PPos, PNeg],
|
||||
-- Transfer ,
|
||||
TempExt -- [TPresTemp, TPerfTemp, TPastTemp, TFutTemp, TPastPresTemp, TFutPresTemp, TPerfPerfTemp, TFutPerfTemp, TPerfPresTemp]
|
||||
;
|
||||
24
src/zulu/grammar_ext/NguniGrammarZul.gf
Executable file
24
src/zulu/grammar_ext/NguniGrammarZul.gf
Executable file
@@ -0,0 +1,24 @@
|
||||
-- All functions are explicitly inherited, in order to allow useful probabilities
|
||||
|
||||
concrete NguniGrammarZul of NguniGrammar =
|
||||
NounZul [DetCN, UsePron, DetQuant, NumSg, NumPl, IndefArt, DefArt, UseN, AdjCN, RelCN, PossNP,UsePN, RelNP, PredetNP, MassNP], -- MassNP, AdvCN,AdvNP,
|
||||
VerbZul [UseV, ComplVS, ComplVA, SlashV2a, UseComp, AdvVP, CompAP, CompNP, CompAdv, ComplSlash],
|
||||
AdjectiveZul [PositA, AdAP],
|
||||
AdverbZul [PositAdvAdj, SubjS],
|
||||
-- Numeral,
|
||||
SentenceZul [PredVP, ImpVP, UseCl, UseQCl, UseRCl],
|
||||
QuestionZul [QuestCl, QuestIAdv, QuestIComp],
|
||||
RelativeZul [RelVP, IdRP],
|
||||
-- Conjunction,
|
||||
PhraseZul [PhrUtt, UttS, UttQS, UttImpSg, NoPConj, NoVoc],
|
||||
TextX - [Temp,Adv,IAdv],
|
||||
StructuralZul [and_Conj,how_IAdv,how8much_IAdv,i_Pron,youSg_Pron,he_Pron,she_Pron,we_Pron,youPl_Pron,they_Pron,this_Quant,that_Quant,all_Predet,only_Predet,very_AdA],
|
||||
-- Idiom,
|
||||
TenseX [PPos,PNeg],
|
||||
-- Transfer ,
|
||||
TempExtZul -- [TPresTemp, TPerfTemp, TPastTemp, TFutTemp, TPastPresTemp, TFutPresTemp, TPerfPerfTemp, TFutPerfTemp, TPerfPresTemp]
|
||||
** open ResZul, Prelude in {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
17
src/zulu/grammar_ext/NguniLang.gf
Executable file
17
src/zulu/grammar_ext/NguniLang.gf
Executable file
@@ -0,0 +1,17 @@
|
||||
--1 Lang: a Test Module for the Resource Grammar
|
||||
|
||||
abstract NguniLang =
|
||||
NguniGrammar,
|
||||
Backward[ComplV2,ComplV3],
|
||||
ExtraExt,
|
||||
NounExt,
|
||||
VerbExt
|
||||
-- MonoLexAbs,
|
||||
-- Chunk
|
||||
-- Symbol - [Symb],
|
||||
-- ,Construction --- could be compiled here, but not in concretes, as they call Syntax and Grammar
|
||||
-- ,Documentation --# notpresent
|
||||
-- ,Markup - [stringMark]
|
||||
** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
20
src/zulu/grammar_ext/NguniLangZul.gf
Executable file
20
src/zulu/grammar_ext/NguniLangZul.gf
Executable file
@@ -0,0 +1,20 @@
|
||||
--# -path=.:../abstract:../common:../api:../prelude
|
||||
|
||||
concrete NguniLangZul of NguniLang =
|
||||
NguniGrammarZul,
|
||||
BackwardZul[ComplV2,ComplV3],
|
||||
ExtraExtZul,
|
||||
NounExtZul,
|
||||
VerbExtZul
|
||||
-- MonoLexZul,
|
||||
-- ChunkZul,
|
||||
-- SymbolZul - [Symb],
|
||||
-- TempZul
|
||||
-- ,ConstructionZul
|
||||
-- ,DocumentationZul --# notpresent
|
||||
-- ,MarkupZul - [stringMark]
|
||||
** {
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
258
src/zulu/grammar_ext/NguniSyntax.gf
Executable file
258
src/zulu/grammar_ext/NguniSyntax.gf
Executable file
@@ -0,0 +1,258 @@
|
||||
incomplete resource NguniSyntax =
|
||||
open Grammar,ExtraZulAbs,Backward,TempAbs
|
||||
|
||||
in {
|
||||
|
||||
oper
|
||||
|
||||
mkUtt = overload {
|
||||
mkUtt : S -> Utt
|
||||
= UttS ;
|
||||
mkUtt : QS -> Utt
|
||||
= UttQS ;
|
||||
mkUtt : Pol -> Imp -> Utt
|
||||
= UttImpSg ;
|
||||
mkUtt : Imp -> Utt
|
||||
= UttImpSg PPos
|
||||
} ;
|
||||
|
||||
mkImp = overload {
|
||||
mkImp : VP -> Imp
|
||||
= ImpVP ;
|
||||
} ;
|
||||
|
||||
mkS = overload {
|
||||
mkS : Temp -> Pol -> Cl -> S
|
||||
= UseCl ;
|
||||
mkS : Pol -> Cl -> S
|
||||
= UseCl TPresTemp ;
|
||||
mkS : Temp -> Cl -> S
|
||||
= \t -> UseCl t PPos ;
|
||||
mkS : Cl -> S
|
||||
= UseCl TPresTemp PPos
|
||||
} ;
|
||||
|
||||
mkQS = overload {
|
||||
mkQS : Temp -> Pol -> QCl -> QS
|
||||
= UseQCl ;
|
||||
mkQS : Pol -> QCl -> QS
|
||||
= UseQCl TPresTemp ;
|
||||
mkQS : Temp -> QCl -> QS
|
||||
= \t -> UseQCl t PPos ;
|
||||
mkQS : QCl -> QS
|
||||
= UseQCl TPresTemp PPos -- ;
|
||||
-- mkQS : Adv -> QS -> QS
|
||||
-- = AdvQS ;
|
||||
} ;
|
||||
|
||||
potQS = overload {
|
||||
potQS : Pol -> QCl -> QS
|
||||
= PotQS
|
||||
} ;
|
||||
|
||||
positivePol : Pol
|
||||
= PPos ;
|
||||
negativePol : Pol
|
||||
= PNeg ;
|
||||
|
||||
presentTense : Temp
|
||||
= TPresTemp ;
|
||||
perfectTense : Temp
|
||||
= TPerfTemp ;
|
||||
pastTense : Temp
|
||||
= TPastTemp ;
|
||||
futureTense : Temp
|
||||
= TFutTemp ;
|
||||
|
||||
mkCl = overload {
|
||||
mkCl : NP -> VP -> Cl
|
||||
= PredVP ;
|
||||
mkCl : NP -> V -> Cl
|
||||
= \np,v -> PredVP np (UseV v) ;
|
||||
mkCl : NP -> V2 -> NP -> Cl
|
||||
= \np,v,obj -> PredVP np (ComplV2 v obj) ;
|
||||
-- mkCl : NP -> AP -> Cl
|
||||
-- = \np,ap -> PredVP np (UseAP ap) ;
|
||||
-- mkCl : NP -> A -> Cl
|
||||
-- = \np,a -> PredVP np (UseAP (PositA a)) ;
|
||||
mkCl : NP -> Cl
|
||||
= PredNP
|
||||
} ;
|
||||
|
||||
mkQCl = overload {
|
||||
mkQCl : Cl -> QCl
|
||||
= QuestCl ;
|
||||
-- mkQCl : NP -> IAdv -> QCl
|
||||
-- = IAdvQCl ;
|
||||
mkQCl : IAdv -> Cl -> QCl
|
||||
= QuestIAdv
|
||||
-- mkQCl : Adv -> QCl -> QCl
|
||||
-- = AdvQCl
|
||||
} ;
|
||||
|
||||
mkVP = overload {
|
||||
mkVP : V -> VP
|
||||
= UseV ;
|
||||
mkVP : V2 -> NP -> VP
|
||||
= ComplV2 ;
|
||||
mkVP : V3 -> NP -> NP -> VP
|
||||
= ComplV3 ;
|
||||
mkVP : NP -> VP
|
||||
= \np -> UseComp (CompNP np) ;
|
||||
mkVP : Adv -> VP
|
||||
= \adv -> UseComp (CompAdv adv) ;
|
||||
mkVP : AP -> VP
|
||||
= \ap -> UseComp (CompAP ap) ;
|
||||
mkVP : VP -> Adv -> VP
|
||||
= AdvVP ;
|
||||
mkVP : VA -> AP -> VP
|
||||
= ComplVA ;
|
||||
mkVP : VS -> S -> VP
|
||||
= ComplVS ;
|
||||
mkVP : VAux -> VP -> VP
|
||||
= ComplVAux
|
||||
} ;
|
||||
|
||||
assocVP = overload {
|
||||
assocVP : NP -> VP
|
||||
= AssocCop
|
||||
} ;
|
||||
|
||||
eqVP = overload {
|
||||
eqVP : NP -> VP
|
||||
= EqCop
|
||||
} ;
|
||||
|
||||
-- progVP = overload {
|
||||
-- progVP : VP -> VP
|
||||
-- = ProgVP
|
||||
-- } ;
|
||||
|
||||
mkNP = overload {
|
||||
mkNP : Det -> CN -> NP
|
||||
= DetCN ;
|
||||
mkNP : Det -> N -> NP
|
||||
= \det,n -> DetCN det (UseN n) ;
|
||||
mkNP : Pron -> NP
|
||||
= UsePron ;
|
||||
mkNP : CN -> NP
|
||||
= \cn -> DetCN (DetQuant IndefArt NumSg) cn ;
|
||||
mkNP : N -> NP
|
||||
= \n -> DetCN (DetQuant IndefArt NumSg) (UseN n) ;
|
||||
-- mkNP : NP -> Conj -> NP -> NP
|
||||
-- = \np1,conj,np2 -> ConjNP np1 conj np2 ;
|
||||
mkNP : QuantStem -> CN -> NP
|
||||
= QuantCN ;
|
||||
mkNP : NP -> Adv -> NP
|
||||
= AdvNP
|
||||
} ;
|
||||
|
||||
i_NP : NP
|
||||
= UsePron i_Pron ;
|
||||
you_NP : NP
|
||||
= UsePron youSg_Pron ;
|
||||
-- he_NP : NP
|
||||
-- = UsePron he_Pron ;
|
||||
-- she_NP : NP
|
||||
-- = UsePron she_Pron ;
|
||||
|
||||
mkCN = overload {
|
||||
mkCN : N -> CN
|
||||
= UseN ;
|
||||
mkCN : AP -> CN -> CN
|
||||
= AdjCN ;
|
||||
mkCN : A -> N -> CN
|
||||
= \a,n -> AdjCN (PositA a) (UseN n) ;
|
||||
mkCN : A -> CN -> CN
|
||||
= \a,cn -> AdjCN (PositA a) cn ;
|
||||
mkCN : Adv -> CN -> CN
|
||||
= \adv,cn -> AdvCN cn adv ;
|
||||
mkCN : CN -> RS -> CN
|
||||
= RelCN ;
|
||||
mkCN : CN -> NP -> CN
|
||||
= PossNP ;
|
||||
mkCN : N -> NP -> CN
|
||||
= \n,np -> PossNP (UseN n) np
|
||||
-- mkCN : CN -> Pron -> CN
|
||||
-- = PossPron ;
|
||||
} ;
|
||||
|
||||
numCN = overload {
|
||||
numCN : CN -> A -> CN
|
||||
= NumAdjCN ;
|
||||
} ;
|
||||
|
||||
-- descrCN : CN -> NP -> CN = DescrNP ;
|
||||
|
||||
mkAP = overload {
|
||||
mkAP : A -> AP
|
||||
= PositA ;
|
||||
mkAP : AdA -> AP -> AP
|
||||
= AdAP
|
||||
} ;
|
||||
|
||||
mkAdv = overload {
|
||||
mkAdv : NP -> Adv
|
||||
= \np -> LocNPAdv np ;
|
||||
-- mkAdv : ConjN -> S -> Adv
|
||||
-- = \conj,s -> ConjAdv conj s ;
|
||||
mkAdv : Subj -> S -> Adv
|
||||
= SubjS ;
|
||||
mkAdv : A -> Adv
|
||||
= PositAdvAdj
|
||||
} ;
|
||||
|
||||
instrAdv = overload {
|
||||
instrAdv : NP -> Adv
|
||||
= \np -> InstrNPAdv np ;
|
||||
instrAdv : Adv -> NP -> Adv
|
||||
= InstrAdvNPAdv
|
||||
} ;
|
||||
|
||||
locAdv = overload {
|
||||
locAdv : NP -> Adv
|
||||
= \np -> LocNPAdv np ;
|
||||
locAdv : Adv -> NP -> Adv
|
||||
= \adv,np -> LocAdvNPAdv adv np
|
||||
} ;
|
||||
|
||||
kwaAdv = overload {
|
||||
kwaAdv : Adv -> NP -> Adv
|
||||
= \adv,np -> KwaNPAdv adv np
|
||||
} ;
|
||||
|
||||
kuAdv = overload {
|
||||
kuAdv : NP -> Adv
|
||||
= \np -> KuNPAdv np ;
|
||||
-- kuAdv : Adv -> NP -> Adv
|
||||
-- = \adv,np -> KuAdvNPAdv adv np
|
||||
} ;
|
||||
|
||||
assocAdv = overload {
|
||||
assocAdv : NP -> Adv
|
||||
= NaNPAdv
|
||||
} ;
|
||||
|
||||
relAdv = overload {
|
||||
relAdv : Adv -> RS
|
||||
= \adv -> RelAdv adv
|
||||
} ;
|
||||
|
||||
mkRS = overload {
|
||||
mkRS : QuantStem -> RS
|
||||
= QuantRS ;
|
||||
mkRS : RelStem -> RS
|
||||
= RelRS ;
|
||||
mkRS : Temp -> Pol -> VP -> RS
|
||||
= \t,p,vp -> UseRCl t p (RelVP IdRP vp) ;
|
||||
mkRS : VP -> RS
|
||||
= \vp -> UseRCl TPresTemp PPos (RelVP IdRP vp)
|
||||
} ;
|
||||
|
||||
aPl_Det : Det
|
||||
= DetQuant IndefArt NumPl ;
|
||||
|
||||
-- mkSymb : Symb
|
||||
-- = MkSymb ;
|
||||
|
||||
}
|
||||
10
src/zulu/grammar_ext/NguniSyntaxZul.gf
Executable file
10
src/zulu/grammar_ext/NguniSyntaxZul.gf
Executable file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:../zulu:../abstract
|
||||
|
||||
resource NguniSyntaxZul =
|
||||
GrammarZul,
|
||||
ExtraZul ** --- inheriting everything from Grammar, not just Cat and Structural
|
||||
NguniSyntax with
|
||||
(Grammar=GrammarZul),
|
||||
(ExtraZulAbs=ExtraZul),
|
||||
(Backward=BackwardZul),
|
||||
(TempAbs=TempZul) ;
|
||||
83
src/zulu/lexica/DevLex.gf
Executable file
83
src/zulu/lexica/DevLex.gf
Executable file
@@ -0,0 +1,83 @@
|
||||
abstract DevLex = Cat ** {
|
||||
|
||||
fun
|
||||
-- adjective stems
|
||||
bana_A : A ;
|
||||
bi_A : A ;
|
||||
bili_A : A ;
|
||||
dala_A : A ;
|
||||
hle_A : A ;
|
||||
khulu_A : A ;
|
||||
ningi_A : A ;
|
||||
de_A : A ;
|
||||
|
||||
-- relative stems
|
||||
mnandi_R : A ;
|
||||
nzima_R : A ;
|
||||
mbalwa_R : A ;
|
||||
qotho_R : A ;
|
||||
mhlophe_R : A ;
|
||||
mbe_R : A ;
|
||||
mnyama_R : A ;
|
||||
|
||||
-- enumerative stems
|
||||
mbe_E : A ;
|
||||
nye_E : A ;
|
||||
|
||||
-- noun stems
|
||||
|
||||
ntu_1_2_N : N ;
|
||||
fana_1_2_N : N ;
|
||||
fundi_1_2_N : N ;
|
||||
bhubesi_5_6_N : N ;
|
||||
phoyisa_5_6_N : N ;
|
||||
jele_5_6_N : N ;
|
||||
hlahla_7_8_N : N ;
|
||||
ncwadi_9_10_N : N ;
|
||||
ndlu_9_10_N : N ;
|
||||
komo_9_10_N : N ;
|
||||
taba_9_10_N : N ;
|
||||
ngane_9_10_N : N ;
|
||||
doda_9_10_N : N ;
|
||||
moto_9_10_N : N ;
|
||||
John_PN : PN ;
|
||||
John_1a_2a_N : N ;
|
||||
nkonyana_5_6_N : N ;
|
||||
lwane_7_8_N : N ;
|
||||
sila_3_4_N : N ;
|
||||
khova_7_8_N : N ;
|
||||
tombi_9_10_N : N ;
|
||||
khaya_5_6_N : N ;
|
||||
|
||||
Tatjana_PN : PN ;
|
||||
medal_N : N ;
|
||||
gold_N : N ;
|
||||
day_N : N ;
|
||||
swimmer_N : N ;
|
||||
majority_N : N ;
|
||||
|
||||
-- verb roots
|
||||
ab_V : V ;
|
||||
ab_V2 : V2 ;
|
||||
aban_V : V ;
|
||||
aban_V2 : V2 ;
|
||||
bon_V2 : V2 ;
|
||||
hamb_V : V ;
|
||||
sh_V : V ;
|
||||
-- th_V : V ;
|
||||
eq_V : V ;
|
||||
ehl_V : V ;
|
||||
f_V : V ;
|
||||
|
||||
be_hot_V : V ;
|
||||
be_healthy_V : V ;
|
||||
be_fast_V : V ;
|
||||
|
||||
win_V2 : V2 ;
|
||||
|
||||
ngaphezu_Adv : Adv ;
|
||||
-- kakhulu_AdA : AdA ;
|
||||
|
||||
lapho_Adv : Adv ;
|
||||
|
||||
}
|
||||
81
src/zulu/lexica/DevLexZul.gf
Executable file
81
src/zulu/lexica/DevLexZul.gf
Executable file
@@ -0,0 +1,81 @@
|
||||
concrete DevLexZul of DevLex = CatZul ** open ResZul,ParadigmsZul in {
|
||||
|
||||
lin
|
||||
-- adjective stems
|
||||
bana_A = mkA "bana" ;
|
||||
bi_A = mkA "bi" ;
|
||||
bili_A = mkA "bili" ;
|
||||
dala_A = mkA "dala" ;
|
||||
hle_A = mkA "hle" ;
|
||||
khulu_A = mkA "khulu" ;
|
||||
ningi_A = mkA "ningi" ;
|
||||
de_A = mkA "de" ;
|
||||
|
||||
-- relative stems
|
||||
mnandi_R = mkRelA "mnandi" ;
|
||||
nzima_R = mkRelA "nzima" ;
|
||||
mbalwa_R = mkRelA "mbalwa" ;
|
||||
qotho_R = mkRelA "qotho" ;
|
||||
mhlophe_R = mkRelA "mhlophe" ;
|
||||
mbe_R = mkRelA "mbe" ;
|
||||
mnyama_R = mkRelA "mnyama" ;
|
||||
|
||||
-- enumerative stems
|
||||
mbe_E = mkA "mbe" ;
|
||||
nye_E = mkA "nye" ;
|
||||
|
||||
-- noun stems
|
||||
ntu_1_2_N = mkN "ntu" C1_2 ;
|
||||
fana_1_2_N = mkN "fana" C1_2 ;
|
||||
fundi_1_2_N = mkN "fundi" C1_2 ;
|
||||
bhubesi_5_6_N = mkN "bhubesi" C5_6 ;
|
||||
phoyisa_5_6_N = mkN "phoyisa" C5_6 ;
|
||||
jele_5_6_N = mkN "jele" "ejele" "emajele" C5_6 ;
|
||||
hlahla_7_8_N = mkN "hlahla" C7_8 ;
|
||||
ncwadi_9_10_N = mkN "ncwadi" C9_10 ;
|
||||
ndlu_9_10_N = mkN "ndlu" C9_10 ;
|
||||
komo_9_10_N = mkN "komo" C9_10 ;
|
||||
taba_9_10_N = mkN "taba" C9_10 ;
|
||||
ngane_9_10_N = mkN "ngane" C9_10 ;
|
||||
doda_9_10_N = mkN "doda" C9_10 ;
|
||||
moto_9_10_N = mkN "moto" C9_10 ;
|
||||
John_PN = mkPN "John" C1a_2a ;
|
||||
John_1a_2a_N = mkN "John" C1a_2a ;
|
||||
Goli_PN = mkPN "Goli" C5_6 ;
|
||||
nkonyana_5_6_N = mkN "nkonyana" C5_6 ;
|
||||
lwane_7_8_N = mkN "lwane" C7_8 ;
|
||||
sila_3_4_N = mkN "sila" C3_4 ;
|
||||
khova_7_8_N = mkN "khova" C7_8 ;
|
||||
tombi_9_10_N = mkN "tombi" C9_10 ;
|
||||
khaya_5_6_N = mkELocN "khaya" C5_6 ;
|
||||
|
||||
Tatjana_PN = mkPN "Tatjana" C1a_2a ;
|
||||
medal_N = mkN "dondo" C9_10 ;
|
||||
gold_N = mkN "golide" C5_6 ;
|
||||
day_N = mkN "suku" C11_10 ;
|
||||
swimmer_N = mkN "hlambi" C9_10 ;
|
||||
majority_N = mkN "ningi" C5_6 ;
|
||||
|
||||
-- verb roots
|
||||
ab_V = mkV "ab" ;
|
||||
ab_V2 = mkV2 "ab" ;
|
||||
aban_V = mkV "aban" ;
|
||||
aban_V2 = mkV2 "aban" ;
|
||||
bon_V2 = mkV2 "bon" ;
|
||||
hamb_V = mkV "hamb" ;
|
||||
sh_V = mkV "sh" ;
|
||||
eq_V = mkV "eq" ;
|
||||
ehl_V = mkV "ehl" ;
|
||||
f_V = mkV "f" ;
|
||||
|
||||
be_hot_V = mkV "shis" ;
|
||||
be_healthy_V = mkV "phil" ;
|
||||
be_fast_V = mkV "shes" ;
|
||||
|
||||
win_V2 = mkV2 "zuz" ;
|
||||
|
||||
ngaphezu_Adv = mkAdv "ngaphezu" ;
|
||||
-- kakhulu_AdA = { s = "kakhulu" } ;
|
||||
|
||||
lapho_Adv = mkAdv "lapho" ;
|
||||
}
|
||||
16976
src/zulu/lexica/MonoLex.gf
Executable file
16976
src/zulu/lexica/MonoLex.gf
Executable file
File diff suppressed because it is too large
Load Diff
16976
src/zulu/lexica/MonoLexZul.gf
Executable file
16976
src/zulu/lexica/MonoLexZul.gf
Executable file
File diff suppressed because it is too large
Load Diff
1150
src/zulu/lexica/MultiLex.gf
Normal file
1150
src/zulu/lexica/MultiLex.gf
Normal file
File diff suppressed because it is too large
Load Diff
1152
src/zulu/lexica/MultiLexZul.gf
Normal file
1152
src/zulu/lexica/MultiLexZul.gf
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
abstract TestLang =
|
||||
Grammar,
|
||||
Grammar - [SlashVP, RelSlash],
|
||||
TestLexiconGerAbs
|
||||
-- , Construction
|
||||
, Construction
|
||||
** {
|
||||
flags startcat=Phr ;
|
||||
|
||||
@@ -32,4 +32,12 @@ abstract TestLang =
|
||||
Pass2V3 : V3 -> NP -> VP ; -- uns erklärt werden ; Eng give_V3[indir,dir]: we are given the book
|
||||
|
||||
Pass2V4 : V4 -> NP -> VPSlash ; -- bei dir (für Gold) gekauft werden
|
||||
|
||||
cat
|
||||
ClauseSlash ;
|
||||
|
||||
fun
|
||||
RelSlash : RP -> ClauseSlash -> RCl ;
|
||||
SlashVP : NP -> VPSlash -> ClauseSlash ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
concrete TestLangEng of TestLang =
|
||||
GrammarEng
|
||||
, TestLexiconEng
|
||||
-- , ConstructionEng
|
||||
, ConstructionEng
|
||||
** open (R=ResEng), (P=ParadigmsEng), Prelude, (E=ExtendEng)
|
||||
in {
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
-- use the modified files in gf-rgl/src/german
|
||||
|
||||
concrete TestLangGer of TestLang =
|
||||
GrammarGer - [PassV2] -- to improve these ,ComplVV,SlashVV,SlashV2V,SlashV2VNP
|
||||
, TestLexiconGer - [helfen_V2V, warnen_V2V, versprechen_dat_V2V, lassen_V2V]
|
||||
-- , ConstructionGer -- needs SlashV2VNP of VerbGer
|
||||
GrammarGer - [SlashVP, RelSlash]
|
||||
, TestLexiconGer
|
||||
, ConstructionGer
|
||||
** open ResGer,Prelude,(P=ParadigmsGer) in {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
@@ -27,147 +27,222 @@ concrete TestLangGer of TestLang =
|
||||
ReflVPSlash v3 = -- reflexive use of v:V3, untested
|
||||
(insertObjRefl (predVc v3) ** {c2 = v3.c3});
|
||||
|
||||
PassV2 v = -- insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ;
|
||||
let c = case <v.c2.c, v.c2.isPrep> of {
|
||||
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} -- acc object -> nom; all others: same PCase
|
||||
in insertObjc (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { subjc = v.c2 ** {c = c} } ;
|
||||
|
||||
PassV2Q v q =
|
||||
PassV2Q v q =
|
||||
let c = case <v.c2.c, v.c2.isPrep> of {
|
||||
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject
|
||||
vp = insertObjc (\\_ => v.s ! VPastPart APred) (predV werdenPass)
|
||||
** { subjc = v.c2 ** {c = c} }
|
||||
vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
|
||||
** { c1 = v.c2 ** {c = c} }
|
||||
in insertExtrapos (bindComma ++ q.s ! QIndir) vp ;
|
||||
|
||||
PassV2S v s =
|
||||
PassV2S v s =
|
||||
let c = case <v.c2.c, v.c2.isPrep> of {
|
||||
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject
|
||||
vp = insertObjc (\\_ => v.s ! VPastPart APred) (predV werdenPass)
|
||||
** { subjc = v.c2 ** {c = c} }
|
||||
vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
|
||||
** { c1 = v.c2 ** {c = c} }
|
||||
in insertExtrapos (bindComma ++ conjThat ++ s.s ! Sub) vp ;
|
||||
|
||||
PassV2V v vp =
|
||||
let c = case <v.c2.c, v.c2.isPrep> of {
|
||||
let
|
||||
inf = mkInf v.isAux Simul Pos vp ; -- ok for v.isAux=False, v.c2.c=Acc
|
||||
c = case <v.c2.c, v.c2.isPrep> of { -- v.objCtrl=True HL 3/22
|
||||
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject
|
||||
vp2 = insertObjc (\\_ => v.s ! VPastPart APred) (predV werdenPass)
|
||||
** { subjc = v.c2 ** {c = c} }
|
||||
in insertExtrapos (bindComma ++ (useInfVP False vp)) vp2 ; -- misses subject agr for vp = ReflVP vps
|
||||
{-
|
||||
vp2 = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
|
||||
** { c1 = v.c2 ** {c = c} } ;
|
||||
in insertInf inf vp2 ; -- v=lassen needs in-place inf instead
|
||||
|
||||
PassVPSlash vp =
|
||||
let c = case <vp.c2.c,vp.c2.isPrep> of {
|
||||
<NPC Acc, False> => NPC Nom ; _ => vp.c2.c}
|
||||
in insertObjc (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass)
|
||||
** {ext = vp.ext ; subjc = vp.c2 ** {c = c}} ;
|
||||
-- regulates passivised object: accusative objects -> nom; all others: same case
|
||||
-- this also gives "mit dir wird gerechnet" ;
|
||||
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
||||
-- HL: does not work for vp = (Slash2V3 v np): uns wird den Beweis erklärt
|
||||
-- vp = (SlashV2V v2v reflVP): wir werden gebeten, uns zu fragen , ob S
|
||||
<NPC Acc, False> => NPC Nom ; _ => vp.c2.c} ;
|
||||
ctrl = case vp.objCtrl of { True => False ; _ => True } -- always False?
|
||||
in -- insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass ** {c1 = vp.c2 ** {c = c}})
|
||||
insertObj (\\_ => vp.s.s ! (VPastPart APred))
|
||||
(predV werdenPass ** {nn = vp.nn ; c1 = vp.c2 ** {c = c}})
|
||||
** {ext = vp.ext ; inf = vp.inf ; c2 =vp.c2 ; objCtrl = ctrl } ; -- c2 ?
|
||||
-- Scharolta: passivised object: acc object -> nom subject; all others: same case/prep
|
||||
-- HL: does not work for vp = (Slash2V3 v np): uns wird *den Beweis erklärt
|
||||
-- 3/22 works for vp = (SlashV2V v2v reflVP): wir werden gebeten, uns zu waschen
|
||||
|
||||
PastPartAP vp = {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++
|
||||
(vp.nn ! agrP3 Sg).p3 ++ (vp.nn ! agrP3 Sg).p4 ++ vp.adj ++ vp.a2
|
||||
++ vp.inf.s ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
++ vp.inf.inpl.p2 ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
adj = [] ;
|
||||
ext = vp.ext
|
||||
ext = (vp.inf.extr ! agrP3 Sg) ++ vp.ext -- HL 5/4/2022
|
||||
} ;
|
||||
-}
|
||||
|
||||
Pass2V3 v np = -- HL 7/19: making the (active) direct object to the (passive) subject
|
||||
let vps = insertObjc (\\_ => (v.s ! VPastPart APred)) (predV werdenPass)
|
||||
** { subjc = PrepNom ; c2 = v.c3 }
|
||||
in insertObjNP np vps.c2 vps ;
|
||||
let vps = insertObj (\\_ => (v.s ! VPastPart APred)) (predV werdenPass)
|
||||
** { c1 = PrepNom ; c2 = v.c3 }
|
||||
in insertObjNP np vps.c2 (vps ** {objCtrl = False});
|
||||
|
||||
Pass3V3 v np = -- HL 7/19: making the (active) indirect object to the (passive) subject
|
||||
let bekommen : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen") ;
|
||||
vps = insertObjc (\\_ => (v.s ! VPastPart APred)) (predV bekommen)
|
||||
** { subjc = PrepNom ; c2 = v.c2 }
|
||||
in insertObjNP np vps.c2 vps ;
|
||||
vps = insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommen)
|
||||
** { c1 = PrepNom ; c2 = v.c2 }
|
||||
in insertObjNP np vps.c2 (vps ** {objCtrl = False});
|
||||
{-
|
||||
Pass2V4 v np =
|
||||
let vps = -- : VPSlashSlash =
|
||||
insertObj (\\_ => (v.s ! VPastPart APred)) (predV werdenPass)
|
||||
** { subjc = PrepNom ; c2 = v.c3 ; c3 = v.c4 }
|
||||
** { c1 = PrepNom ; c2 = v.c3 ; c3 = v.c4 }
|
||||
in (insertObjNP np vps.c3 vps) ;
|
||||
|
||||
-- Todo: Pass?V2S, Pass?V2Q, PassVS, PassVQ Pass?V2V
|
||||
-}
|
||||
|
||||
SlashV2Vneg v vp = -- versprechen, (\agr => sich!agr es nicht zu merken)
|
||||
SlashV2Vneg v vp = -- HL 3/22
|
||||
let
|
||||
vps = (predVGen v.isAux v) ** { c2 = v.c2 } ; --; ctrl = v.ctrl } ;
|
||||
vpi = infzuVP v.isAux v.ctrl Simul Neg vp ;
|
||||
comma = case orB vp.isAux (case vp.inf.ctrl of { NoC => True ; _ => False }) of {True => [] ; _ => bindComma} ;
|
||||
embeddedInf : Agr => Str = case vp.inf.isAux of {
|
||||
True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- ihn es lesen (zu) lassen
|
||||
False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- ihn (zu) bitten , es zu lesen
|
||||
in
|
||||
insertExtrapos vpi.ext (
|
||||
insertInf vpi.pred (
|
||||
insertInfExtraObj vpi.objs (
|
||||
insertInfExtraInf embeddedInf vps))) ;
|
||||
|
||||
lin -- with param Control in ../../src/german/ParadigmsGer.gf
|
||||
helfen_V2V = P.mkV2V (P.irregV "helfen" "hilft" "half" "hälfe" "geholfen") P.datPrep ;
|
||||
warnen_V2V = P.mkV2V (P.regV "warnen") P.accPrep ;
|
||||
versprechen_dat_V2V =
|
||||
P.subjV2V (P.mkV2V (P.irregV "versprechen" "verspricht" "versprach" "verspräche" "versprochen") P.datPrep) ;
|
||||
lassen_V2V = P.auxV2V (P.irregV "lassen" "lasst" "ließ" "ließe" "gelassen") P.accPrep ; -- lasse dich (*zu) arbeiten
|
||||
vps = (predVGen v.isAux v) ;
|
||||
inf = mkInf v.isAux Simul Neg vp
|
||||
in
|
||||
insertExtrapos vp.ext (
|
||||
insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ;
|
||||
|
||||
-- SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
|
||||
-- -- (the book) that (she (begged:V2V me:NP (to buy ()):VPSlash):VPSlash):ClSlash
|
||||
|
||||
-- very expensive:
|
||||
-- + SlashV2V 2332800 (6480,40)
|
||||
-- + SlashV2VNP 2267481600 (4320,270) vs. (1080,90) in VerbGer, 305460 msec
|
||||
-- Languages: TestLangGer
|
||||
-- 623657 msec
|
||||
{-
|
||||
SlashV2VNP v np vp =
|
||||
let
|
||||
vps = (predVGen v.isAux v) ** { c2 = vp.c2 } ; -- objCtrl =
|
||||
vpi = infzuVP v.isAux v.ctrl Simul Pos vp ;
|
||||
-- comma = case <vp.isAux,vp.inf.ctrl> of { <True,_> => [] ; <_,NoC> => [] ; _ => bindComma} ;
|
||||
embeddedInf : Agr => Str =
|
||||
\\agr => "[" ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ++ "]";
|
||||
-- embeddedInf : Agr => Str = case vp.inf.isAux of {
|
||||
-- True => \\agr => comma ++ (vp.nn!agr).p5 ++ (vp.nn!agr).p6 ++ vpi.inf ; -- ihn es lesen (zu) lassen
|
||||
-- False => \\agr => comma ++ (vp.nn!agr).p5 ++ vpi.inf ++ (vp.nn!agr).p6 } -- ihn (zu) bitten , es zu lesen
|
||||
in
|
||||
insertExtrapos vpi.ext ( -- vps.ext <- vp's object-sentence ++ extractedInfzu?
|
||||
insertInf vpi.pred ( -- vps.inf <- vp's infinite main verb
|
||||
insertInfExtraObj vpi.objs ( -- vps.nn.p5 <- vp's object nps
|
||||
insertInfExtraInf embeddedInf (
|
||||
insertObjNP np v.c2 vps )))) ;
|
||||
-}
|
||||
-- 3/22 expensive: |NP|=54, |Prep|=|18|, |V2|=180, |V2V|=720, |VP|=360, |VPSlash|=12.290 (!)
|
||||
-- i -v -src TestLangGer.gf
|
||||
-- + ComplSlash 699840 (355680,532)
|
||||
-- + SlashV2V 259200 (1440,20)
|
||||
-- + SlashV2VNP 503884800 (77760,540)
|
||||
-- 243273 msec
|
||||
|
||||
{-
|
||||
TestLang> p "the book that we beg her to promise him to read" | l
|
||||
the book that we beg her to promise him to read
|
||||
das Buch , das wir sie bitten , ihn zu versprechen [ [ ] zu lesen ]
|
||||
das Buch , das wir sie bitten , ihm zu versprechen , zu lesen
|
||||
|
||||
TestLang> p "the book that we beg her to beg him to read" | l
|
||||
the book that we beg her to beg him to read
|
||||
das Buch , das wir sie bitten , ihn zu bitten [ [ ] zu lesen ]
|
||||
das Buch , das wir sie bitten , ihn zu bitten , zu lesen
|
||||
|
||||
TestLang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (UsePron we_Pron) (SlashV2VNP versprechen_dat_V2V (UsePron she_Pron) (SlashV2a read_V2))))))
|
||||
TestLangEng: the book that we promise her to read
|
||||
TestLangGer: das Buch , dem wir ihr versprechen , zu lesen Bug: dem => das
|
||||
TestLangGer: das Buch , das wir ihr versprechen , zu lesen
|
||||
|
||||
TestLang> p "the book that we beg her to sell to him" | l
|
||||
the book that we beg her to sell to him
|
||||
das Buch , das wir ihm sie bitten , zu verkaufen
|
||||
=> das Buch , das wir sie bitten , ihm zu verkaufen
|
||||
das Buch , das wir sie bitten , ihm zu verkaufen
|
||||
|
||||
p -lang=Ger "das Kind , auf das wir ihn bitten , zu warten ," | l
|
||||
the child that we beg him to wait for
|
||||
das Kind , auf das wir ihn bitten , zu warten
|
||||
|
||||
pied piping:
|
||||
~~> das Buch , das ihm zu verkaufen wir sie bitten
|
||||
~~ das Buch , an das zu glauben wir sie bitten
|
||||
~~> das Kind , auf das zu warten wir ihn bitten
|
||||
|
||||
Wrong in gf-3.9 as well:
|
||||
Lang> p "the woman that we beg him to listen to" | l
|
||||
the woman that we beg him to listen to
|
||||
die Frau , die wir ihn zuzuhören bitten (Bug: die => der)
|
||||
die Frau , der wir ihn bitten , zuzuhören
|
||||
|
||||
Lang> p "the book that we beg her to sell to him" | l
|
||||
the book that we beg her to sell to him
|
||||
das Buch , das wir ihn sie zu verkaufen bitten (Bug: ihn sie => sie ihm)
|
||||
=> das Buch, das wir sie bitten, ihm zu verkaufen
|
||||
das Buch, das wir sie bitten, ihm zu verkaufen
|
||||
|
||||
Test reflexive resolution:
|
||||
|
||||
gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wash_V2))) (UsePron ?))) | l
|
||||
|
||||
-}
|
||||
|
||||
-- Reimplementation of SlashVP: replace mkClause by mkClSlash to let reflexives agree
|
||||
-- with object in relative clauses, if objCtrl = true. To save memory, use
|
||||
-- ClauseSlash.s : ... => RelGenNum => Str instead of : ... => Agr => Str.
|
||||
-- + SlashVP 699840 gf: out of memory (requested 2097152 bytes) with Agr => Str
|
||||
-- + SlashVP 699840 (2880,160) with RelGenNum => Str; |Agr| = 18, |RelGenNum| = 5.
|
||||
-- Todo: replace other uses of ClSlash by ClauseSlash
|
||||
|
||||
lincat
|
||||
ClauseSlash = {
|
||||
s : Mood => ResGer.Tense => Anteriority => Polarity => Order => RelGenNum => Str ;
|
||||
c2 : Preposition
|
||||
} ;
|
||||
|
||||
lin
|
||||
SlashVP np vp =
|
||||
let subj = mkSubj np vp.c1
|
||||
in mkClSlash subj.p1 subj.p2 vp ** { c2 = vp.c2 } ;
|
||||
|
||||
RelSlash rp cls = lin RCl {
|
||||
s = \\m,t,a,p,gn =>
|
||||
appPrep cls.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++
|
||||
cls.s ! m ! t ! a ! p ! Sub ! gn ;
|
||||
c = (prepC cls.c2.c).c
|
||||
} ;
|
||||
{-
|
||||
QuestSlash ip slash = {
|
||||
s = \\m,t,a,p =>
|
||||
let
|
||||
cls = slash.s ! m ! t ! a ! p ;
|
||||
who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ;
|
||||
in table {
|
||||
QDir => who ++ cls ! Inv ;
|
||||
QIndir => who ++ cls ! Sub
|
||||
}
|
||||
} ;
|
||||
-}
|
||||
|
||||
|
||||
oper
|
||||
gnToAgr : RelGenNum -> Agr = \gn ->
|
||||
case gn of {RGenNum (GSg g) => Ag g Sg P3 ;
|
||||
RGenNum GPl => Ag Neutr Pl P3 ;
|
||||
RSentence => Ag Neutr Sg P3} ;
|
||||
|
||||
|
||||
mkClSlash : Str -> Agr -> ResGer.VPSlash -> ClauseSlash = \subj,agr,vp ->
|
||||
let vps = useVP vp in lin ClauseSlash {
|
||||
c2 = vp.c2 ;
|
||||
s = \\m,t,a,b,o,gn =>
|
||||
let
|
||||
ord = case o of {
|
||||
Sub => True ; -- glue prefix to verb
|
||||
_ => False
|
||||
} ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
haben = verb.inf2 ;
|
||||
neg = negation ! b ;
|
||||
ag : Agr = case vp.objCtrl of {True => gnToAgr gn ; _ => agr} ;
|
||||
obj1 = (vp.nn ! ag).p1 ++ (vp.nn ! ag).p2 ; -- refl ++ pronouns ++ light nps
|
||||
obj2 = (vp.nn ! ag).p3 ; -- pp-objects and heavy nps
|
||||
obj3 = (vp.nn ! ag).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||
compl : Str = obj1 ++ obj2 ++ neg ++ obj3 ;
|
||||
infObjs = (vp.inf.inpl.p1) ! ag ;
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; _ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||
<_,Anter,True> => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
<Pres,_,_> =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
; --# notpresent
|
||||
_ => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||
} ;
|
||||
extra : Str = (vp.inf.extr) ! ag ++ vp.ext ;
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ oper
|
||||
\v,p2,p3,p4 -> lin V4 (v ** { c2=p2 ; c3=p3 ; c4=p4 }) ;
|
||||
dirV4 : V -> Prep -> Prep -> V4 = \v,c,d -> mkV4 v accPrep c d ;
|
||||
-- control verbs
|
||||
dirV2V : V -> V2V = \v -> mkV2V v ;
|
||||
|
||||
dirV2V : V -> V2V = \v -> mkV2V v ; -- object control verb;
|
||||
-- subjV2V v2v = subject-control verb
|
||||
lin
|
||||
aendern_rV = reflV (regV "ändern") accusative ;
|
||||
anstrengen_rV = reflV (prefixV "an" (regV "strengen")) accusative ;
|
||||
@@ -37,29 +37,37 @@ lin
|
||||
|
||||
erklaeren_dat_V3 = mkV3 (irregV "erklären" "erklärt" "erklärte" "erklärte" "erklärt") ;
|
||||
anklagen_gen_V3 = dirV3 (prefixV "an" (regV "klagen")) genPrep ;
|
||||
erinnern_an_V3 = dirV3 (irregV "erinnern" "erinnert" "erinnerte" "erinnerte" "erinnert") (mkPrep "an" accusative) ;
|
||||
erinnern_an_V3 = dirV3 (irregV "erinnern" "erinnert" "erinnerte"
|
||||
"erinnerte" "erinnert") (mkPrep "an" accusative) ;
|
||||
danken_dat_fuer_V3 = mkV3 (regV "danken") datPrep (mkPrep "für" accusative) ;
|
||||
debattieren_mit_ueber_V3 = mkV3 (irregV "debattieren" "debattiert" "debattierte" "debattierte" "debattiert") mit_Prep (mkPrep "über" accusative) ;
|
||||
debattieren_mit_ueber_V3 = mkV3 (irregV "debattieren" "debattiert" "debattierte"
|
||||
"debattierte" "debattiert") mit_Prep (mkPrep "über" accusative) ;
|
||||
lehren_V3 = dirV3 (regV "lehren") accPrep ;
|
||||
|
||||
abschauen_bei_rV3 = reflV3 (prefixV "ab" (irregV "schauen" "schaut" "schaute" "schaute" "geschaut")) dative accPrep bei_Prep ;
|
||||
abschauen_bei_rV3 = reflV3 (prefixV "ab" (irregV "schauen" "schaut"
|
||||
"schaute" "schaute" "geschaut")) dative accPrep bei_Prep ;
|
||||
leihen_von_rV3 = reflV3 (irregV "leihen" "leiht" "lieh" "liehe" "geliehen") dative accPrep von_Prep ;
|
||||
|
||||
entschuldigen_bei_fuer_rV3 =
|
||||
reflV3 (irregV "entschuldigen" "entschuldigt" "entschuldigte" "entschuldigte" "entschuldigt") accusative bei_Prep fuer_Prep ;
|
||||
entschuldigen_bei_fuer_rV3 = reflV3 (irregV "entschuldigen" "entschuldigt" "entschuldigte"
|
||||
"entschuldigte" "entschuldigt") accusative bei_Prep fuer_Prep ;
|
||||
raechen_am_fuer_rV3 = reflV3 (regV "rächen") accusative (mkPrep "an" dative) fuer_Prep ;
|
||||
|
||||
kaufen_bei_fuer_V4 = dirV4 (regV "kaufen") bei_Prep fuer_Prep ;
|
||||
mieten_von_fuer_V4 = dirV4 (regV "mieten") von_Prep fuer_Prep ;
|
||||
|
||||
neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ;
|
||||
|
||||
|
||||
-- verbs with infinitival object (non-modal):
|
||||
wagen_VV = mkVV (regV "wagen") ;
|
||||
versuchen_VV = mkVV (irregV "versuchen" "versucht" "versuchte" "versuchte" "versucht") ;
|
||||
|
||||
-- object control verbs:
|
||||
helfen_V2V = mkV2V (irregV "helfen" "hilft" "half" "hälfe" "geholfen") datPrep ;
|
||||
warnen_V2V = dirV2V (regV "warnen") ;
|
||||
-- versprechen_dat_V2V = subjV2V (mkV2V (irregV "versprechen" "verspricht" "versprach" "verspräche" "versprochen") datPrep) ;
|
||||
lassen_V2V = auxV2V (irregV "lassen" "lasst" "ließ" "ließe" "gelassen") accPrep ; -- lasse dich (*zu) arbeiten
|
||||
lassen_V2V = auxV2V (irregV "lassen" "läßt" "ließ" "ließe" "gelassen") accPrep ;
|
||||
-- lasse dich (*zu) arbeiten
|
||||
-- subject control verb:
|
||||
versprechen_dat_V2V = subjV2V (mkV2V (irregV "versprechen" "verspricht"
|
||||
"versprach" "verspräche" "versprochen") datPrep) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (SlashV2a read_V2
|
||||
TestLangGer: ich will das Buch lesen
|
||||
TestLangEng: I want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV wagen_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich wage das Buch , zu lesen -- wrong
|
||||
TestLangGer: ich wage das Buch zu lesen
|
||||
TestLangEng: I dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich muss das Buch lesen
|
||||
@@ -68,22 +68,22 @@ TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV must_VV (SlashVV want_VV
|
||||
TestLangGer: ich muss das Buch lesen wollen
|
||||
TestLangEng: I must want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV must_VV (SlashVV wagen_VV (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich muss das Buch wagen , zu lesen -- wrong
|
||||
TestLangGer: ich muss das Buch zu lesen wagen
|
||||
TestLangEng: I must dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (SlashVV wagen_VV (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich will das Buch wagen , zu lesen -- wrong
|
||||
TestLangGer: ich will das Buch zu lesen wagen
|
||||
TestLangEng: I want to dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV wagen_VV (SlashVV want_VV (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich wage das Buch , lesen zu wollen -- wrong
|
||||
TestLangGer: ich wage das Buch lesen zu wollen
|
||||
TestLangEng: I dare to want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich muss das Buch lesen wollen
|
||||
TestLangEng: I must want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplSlash (SlashVV wagen_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich muss das Buch wagen , zu lesen -- wrong
|
||||
TestLangGer: ich muss das Buch wagen zu lesen -- wrong
|
||||
TestLangEng: I must dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashVV wagen_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich will das Buch wagen , zu lesen -- wrong
|
||||
TestLangGer: ich will das Buch wagen zu lesen -- wrong
|
||||
TestLangEng: I want to dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV wagen_VV (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich wage , das Buch lesen zu wollen
|
||||
@@ -101,22 +101,22 @@ TestLang: PredVP (UsePron i_Pron) (ComplVV wagen_VV (ComplVV want_VV (ComplSlash
|
||||
TestLangGer: ich wage , das Buch lesen zu wollen
|
||||
TestLangEng: I dare to want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplSlash (SlashVV want_VV (SlashVV wagen_VV (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich muss das Buch wagen wollen , zu lesen -- wrong
|
||||
TestLangGer: ich muss das Buch zu lesen wagen wollen
|
||||
TestLangEng: I must want to dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplVV want_VV (ComplSlash (SlashVV wagen_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))))
|
||||
TestLangGer: ich muss das Buch wagen wollen , zu lesen -- wrong
|
||||
TestLangGer: ich muss das Buch wagen wollen zu lesen -- wrong
|
||||
TestLangEng: I must want to dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplVV want_VV (ComplVV wagen_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))))
|
||||
TestLangGer: ich muss wagen wollen , das Buch zu lesen
|
||||
TestLangEng: I must want to dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV must_VV (SlashVV wagen_VV (SlashVV want_VV (SlashV2a read_V2)))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich muss das Buch wagen , lesen zu wollen -- wrong
|
||||
TestLangGer: ich muss das Buch wagen lesen zu wollen -- wrong
|
||||
TestLangEng: I must dare to want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashVV must_VV (SlashVV want_VV (SlashVV wagen_VV (SlashV2a read_V2)))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich muss das Buch wagen , zu lesen wollen -- wrong
|
||||
TestLangGer: ich muss das Buch zu lesen wagen wollen
|
||||
TestLangEng: I must want to dare to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplSlash (SlashVV wagen_VV (SlashVV want_VV (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N))))
|
||||
TestLangGer: ich muss das Buch wagen , lesen zu wollen -- wrong
|
||||
TestLangGer: ich muss das Buch wagen lesen zu wollen -- wrong
|
||||
TestLangEng: I must dare to want to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV must_VV (ComplVV wagen_VV (ComplSlash (SlashVV want_VV (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))))
|
||||
TestLangGer: ich muss wagen , das Buch lesen zu wollen
|
||||
@@ -149,43 +149,43 @@ TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ComplSlash (Sla
|
||||
TestLangGer: ich bitte ihn , ihm zu versprechen , das Buch zu lesen
|
||||
TestLangEng: I beg him to promise him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP lassen_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich lasse das Buch ihn lesen -- wrong object order (3.9 SlashV2VNP)
|
||||
TestLangGer: ich lasse ihn das Buch lesen
|
||||
TestLangEng: I let him read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP beg_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich bitte das Buch ihn , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangGer: ich bitte ihn das Buch , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangEng: I beg him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP versprechen_dat_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich verspreche das Buch ihm , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangGer: ich verspreche ihm das Buch , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangEng: I promise him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP beg_V2V (DetNP (DetQuant DefArt NumPl)) (SlashV2VNP lassen_V2V (UsePron he_Pron) (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich bitte das Buch ihn die , zu lassen lesen -- wrong (SlahV2VNP) bitte die, ihn es lesen zu lassen
|
||||
TestLangGer: ich bitte die das Buch , ihn lesen zu lassen -- wrong (SlahV2VNP)
|
||||
TestLangEng: I beg them to let him read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP beg_V2V (UsePron they_Pron) (SlashV2VNP lassen_V2V (UsePron he_Pron) (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich bitte das Buch ihn sie , zu lassen lesen -- wrong (SlashV2VNP)
|
||||
TestLangGer: ich bitte sie das Buch , ihn lesen zu lassen -- wrong (SlashV2VNP)
|
||||
TestLangEng: I beg them to let him read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ComplSlash (SlashV2VNP lassen_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))) (DetNP (DetQuant DefArt NumPl)))
|
||||
TestLangGer: ich bitte die , das Buch ihn lesen zu lassen -- wrong obj order
|
||||
TestLangGer: ich bitte die , ihn das Buch lesen zu lassen
|
||||
TestLangEng: I beg them to let him read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ComplSlash (SlashV2VNP lassen_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))) (UsePron they_Pron))
|
||||
TestLangGer: ich bitte sie , das Buch ihn lesen zu lassen -- wrong obj order
|
||||
TestLangGer: ich bitte sie , ihn das Buch lesen zu lassen
|
||||
TestLangEng: I beg them to let him read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP versprechen_dat_V2V (DetNP (DetQuant DefArt NumPl)) (SlashV2VNP beg_V2V (UsePron he_Pron) (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich verspreche das Buch ihn denen , zu bitten zu lesen -- wrong (SlashV2VNP gf-3.9))
|
||||
TestLangGer: ich verspreche denen das Buch , ihn zu bitten , zu lesen -- wrong (SlashV2VNP))
|
||||
TestLangEng: I promise them to beg him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP versprechen_dat_V2V (UsePron they_Pron) (SlashV2VNP beg_V2V (UsePron he_Pron) (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich verspreche das Buch ihn ihnen , zu bitten zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangGer: ich verspreche ihnen das Buch , ihn zu bitten , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangEng: I promise them to beg him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V versprechen_dat_V2V (ComplSlash (SlashV2VNP beg_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))) (DetNP (DetQuant DefArt NumPl)))
|
||||
TestLangGer: ich verspreche denen , das Buch ihn zu bitten , zu lesen -- wrong obj order
|
||||
TestLangGer: ich verspreche denen , ihn das Buch zu bitten , zu lesen
|
||||
TestLangEng: I promise them to beg him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V versprechen_dat_V2V (ComplSlash (SlashV2VNP beg_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))) (UsePron they_Pron))
|
||||
TestLangGer: ich verspreche ihnen , das Buch ihn zu bitten , zu lesen -- wrong obj order
|
||||
TestLangGer: ich verspreche ihnen , ihn das Buch zu bitten , zu lesen -- wrong
|
||||
TestLangEng: I promise them to beg him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2VNP beg_V2V (UsePron he_Pron) (SlashV2VNP versprechen_dat_V2V (UsePron he_Pron) (SlashV2a read_V2))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))
|
||||
TestLangGer: ich bitte das Buch ihm ihn , zu versprechen zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangGer: ich bitte ihn das Buch , ihm zu versprechen , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangEng: I beg him to promise him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ComplSlash (SlashV2VNP versprechen_dat_V2V (UsePron he_Pron) (SlashV2a read_V2)) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))) (UsePron he_Pron))
|
||||
TestLangGer: ich bitte ihn , das Buch ihm zu versprechen , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangGer: ich bitte ihn , ihm das Buch zu versprechen , zu lesen -- wrong (SlashV2VNP)
|
||||
TestLangEng: I beg him to promise him to read the book
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ReflVP (SlashV2a love_V2))) (UsePron youSg_Pron))
|
||||
TestLangGer: ich bitte dich , dich zu lieben
|
||||
@@ -200,7 +200,7 @@ TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V versprechen_dat_V2V (Com
|
||||
TestLangGer: ich verspreche ihr , mich lieben zu wollen
|
||||
TestLangEng: I promise her to want to love herself -- wrong: myself
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2V beg_V2V (ComplSlash (SlashV2Vneg versprechen_dat_V2V (ReflVP (SlashV2a hate_V2))) (UsePron youSg_Pron))) (UsePron she_Pron)))
|
||||
TestLangGer: ich will sie bitten , dir zu versprechen , sich nicht zu hassen
|
||||
TestLangGer: ich will sie bitten , dir zu versprechen , sich nicht zu hassen (uses SlashV2Vneg)
|
||||
TestLangEng: I want to beg her to promise you not to hate yourself -- wrong: herself
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V versprechen_dat_V2V (ComplSlash (ReflVPSlash entschuldigen_bei_fuer_rV3) (UsePron it_Pron))) (UsePron she_Pron))
|
||||
TestLangGer: ich verspreche ihr , mich bei mir für es zu entschuldigen
|
||||
@@ -209,7 +209,7 @@ TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V versprechen_dat_V2V (Com
|
||||
TestLangGer: ich verspreche uns , es mir zu geben
|
||||
TestLangEng: I promise us to give it itself -- wrong: myself
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2V versprechen_dat_V2V (ComplSlash (SlashV2Vneg beg_V2V (ReflVP (SlashV2a hate_V2))) (UsePron youSg_Pron))) (UsePron she_Pron)))
|
||||
TestLangGer: ich will ihr versprechen , dich zu bitten , dich nicht zu hassen
|
||||
TestLangGer: ich will ihr versprechen , dich zu bitten , dich nicht zu hassen -- SlashV2Vneg
|
||||
TestLangEng: I want to promise her to beg you to not hate yourself
|
||||
TestLang: PredVP (UsePron i_Pron) (ComplSlash (SlashV2V beg_V2V (ComplSlash (ReflVPSlash entschuldigen_bei_fuer_rV3) (UsePron it_Pron))) (UsePron youSg_Pron))
|
||||
TestLangGer: ich bitte dich , dich bei dir für es zu entschuldigen
|
||||
@@ -227,7 +227,7 @@ TestLang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPas
|
||||
TestLangGer: das Buch , das wir nicht lesen mussten
|
||||
TestLangEng: the book that we hadn't to read
|
||||
TestLang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PNeg (RelSlash IdRP (SlashVP (UsePron we_Pron) (SlashVV wagen_VV (SlashV2a read_V2))))))
|
||||
TestLangGer: das Buch , das wir nicht wagten , zu lesen
|
||||
TestLangGer: das Buch , das wir nicht zu lesen wagten
|
||||
TestLangEng: the book that we didn't dare to read
|
||||
TestLang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PNeg (RelSlash IdRP (SlashVP (UsePron we_Pron) (SlashVV wagen_VV (Slash3V3 erklaeren_dat_V3 (UsePron she_Pron)))))))
|
||||
TestLangGer: das Buch , das wir nicht wagten , ihr zu erklären
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- To create vp-paradigm.out, I used changes of 30/6/2019 (in git branch vp-paradigm):
|
||||
-- i ../../src/german/LangGer.gf
|
||||
i ../../src/german/LangGer.gf
|
||||
-- Use gf --run < vp-paradigm.gfs > vp-paradigm.tmp to compare with gf-rgl. HL 3/7/2019
|
||||
i alltenses/LangGer.gfo
|
||||
-- i alltenses/LangGer.gfo
|
||||
|
||||
-- verb phrases with modal verb
|
||||
l -lang=Ger -table (PredVP (UsePron he_Pron) (ComplVV want_VV (UseV sleep_V)))
|
||||
@@ -19,3 +19,7 @@ l -table (PredVP (DetCN (DetQuant DefArt NumSg) (UseN book_N)) (PassV2 read_V2))
|
||||
l PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (Slash3V3 send_V3 (DetCN (DetQuant DefArt NumSg) (UseN woman_N))) (DetCN (DetQuant DefArt NumSg) (UseN book_N)))))) NoVoc
|
||||
|
||||
l PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (Slash3V3 send_V3 (UsePron she_Pron)) (UsePron it_Pron))))) NoVoc
|
||||
|
||||
-- relative clause from object np is not extracted behind vpart:
|
||||
l UseCl (TTAnt TPast AAnter) PNeg (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a know_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast AAnter) PPos (RelSlash IdRP (SlashVP (UsePron youPl_Pron) (SlashV2VNP beg_V2V (UsePron we_Pron) (AdvVPSlash (SlashV2a read_V2) today_Adv)))))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user