Implemented QuestIComp in QuestionCgg.gf and edesigned IAdv, IP and IComp

This commit is contained in:
David Bamutura
2019-05-30 15:30:54 +02:00
parent 9488cae6f4
commit 0ee7f24982
5 changed files with 89 additions and 21 deletions

View File

@@ -16,8 +16,17 @@ lincat
Cl = Res.Clause ; -- declarative clause, with all tenses e.g. "she looks at this"
--Questions
QCl = Res.Clause ** {posibleSubAgr: Res.Agreement =>Str} ;
IComp = {s : Str; other:Str; n : Res.INumber; requiresSubjPrefix: Bool;endOfSentence : Bool} ;
IP = {s :Str ; other:Str; n : Res.INumber; isVerbSuffix: Bool; requiresIPPrefix: Bool; aux:Str; endOfSentence:Bool}; -- other holds the Idet without a prefix
IComp =
{
s : Str;
--other:Str; Has been deleted but note that there are several words for asking questions
n : Res.INumber;
requiresSubjPrefix: Bool;
requiresIPPrefix: Bool;
usesAux : Bool;
endOfSentence : Bool
} ;
IP = {s :Str ; n : Res.INumber; isVerbSuffix: Bool; requiresIPPrefix: Bool; aux:Str; endOfSentence:Bool}; -- other holds the Idet without a prefix
IAdv = {s : Str ; requiresSubjPrefix: Bool; endOfSentence:Bool};
IDet = {s : Str ; n : Res.Number; requiresSubjPrefix: Bool};
IQuant = {s : Res.Number =>Str ; requiresSubjPrefix: Bool};

View File

