diff --git a/src/rukiga/AdjectiveCgg.gf b/src/rukiga/AdjectiveCgg.gf index 25fef1a76..8707eb45b 100755 --- a/src/rukiga/AdjectiveCgg.gf +++ b/src/rukiga/AdjectiveCgg.gf @@ -1,7 +1,7 @@ --# -path=.:../prelude:../abstract:../common concrete AdjectiveCgg of Adjective = CatCgg ** - open (Res = ResCgg), Prelude, ParamX in { + open ResCgg, Prelude, ParamX in { lin @@ -19,11 +19,11 @@ lin --AdAP : AdA -> AP -> AP ; -- very warm AdAP ada ap = case ada.position1 of { - Post => {s = \\agr => ap.s ! agr ++ ada.s; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep}; - Pre => {s = \\agr => ada.s ++ ap.s!agr ; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep} + Pre => {s = \\agr => ada.s ++ ap.s!agr ; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep}; + Post => {s = \\agr => ap.s ! agr ++ ada.s; position1= ap.position1; isProper = ap.isProper; isPrep = ap.isPrep} + }; - -{- + {- abstract Adjective = Cat ** { fun @@ -62,4 +62,4 @@ abstract Adjective = Cat ** { -} -} +} \ No newline at end of file diff --git a/src/rukiga/ConjunctionCgg.gf b/src/rukiga/ConjunctionCgg.gf index 230a68c4b..1fbe99d75 100755 --- a/src/rukiga/ConjunctionCgg.gf +++ b/src/rukiga/ConjunctionCgg.gf @@ -2,14 +2,20 @@ concrete ConjunctionCgg of Conjunction = CatCgg ** open ResCgg, Coordination, Prelude in { -{- + + + lincat + [NP] = {s1,s2 :Case => Str ; agr : Agreement}; + [CN] = {s1,s2 : Number => NounState => Str; gender:Gender}; + [AP] = {s1,s2 : Agreement=> Str ; position1 : Position1; isProper : Bool; isPrep: Bool}; + [RS] = {s1,s2 : RForm => Str}; + --[IAdv] = {s1,s2 : Str} ; + {- [S] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Str} ; [AdV] = {s1,s2 : Str} ; - [IAdv] = {s1,s2 : Str} ; - [NP] = {s1,s2 : NPCase => Str ; a : Agr} ; - [AP] = {s1,s2 : Agr => Str ; isPre : Bool}; + [RS] = {s1,s2 : Agr => Str ; c : NPCase}; [CN] = {s1,s2 : Number => Case => Str}; [DAP] = {s1,s2 : Str ; n : Number}; diff --git a/src/rukiga/NounCgg.gf b/src/rukiga/NounCgg.gf index bb3cb73c4..61a8672df 100755 --- a/src/rukiga/NounCgg.gf +++ b/src/rukiga/NounCgg.gf @@ -6,18 +6,18 @@ concrete NounCgg of Noun = CatCgg ** lin --UsePN : PN -> NP ; -- John - UsePN pn = {s = \\ _ => pn.s; agr = pn.a}; -- John + UsePN pn = {s = \\ _ => pn.s; agr = pn.a; nounCat = PropNoun}; -- John {- need use of a pre -} UsePron pron = let default3PAgr = (AgP3 Sg KI_BI) in case of { - <(AgrYes a)> => {s = pron.s; agr = a}; --: Pron -> NP ; -- he - <_> => {s = pron.third !default3PAgr; agr = default3PAgr} + <(AgrYes a)> => {s = pron.s; agr = a; nounCat = ComNoun}; --: Pron -> NP ; -- he + <_> => {s = pron.third !default3PAgr; agr = default3PAgr; nounCat = ComNoun} }; --UsePron pron = pron; -- the result of use pron is a NounPhrase --MassNP : CN -> NP ; -- (beer) - MassNP cn = {s = \\_ =>cn.s ! Sg ! Complete; agr = AgP3 Sg cn.gender}; --: CN -> NP ; -- milk + MassNP cn = {s = \\_ =>cn.s ! Sg ! Complete; agr = AgP3 Sg cn.gender; nounCat = ComNoun}; --: CN -> NP ; -- milk --DetCN det cn = mkDeterminer det cn; --Should be nemed mkDetCN DetCN det cn = mkDetCN det cn; -- the man {- @@ -30,38 +30,39 @@ lin --Noun = {s : NounType=>Number => Str ; nc : NClass} ; --AdjCN ap cn = {s=\\ntype, num=>cn.s!ntype!num ++ ap.s!AgP3 num cn.nc; nc=cn.nc}; + --AdjCN : AP -> CN -> CN ; -- big house AdjCN ap cn = case of { => { s = \\ num, ns =>ap.s ! AgP3 Sg KI_BI ++ cn.s ! num ! ns ; - gender = cn.gender + gender = cn.gender; nounCat = cn.nounCat }; => case ap.isPrep of { False => { s = \\ num, ns => cn.s ! num ! ns ++ mkAdjPronIVClitic (AgP3 num cn.gender) ++ ap.s ! AgP3 Sg KI_BI; - gender = cn.gender + gender = cn.gender; nounCat = cn.nounCat }; True => { s = \\ num, ns => (cn.s ! num ! ns) ++ mkGenPrepNoIVClitic (AgP3 num cn.gender) ++ ap.s ! AgP3 Sg KI_BI; - gender = cn.gender + gender = cn.gender; nounCat = cn.nounCat } }; => { s = \\ num, ns => mkAdjPronIVClitic (AgP3 num cn.gender) ++ ap.s ! AgP3 Sg KI_BI ++ (cn.s ! num ! ns) ; - gender = cn.gender + gender = cn.gender; nounCat = cn.nounCat }; => { s = \\ num, ns => (cn.s ! num ! ns) ++ ap.s ! AgP3 Sg KI_BI; - gender = cn.gender + gender = cn.gender; nounCat = cn.nounCat } }; -- big house --RelCN : CN -> RS -> CN ; -- house that John bought - RelCN cn rs = {s=\\n,ns => cn.s !n ! ns ++ rs.s! (RF RObj); gender = cn.gender }; + RelCN cn rs = {s=\\n,ns => cn.s !n ! ns ++ rs.s! (RF RObj); gender = cn.gender; nounCat = cn.nounCat}; {- A predeterminer is any word that modifies a noun Phrase. @@ -73,23 +74,23 @@ lin accS = np.s ! Acc; in case of { - => {s = \\_ =>nomS ++ mkPredetPref a ++ predet.s ; agr = a}; + => {s = \\_ =>nomS ++ mkPredetPref a ++ predet.s ; agr = a; nounCat = np.nounCat}; => {s = \\_ =>nomS ++ mkPredetPref a ++ predet.s ++ - mkPredetPref a ++ predet.s2; agr = a}; - => {s = \\_ =>nomS ++ predet.s ; agr = a}; - => {s = \\_ =>nomS ++ predet.s ++ predet.s2; agr = a} -- never seen this case + mkPredetPref a ++ predet.s2; agr = a; nounCat = np.nounCat}; + => {s = \\_ =>nomS ++ predet.s ; agr = a; nounCat = np.nounCat}; + => {s = \\_ =>nomS ++ predet.s ++ predet.s2; agr = a; nounCat = np.nounCat} -- never seen this case }; --AdvNP : NP -> Adv -> NP ; -- Paris today - AdvNP np adv = {s= \\c => np.s ! c ++ adv.s; agr = np.agr }; + 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}; + {s= \\c => np.s!c ++ mkSubjClitic np.agr ++ v2.s ++ BIND ++ v2.morphs!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}; -- how do I do the adverbial clause? + ExtAdvNP np adv = {s= \\c => np.s ! c ++ embedInCommas adv.s; agr = np.agr; nounCat = np.nounCat}; -- how do I do the adverbial clause? -- Determiner: Type = {s:Str; ntype:NounType; num:Number; pos:Position}; -- type for Determier necessary for catCgg.gf - RelNP np rs ={s = \\c => np.s ! c ++ rs.s! (RF RSubj); agr =np.agr}; + RelNP np rs ={s = \\c => np.s ! c ++ rs.s! (RF RSubj); agr =np.agr; nounCat = np.nounCat}; -- The determiner has a fine-grained structure, in which a 'nucleus' -- quantifier and an optional numeral can be discerned. --DetQuant : Quant -> Num -> Det ; -- these five @@ -132,7 +133,7 @@ lin --OrdNumeralSuperl : Numeral -> A -> Ord ; -- third largest OrdNumeralSuperl numeral a = {s= \\c => numeral.s !NOrd !c ++ "omu" ++ "kukirayo" ++ "obu" ++ BIND ++ a.s; position1 = a.position1}; -- AdvCN : CN -> Adv -> CN ; -- house on the hill - AdvCN cn adv ={s=\\ntype,num =>cn.s!ntype!num ++ adv.s; gender=cn.gender}; + AdvCN cn adv ={s=\\ntype,num =>cn.s!ntype!num ++ adv.s; gender=cn.gender; nounCat = cn.nounCat}; -- Pronouns have possessive forms. Genitives of other kinds -- of noun phrases are not given here, since they are not possible -- in e.g. Romance languages. They can be found in $Extra$ modules. @@ -162,57 +163,57 @@ lin ComplN2 n2 np = { s = \\n, ns => n2.s ! n ! ns ++ n2.c2 ! mkAgreement n2.gender P1 n ++ np.s !Acc; - gender=n2.gender}; + gender=n2.gender; nounCat = n2.nounCat}; --ComplN3 : N3 -> NP -> N2 ; -- distance from this city (to Paris) ComplN3 n3 np = {s = \\n, ns => n3.s ! n ! ns ++ n3.c2 ! mkAgreement n3.gender P1 n ++ np.s !Acc; c2 = n3.c3; - gender=n3.gender}; + gender=n3.gender; nounCat = n3.nounCat}; -- we choose n3 because it is important when using the na conjunction --2 Apposition -- This is certainly overgenerating. --ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y) - ApposCN cn np ={s = \\n, ns => cn.s! n!ns ++ np.s !Nom; gender = cn.gender}; + ApposCN cn np ={s = \\n, ns => cn.s! n!ns ++ np.s !Nom; gender = cn.gender; nounCat = cn.nounCat}; -- This is different from the partitive, as shown by many languages. --CountNP : Det -> NP -> NP ; -- three of them, some of the boys CountNP det np = case det.doesAgree of { - True => {s=\\c=> np.s!c ++ "emye ahari" ++ det.s2 ! np.agr; agr = np.agr}; - False => {s=\\c=> np.s!c ++ det.s; agr = np.agr} + True => {s=\\c=> np.s!c ++ "emye ahari" ++ det.s2 ! np.agr; agr = np.agr; nounCat = np.nounCat}; + False => {s=\\c=> np.s!c ++ det.s; agr = np.agr; nounCat = np.nounCat} }; --Determiners can form noun phrases directly. --DetNP : Det -> NP ; -- these five DetNP det = case det.doesAgree of { - True => {s=\\_=> det.s2 ! AgP3 Sg KI_BI; agr = AgP3 Sg KI_BI}; - False => {s=\\c=> det.s; agr = AgP3 Sg KI_BI} + True => {s=\\_=> det.s2 ! AgP3 Sg KI_BI; agr = AgP3 Sg KI_BI; nounCat = ComNoun}; + False => {s=\\c=> det.s; agr = AgP3 Sg KI_BI; nounCat = ComNoun} }; -- Nouns can also be modified by embedded sentences and questions. -- For some nouns this makes little sense, but we leave this for applications -- to decide. Sentential complements are defined in [Verb Verb.html]. --SentCN : CN -> SC -> CN -SentCN cn sc = {s = \\ n, ns => cn.s!n!ns ++ sc.s; gender = cn.gender}; +SentCN cn sc = {s = \\ n, ns => cn.s!n!ns ++ sc.s; gender = cn.gender; nounCat = cn.nounCat}; -- Relational nouns can also be used without their arguments. -- The semantics is typically derivative of the relational meaning. --UseN2 : N2 -> CN ; -- mother - UseN2 n2 = {s = n2.s; gender = n2.gender}; + UseN2 n2 = {s = n2.s; gender = n2.gender; nounCat = n2.nounCat}; --Use2N3 : N3 -> N2 ; -- distance (from this city) - Use2N3 n3 = {s = n3.s; gender = n3.gender; c2 = n3.c2}; + Use2N3 n3 = {s = n3.s; gender = n3.gender; nounCat = n3.nounCat; c2 = n3.c2}; --Use3N3 : N3 -> N2 ; -- distance (to Paris) - Use3N3 n3 = {s = n3.s; gender = n3.gender; c2 = n3.c3}; + Use3N3 n3 = {s = n3.s; gender = n3.gender; nounCat = n3.nounCat; c2 = n3.c3}; -- (New 13/3/2013 AR; Structural.possess_Prep and part_Prep should be deprecated in favour of these.) --PossNP : CN -> NP -> CN ; -- house of Paris, house of mine - PossNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender}; + PossNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender; nounCat = cn.nounCat}; --PartNP : CN -> NP -> CN ; -- glass of wine - PartNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender}; + PartNP cn np ={s =\\n,ns => cn.s! n ! ns ++ mkGenPrepNoIVClitic np.agr ++ np.s ! Nom; gender = cn.gender; nounCat = cn.nounCat}; {- --1 Noun: Nouns, noun phrases, and determiners diff --git a/src/rukiga/QuestionCgg.gf b/src/rukiga/QuestionCgg.gf index b05132685..e0c759cbe 100755 --- a/src/rukiga/QuestionCgg.gf +++ b/src/rukiga/QuestionCgg.gf @@ -6,9 +6,9 @@ concrete QuestionCgg of Question = CatCgg ** open ResCgg, Prelude in { -- with an interrogative. lin - --QuestCl : Cl -> QCl ; -- does John walk - QuestCl cl = cl ** {posibleSubAgr = mkSubjCliticTable;}; - --QuestVP : IP -> VP -> QCl ; -- who walks + --QuestCl : Cl -> QCl ; -- does John walk + QuestCl cl = cl ** {posibleSubAgr = mkSubjCliticTable}; + --QuestVP : IP -> VP -> QCl ; -- who walks QuestVP ip vp = { s = ip.s; diff --git a/src/rukiga/RelativeCgg.gf b/src/rukiga/RelativeCgg.gf index 7b1c72818..e592c73d3 100755 --- a/src/rukiga/RelativeCgg.gf +++ b/src/rukiga/RelativeCgg.gf @@ -62,7 +62,7 @@ lin let comp = case clSlash.complType of{ Ap => clSlash.ap; Adverbial => clSlash.adv; - AdverbVerbial => clSlash.adV; + AdverbialVerb => clSlash.adV; _ => [] }; isCompApStem = case clSlash.complType of{ diff --git a/src/rukiga/ResCgg.gf b/src/rukiga/ResCgg.gf index b0d3d9c03..ad24f77dc 100755 --- a/src/rukiga/ResCgg.gf +++ b/src/rukiga/ResCgg.gf @@ -75,7 +75,7 @@ VVMood = VVImp | VVPerf | VVBoth; oper -- the is for Common Nouns only - Noun : Type = {s : Number=> NounState=> Str ; gender : Gender} ; + Noun : Type = {s : Number=> NounState=> Str ; gender : Gender; nounCat:NounCat} ; ivs : pattern Str = #("a" | "e" | "o"); --pattern for initial vowels @@ -88,7 +88,8 @@ oper Sg => table {Complete => sg; Incomplete => Predef.drop 1 sg}; Pl => table {Complete => pl; Incomplete => Predef.drop 1 pl} }; - gender = g + gender = g; + nounCat = ComNoun; }; @@ -213,12 +214,13 @@ oper that label because is helps us disambiguate which preposition to use for in, on and at i.e LOCATIVES omuri, ahari, etc -} - ProperNoun : Type = {s: Str ; a:Agreement ; isPlace : Bool}; + ProperNoun : Type = {s: Str ; a:Agreement ; isPlace : Bool; nounCat:NounCat}; mkPN : Str -> Agreement -> Bool -> ProperNoun = \ pn, a, b-> { s = pn ; a = a; isPlace = b; + nounCat = PropNoun; } ; -- concatenates the string left to right @@ -1076,9 +1078,9 @@ mkSubjPrefix : Agreement -> Str =\a ->case a of { let subjClitic = mkSubjClitic (AgP3 det.num cn.gender) in case of { - => {s = \\_=> subjClitic ++ cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender}; - => {s = \\_=>cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender}; - => { s =\\_ => det.s ++ cn.s !n ! det.ntype; agr = AgP3 det.num cn.gender} --; + => {s = \\_=> subjClitic ++ cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat}; + => {s = \\_=>cn.s!det.num! det.ntype ++ subjClitic ++ det.s; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat}; + => { s =\\_ => det.s ++ cn.s !n ! det.ntype; agr = AgP3 det.num cn.gender; nounCat = cn.nounCat} --; -- => {s = \\_=> cn.s!det.ntype!det.num; agr = AgP3 det.num cn.gender } }; diff --git a/src/rukiga/StructuralCgg.gf b/src/rukiga/StructuralCgg.gf index 6697c5be4..579fda0c9 100755 --- a/src/rukiga/StructuralCgg.gf +++ b/src/rukiga/StructuralCgg.gf @@ -61,7 +61,7 @@ lin and_Conj = { s = table { AConj Other => "kandi"; - _ => "na" + _ => "na" -- used to link nouns, pronouns, relative subject clauses, relative object clauses and adjectival nouns or infinitives (okuzana na okwikruka }; s2 =[]; @@ -224,6 +224,20 @@ lin but_PConj = ss "báìtu"; --: PConj ; -- variants béìtu otherwise_PConj = ss "okûndi"; --: PConj ; therefore_PConj = ss "n'ahabwe'êkyo"; --: PConj ; + {- + and_Conj : Conj ; + both7and_DConj : Conj ; -- both...and + both7and_DConj : DConj ; + but_PConj : PConj ; + either7or_DConj : Conj ; -- either...or + either7or_DConj : DConj ; + or_Conj : Conj ; + otherwise_PConj : PConj ; + therefore_PConj : PConj ; + if_then_Conj : Conj ; + + -} + {- --1 Structural: Structural Words --