diff --git a/src/somali/NounSom.gf b/src/somali/NounSom.gf index 2bc9db63d..37be7bf66 100644 --- a/src/somali/NounSom.gf +++ b/src/somali/NounSom.gf @@ -13,15 +13,15 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { a = getAgr det.n (gender cn) } where { sTable : Case => Str = \\c => let nfc : {nf : NForm ; c : Case} = - case of { + case of { -- Numbers => {nf=Numerative ; c=c} ; -- special form for fem. nouns - <_,Nom,False,Indefinite,Sg> => {nf=NomSg ; c=c} ; + <_,Nom,NoMod|OtherMod,Indefinite,Sg> => {nf=NomSg ; c=c} ; -- If cn has modifier, Nom ending attaches to the modifier - <_,Nom,True,_,_> => {nf=Def det.n ; c=Abs} ; + <_,Nom,AMod,_,_> => {nf=Def det.n ; c=Abs} ; -- a Det with st=Indefinite uses Indef forms <_,_,_,Indefinite,n> => {nf=Indef n ; c=c} ; @@ -258,27 +258,28 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { AdjCN ap cn = cn ** { s = table { -- Add oo after Numerative only if this is CN's first modifier. Numerative => cn.s ! Numerative - ++ andConj Indefinite (notB cn.hasMod) ; + ++ andConj Indefinite (notMod cn.modtype) ; NomSg => cn.s ! Indef Sg ; -- Add adj -> noun loses case marker nf => cn.s ! nf } ; mod = \\st,n,c => cn.mod ! st ! n ! Abs -- If there was something before, it is now in Abs - ++ andConj st cn.hasMod -- If the sentence is already modified, any new modifier needs to be introduced with conjunction + ++ andConj st cn.modtype -- If the sentence is already modified, any new modifier needs to be introduced with conjunction ++ ap.s ! AF n c ; - hasMod = True + modtype = AMod } ; -- : CN -> RS -> CN ; RelCN cn rs = cn ** { s = table { - Numerative => cn.s ! Numerative ++ andConj Indefinite (notB cn.hasMod) ; - NomSg => cn.s ! Indef Sg ; -- Add adj -> noun loses case marker + Numerative => cn.s ! Numerative ++ andConj Indefinite (notMod cn.modtype) ; nf => cn.s ! nf } ; mod = \\st,n,c => --what to do with subject case if there's both adj and RS? cn.mod ! st ! n ! Abs - ++ andConj st cn.hasMod + ++ andConj st cn.modtype ++ rs.s ! st ! gennum cn Sg ! c ; -- gennum cn Sg, because plural form is only for 1st person plural - hasMod = True ; + modtype = case cn.modtype of { + AMod => AMod ; + _ => OtherMod } } ; {- @@ -307,11 +308,23 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { PossNP cn np = cn ** { -- guriga Axmed, not Axmed gurigiisa mod = \\st,n,c => cn.mod ! st ! n ! c ++ objpron np ! Abs } ; -{- + -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples - PartNP cn np = cn ** { } ; - + PartNP cn np = cn ** { + s = table { + Numerative => cn.s ! Numerative ++ andConj Indefinite (notMod cn.modtype) ; + nf => cn.s ! nf } ; + mod = \\st,n,c => + cn.mod ! st ! n ! c + ++ andConj st cn.modtype -- If the sentence is already modified, any new modifier needs to be introduced with conjunction + ++ np.s ! Abs + ++ "ah" ; + modtype = case cn.modtype of { + AMod => AMod ; + _ => OtherMod } + } ; +{- -- This is different from the partitive, as shown by many languages. @@ -329,10 +342,10 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { -} oper - andConj : State -> Bool -> Str = \st,hasMod -> - case of { - => "oo" ; - => "ee" ; - _ => [] + andConj : State -> ModType -> Str = \st,mod -> + case of { + => "oo" ; + => "ee" ; + _ => [] } ; } diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index b0c12e9a8..531a3a35e 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -224,6 +224,15 @@ oper param AForm = AF Number Case ; ---- TODO: past tense + ModType = NoMod | AMod | OtherMod ; + +oper + -- to flip ModType + notMod : ModType -> ModType = \mt -> case mt of { + NoMod => OtherMod ; + _ => NoMod + } ; + -------------------------------------------------------------------------------- -- Prepositions diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 3a90d39b7..32bb9d9cc 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -15,7 +15,7 @@ oper CNoun : Type = Noun ** { mod : State -- for conjunctions: oo for indef, ee for def => Number => Case => Str ; - hasMod : Bool ; + modtype : ModType ; isPoss : Bool -- to prevent impossible forms in ComplN2 with Ns that have short possessive, e.g. "father" } ; @@ -159,7 +159,7 @@ oper False => np.s} ; useN : Noun -> CNoun ** BaseNP = \n -> n ** - { mod = \\_,_,_ => [] ; hasMod = False ; + { mod = \\_,_,_ => [] ; modtype = NoMod ; a = Sg3 (gender n) ; isPron,isPoss = False ; empty = [] ; st = Indefinite } ;