1
0
forked from GitHub/gf-rgl

=Remodelled RS to accomodate RelCN and RelNP appropriately and give both direct and direct relative prnouns

This commit is contained in:
David Bamutura
2019-05-24 02:20:02 +02:00
parent 366d6cd38e
commit 304b877854
7 changed files with 223 additions and 36 deletions

View File

@@ -15,7 +15,7 @@ lincat
S = SS ; -- declarative sentence e.g. "she lived here"
Cl = Res.Clause ; -- declarative clause, with all tenses e.g. "she looks at this"
QCl = Res.Clause ** {posibleSubAgr: Res.Agreement =>Str} ;
RS = {s : Str} ; -- relative e.g. "in which she lived"
RS = {s :Res.RForm => Str} ; -- relative e.g. "in which she lived"
V,VS, VQ, VA = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep"
V2,V2Q, V2S = Res.Verb2;
V2A,V3 = Res.Verb3; -- three-place verb e.g. "show"
@@ -42,13 +42,17 @@ lincat
RP = {s : Res.RCase => Res.Agreement => Str ; rObjVariant2: Res.Agreement => Str} ;
RCl ={
s : Str ; --subject
rp: Res.RCase => Res.Agreement => Str;
rObjVariant2: Res.Agreement => Str;
subjAgr : Res.AgrExist;
--subAgr:Res.Agreement;
rp: Res.RCase => Res.Agreement => Str; -- could delete this
--rObjVariant2: Res.Agreement => Str;
agr : Res.AgrExist;
pres :Str;
perf :Str;
root : Str;
morphs : Res.VFormMini => Res.VerbMorphPos =>Str;
compl : Str; -- after verb: complement, adverbs
agr : Res.AgrExist
isCompApStem : Bool;
whichRel: Res.RForm
} ;
--VPSlash ={s:Str; morphs: VMorphs}; --VPSlash ; -- verb phrase missing complement e.g. "give to John"
--ClSlash;-- clause missing NP (S/NP in GPSG) e.g. "she looks at"
@@ -62,9 +66,8 @@ lincat
ap:Str;
isRegular:Bool;
adv:Str;
containsAdv:Bool;
adV:Str;
containsAdV:Bool
complType: Res.ComplType;
} ;
Numeral = {s : Res.CardOrd=>Res.Agreement=> Str ; g : Res.Gender; n: Res.Number} ;
Digits = {s : Res.CardOrd => Res.Agreement=>Str ; n : Res.Number ; tail : Px.DTail} ;
@@ -81,9 +84,10 @@ lincat
VV = Res.Verb ** {inf:Str; whenUsed: Res.VVMood}; --inf is the other verb
AdA = {s:Str; position1:Res.Position1};
linref
Cl =\cl -> cl.s ++ Res.mkSubjClitic cl.subjAgr ++ cl.root ++ BIND ++ cl.pres;
QCl =\qcl -> qcl.s ++ qcl.posibleSubAgr ! (Res.mkAgreement Res.MU_BA Res.P3 Res.Sg) ++ qcl.root ++ BIND ++ qcl.pres;
VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap;
--VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap;
VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres;

View File

@@ -120,7 +120,7 @@ lin
run_V = mkV "íruk"; -- : V ;
sleep_V = mkV "nyama" ; --: V ;--Kugwejegyera, kubyama
swim_V = mkV "og"; --: V ;
travel_V = mkV "gyend";--: V ;
travel_V = mkV "gyen" "da" "zire" ;--: V ;
walk_V = mkV "ribá" "ta" "si"; --: V ; or kuribata Runynakore it is different
-- A verb whose complement is a sentence

View File

