From a21df23da5f51f5ee3029360f16e19ca7373098a Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Thu, 28 Nov 2019 07:12:57 +0300 Subject: [PATCH] redesigned the Verb, VerbPhrase, Cl and RCL so as to check for empty tense Markers and hence correct errors with Copulative statements. The Problem with Numeral still remains --- src/rukiga/CatCgg.gf | 4 + src/rukiga/DictCggAbs.gf | 2 +- src/rukiga/ExtraCatAbs.gf | 5 ++ src/rukiga/ExtraCggAbs.gf | 16 ++++ src/rukiga/ExtraCggAbsCgg.gf | 14 ++++ src/rukiga/LexiconCgg.gf | 2 +- src/rukiga/QuestionCgg.gf | 13 +++ src/rukiga/RelativeCgg.gf | 8 +- src/rukiga/ResCgg.gf | 38 +++++++-- src/rukiga/SentenceCgg.gf | 132 ++++++++++++++++++++++-------- src/rukiga/SentenceCggAbsCgg.gf | 33 ++++++++ src/rukiga/SentenceCggExtra.gf | 3 + src/rukiga/SentenceCggExtraAbs.gf | 25 ++++++ src/rukiga/StructuralCgg.gf | 15 ++-- src/rukiga/VerbCgg.gf | 109 ++++++++++++++++++------ 15 files changed, 344 insertions(+), 75 deletions(-) create mode 100644 src/rukiga/ExtraCatAbs.gf create mode 100644 src/rukiga/ExtraCggAbs.gf create mode 100644 src/rukiga/ExtraCggAbsCgg.gf create mode 100644 src/rukiga/SentenceCggAbsCgg.gf create mode 100644 src/rukiga/SentenceCggExtra.gf create mode 100644 src/rukiga/SentenceCggExtraAbs.gf diff --git a/src/rukiga/CatCgg.gf b/src/rukiga/CatCgg.gf index 2fa057e80..4022333e3 100755 --- a/src/rukiga/CatCgg.gf +++ b/src/rukiga/CatCgg.gf @@ -65,6 +65,8 @@ lincat perf :Str; root : Str; --morphs : Res.VFormMini => Res.VerbMorphPos =>Str; + isPresBlank :Bool; + isPerfBlank : Bool; compl : Str; -- after verb: complement, adverbs isCompApStem : Bool; whichRel: Res.RForm @@ -78,6 +80,8 @@ lincat pres: Str; perf:Str; --morphs : Res.VFormMini => Res.VerbMorphPos =>Str; --; compl : Str -- after verb: complement, adverbs + isPresBlank : Bool; + isPerfBlank : Bool; ap:Str; isRegular:Bool; adv:Str; diff --git a/src/rukiga/DictCggAbs.gf b/src/rukiga/DictCggAbs.gf index 3b21f73a4..453fccc20 100644 --- a/src/rukiga/DictCggAbs.gf +++ b/src/rukiga/DictCggAbs.gf @@ -1,4 +1,4 @@ -abstract DictEngAbs = Cat ** { +abstract DictCggAbs = Cat ** { {- --beginning of comment diff --git a/src/rukiga/ExtraCatAbs.gf b/src/rukiga/ExtraCatAbs.gf new file mode 100644 index 000000000..dc3563b08 --- /dev/null +++ b/src/rukiga/ExtraCatAbs.gf @@ -0,0 +1,5 @@ +abstract ExtraCatAbs = Cat **{ + cat + TenseExtra; + TempExtra; +} \ No newline at end of file diff --git a/src/rukiga/ExtraCggAbs.gf b/src/rukiga/ExtraCggAbs.gf new file mode 100644 index 000000000..fe1afbc65 --- /dev/null +++ b/src/rukiga/ExtraCggAbs.gf @@ -0,0 +1,16 @@ +abstract ExtraCggAbs = Cat **{ + +-- there is a default linearization for abstract +-- categories Tense and Temp +-- these in TenseX +-- + cat + AllTenses; + --TempExtra; + fun + UseClExtra : TempExtra -> Pol -> Cl -> S ; -- she had not slept + UseQClExtra : TempExtra -> Pol -> QCl -> QS ; -- who had not slept + UseRClExtra : TempExtra -> Pol -> RCl -> RS ; -- that had not slept + UseSlashExtra : TempExtra -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen + +} \ No newline at end of file diff --git a/src/rukiga/ExtraCggAbsCgg.gf b/src/rukiga/ExtraCggAbsCgg.gf new file mode 100644 index 000000000..3a23599da --- /dev/null +++ b/src/rukiga/ExtraCggAbsCgg.gf @@ -0,0 +1,14 @@ +concrete ExtraCggAbsCgg of ExtraCggAbs = CatCgg + open (R=ResCgg), (P=ParamX) in { + + lincat + AllTenses = {s : Str ; t : P.Tense; tExtra : R.TensesExtra } ; + TempExtra = {s : Str ; t : R.TensesExtra } ; + --TempExtraWithAspects = {s : Str ; t : P.Tense ; a : R.AspectsExtra } ; + fun + UseClExtra : TempTempExtra -> Pol -> Cl -> S ; -- she had not slept + UseQClExtra : TempTempExtra -> Pol -> QCl -> QS ; -- who had not slept + UseRClExtra : TempTempExtra -> Pol -> RCl -> RS ; -- that had not slept + UseSlashExtra : TempTempExtra -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen + +} \ No newline at end of file diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index 868cdd602..d623ff1b3 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -145,7 +145,7 @@ lin --today_Adv = mkAdv "erizooba" AgrNo; - father_N2 = mkN2 (mkN "tata" MU_BA) (lin Prep (mkPrep [] [] True)) ; + father_N2 = mkN2 (mkN "tata" ZERO_BAA) (lin Prep (mkPrep [] [] True)) ; distance_N3 = mkN3 (mkN "orugyendo" ZERO_BU) (lin Prep (mkPrep "kurunga" "" False)) (lin Prep (mkPrep "mpáka" "" False)); --could orugyendo work in its place? diff --git a/src/rukiga/QuestionCgg.gf b/src/rukiga/QuestionCgg.gf index eaf866e7a..352a82990 100755 --- a/src/rukiga/QuestionCgg.gf +++ b/src/rukiga/QuestionCgg.gf @@ -7,6 +7,7 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { lin --QuestCl : Cl -> QCl ; -- does John walk + QuestCl cl = cl ** {posibleSubAgr = mkSubjCliticTable}; --QuestVP : IP -> VP -> QCl ; -- who walks @@ -17,6 +18,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { root = vp.s; pres = vp.pres; perf = vp.perf; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; --morphs = vp.morphs; {- inf : Str; @@ -45,6 +48,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { root = clSlash.s; pres = clSlash.pres; perf = clSlash.perf; + isPresBlank = clSlash.isPresBlank; + isPerfBlank = clSlash.isPerfBlank; --morphs = clSlash.morphs; {- inf : Str; @@ -66,6 +71,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { pres = cl.pres; perf = cl.perf; --morphs = cl.morphs; + isPresBlank = cl.isPresBlank; + isPerfBlank = cl.isPerfBlank; {- inf : Str; pres : Str; @@ -90,6 +97,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { pres = be_Copula.pres; perf = be_Copula.perf; --morphs = be_Copula.morphs; + isPresBlank = be_Copula.isPresBlank; + isPerfBlank = be_Copula.isPerfBlank; {- inf : Str; pres : Str; @@ -108,6 +117,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { pres = be_Copula.pres; perf = be_Copula.perf; --morphs = be_Copula.morphs; + isPresBlank = be_Copula.isPresBlank; + isPerfBlank = be_Copula.isPerfBlank; {- inf : Str; pres : Str; @@ -126,6 +137,8 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { pres = be_Copula.pres; perf = be_Copula.perf; --morphs = be_Copula.morphs; + isPresBlank = be_Copula.isPresBlank; + isPerfBlank = be_Copula.isPerfBlank; {- inf : Str; pres : Str; diff --git a/src/rukiga/RelativeCgg.gf b/src/rukiga/RelativeCgg.gf index 4f62f2956..97cf02de2 100755 --- a/src/rukiga/RelativeCgg.gf +++ b/src/rukiga/RelativeCgg.gf @@ -32,6 +32,8 @@ lin perf =cl.perf; root = cl.root; --morphs = cl.morphs; + isPresBlank = cl.isPresBlank; + isPerfBlank = cl.isPerfBlank; compl =cl.compl; isCompApStem = False; whichRel = Such_That; @@ -52,6 +54,8 @@ lin perf =vp.perf; root = vp.s; --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; compl =vp.comp; isCompApStem = vp.isCompApStem; whichRel = RF RSubj; @@ -76,9 +80,11 @@ lin rp = rp.s; --rObjVariant2 = rp.rObjVariant2; pres = clSlash.pres; - perf = clSlash.perf; + perf = clSlash.perf; root = clSlash.root; --morphs = clSlash.morphs; + isPresBlank = clSlash.isPresBlank; + isPerfBlank = clSlash.isPerfBlank; compl = comp; isCompApStem = isCompApStem; whichRel = RF RObj; diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index 922ba4385..355978ad0 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -62,6 +62,13 @@ param -- may not need it NounCat = ComNoun | PropNoun; --prepositions agree with nouns to form adverbial Phrases PrepForm = Form1 | Form2; -- omu and omuri, aha, ahari + -- for Extra Tenses not implemented + -- would be better if I had alliases + TensesExtra = RemotePast | ImmediatePast | RemoteFuture; + + -- for Extra Aspects not implemented + -- would be better if I had alliases + Aspect = Performative | Perfect | Resultative | Retrospective | Habitual | Progressive | Persitive; {- Complete = Nouns with IV, Incomplete = Nouns without IV: important for use with pre-determiners @@ -100,6 +107,8 @@ oper s = rad; pres = end1; perf = end2; + isPresBlank = False; + isPerfBlank = False; --morphs = mkVerbMorphs; isRegular = False; }; @@ -109,6 +118,8 @@ oper pres = "a"; perf = "ire"; --morphs = mkVerbMorphs; + isPresBlank = False; + isPerfBlank = False; isRegular = True; }; @@ -1105,6 +1116,8 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { pres:Str; perf:Str; --morphs: VFormMini => VerbMorphPos=> Str; + isPresBlank : Bool; + isPerfBlank : Bool; isRegular:Bool }; @@ -1139,7 +1152,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { s:Str; pres:Str; perf:Str; - --morphs: VMorphs ; + --morphs: VMorphs ; + isPresBlank : Bool; + isPerfBlank : Bool; isRegular:Bool; comp:Str ; comp2:Str; @@ -1177,13 +1192,17 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { s = "ri" ; pres=[]; perf=[]; - --morphs= mkVerbMorphs; + --morphs= mkVerbMorphs; + isPresBlank = True; + isPerfBlank = True; isRegular=False }; mkBecome : Verb ={ s = "b" ; pres="a"; - perf="ire"; + perf="ire"; + isPresBlank = False; + isPerfBlank = False; --morphs= mkVerbMorphs; isRegular=False }; @@ -1339,7 +1358,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { s:Str; pres:Str; perf:Str; - --morphs: VMorphs; + --morphs: VMorphs; + isPresBlank : Bool; + isPerfBlank : Bool; comp: Str; comp2:Str; ap:Str; @@ -1362,6 +1383,8 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { root : Str; pres: Str; perf: Str; + isPresBlank : Bool; + isPerfBlank : Bool; --morphs : VFormMini => VerbMorphPos =>Str; {- inf : Str; @@ -1371,9 +1394,12 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { pastPart : Str; -- subject --root : Str ; -- dep. on Pol,Temp, e.g. "does","sleep" -} - compl : Str -- after verb: complement, adverbs + compl : Str -- after verb: complement, adverbs } ; - Comp : Type = {s:Str}; +param + CompSource = NounP | ADverb | AdjP | CommonNoun; +oper + Comp : Type = {s:Str; source : CompSource }; --Conjunctions diff --git a/src/rukiga/SentenceCgg.gf b/src/rukiga/SentenceCgg.gf index 411e349a7..8b61cb4af 100755 --- a/src/rukiga/SentenceCgg.gf +++ b/src/rukiga/SentenceCgg.gf @@ -24,54 +24,110 @@ lin compl = cl.compl in case of { - => {s = subj ++ clitic ++ --Predef.BIND ++ - root ++ Predef.BIND ++ presRestOfVerb ++ compl}; + => case cl.isPresBlank of { + True => {s = subj ++ clitic ++ root ++ compl}; + False => {s = subj ++ clitic ++ root ++ Predef.BIND ++ compl} + }; {-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-} - => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++ - root ++ presRestOfVerb ++ compl}; - => {s = subj ++ clitic ++ --Predef.BIND ++ - vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; - =>{s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++ - vMorphs!VFPresAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; + => case cl.isPresBlank of { + True => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ root ++ compl}; + False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ + root ++ Predef.BIND ++ presRestOfVerb ++ compl} + }; + => case cl.isPerfBlank of { + True => {s = subj ++ clitic ++ root ++ compl}; + False => {s = subj ++ clitic ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; + => case cl.isPerfBlank of { + True => {s = subj ++ clitic ++ root ++ compl}; + False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ + root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; - => {s = subj ++ clitic ++ --Predef.BIND ++ - root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; + => case cl.isPerfBlank of { + True => {s = subj ++ clitic ++ "ka" ++ Predef.BIND ++ root ++ compl}; + False => {s = subj ++ clitic ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; {-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-} - => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ --Predef.BIND ++ - root ++ pastRestOfVerb ++ compl}; - => {s = subj ++ clitic ++ "bire" ++ clitic ++ --Predef.BIND ++ - vMorphs!VFPastAnt!TAMarker ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; - =>{s = subj ++ clitic ++ "bire" ++ clitic ++ "ta"--Predef.BIND ++ ant!TAMarker - ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; + => case cl.isPerfBlank of { + True => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ root ++ compl}; + False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ + root ++ pastRestOfVerb ++ compl} + }; - => {s = subj ++ "ni" ++ Predef.BIND ++clitic ++ "za ku" ++ Predef.BIND ++ --choice of za over ija - root ++ Predef.BIND ++ presRestOfVerb ++ compl}; + => case cl.isPerfBlank of { + True => {s = subj ++ clitic ++ "kaba" ++Predef.BIND ++ clitic ++ + root ++ compl}; + False => {s = subj ++ clitic ++ "kaba" ++ clitic ++ "a" ++ Predef.BIND ++ + root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; + =>case cl.isPerfBlank of { + True => {s = subj ++ clitic ++ "ka" ++Predef.BIND ++ clitic ++ + root ++ compl}; + False => {s = subj ++ clitic ++ "kaba" ++ clitic ++ "taa" ++ Predef.BIND ++ + root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; + + => case cl.isPresBlank of { + True => {s = subj ++ "ni" ++ Predef.BIND ++clitic ++ "za ku" ++ Predef.BIND ++ --choice of za over ija + root ++ compl}; + False => {s = subj ++ "ni" ++ Predef.BIND ++clitic ++ "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-} - => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kuza ku" ++ Predef.BIND ++ - root ++ presRestOfVerb ++ compl}; - => {s = subj ++ "ni" ++ Predef.BIND ++clitic ++ "za kuba" ++ Predef.BIND ++ --choice of za over ija - root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; - =>{s = subj ++ "ni" ++ Predef.BIND ++ clitic ++ "za kuba" ++ clitic ++ "taka" ++ Predef.BIND ++ - root ++ pastRestOfVerb ++ compl}; - - - => {s = subj ++ clitic ++ "kaa" ++Predef.BIND ++ - root ++ Predef.BIND ++ presRestOfVerb ++ compl}; + => case cl.isPresBlank of { + True => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kuza ku" ++ Predef.BIND ++ + root ++ compl}; + False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kuza ku" ++ Predef.BIND ++ + root ++ BIND ++ presRestOfVerb ++ compl} + }; + => case cl.isPerfBlank of { + True => {s = subj ++ "ni" ++ Predef.BIND ++clitic ++ "za kuba" ++ Predef.BIND ++ clitic ++ --choice of za over ija + root ++ Predef.BIND ++ "ire" ++ compl}; + False => {s = subj ++ "ni" ++ Predef.BIND ++clitic ++ "za kuba" ++ Predef.BIND ++ clitic ++ --choice of za over ija + root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; + + => case cl.isPerfBlank of { + True => {s = subj ++ "ni" ++ Predef.BIND ++ clitic ++ "za kuba" ++ clitic ++ Predef.BIND ++ + root ++ "ire" ++ compl}; + False => {s = subj ++ "ni" ++ Predef.BIND ++ clitic ++ "za kuba" ++ clitic ++ "taka" ++ Predef.BIND ++ + root ++ pastRestOfVerb ++ compl} + }; + => case cl.isPresBlank of { + True => {s = subj ++ clitic ++ "kaa" ++Predef.BIND ++ root ++ compl}; + False => {s = subj ++ clitic ++ "kaa" ++Predef.BIND ++ + root ++ Predef.BIND ++ presRestOfVerb ++ compl} + }; {-Note: when I use pol.s instead of ti, the word alignment instead becomes worse-} - => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kaa" ++ Predef.BIND ++ - root ++ presRestOfVerb ++ compl}; - => {s = subj ++ clitic ++ "kaa"--Predef.BIND ++ - ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl}; - =>{s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kaa" ++Predef.BIND + =>case cl.isPresBlank of { + True => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kaa" ++ Predef.BIND ++ + root ++ "ire" ++ compl}; + False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kaa" ++ Predef.BIND ++ + root ++ presRestOfVerb ++ compl} + }; + + => case cl.isPerfBlank of { + True => {s = subj ++ clitic ++ "kaa" ++ root ++ compl}; + False => {s = subj ++ clitic ++ "kaa" ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + }; + + =>case cl.isPerfBlank of { + True => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kaa" ++Predef.BIND + ++ root ++ Predef.BIND ++ "ire" ++ compl}; + False => {s = subj ++ "ti" ++ Predef.BIND ++ clitic ++ "kaa" ++Predef.BIND ++ root ++ Predef.BIND ++ pastRestOfVerb ++ compl} + } }; --: Temp -> Pol -> QCl -> QS ; -- has John walked -- These are the 2 x 4 x 4 = 16 forms generated by different -- combinations of tense, polarity, and -- anteriority, which are defined in [``Common`` Common.html]. UseQCl = UseCl; -- : Temp -> Pol -> Cl -> S ; -- John has not walked - QuestCl qcl = qcl; --: Cl -> QCl ; -- does John (not) walk + --UseRCl : Temp -> Pol -> RCl -> RS ; -- that had not slept UseRCl temp pol rcl = let @@ -231,6 +287,8 @@ lin perf = vp.perf; root = vp.s; --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; {- inf = mkVerbInrf vp.root; pres = mkVerbPres vp.root; @@ -248,6 +306,8 @@ lin perf = vp.perf; root = vp.s; --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; {- inf = mkVerbInrf vp.root; pres = mkVerbPres vp.root; @@ -256,7 +316,7 @@ lin pastPart = mkVerbPastPart vp.root; -- subject -} --root = vp.root ; - compl = mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp + compl = mkSubjClitic np.agr ++ vp.comp --mkSubjClitic np.agr ++ Predef.BIND ++ vp.comp } };--: NP -> VP -> Cl ; -- John walks / John does not walk @@ -309,6 +369,8 @@ lin pres = vpslash.pres; perf = vpslash.perf; --morphs = vpslash.morphs; + isPresBlank = vpslash.isPresBlank; + isPerfBlank = vpslash.isPerfBlank; ap = vpslash.ap; isRegular = vpslash.isRegular; adv = vpslash.adv; diff --git a/src/rukiga/SentenceCggAbsCgg.gf b/src/rukiga/SentenceCggAbsCgg.gf new file mode 100644 index 000000000..b01aad45b --- /dev/null +++ b/src/rukiga/SentenceCggAbsCgg.gf @@ -0,0 +1,33 @@ +concrete SentenceCggAbsCgg of SentenceCggAbs = CatCgg + open (R=ResCgg) in { + + lincat + ExtTense = {s : Str ; t : R.TensesExtra } ; + TempExtra = {s : Str ; t : R.TensesExtra a : R.Aspects} ; + Aspect = {s : Str ; a : R.AspectsExtra } ; + lin + --TAspect -> ExtTense ->Ant -> TempExtra ; + TAspect extT a ={s = extT.s ++ a.s; t = exT.t; a = a.a}; + --TRPast : ExtTense ; -- bakagyenda [Remote past] + TRPast = {s = [] ; t = R.Remotepast }; + --TIPast : ExtTense ; -- baagyenda [Immediate Past or Memorial ] + TIPast = {s =[] ; t = R.ImmediatePast}; + --TRFut : ExtTense ; -- I sleep/slept [simultaneous, not compound] + TRFut = {s = [] ; t = R.RemoteFut}; + + --APerformative : Aspect ; -- I slept [past, "imperfect"] --# notpresent + APerformative = {s = []; a = R.Performative }; + APerfect = {s = []; a = R.Perfect }; -- I will sleep [future] --# notpresent + ARes = {s = []; a = R.Resultative }; -- I would sleep [conditional] --# notpresent + ARetr = {s = []; a = R.Retrospective }; -- I have slept/had slept [anterior, "compound", "perfect"] --# notpresent + AHab = {s = []; a = R.Habitual }; + AProg = {s = []; a = R.Progrssive }; + APer = {s = []; a = R.Persitive }; + UseClExtra : TempExtra -> Pol -> Cl -> S ; -- she had not slept + + + --UseQClExtra : TempExtra -> Pol -> QCl -> QS ; -- who had not slept + --UseRClExtra : TempExtra -> Pol -> RCl -> RS ; -- that had not slept + --UseSlashExtra : TempExtra -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen + +} \ No newline at end of file diff --git a/src/rukiga/SentenceCggExtra.gf b/src/rukiga/SentenceCggExtra.gf new file mode 100644 index 000000000..07dfb0815 --- /dev/null +++ b/src/rukiga/SentenceCggExtra.gf @@ -0,0 +1,3 @@ +abstract SentenceCggExtra = Cat **{ + +} \ No newline at end of file diff --git a/src/rukiga/SentenceCggExtraAbs.gf b/src/rukiga/SentenceCggExtraAbs.gf new file mode 100644 index 000000000..b21c3f093 --- /dev/null +++ b/src/rukiga/SentenceCggExtraAbs.gf @@ -0,0 +1,25 @@ +abstract SentenceCggExtraAbs = Cat **{ + + cat + ExtTense; + TempExtra; + Aspect; + fun + TAspect -> ExtTense ->Ant -> TempExtra ; + TRPast : ExtTense ; -- bakagyenda [Remote past] + TIPast : ExtTense ; -- baagyenda [Immediate Past or Memorial ] + TRFut : ExtTense ; -- I sleep/slept [simultaneous, not compound] + APerformative : Aspect ; -- I slept [past, "imperfect"] --# notpresent + APerfect : Aspect ; -- I will sleep [future] --# notpresent + ARes : Aspect ; -- I would sleep [conditional] --# notpresent + ARetr : Aspect ; -- I have slept/had slept [anterior, "compound", "perfect"] --# notpresent + AHab : Aspect ; + AProg : Aspect ; + APer : Aspect ; + + + UseClExtra : TempExtra -> Pol -> Cl -> S ; -- she had not slept + UseQClExtra : TempExtra -> Pol -> QCl -> QS ; -- who had not slept + UseRClExtra : TempExtra -> Pol -> RCl -> RS ; -- that had not slept + UseSlashExtra : TempExtra -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen +} \ No newline at end of file diff --git a/src/rukiga/StructuralCgg.gf b/src/rukiga/StructuralCgg.gf index 95b361720..64ec1527b 100755 --- a/src/rukiga/StructuralCgg.gf +++ b/src/rukiga/StructuralCgg.gf @@ -97,7 +97,8 @@ lin n = Sg }; - have_V2 ={s= "ine"; pres=[]; perf =[]; morphs = mkVerbMorphs; comp = []; isRegular=False}; --: V2 ; + have_V2 ={s= "ine"; pres=[]; perf =[]; isPresBlank = False; + isPerfBlank = False; morphs = mkVerbMorphs; comp = []; isRegular=False}; --: V2 ; {- All Predeterminers are given here. @@ -203,12 +204,16 @@ lin doesAgree = True };--: Det ; - want_VV = {s = "yend"; pres="da"; perf = "zire"; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth}; - can8know_VV = {s = "baas"; pres="a"; perf = "ize"; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (capacity) - can_VV = {s = "baas"; pres="a"; perf = "ize"; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (possibility) + want_VV = {s = "yend"; pres="da"; perf = "zire"; isPresBlank = False; + isPerfBlank = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth}; + can8know_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; + isPerfBlank = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (capacity) + can_VV = {s = "baas"; pres="a"; perf = "ize"; isPresBlank = False; + isPerfBlank = False; morphs=mkVerbMorphs; isRegular=True; inf=[]; whenUsed = VVBoth};--: VV ; -- can (possibility) -- must_VV used especially in the perfective mood: see dictionary entry shemerera on Pg 501 of Mpairwe -- must has no passive form - must_VV = {s = "shemere"; pres="ra"; perf = "ire"; morphs=mkVerbMorphs; isRegular=False; inf=[]; whenUsed = VVPerf}; --VV + must_VV = {s = "shemere"; pres="ra"; perf = "ire"; isPresBlank = False; + isPerfBlank = False; morphs=mkVerbMorphs; isRegular=False; inf=[]; whenUsed = VVPerf}; --VV --somebody_NP = {}; --: NP ; --something_NP : NP ; --somewhere_Adv : Adv ; diff --git a/src/rukiga/VerbCgg.gf b/src/rukiga/VerbCgg.gf index f94d4e12b..f2832cfcc 100755 --- a/src/rukiga/VerbCgg.gf +++ b/src/rukiga/VerbCgg.gf @@ -8,7 +8,9 @@ lin s = v.s ; pres =v.pres; perf = v.perf; - --morphs = v.morphs; + --morphs = v.morphs; + isPresBlank = v.isPresBlank; + isPerfBlank = v.isPerfBlank; comp =[]; comp2 = []; ap =[]; @@ -23,14 +25,35 @@ lin -- UseComp : Comp -> VP ; -- be warm means complement of a copula especially adjectival Phrase --AdjectivalPhrase : Type = {s : Str ; post : Str; isPre : Bool; isProper : Bool; isPrep: Bool}; - UseComp comp = let auxBe = mkBecome - - in - { - s = auxBe.s ++ BIND ++auxBe.pres++ comp.s; --Assuming there is no AP which is prepositional + UseComp comp = + --let auxBe = mkBecome + --in + case comp.source of{ + AdjP => { + s = mkBecome.s ++ BIND ++ mkBecome.pres; --Assuming there is no AP which is prepositional + pres =[]; + perf = []; + isPresBlank = True; + isPerfBlank = True; + --morphs=\\form,morphs=>[]; + comp = comp.s; + comp2 = []; + ap = []; + isCompApStem = True; + agr = AgrNo; + isRegular = False; + adv = []; + containsAdv =False; + adV =[]; + containsAdV = False + }; + _ => { + s = mkBecome.s ++ BIND ++mkBecome.pres++ comp.s; --Assuming there is no AP which is prepositional pres =[]; perf = []; --morphs=\\form,morphs=>[]; + isPresBlank = True; + isPerfBlank = True; comp = []; comp2 = []; ap = []; @@ -41,27 +64,32 @@ lin containsAdv =False; adV =[]; containsAdV = False - }; --its not generating any sentence + } + }; --its not generating any sentence + + -- CompAP : AP -> Comp; -- (be) small - CompAP ap = {s=ap.s! AgP3 Sg KI_BI}; -- used a hack. + CompAP ap = {s=ap.s! AgP3 Sg KI_BI; source = AdjP}; -- used a hack. -- CompNP : NP -> Comp ; -- (be) the man - CompNP np = {s= np.s ! Acc}; --{s =[] ; post =np.s; isPre = False; isProper = Bool; isPrep: Bool}; + CompNP np = {s= np.s ! Acc; source = NounP}; --{s =[] ; post =np.s; isPre = False; isProper = Bool; isPrep: Bool}; -- CompAdv : Adv -> Comp ; -- (be) here - CompAdv adv =adv; + CompAdv adv ={ s= adv.s; source = ADverb}; {- This has been a hack to simply pick the sigular and complete noun. -} --CompCN : CN -> Comp ; -- (be) a man/men - CompCN cn = {s =cn.s ! Sg ! Complete} ; -- (be) a man/men + CompCN cn = {s =cn.s ! Sg ! Complete; source = CommonNoun} ; -- (be) a man/men -- SlashV2a : V2 -> VPSlash ; -- love (it) SlashV2a v2 ={ s =v2.s; pres =v2.pres; perf = v2.perf; --morphs = v2.morphs; + isPresBlank = v2.isPresBlank; + isPerfBlank = v2.isPerfBlank; comp = []; comp2 =[]; ap =[]; @@ -76,7 +104,9 @@ lin s =v3.s; pres =v3.pres; perf = v3.perf; - --morphs = v3.morphs; + --morphs = v3.morphs; + isPresBlank = v3.isPresBlank; + isPerfBlank = v3.isPerfBlank; comp = np.s ! Acc; comp2 =[]; ap =[]; @@ -93,6 +123,8 @@ lin pres =v3.pres; perf = v3.perf; --morphs = v3.morphs; + isPresBlank = v3.isPresBlank; + isPerfBlank = v3.isPerfBlank; comp = np.s ! Acc; comp2 = np.s ! Acc; -- what is the meaning of this function? ap = []; @@ -107,8 +139,13 @@ lin s =vv.s; pres =vv.pres; perf = vv.perf; - --morphs = vv.morphs; - comp = vpslash.s ++ BIND ++ vpslash.pres; + --morphs = vv.morphs; + isPresBlank = vv.isPresBlank; + isPerfBlank = vv.isPerfBlank; + comp = case vv.isPresBlank of { + False => vpslash.s ++ BIND ++ vpslash.pres; + _ => vpslash.s + }; comp2 = []; ap = []; isRegular = vv.isRegular; @@ -127,7 +164,9 @@ lin s =vpslash.s; pres =vpslash.pres; perf = vpslash.perf; - --morphs = vpslash.morphs; + --morphs = vpslash.morphs; + isPresBlank = vpslash.isPresBlank; + isPerfBlank = vpslash.isPerfBlank; comp = vpslash.comp ++ np.s ! Acc; comp2 =vpslash.comp2; --should be empty ap = []; @@ -146,7 +185,9 @@ lin s=vp.s; pres =vp.pres; perf = vp.perf; - --morphs = vp.morphs; + --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; comp = adv.s; comp2 = []; ap =[]; @@ -164,9 +205,11 @@ lin s=vp.s; pres =vp.pres; perf = vp.perf; - --morphs = vp.morphs; + --morphs = vp.morphs; + isPresBlank = vp.isPresBlank; + isPerfBlank = vp.isPerfBlank; comp = vp.comp; - comp2 =vp.comp; + comp2 =vp.comp2; ap = []; isCompApStem = False; agr = AgrNo; @@ -187,7 +230,9 @@ lin s =vpslash.s; pres =vpslash.pres; perf = vpslash.perf; - --morphs = vpslash.morphs; + --morphs = vpslash.morphs; + isPresBlank = vpslash.isPresBlank; + isPerfBlank = vpslash.isPerfBlank; comp = vpslash.comp; comp2 = vpslash.comp2; ap = []; @@ -207,7 +252,9 @@ lin s =vpslash.s; pres =vpslash.pres; perf = vpslash.perf; - --morphs = vpslash.morphs; + --morphs = vpslash.morphs; + isPresBlank = vpslash.isPresBlank; + isPerfBlank = vpslash.isPerfBlank; comp = vpslash.comp; comp2 = vpslash.comp2; ap = []; @@ -231,7 +278,9 @@ lin s= vv.s ++ BIND ++ vv.perf ++ vpPres; pres = [];--vv.pres; perf= []; -- vv.perf; - --morphs = vv.morphs; + --morphs = vv.morphs; + isPresBlank = True; + isPerfBlank = True; comp=vp.comp ; comp2 = vp.comp2; ap = []; @@ -246,7 +295,9 @@ lin s= vv.s ++ BIND ++ vv.pres ++ vpPres; pres = [];--vv.pres; perf= [];--vv.perf; - --morphs = vv.morphs; + --morphs = vv.morphs; + isPresBlank = True; + isPerfBlank = True; comp=vp.comp ; comp2 = vp.comp2; ap = []; @@ -265,7 +316,9 @@ lin s= vs.s; pres =vs.pres; perf=vs.perf; - --morphs = vs.morphs; + --morphs = vs.morphs; + isPresBlank = vs.isPresBlank; + isPerfBlank = vs.isPerfBlank; comp=s.s ; comp2 = []; ap = []; @@ -286,7 +339,9 @@ lin s= vq.s; pres =vq.pres; perf=vq.perf; - --morphs = vq.morphs; + --morphs = vq.morphs; + isPresBlank = vq.isPresBlank; + isPerfBlank = vq.isPerfBlank; comp=qs.s ; comp2 = []; ap = []; @@ -312,7 +367,9 @@ lin s= va.s; pres =va.pres; perf=va.perf; - --morphs = va.morphs; + --morphs = va.morphs; + isPresBlank = va.isPresBlank; + isPerfBlank = va.isPerfBlank; comp=[] ; comp2 = []; ap = ap.s! AgP3 Sg KI_BI; @@ -327,7 +384,7 @@ lin -- Copula alone --UseCopula : VP ; -- be - UseCopula = mkBecome ** { + UseCopula = be_Copula ** { comp=[]; comp2 = []; ap = [];