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" Cl = Res.Clause ; -- declarative clause, with all tenses e.g. "she looks at this"
--Questions --Questions
QCl = Res.Clause ** {posibleSubAgr: Res.Agreement =>Str} ; QCl = Res.Clause ** {posibleSubAgr: Res.Agreement =>Str} ;
IComp = {s : Str; other:Str; n : Res.INumber; requiresSubjPrefix: Bool;endOfSentence : Bool} ; IComp =
IP = {s :Str ; other:Str; n : Res.INumber; isVerbSuffix: Bool; requiresIPPrefix: Bool; aux:Str; endOfSentence:Bool}; -- other holds the Idet without a prefix {
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}; IAdv = {s : Str ; requiresSubjPrefix: Bool; endOfSentence:Bool};
IDet = {s : Str ; n : Res.Number; requiresSubjPrefix: Bool}; IDet = {s : Str ; n : Res.Number; requiresSubjPrefix: Bool};
IQuant = {s : Res.Number =>Str ; requiresSubjPrefix: Bool}; IQuant = {s : Res.Number =>Str ; requiresSubjPrefix: Bool};

View File

@@ -8,7 +8,7 @@ lin
--UsePN : PN -> NP ; -- John --UsePN : PN -> NP ; -- John
UsePN pn = {s = \\ _ => pn.s; agr = pn.a}; -- John UsePN pn = {s = \\ _ => pn.s; agr = pn.a}; -- John
{need use of a pre} {- need use of a pre -}
UsePron pron = UsePron pron =
let default3PAgr = (AgP3 Sg KI_BI) let default3PAgr = (AgP3 Sg KI_BI)
in case <pron.agr> of { 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 compl = cl.compl -- after verb: complement, adverbs
} ; } ;
--QuestIComp : IComp -> NP -> QCl ; -- where is John --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 -> IP ; -- which five songs
IdetCN idet cn = let num = case idet.n of{ IdetCN idet cn = let num = case idet.n of{
@@ -89,8 +149,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
case idet.requiresSubjPrefix of { 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}; 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; other =[]; n=num; 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 --IdetIP : IDet -> IP ; -- which five
--Noun Class has been ignored --Noun Class has been ignored
@@ -102,7 +162,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
in in
{ {
s = idet.s ; s = idet.s ;
other = idet.s;
isVerbSuffix=False; isVerbSuffix=False;
n=num; requiresIPPrefix=True; n=num; requiresIPPrefix=True;
aux= "ni"; aux= "ni";
@@ -118,24 +178,24 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in {
CompIAdv iadv = CompIAdv iadv =
{ {
s =iadv.s ; s =iadv.s ;
other = [];
n = INeut; n = INeut;
isVerbSuffix=False; isVerbSuffix=False;
requiresSubjPrefix =False; requiresSubjPrefix =False;
requiresIPPrefix=False; requiresIPPrefix=False;
aux=[]; aux=[];
usesAux = False;
endOfSentence=iadv.endOfSentence endOfSentence=iadv.endOfSentence
}; };
--CompIP : IP -> IComp ; -- who (is it) --CompIP : IP -> IComp ; -- who (is it)
CompIP ip = CompIP ip =
{ {
s = ip.s; s = ip.s;
other =ip.other;
n = ip.n; n = ip.n;
isVerbSuffix = ip.isisVerbSuffix; isVerbSuffix = ip.isVerbSuffix;
requiresSubjPrefix = False; requiresSubjPrefix = False;
requiresIPPrefix = ip.requiresIPPrefix; requiresIPPrefix = ip.requiresIPPrefix;
aux=ip.aux; aux=ip.aux;
usesAux = True;
endOfSentence= ip.endOfSentence; endOfSentence= ip.endOfSentence;
}; };

View File

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

View File

@@ -158,10 +158,10 @@ lin
{-Beggining of Interrogative Pronoun-} {-Beggining of Interrogative Pronoun-}
whatPl_IP = { s= "ki"; other =[]; n = IPl; isVerbSuffix = True; requiresIPPrefix = False; aux=[]; endOfSentence = True} ; -- what (plural) whatPl_IP = { s= "ki"; 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) whatSg_IP = { s= "ki"; 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) whoPl_IP = { s= "ha"; 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) 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. --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 ; how_IAdv = {s ="ta"; requiresSubjPrefix = True; endOfSentence =True}; --: IAdv ;
--how8much_IAdv = {s ="kwiga"; s2requireSubjPrefix = True};--: IAdv ; --how8much_IAdv = {s ="kwiga"; s2requireSubjPrefix = True};--: IAdv ;
@@ -170,7 +170,7 @@ lin
where_IAdv = {s ="nkahe"; requiresSubjPrefix = False; endOfSentence =True}; --: IAdv ; where_IAdv = {s ="nkahe"; requiresSubjPrefix = False; endOfSentence =True}; --: IAdv ;
why_IAdv = {s ="ahabweki"; requiresSubjPrefix = False; endOfSentence =False};--: 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 ; which_IQuant ={s =\\_ =>"ha"; requiresSubjPrefix = False};--: IQuant ;