@@ -8,7 +8,7 @@ lin
--UsePN : PN -> NP ; -- John
UsePN pn = {s = \\ _ => pn.s; agr = pn.a}; -- John
{need use of a pre}
{- need use of a pre -}
UsePron pron =
let default3PAgr = (AgP3 Sg KI_BI)
in case <pron.agr> of {

View File

@@ -77,7 +77,67 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
compl = cl.compl -- after verb: complement, adverbs
} ;
--QuestIComp : IComp -> NP -> QCl ; -- where is John
--QuestIComp icomp
{-
This function always uses the auxiliary. When we meet questions that may or may not use it, we shall
querry the usesAux field
-}
QuestIComp icomp np = case <icomp.endOfSentence, icomp.requiresSubjPrefix> of {
<True, True> =>{ --such as ta?
s = np.s ! Acc;
subjAgr = np.agr; -- no option but to just pick one
posibleSubAgr = mkSubjCliticTable;
root = be_Copula.s;
pres = be_Copula.pres;
perf = be_Copula.perf;
morphs = be_Copula.morphs;
{-
inf : Str;
pres : Str;
past : Str;
presPart : Str;
pastPart : Str; -- subject
--root : Str ; -- dep. on Pol,Temp, e.g. "does","sleep"
-}
compl = mkSubjCliticTable ! np.agr ++ icomp.s -- after verb: complement, adverbs
} ;
<True, False> =>{ -- such as nkahe?
s = np.s ! Acc;
subjAgr = np.agr; -- no option but to just pick one
posibleSubAgr = mkSubjCliticTable;
root = be_Copula.s;
pres = be_Copula.pres;
perf = be_Copula.perf;
morphs = be_Copula.morphs;
{-
inf : Str;
pres : Str;
past : Str;
presPart : Str;
pastPart : Str; -- subject
--root : Str ; -- dep. on Pol,Temp, e.g. "does","sleep"
-}
compl = icomp.s -- after verb: complement, adverbs
} ;
<_, _> => {
s = icomp.s;
subjAgr = np.agr; -- no option but to just pick one
posibleSubAgr = mkSubjCliticTable;
root = be_Copula.s;
pres = be_Copula.pres;
perf = be_Copula.perf;
morphs = be_Copula.morphs;
{-
inf : Str;
pres : Str;
past : Str;
presPart : Str;
pastPart : Str; -- subject
--root : Str ; -- dep. on Pol,Temp, e.g. "does","sleep"
-}
compl = np.s ! Acc -- after verb: complement, adverbs
}
};
--IdetCN : IDet -> CN -> IP ; -- which five songs
IdetCN idet cn = let num = case idet.n of{
@@ -85,12 +145,12 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
Pl => IPl
};
in
in
case idet.requiresSubjPrefix of {
True => {s = cn.s!idet.n!Complete ++ mkSubjPrefix (mkAgreement cn.gender P3 idet.n) ++ idet.s; other =[]; n = num; isVerbSuffix=False; requiresIPPrefix=True; aux= "ni"; endOfSentence = True};
False => { s = cn.s!idet.n!Complete ++ idet.s; isVerbSuffix=False; other =[]; n=num; requiresIPPrefix=True; aux= "ni"; endOfSentence = True}
True => {s = cn.s!idet.n!Complete ++ mkSubjPrefix (mkAgreement cn.gender P3 idet.n) ++ idet.s; n = num; isVerbSuffix=False; requiresIPPrefix=True; aux= "ni"; endOfSentence = True};
False => { s = cn.s!idet.n!Complete ++ idet.s; isVerbSuffix=False; n=num; requiresIPPrefix=True; aux= "ni"; endOfSentence = True}
};
--IdetIP : IDet -> IP ; -- which five
--Noun Class has been ignored
@@ -102,7 +162,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
in
{
s = idet.s ;
other = idet.s;
isVerbSuffix=False;
n=num; requiresIPPrefix=True;
aux= "ni";
@@ -118,24 +178,24 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
CompIAdv iadv =
{
s =iadv.s ;
other = [];
n = INeut;
isVerbSuffix=False;
requiresSubjPrefix =False;
requiresIPPrefix=False;
aux=[];
aux=[];
usesAux = False;
endOfSentence=iadv.endOfSentence
};
--CompIP : IP -> IComp ; -- who (is it)
CompIP ip =
{
s = ip.s;
other =ip.other;
n = ip.n;
isVerbSuffix = ip.isisVerbSuffix;
isVerbSuffix = ip.isVerbSuffix;
requiresSubjPrefix = False;
requiresIPPrefix = ip.requiresIPPrefix;
aux=ip.aux;
usesAux = True;
endOfSentence= ip.endOfSentence;
};

View File

@@ -553,7 +553,6 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
mkSStand :Agreement -> Str = \a -> case a of {
AgMUBAP1 Sg => "nyowe";
AgMUBAP1 Pl => "itwe";
AgMUBAP1 Pl => "aba" ;
AgMUBAP2 Sg => "iwe" ; --probably an error check your grammar book
AgMUBAP2 Pl => "imwe" ;
AgP3 Sg MU_BA => "uwe" ;
@@ -1093,7 +1092,7 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
--Verb : Type = {s : VFormMini => Str};
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
@@ -1153,8 +1152,8 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of {
isAux = True};
mkBecome : Verb ={
be_Copula : Verb = {s = "ri" ; pres=[]; perf=[]; morphs= mkVerbMorphs; isRegular=False};
mkBecome : Verb ={
s = "b" ; pres="a"; perf="ire"; morphs= mkVerbMorphs; isRegular=False};

View File

@@ -158,10 +158,10 @@ lin
{-Beggining of Interrogative Pronoun-}
whatPl_IP = { s= "ki"; other =[]; n = IPl; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True} ; -- what (plural)
whatSg_IP = { s= "ki"; other =[]; n = ISg; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True}; --: IP ; -- what (singular)
whoPl_IP = { s= "ha"; other =[]; n = IPl; isVerbSuffix = True; requiresIPPrefix = False; aux="ni"; endOfSentence = True} ;--: IP ; -- who (plural)
whoSg_IP = { s= "ha"; other =[]; n = ISg; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True}; --: IP ; -- who (singular)
whatPl_IP = { s= "ki"; n = IPl; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True} ; -- what (plural)
whatSg_IP = { s= "ki"; n = ISg; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True}; --: IP ; -- what (singular)
whoPl_IP = { s= "ha"; n = IPl; isVerbSuffix = True; requiresIPPrefix = False; aux="ni"; endOfSentence = True} ;--: IP ; -- who (plural)
whoSg_IP = { s= "ha"; n = ISg; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True}; --: IP ; -- who (singular)
--You may need to use booleans to indicate that you need these tables rather than carrying them.
how_IAdv = {s ="ta"; requiresSubjPrefix = True; endOfSentence =True}; --: IAdv ;
--how8much_IAdv = {s ="kwiga"; s2requireSubjPrefix = True};--: IAdv ;
@@ -170,7 +170,7 @@ lin
where_IAdv = {s ="nkahe"; requiresSubjPrefix = False; endOfSentence =True}; --: IAdv ;
why_IAdv = {s ="ahabweki"; requiresSubjPrefix = False; endOfSentence =False};--: IAdv ;
how8many_IDet ={s ="ngahe"; other =[]; n =Pl; requiresSubjPrefix = False; endOfSentence = True};--: IDet ;
how8many_IDet ={s ="ngahe"; n =Pl; requiresSubjPrefix = False; endOfSentence = True};--: IDet ;
which_IQuant ={s =\\_ =>"ha"; requiresSubjPrefix = False};--: IQuant ;