=I have managed to model the Verb and delay the Verbal template mophology for tense, Anteriority and polarity to only points when the actual sentence of verb is built. My only problem is including it in the default linearizations within cat

This commit is contained in:
David Bamutura
2019-06-05 02:39:15 +02:00
parent 4eec043991
commit ba4db3d913
7 changed files with 93 additions and 69 deletions

View File

@@ -64,7 +64,7 @@ lincat
pres :Str;
perf :Str;
root : Str;
morphs : Res.VFormMini => Res.VerbMorphPos =>Str;
--morphs : Res.VFormMini => Res.VerbMorphPos =>Str;
compl : Str; -- after verb: complement, adverbs
isCompApStem : Bool;
whichRel: Res.RForm
@@ -77,7 +77,7 @@ lincat
root : Str;
pres: Str;
perf:Str;
morphs : Res.VFormMini => Res.VerbMorphPos =>Str; --; compl : Str -- after verb: complement, adverbs
--morphs : Res.VFormMini => Res.VerbMorphPos =>Str; --; compl : Str -- after verb: complement, adverbs
ap:Str;
isRegular:Bool;
adv:Str;

View File

@@ -85,7 +85,7 @@ lin
AdvNP np adv = {s= \\c => np.s ! c ++ adv.s; agr = np.agr; nounCat = np.nounCat };
--PPartNP : NP -> V2 -> NP ; -- the man seen use the Passive form of the verb see. abantu abarebirwe
PPartNP np v2 =
{s= \\c => np.s!c ++ mkSubjClitic np.agr ++ v2.s ++ BIND ++ v2.morphs!VFPastPart!RestOfVerb; agr = np.agr; nounCat = np.nounCat};
{s= \\c => np.s!c ++ mkSubjClitic np.agr ++ v2.s ++ BIND ++ mkVerbMorphs!VFPastPart!RestOfVerb; agr = np.agr; nounCat = np.nounCat};
{-What the hell does this mean?-}
ExtAdvNP np adv = {s= \\c => np.s ! c ++ embedInCommas adv.s; agr = np.agr; nounCat = np.nounCat}; -- how do I do the adverbial clause?

View File