@@ -60,7 +60,7 @@ lin
}; -- big house
--RelCN : CN -> RS -> CN ; -- house that John bought
RelCN cn rs = {s=\\n,ns => cn.s !n ! ns ++ rs.s; gender = cn.gender };
RelCN cn rs = {s=\\n,ns => cn.s !n ! ns ++ rs.s! (RF RObj); gender = cn.gender };
{-
A predeterminer is any word that modifies a noun Phrase.
@@ -88,7 +88,7 @@ lin
{-What the hell does this mean?-}
ExtAdvNP np adv = {s= \\c => np.s ! c ++ embedInCommas adv.s; agr = np.agr}; -- how do I do the adverbial clause?
-- Determiner: Type = {s:Str; ntype:NounType; num:Number; pos:Position}; -- type for Determier necessary for catCgg.gf
RelNP np rs ={s = \\c => np.s ! c ++ rs.s; agr =np.agr};
RelNP np rs ={s = \\c => np.s ! c ++ rs.s! (RF RSubj); agr =np.agr};
-- The determiner has a fine-grained structure, in which a 'nucleus'
-- quantifier and an optional numeral can be discerned.
--DetQuant : Quant -> Num -> Det ; -- these five

View File

@@ -25,14 +25,16 @@ lin
-- a pronoun similar to "such that".
RelCl cl = {
s = "kugira ngu" ++ cl.s ;
subjAgr = AgrYes cl.subjAgr;
agr = AgrYes cl.subjAgr;
rp = mkRPs;
rObjVariant2 = mkRObjV2;
--rObjVariant2 = mkRObjV2;
pres =cl.pres;
perf =cl.perf;
root = cl.root;
morphs = cl.morphs;
compl =cl.compl;
isCompApStem = False;
agr = AgrNo
whichRel = Such_That;
}; -- such that John loves her. why does it need any case?
-- The more proper ways are from a verb phrase
@@ -43,18 +45,44 @@ lin
RelVP rp vp =
{
s = [];
subjAgr = AgrNo;
agr = AgrNo;
rp = rp.s;
rObjVariant2 = rp.rObjVariant2;
--rObjVariant2 = rp.rObjVariant2;
pres =vp.pres;
perf =vp.perf;
root = vp.s;
morphs = vp.morphs;
compl =vp.comp;
isCompApStem = vp.isCompApStem;
agr = vp.agr
whichRel = RF RSubj;
};
--RelSlash : RP -> ClSlash -> RCl ; -- whom John loves
RelSlash rp clSlash =
let comp = case clSlash.complType of{
Ap => clSlash.ap;
Adverbial => clSlash.adv;
AdverbVerbial => clSlash.adV;
_ => []
};
isCompApStem = case clSlash.complType of{
Adverbial => True;
_ => False
};
in
{
s = clSlash.s;
agr = AgrYes clSlash.subjAgr;
rp = rp.s;
--rObjVariant2 = rp.rObjVariant2;
pres = clSlash.pres;
perf = clSlash.perf;
root = clSlash.root;
morphs = clSlash.morphs;
compl = comp;
isCompApStem = isCompApStem;
whichRel = RF RObj;
};
{-
--1 Relative clauses and pronouns

View File

@@ -27,6 +27,8 @@ param
KA_ZERO |ZERO_BAA | N_ZERO | KI_ZERO | Null;
Case = Acc | Nom |Gen; -- we need to include Gen because we shall need it with Gen Pronouns
RCase = RSubj | RObj;
RForm = RF RCase | Such_That;
ComplType = Nn |Ap | Adverbial |AdverbialVerb | Empty;
PersonalPronounType = SubjM | Obj | RelSubj | RelObj |
AdjPron2 | -- aAdjectival Prefixes with initial vowel with the semantics of "the" e.g. -- omuntu o-mu-rungi
AdjPron | -- without initial vowel i.e. -- omuntu mu-rungi

View File

@@ -73,7 +73,153 @@ lin
QuestCl qcl = qcl; --: Cl -> QCl ; -- does John (not) walk
--UseRCl : Temp -> Pol -> RCl -> RS ; -- that had not slept
--UseRCl temp pol rcl =
UseRCl temp pol rcl = let
subj = rcl.s; -- this could be empty
subjClitic = case rcl.agr of {
AgrYes a => mkSubjClitic a;
_ => mkSubjClitic (AgP3 Sg MU_BA)
};
rsubjClitic = case rcl.agr of {
AgrYes a => mkRPs!RSubj! a;
_ => mkRPs!RSubj! AgP3 Sg MU_BA
};
robjClitic = case rcl.agr of {
AgrYes a => mkRPs!RObj! a;
_ => mkRPs!RObj! AgP3 Sg MU_BA
};
presSimul = rcl.morphs ! VFPres; --this is not delivering the string
presAnt = rcl.morphs ! VFPastPart; --this is not delivering the string
root = rcl.root;
presRestOfVerb = rcl.pres;
pastRestOfVerb = rcl.perf; --morphs ! VFPastPart ! RestOfVerb;
compl = rcl.compl
in {- will these strings I am introducing allow back translation? Yes, it simply depends on functions-}
case <temp.t,temp.a, pol.p> of {
<Pres,Simul, Pos> => {s = table {
RF RSubj => subj ++ rsubjClitic ++ root ++ Predef.BIND ++ presRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ root ++ Predef.BIND ++ presRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ subjClitic ++ root ++ Predef.BIND ++ presRestOfVerb ++ compl
}
};
{-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-}
<Pres,Simul, Neg> => {
s = table {
RF RSubj => subj ++ "ti" ++ Predef.BIND ++ rsubjClitic ++ root ++ presRestOfVerb ++ compl;
RF RObj => subj ++ "ti" ++ Predef.BIND ++ robjClitic ++ root ++ presRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ subj ++ "ti" ++ Predef.BIND ++ subjClitic ++ root ++ presRestOfVerb ++ compl
}
};
<Pres,Anter, Pos> => {
s = table{
RF RSubj => subj ++ rsubjClitic ++ rcl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ rcl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ subj ++ subjClitic ++ rcl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
<Pres,Anter, Neg> =>{
s = table {
RF RSubj => subj ++ "ti" ++ Predef.BIND ++ rsubjClitic ++ rcl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ "ti" ++ Predef.BIND ++ robjClitic ++ rcl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "ti" ++ Predef.BIND ++ rsubjClitic ++ rcl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
<Past,Simul, Pos> => {
s = table {
RF RSubj => subj ++ rsubjClitic ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ subjClitic ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
{-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-}
<Past,Simul, Neg> => {
s = table {
RF RSubj => subj ++ "ti" ++ Predef.BIND ++ rsubjClitic ++root ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ "ti" ++ Predef.BIND ++ robjClitic ++root ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "ti" ++ Predef.BIND ++ subjClitic ++ root ++ pastRestOfVerb ++ compl
}
};
<Past,Anter, Pos> => {
s = table {
RF RSubj => subj ++ rsubjClitic ++ "bire" ++ rsubjClitic ++ rcl.morphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ "bire" ++ subjClitic ++ rcl.morphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "bire" ++ subjClitic ++ rcl.morphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
<Past,Anter, Neg> =>{
s = table {
RF RSubj => subj ++ rsubjClitic ++ "bire" ++ subjClitic ++ "ta" ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ "bire" ++ subjClitic ++ "ta" ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "bire" ++ subjClitic ++ "ta" ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
<Fut,Simul, Pos> => {
s = table {
RF RSubj => subj ++ "ni" ++ Predef.BIND ++ rsubjClitic ++ "za ku" ++ Predef.BIND ++ --choice of za over ija
root ++ Predef.BIND ++ presRestOfVerb ++ compl;
RF RObj => subj ++ "ni" ++ Predef.BIND ++ robjClitic ++ "za ku" ++ Predef.BIND ++ --choice of za over ija
root ++ Predef.BIND ++ presRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "ni" ++ Predef.BIND ++ robjClitic ++ "za ku" ++ Predef.BIND ++ --choice of za over ija
root ++ Predef.BIND ++ presRestOfVerb ++ compl
}
};
{-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-}
<Fut,Simul, Neg> => {
s = table {
RF RSubj =>subj ++ "ti" ++ Predef.BIND ++ rsubjClitic ++ "kuza ku" ++ Predef.BIND ++ root ++ presRestOfVerb ++ compl;
RF RObj =>subj ++ "ti" ++ Predef.BIND ++ robjClitic ++ "kuza ku" ++ Predef.BIND ++ root ++ presRestOfVerb ++ compl;
Such_That => "Kugira ngu" ++ "ti" ++ Predef.BIND ++ subjClitic ++ "kuza ku" ++ Predef.BIND ++ root ++ presRestOfVerb ++ compl
}
};
<Fut,Anter, Pos> => {
s = table {
RF RSubj => subj ++ "ni" ++ Predef.BIND ++ rsubjClitic ++ "za kuba" ++ Predef.BIND ++ --choice of za over ija
root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ "ni" ++ Predef.BIND ++ robjClitic ++ "za kuba" ++ Predef.BIND ++ --choice of za over ija
root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "ni" ++ Predef.BIND ++ robjClitic ++ "za kuba" ++ Predef.BIND ++ --choice of za over ija
root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
<Fut,Anter, Neg> => {
s = table {
RF RSubj => subj ++ "ni" ++ Predef.BIND ++ rsubjClitic ++ "za kuba" ++ subjClitic ++ "taka" ++ Predef.BIND ++
root ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ "ni" ++ Predef.BIND ++ robjClitic ++ "za kuba" ++ subjClitic ++ "taka" ++ Predef.BIND ++
root ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "ni" ++ Predef.BIND ++ subjClitic ++ "za kuba" ++ subjClitic ++ "taka" ++ Predef.BIND ++
root ++ pastRestOfVerb ++ compl
}
};
<Cond,Simul, Pos> => {
s = table {
RF RSubj => subj ++ subjClitic ++ "kaa" ++Predef.BIND ++ root ++ Predef.BIND ++ presRestOfVerb ++ compl;
RF RObj => subj ++ subjClitic ++ "kaa" ++Predef.BIND ++ root ++ Predef.BIND ++ presRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ subjClitic ++ "kaa" ++Predef.BIND ++ root ++ Predef.BIND ++ presRestOfVerb ++ compl
}
};
{-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-}
<Cond,Simul, Neg> => { s = \\_ => subj ++ "ti" ++ Predef.BIND ++ subjClitic ++ "kaa" ++ Predef.BIND ++ root ++ presRestOfVerb ++ compl
--RF RSubj => subj ++ "ti" ++ Predef.BIND ++ subjClitic ++ "kaa" ++ Predef.BIND ++ root ++ presRestOfVerb ++ compl;
--RF RObj =>
--Such_That =>
};
<Cond,Anter, Pos> => { s = \\_ => subj ++ subjClitic ++ "kaa" ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
<Cond,Anter, Neg> => {s = \\_ => subj ++ "ti" ++ Predef.BIND ++ subjClitic ++ "kaa" ++Predef.BIND
++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl} --: Temp -> Pol -> QCl -> QS ; -- has John walked
};
PredVP np vp = case vp.isCompApStem of{
False => {
@@ -147,20 +293,27 @@ lin
-- *Note* the set is not complete and lacks e.g. verbs with more than 2 places.
--SlashVP : NP -> VPSlash -> ClSlash ; -- (whom) he sees
SlashVP np vpslash ={
s = np.s ! Nom;
subjAgr = np.agr;
root = vpslash.s;
pres = vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
ap = vpslash.ap;
isRegular = vpslash.isRegular;
adv = vpslash.adv;
containsAdv = vpslash.containsAdv;
adV = vpslash.adV;
containsAdV = vpslash.containsAdV
};
SlashVP np vpslash =let complTp = case <vpslash.containsAdv, vpslash.containsAdV> of {
<True, False> => Adverbial;
<False, True> => AdverbialVerb;
<False, False> => Ap;
<True, True> => Empty
};
in
{
s = np.s ! Nom;
subjAgr = np.agr;
root = vpslash.s;
pres = vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
ap = vpslash.ap;
isRegular = vpslash.isRegular;
adv = vpslash.adv;
adV = vpslash.adV;
complType = complTp
};
--AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
--SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks

View File

@@ -225,7 +225,7 @@ lin
ComplVV vv vp = let vpPres = "ku" ++ BIND ++ vp.s ++ BIND ++ vp.pres;
in case vv.whenUsed of {
VVPerf => {
s= vv.s ++ BIND ++ vv.perf ++ vpPres;
s= vv.s ++ BIND ++ vv.perf;
pres =vv.pres; perf=vv.perf;
morphs = vv.morphs;
comp=vp.comp ;