From db4126c61f6acff428e8d5fe4d31acee490dc84f Mon Sep 17 00:00:00 2001 From: David Bamutura Date: Sun, 19 May 2019 10:14:10 +0200 Subject: [PATCH] =Finished Implementation of PhraseCgg.gf --- src/rukiga/AdjectiveCgg.gf | 2 +- src/rukiga/CatCgg.gf | 2 +- src/rukiga/LexiconCgg.gf | 2 +- src/rukiga/NounCgg.gf | 2 +- src/rukiga/PhraseCgg.gf | 35 +++++++++++++++++++++++++++++++++++ src/rukiga/SentenceCgg.gf | 2 +- src/rukiga/VerbCgg.gf | 2 +- 7 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/rukiga/AdjectiveCgg.gf b/src/rukiga/AdjectiveCgg.gf index 37574c5e8..25fef1a76 100755 --- a/src/rukiga/AdjectiveCgg.gf +++ b/src/rukiga/AdjectiveCgg.gf @@ -10,7 +10,7 @@ lin -- The superlative use is covered in $Ord$. --AdjOrd : Ord -> AP ; -- warmest - AdjOrd ord = {s= \\agr => ord.s!agr ; position1= ord.position1; isProper = False; isPrep = False}; + AdjOrd ord = {s= \\agr => ord.s!agr ; position1= ord.position1; isProper = False; isPrep = False}; -- UseComparA : A -> AP ; -- warmer UseComparA a ={s =\\_ => a.s ++ BIND ++ "ho" ++ "kukira"; position1= a.position1; isProper = a.isProper; isPrep = a.isPrep}; diff --git a/src/rukiga/CatCgg.gf b/src/rukiga/CatCgg.gf index 4e7960608..106bec4f4 100755 --- a/src/rukiga/CatCgg.gf +++ b/src/rukiga/CatCgg.gf @@ -75,7 +75,7 @@ lincat 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 =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap; VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres; diff --git a/src/rukiga/LexiconCgg.gf b/src/rukiga/LexiconCgg.gf index dda3c50ee..9e035e7cb 100755 --- a/src/rukiga/LexiconCgg.gf +++ b/src/rukiga/LexiconCgg.gf @@ -149,7 +149,7 @@ lin distance_N3 = mkN3 (mkN "orugyendo" ZERO_BU) (lin Prep (mkPrep "kurunga" "" False)) (lin Prep (mkPrep "mpáka" "" False)); --could orugyendo work in its place? - + alas_Interj ={s="ninkasharwe"}; --: Interj ; oper aboutP = mkPrep "about" ; diff --git a/src/rukiga/NounCgg.gf b/src/rukiga/NounCgg.gf index b4f4f169c..826c70136 100755 --- a/src/rukiga/NounCgg.gf +++ b/src/rukiga/NounCgg.gf @@ -126,7 +126,7 @@ lin OrdNumeral numeral ={s=numeral.s!NOrd; position1 = Post}; --OrdSuperl : A -> Ord ; -- warmest --Adjective : Type = {s : Str ; position1 : Position1; isProper : Bool; isPrep: Bool}; - OrdSuperl a = {s= \\c => "okukirayo" ++ a.s ++ (mkAdjPronIVClitic c) ++ BIND ++ "ona"; position1 = a.position1}; + OrdSuperl a = {s= \\c => "okukirayo" ++ (mkAdjPronIVClitic c) ++ "obu" ++ BIND ++ a.s; position1 = a.position1} ;--{s= \\c => "okukirayo" ++ (mkAdjPronIVClitic c) ++ a.s ++ ++ BIND ++ "ona"; position1 = a.position1}; -- One can combine a numeral and a superlative. --OrdNumeralSuperl : Numeral -> A -> Ord ; -- third largest OrdNumeralSuperl numeral a = {s= \\c => numeral.s !NOrd !c ++ "omu" ++ "kukirayo" ++ "obu" ++ BIND ++ a.s; position1 = a.position1}; diff --git a/src/rukiga/PhraseCgg.gf b/src/rukiga/PhraseCgg.gf index 7e2459edd..2ca796c69 100755 --- a/src/rukiga/PhraseCgg.gf +++ b/src/rukiga/PhraseCgg.gf @@ -27,6 +27,41 @@ lin Neg => (mkSubjClitic (AgMUBAP2 Pl)) ++ imp.s!ImpNeg } }; + + --UttAdv : Adv -> Utt ; -- here + UttAdv adv = {s= adv.s}; + + --can be improved upon + UttVP vp = {s = vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap }; + + UttAP ap = {s=ap.s!(AgP3 Sg KI_BI)}; + + -- There are also 'one-word utterances'. A typical use of them is + -- as answers to questions. + -- *Note*. This list is incomplete. More categories could be covered. + -- Moreover, in many languages e.g. noun phrases in different cases + -- can be used. + + --UttIP : IP -> Utt ; -- who + UttIP ip ={s=ip.s}; + --UttIAdv : IAdv -> Utt ; -- why + UttIAdv iAdv = case iAdv.requiresSubjPrefix of { + True => {s= mkSubjClitic (AgP3 Sg MU_BA) ++ iAdv.s}; + False => {s= iAdv.s} + }; + + --UttNP : NP -> Utt ; -- this man + --UttNP np = {s= np.s!Nom}; + --UttAdv : Adv -> Utt ; -- here + --UttAdv adv ={s = adv.s}; + --UttVP : VP -> Utt ; -- to sleep + --UttCN : CN -> Utt ; -- house + UttCN cn ={s=cn.s!Sg!Complete}; + --UttCard : Card -> Utt ; -- five + UttCard card ={s = card.s!(AgP3 Sg MU_BA)}; + --UttAP : AP -> Utt ; -- fine + --UttInterj : Interj -> Utt ; -- alas + UttInterj interj =interj; {- --1 Phrase: Phrases and Utterances diff --git a/src/rukiga/SentenceCgg.gf b/src/rukiga/SentenceCgg.gf index 48890cf4a..7f9378605 100755 --- a/src/rukiga/SentenceCgg.gf +++ b/src/rukiga/SentenceCgg.gf @@ -86,7 +86,7 @@ lin ImpPos => vp.s ++ Predef.BIND ++ vp.morphs!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.comp; + 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 } diff --git a/src/rukiga/VerbCgg.gf b/src/rukiga/VerbCgg.gf index 700cb6c4d..a42e63a92 100755 --- a/src/rukiga/VerbCgg.gf +++ b/src/rukiga/VerbCgg.gf @@ -222,7 +222,7 @@ lin --This function requires the remodelling of VP to accomodate two Verbs. -- -} - ComplVV vv vp = let vpPres = vp.s ++ BIND ++ vp.pres; + 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;