diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index f0da1e000..2c6a090f3 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -122,4 +122,5 @@ linref VP = linVP VInf ; CN = linCN ; Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ; + S = \s -> linBaseCl (s.s ! False) ; } diff --git a/src/somali/NounSom.gf b/src/somali/NounSom.gf index fe8bfb9e5..051308f33 100644 --- a/src/somali/NounSom.gf +++ b/src/somali/NounSom.gf @@ -225,18 +225,18 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { AdjCN ap cn = cn ** { s = table { NomSg => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker. x => cn.s ! x } ; - mod = \\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs - ++ case cn.hasMod of { - True => "oo" ; - False => [] } - ++ ap.s ! AF n c ; + mod = let conj = if_then_Str cn.hasMod "oo" [] in + \\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs + ++ conj -- If the sentence is already modified, any new modifier needs to be introduced with conjunction + ++ ap.s ! AF n c ; hasMod = True } ; -- : CN -> RS -> CN ; RelCN cn rs = cn ** { - mod = \\n,c => cn.mod ! n ! c ++ rs.s ! gender cn ! c ; + mod = let conj = if_then_Str cn.hasMod "ee" [] in + \\n,c => cn.mod ! n ! c ++ conj ++ rs.s ! gender cn ! c ; hasMod = True ; } ; diff --git a/src/somali/NumeralSom.gf b/src/somali/NumeralSom.gf index e542ee6f7..e472a6e11 100644 --- a/src/somali/NumeralSom.gf +++ b/src/somali/NumeralSom.gf @@ -102,7 +102,7 @@ lin pot2plus d e = d ** { n = Pl} ; lin pot2as3 n = n ; lin pot3 n = n ** { - thousand = "kun" ; + thousand = n.thousand ++ "kun" ; ord = n.s ! Kow ++ "kunaad" ; --da = M KA ; -- TODO check n = Pl } ; diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index 85e1f5894..e13ee1d45 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -154,7 +154,7 @@ oper _ => Sg3 g } ; getNum : Agreement -> Number = \a -> - case a of { Sg1|Sg2|Sg3 _ => Sg ; _ => Pl } ; + case a of { Sg1|Sg2|Sg3 _|Impers => Sg ; _ => Pl } ; plAgr : Agreement -> Agreement = \agr -> case agr of { Sg1 => Pl1 Excl ; diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index d25ad109c..f369b7e51 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -161,16 +161,13 @@ oper emptyNP : NounPhrase = { s = \\_ => [] ; - a = Pl3 ; + a = Sg3 Masc ; isPron = False ; empty = [] ; st = Indefinite } ; - impersNP : NounPhrase = emptyNP ** { - a = Impers ; - isPron = True - } ; + impersNP : NounPhrase = pronTable ! Impers ; -------------------------------------------------------------------------------- -- Pronouns @@ -234,7 +231,7 @@ oper poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"} } ; Impers => { - s = table {Nom => "la" ; Abs => "la"} ; + s = \\_ => [] ; -- the string `la' comes from Passive (: PrepCombination) a = Impers ; isPron = True ; sp = \\_ => "" ; empty = [] ; st = Definite ; poss = {s, short = quantTable "??" ; sp = gnTable "??" "??" "??"} @@ -787,17 +784,19 @@ oper predVP : NounPhrase -> VerbPhrase -> Clause = \np,vps -> { s = \\cltyp,t,a,p => let predRaw : {fin : Str ; inf : Str} = vf cltyp t a p subj.a vp ; - pred : {fin : Str ; inf : Str} = case of { - => {fin,inf = []} ; - <_ , _, Copula> => {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ; - _ => predRaw + pred : {fin : Str ; inf : Str} = case of { + + => {fin,inf = []} ; -- If the VP is formed with CompNP + <_ , _,Pres,NoCopula|Copula, _> -- Comp* present tense + => {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ; + _ => predRaw } ; subjnoun : Str = if_then_Str np.isPron np.empty (subj.s ! Nom) ; subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ; obj : {p1,p2 : Str} = let o : {p1,p2 : Str} = vp.comp ! subj.a ; - bind : Str = case of { - => [] ; + bind : Str = case of { + => [] ; _ => BIND } ; in case of { => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} ; @@ -809,7 +808,7 @@ oper p2 = if_then_Pol p subjpron []} ; Question => {p1 = "ma" ; p2 = []} ; -- TODO find out how negative questions work Statement => case of { - => {p1 = "waa" ; p2 = []} ; + => {p1 = "waa" ; p2 = []} ; _ => stmarkerNoContr ! subj.a ! p }} ; in (wordOrder subjnoun subjpron stm obj pred vp) ; } where { diff --git a/src/somali/unittest/cl.gftest b/src/somali/unittest/cl.gftest new file mode 100644 index 000000000..b0ad409f3 --- /dev/null +++ b/src/somali/unittest/cl.gftest @@ -0,0 +1,11 @@ +-- LangEng: the books that the men buy +LangSom: buugaag BIND ta niman BIND ku iibsadaan +Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN book_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (SlashV2a buy_V2))))))) NoVoc + +-- LangEng: the men that buy the books +LangSom: niman BIND ka buugaag BIND ta iibsada +Lang: PhrUtt NoPConj (UttNP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N)))))))) NoVoc + +-- LangEng: the men that buy the books are these +LangSom: niman BIND ka buugaag BIND ta iibsadaa waa kuwan +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumPl) (RelCN (UseN man_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant DefArt NumPl) (UseN book_N))))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumPl))))))) NoVoc diff --git a/src/somali/unittest/vp.gftest b/src/somali/unittest/vp.gftest index eac88d2bf..6b32ac525 100644 --- a/src/somali/unittest/vp.gftest +++ b/src/somali/unittest/vp.gftest @@ -13,7 +13,7 @@ LangSom: waa ay ku arkeen Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron they_Pron) (ComplSlash (SlashV2a see_V2) (UsePron youSg_Pron))))) NoVoc -- LangEng: they didn't see you -LangSom: ku &+ ma arkin +LangSom: ku BIND ma arkin Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PNeg (PredVP (UsePron they_Pron) (ComplSlash (SlashV2a see_V2) (UsePron youSg_Pron))))) NoVoc -- LangEng: you taught yourself @@ -21,7 +21,7 @@ LangSom: waa aad isku bartay Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron youSg_Pron) (ReflVP (SlashV2a teach_V2))))) NoVoc -- LangEng: you don't teach yourself -LangSom: isku &+ ma barto +LangSom: isku BIND ma barto Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youSg_Pron) (ReflVP (SlashV2a teach_V2))))) NoVoc -- LangEng: one saw you @@ -48,7 +48,7 @@ LangSom: hooyo waa ay ina kaa siisey Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (MassNP (UseN2 mother_N2)) (ComplSlash (Slash3V3 give_V3 (UsePron we_Pron)) (UsePron youSg_Pron))))) NoVoc -- LangEng: mother didn't give you us -LangSom: hooyo ina &+ ma ay kaa siin +LangSom: hooyo ina BIND ma ay kaa siin Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PNeg (PredVP (MassNP (UseN2 mother_N2)) (ComplSlash (Slash3V3 give_V3 (UsePron we_Pron)) (UsePron youSg_Pron))))) NoVoc -- LangEng: he gave himself bread @@ -56,7 +56,7 @@ LangSom: rooti waa uu is siiyey Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron he_Pron) (ReflVP (Slash2V3 give_V3 (MassNP (UseN bread_N))))))) NoVoc -- LangEng: one adds salt to the meat -LangSom: hilib &+ ka cusbo waa lagu daraa +LangSom: hilib BIND ka cusbo waa lagu daraa Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (GenericCl (ComplSlash (Slash3V3 add_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))) (MassNP (UseN salt_N)))))) NoVoc -- LangEng: one can add salt to meat @@ -71,5 +71,5 @@ LangSom: waa aan ka dul boodi karaa Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV can_VV (UseV jump_V)) (PrepNP above_Prep (UsePron it_Pron)))))) NoVoc -- LangEng: you can't jump above me -LangSom: iga &+ ma dul boodi karto +LangSom: iga BIND ma dul boodi karto Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron youSg_Pron) (AdvVP (ComplVV can_VV (UseV jump_V)) (PrepNP above_Prep (UsePron i_Pron)))))) NoVoc