@@ -17,7 +17,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
root = vp.s;
pres = vp.pres;
perf = vp.perf;
morphs = vp.morphs;
--morphs = vp.morphs;
{-
inf : Str;
pres : Str;
@@ -45,7 +45,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
root = clSlash.s;
pres = clSlash.pres;
perf = clSlash.perf;
morphs = clSlash.morphs;
--morphs = clSlash.morphs;
{-
inf : Str;
pres : Str;
@@ -65,7 +65,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
root = cl.s;
pres = cl.pres;
perf = cl.perf;
morphs = cl.morphs;
--morphs = cl.morphs;
{-
inf : Str;
pres : Str;
@@ -89,7 +89,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
root = be_Copula.s;
pres = be_Copula.pres;
perf = be_Copula.perf;
morphs = be_Copula.morphs;
--morphs = be_Copula.morphs;
{-
inf : Str;
pres : Str;
@@ -107,7 +107,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
root = be_Copula.s;
pres = be_Copula.pres;
perf = be_Copula.perf;
morphs = be_Copula.morphs;
--morphs = be_Copula.morphs;
{-
inf : Str;
pres : Str;
@@ -125,7 +125,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
root = be_Copula.s;
pres = be_Copula.pres;
perf = be_Copula.perf;
morphs = be_Copula.morphs;
--morphs = be_Copula.morphs;
{-
inf : Str;
pres : Str;

View File

@@ -31,7 +31,7 @@ lin
pres =cl.pres;
perf =cl.perf;
root = cl.root;
morphs = cl.morphs;
--morphs = cl.morphs;
compl =cl.compl;
isCompApStem = False;
whichRel = Such_That;
@@ -51,7 +51,7 @@ lin
pres =vp.pres;
perf =vp.perf;
root = vp.s;
morphs = vp.morphs;
--morphs = vp.morphs;
compl =vp.comp;
isCompApStem = vp.isCompApStem;
whichRel = RF RSubj;
@@ -78,7 +78,7 @@ lin
pres = clSlash.pres;
perf = clSlash.perf;
root = clSlash.root;
morphs = clSlash.morphs;
--morphs = clSlash.morphs;
compl = comp;
isCompApStem = isCompApStem;
whichRel = RF RObj;

View File

@@ -100,7 +100,7 @@ oper
s = rad;
pres = end1;
perf = end2;
morphs = mkVerbMorphs;
--morphs = mkVerbMorphs;
isRegular = False;
};
--These are regular verbs with {a-ire} entry in the dictionary
@@ -108,7 +108,7 @@ oper
s = rad;
pres = "a";
perf = "ire";
morphs = mkVerbMorphs;
--morphs = mkVerbMorphs;
isRegular = True;
};
@@ -1086,9 +1086,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
let subjClitic = mkSubjClitic (AgP3 det.num cn.gender)
in
case <det.pos, det.num> of {
<PostDeterminer, Pl> => {s = \\_=> subjClitic ++ cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat};
<PostDeterminer, Sg> => {s = \\_=>cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat};
<PreDeterminer, n> => { s =\\_ => det.s ++ cn.s !n ! det.ntype; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat} --;
<Post, Pl> => {s = \\_=> subjClitic ++ cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat};
<Post, Sg> => {s = \\_=>cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat};
<Pre, n> => { s =\\_ => det.s ++ cn.s !n ! det.ntype; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat} --;
--<PostDeterminer, PFalse> => {s = \\_=> cn.s!det.ntype!det.num; agr = AgP3 det.num cn.gender }
};
@@ -1100,15 +1100,26 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
VFormMini = VFInf | VFPres | VFPast | VFPastAnt | VFPresAnt | VFPresProg | VFPresPart |VFPastPart;
oper
--Verb : Type = {s : VFormMini => Str};
Verb : Type = {s : Str; pres:Str; perf:Str; morphs: VFormMini => VerbMorphPos=> Str; isRegular:Bool};
Verb : Type = {
s : Str;
pres:Str;
perf:Str;
--morphs: VFormMini => VerbMorphPos=> Str;
isRegular:Bool
};
GVerb : Type = {s : Bool =>Str ;morphs: VFormMini => VerbMorphPos =>Str; isAux : Bool};
GVerb : Type = {
s : Bool => Str ;
--morphs : VFormMini => VerbMorphPos =>Str;
isAux : Bool
};
{-
The V2 sometimes uses preopsitions for formation
of direct object. Unlike in English where the verb
and the preposition are disjunctive such as "send to",
In runyakore and rukiga, the verb and preposition are
conjunctive such as sindik-ira.
conjunctive such as sindik-ira.
--The English equivalents are phrasal verbs not V2 I guess.
Because of the fusion, I have deffered including this in
the compPrep. Actually, it is going to be empty in the next version
@@ -1128,7 +1139,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
s:Str;
pres:Str;
perf:Str;
morphs: VMorphs ;
--morphs: VMorphs ;
isRegular:Bool;
comp:Str ;
comp2:Str;
@@ -1146,7 +1157,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
True => v.s;
False => ba --the special verb to be
};
morphs = v.morphs;
--morphs = v.morphs;
isAux = False
};
{-
@@ -1158,13 +1169,24 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
-}
be_GVerb : GVerb = {
s= table{True => "ri"; False =>"b" };
morphs = \\form, morphs =>[];
--morphs = \\form, morphs =>[];
isAux = True};
be_Copula : Verb = {s = "ri" ; pres=[]; perf=[]; morphs= mkVerbMorphs; isRegular=False};
be_Copula : Verb = {
s = "ri" ;
pres=[];
perf=[];
--morphs= mkVerbMorphs;
isRegular=False
};
mkBecome : Verb ={
s = "b" ; pres="a"; perf="ire"; morphs= mkVerbMorphs; isRegular=False};
s = "b" ;
pres="a";
perf="ire";
--morphs= mkVerbMorphs;
isRegular=False
};
--be1_Verb: Verb = {s="b"; pres = "e"; perf="a"; morphs = mkVerbMorphs};
@@ -1317,7 +1339,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
s:Str;
pres:Str;
perf:Str;
morphs: VMorphs;
--morphs: VMorphs;
comp: Str;
comp2:Str;
ap:Str;
@@ -1340,7 +1362,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
root : Str;
pres: Str;
perf: Str;
morphs : VFormMini => VerbMorphPos =>Str;
--morphs : VFormMini => VerbMorphPos =>Str;
{-
inf : Str;
pres : Str;

View File

@@ -13,11 +13,12 @@ lin
--Temp = {s : Str ; t : R.Tense ; a : R.Anteriority} ;
UseCl temp pol cl = let
subj = cl.s;
vMorphs = mkVerbMorphs;
clitic = mkSubjClitic cl.subjAgr;
presSimul = cl.morphs ! VFPres; --this is not delivering the string
presAnt = cl.morphs ! VFPastPart; --this is not delivering the string
presSimul = vMorphs ! VFPres; --this is not delivering the string
presAnt = vMorphs ! VFPastPart; --this is not delivering the string
root = cl.root;
presRestOfVerb = cl.morphs ! VFPres ! RestOfVerb;
presRestOfVerb = cl.pres;
pastRestOfVerb = cl.perf; --morphs ! VFPastPart ! RestOfVerb;
compl = cl.compl
@@ -29,9 +30,9 @@ lin
<Pres,Simul, Neg> => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++
root ++ presRestOfVerb ++ compl};
<Pres,Anter, Pos> => {s = subj ++ clitic ++ --Predef.BIND ++
cl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
<Pres,Anter, Neg> =>{s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++
cl.morphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
<Past,Simul, Pos> => {s = subj ++ clitic ++ --Predef.BIND ++
@@ -40,7 +41,7 @@ lin
<Past,Simul, Neg> => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++
root ++ pastRestOfVerb ++ compl};
<Past,Anter, Pos> => {s = subj ++ clitic ++ "bire" ++ clitic ++ --Predef.BIND ++
cl.morphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
vMorphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
<Past,Anter, Neg> =>{s = subj ++ clitic ++ "bire" ++ clitic ++ "ta"--Predef.BIND ++ ant!TAMarker
++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl};
@@ -75,6 +76,7 @@ lin
--UseRCl : Temp -> Pol -> RCl -> RS ; -- that had not slept
UseRCl temp pol rcl = let
subj = rcl.s; -- this could be empty
vMorphs = mkVerbMorphs;
subjClitic = case rcl.agr of {
AgrYes a => mkSubjClitic a;
_ => mkSubjClitic (AgP3 Sg MU_BA)
@@ -87,8 +89,8 @@ lin
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
presSimul = vMorphs ! VFPres; --this is not delivering the string
presAnt = vMorphs ! VFPastPart; --this is not delivering the string
root = rcl.root;
presRestOfVerb = rcl.pres;
pastRestOfVerb = rcl.perf; --morphs ! VFPastPart ! RestOfVerb;
@@ -112,16 +114,16 @@ lin
};
<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
RF RSubj => subj ++ rsubjClitic ++ vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ subj ++ subjClitic ++ vMorphs!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
RF RSubj => subj ++ "ti" ++ Predef.BIND ++ rsubjClitic ++ vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ "ti" ++ Predef.BIND ++ robjClitic ++ vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "ti" ++ Predef.BIND ++ rsubjClitic ++ vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
@@ -142,9 +144,9 @@ lin
};
<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
RF RSubj => subj ++ rsubjClitic ++ "bire" ++ rsubjClitic ++ vMorphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
RF RObj => subj ++ robjClitic ++ "bire" ++ subjClitic ++ vMorphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl;
Such_That => "kugira ngu" ++ "bire" ++ subjClitic ++ vMorphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl
}
};
<Past,Anter, Neg> =>{
@@ -228,7 +230,7 @@ lin
pres = vp.pres;
perf = vp.perf;
root = vp.s;
morphs = vp.morphs;
--morphs = vp.morphs;
{-
inf = mkVerbInrf vp.root;
pres = mkVerbPres vp.root;
@@ -245,7 +247,7 @@ lin
pres = vp.pres;
perf = vp.perf;
root = vp.s;
morphs = vp.morphs;
--morphs = vp.morphs;
{-
inf = mkVerbInrf vp.root;
pres = mkVerbPres vp.root;
@@ -266,14 +268,14 @@ lin
Reason: When I add a BIND command, I get two bind tokens in the linearizations
-}
ImpVP vp = {
ImpVP vp = let vMorphs = mkVerbMorphs in {
s =table{
ImpPos => vp.s ++ Predef.BIND ++ vp.morphs!VFInf!RestOfVerb ++ vp.comp;
ImpPos => vp.s ++ Predef.BIND ++ vMorphs!VFInf!RestOfVerb ++ vp.comp;
ImpNeg => case vp.isCompApStem of { -- How do I make the number dynamic use case?
True =>vp.morphs!VFPres!SecNegM ++ Predef.BIND ++ vp.s ++ Predef.BIND ++
vp.morphs!VFInf!RestOfVerb ++ (mkAdjPronNoIVClitic (AgMUBAP2 Sg)) ++ vp.ap;
False => vp.morphs!VFPres!SecNegM ++ Predef.BIND ++ vp.s ++ Predef.BIND ++
vp.morphs!VFInf!RestOfVerb ++ vp.comp
True =>vMorphs!VFPres!SecNegM ++ Predef.BIND ++ vp.s ++ Predef.BIND ++
vMorphs!VFInf!RestOfVerb ++ (mkAdjPronNoIVClitic (AgMUBAP2 Sg)) ++ vp.ap;
False => vMorphs!VFPres!SecNegM ++ Predef.BIND ++ vp.s ++ Predef.BIND ++
vMorphs!VFInf!RestOfVerb ++ vp.comp
}
}
}; --: VP -> Imp ; -- walk / do not walk
@@ -306,7 +308,7 @@ lin
root = vpslash.s;
pres = vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
--morphs = vpslash.morphs;
ap = vpslash.ap;
isRegular = vpslash.isRegular;
adv = vpslash.adv;

View File

@@ -8,7 +8,7 @@ lin
s = v.s ;
pres =v.pres;
perf = v.perf;
morphs = v.morphs;
--morphs = v.morphs;
comp =[];
comp2 = [];
ap =[];
@@ -30,7 +30,7 @@ lin
s = auxBe.s ++ BIND ++auxBe.pres++ comp.s; --Assuming there is no AP which is prepositional
pres =[];
perf = [];
morphs=\\form,morphs=>[];
--morphs=\\form,morphs=>[];
comp = [];
comp2 = [];
ap = [];
@@ -61,7 +61,7 @@ lin
s =v2.s;
pres =v2.pres;
perf = v2.perf;
morphs = v2.morphs;
--morphs = v2.morphs;
comp = [];
comp2 =[];
ap =[];
@@ -76,7 +76,7 @@ lin
s =v3.s;
pres =v3.pres;
perf = v3.perf;
morphs = v3.morphs;
--morphs = v3.morphs;
comp = np.s ! Acc;
comp2 =[];
ap =[];
@@ -92,7 +92,7 @@ lin
s =v3.s;
pres =v3.pres;
perf = v3.perf;
morphs = v3.morphs;
--morphs = v3.morphs;
comp = np.s ! Acc;
comp2 = np.s ! Acc; -- what is the meaning of this function?
ap = [];
@@ -107,7 +107,7 @@ lin
s =vv.s;
pres =vv.pres;
perf = vv.perf;
morphs = vv.morphs;
--morphs = vv.morphs;
comp = vpslash.s ++ BIND ++ vpslash.pres;
comp2 = [];
ap = [];
@@ -127,7 +127,7 @@ lin
s =vpslash.s;
pres =vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
--morphs = vpslash.morphs;
comp = vpslash.comp ++ np.s ! Acc;
comp2 =vpslash.comp2; --should be empty
ap = [];
@@ -146,7 +146,7 @@ lin
s=vp.s;
pres =vp.pres;
perf = vp.perf;
morphs = vp.morphs;
--morphs = vp.morphs;
comp = adv.s;
comp2 = [];
ap =[];
@@ -164,7 +164,7 @@ lin
s=vp.s;
pres =vp.pres;
perf = vp.perf;
morphs = vp.morphs;
--morphs = vp.morphs;
comp = vp.comp;
comp2 =vp.comp;
ap = [];
@@ -187,7 +187,7 @@ lin
s =vpslash.s;
pres =vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
--morphs = vpslash.morphs;
comp = vpslash.comp;
comp2 = vpslash.comp2;
ap = [];
@@ -207,7 +207,7 @@ lin
s =vpslash.s;
pres =vpslash.pres;
perf = vpslash.perf;
morphs = vpslash.morphs;
--morphs = vpslash.morphs;
comp = vpslash.comp;
comp2 = vpslash.comp2;
ap = [];
@@ -231,7 +231,7 @@ lin
s= vv.s ++ BIND ++ vv.perf ++ vpPres;
pres = [];--vv.pres;
perf= []; -- vv.perf;
morphs = vv.morphs;
--morphs = vv.morphs;
comp=vp.comp ;
comp2 = vp.comp2;
ap = [];
@@ -246,7 +246,7 @@ lin
s= vv.s ++ BIND ++ vv.pres ++ vpPres;
pres = [];--vv.pres;
perf= [];--vv.perf;
morphs = vv.morphs;
--morphs = vv.morphs;
comp=vp.comp ;
comp2 = vp.comp2;
ap = [];
@@ -265,7 +265,7 @@ lin
s= vs.s;
pres =vs.pres;
perf=vs.perf;
morphs = vs.morphs;
--morphs = vs.morphs;
comp=s.s ;
comp2 = [];
ap = [];
@@ -286,7 +286,7 @@ lin
s= vq.s;
pres =vq.pres;
perf=vq.perf;
morphs = vq.morphs;
--morphs = vq.morphs;
comp=qs.s ;
comp2 = [];
ap = [];
@@ -312,7 +312,7 @@ lin
s= va.s;
pres =va.pres;
perf=va.perf;
morphs = va.morphs;
--morphs = va.morphs;
comp=[] ;
comp2 = [];
ap = ap.s! AgP3 Sg KI_BI;