forked from GitHub/gf-rgl
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 => 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 => 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 => 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
|
||||
-- ++ 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 ++
|
||||
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 ++
|
||||
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 ++
|
||||
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
|
||||
++ vp.iadv ++ vp.advs
|
||||
} ;
|
||||
|
||||
}
|
||||
1867
src/zulu/ResZul.gf
Executable file
1867
src/zulu/ResZul.gf
Executable file
File diff suppressed because it is too large
Load Diff
247
src/zulu/SentenceZul.gf
Executable file
247
src/zulu/SentenceZul.gf
Executable file
@@ -0,0 +1,247 @@
|
||||
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) => {
|
||||
s = \\p,t => np.s!NFull ++ (verb_prefix vp p t np.agr) ++ vp.s!MainCl!np.agr!p!t ++ 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 ++ vp.comp ++ vp.iadv ++ vp.advs ;
|
||||
Neg => "unga" ++ vp.s!MainCl!np.agr!Neg!impTense ++ 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
|
||||
++ 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
|
||||
subj
|
||||
++ (imp_verb_prefix vp p t np.agr)
|
||||
++ vp.s!MainCl!np.agr!p!t
|
||||
++ 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 ;
|
||||
in
|
||||
subj
|
||||
++ (verb_prefix vp p t np.agr)
|
||||
++ vp.s!MainCl!np.agr!p!t
|
||||
++ 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
|
||||
++ 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
|
||||
++ 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 => 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 = loc.s ;
|
||||
comp,advs,iadv = [] ;
|
||||
hasComp = True ;
|
||||
r = RC ;
|
||||
syl = SylMult ;
|
||||
vptype = CopLoc
|
||||
} ;
|
||||
|
||||
}
|
||||
312
src/zulu/VerbZul.gf
Executable file
312
src/zulu/VerbZul.gf
Executable file
@@ -0,0 +1,312 @@
|
||||
concrete VerbZul of Verb = CatZul ** open ResZul, Prelude, ParamX in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV v = {
|
||||
s = table {
|
||||
MainCl => \\a,p,t => let
|
||||
vform = VFIndic MainCl p t ;
|
||||
tp = tensePref vform v.r v.syl ; -- [] / zo- / zuku-
|
||||
r = v.s!(rform (VFIndic MainCl p t) True) -- hamba
|
||||
-- rest of verb prefix built later (eg no "ya" with certain question words)
|
||||
in tp ++ r ;
|
||||
RelCl => \\a,p,t => 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 True) ; -- hamba
|
||||
suf = relSuf vform -- [] / -yo
|
||||
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 } ;
|
||||
-- {
|
||||
-- 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) ;
|
||||
81
src/zulu/lexica/DevLex.gf
Executable file
81
src/zulu/lexica/DevLex.gf
Executable file
@@ -0,0 +1,81 @@
|
||||
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 ;
|
||||
|
||||
}
|
||||
79
src/zulu/lexica/DevLexZul.gf
Executable file
79
src/zulu/lexica/DevLexZul.gf
Executable file
@@ -0,0 +1,79 @@
|
||||
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" } ;
|
||||
}
|
||||
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
1094
src/zulu/lexica/MultiLex.gf
Normal file
1094
src/zulu/lexica/MultiLex.gf
Normal file
File diff suppressed because it is too large
Load Diff
1095
src/zulu/lexica/MultiLexZul.gf
Normal file
1095
src/zulu/lexica/MultiLexZul.gf
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user