From 0e52ffbb6a30c667d7d3eddc37b2748f13ad82e4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 1 Jul 2019 10:28:03 +0200 Subject: [PATCH] (Som) Make object pronoun and preposition(s) contract with negation. --- src/somali/ResSom.gf | 7 +++---- src/somali/SentenceSom.gf | 29 ++++++++++++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index d55bfc08..99ecc9e4 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -191,7 +191,7 @@ oper } ; Pl1 Excl => { s = table {Nom => "aan" ; Abs => "na"} ; - a = Pl1 Incl ; isPron = True ; sp ="annaga" ; + a = Pl1 Excl ; isPron = True ; sp ="annaga" ; poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"} } ; Pl1 Incl => { @@ -353,7 +353,6 @@ oper ula => "inoola" ; kaga => "inagaga" ; kula => "inagula" ; kala => "inagala" ; Single p => (prepTable ! p).s ! Pl1 Incl } ; - Pl2 => table { ugu => "idiinku" ; uga => "idiinka" ; ula => "idiinla" ; kaga => "idinkaga" ; kula => "idinkula" ; kala => "idinkala" ; @@ -651,8 +650,8 @@ oper comp = \\agr => let cmp = vps.comp ! agr in {p1 = np.s ++ cmp.p1 ; -- if object is a noun, it will come before verb in the sentence. -- if object is a pronoun, np.s is empty. - p2 = cmp.p2 ++ compl np.a vps ++ vps.secObj} -- object combines with the preposition of the verb. - } ; -- secObj in case there was a ditransitive verb. + p2 = cmp.p2 ++ compl np.a vps} -- object combines with the preposition of the verb. + } ; compl : AgreementPlus -> VerbPhrase -> Str = \a,vp -> let agr = case a of {IsPron x => x ; _ => Pl3} ; diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index 5d1298e1..c8bc9dcc 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -21,21 +21,28 @@ lin } ; subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ; subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ; - obj : {p1,p2 : Str} = vp.comp ! subj.a ; - stm : Str = - case of { - => "waa" ; - => "ma" ; - _ => case of { - => "waa" ++ subjpron ; -- to force some string from NP to show in the tree - => {-glue obj.p2-} "ma" ++ subjpron ; - => stmarkerNoContr ! subj.a ! p }} ; + obj : {p1,p2 : Str} = + let o : {p1,p2 : Str} = vp.comp ! subj.a ; + in case p of { + Pos => o ; + Neg => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ BIND} -- object pronoun, prepositions and negation all contract + } ; + stm : Str = case of { + => "waa" ; + => "ma" ; + _ => case of { + => "waa" ++ subjpron ; -- to force some string from NP to show in the tree + => "ma" ++ subjpron ; + => stmarkerNoContr ! subj.a ! p + } + } ; in subjnoun -- subject if it's a noun ++ obj.p1 -- object if it's a noun - ++ stm -- sentence type marker + possible subj. pronoun + ++ stm -- sentence type marker + possible subj. pronoun ++ vp.adv ---- TODO word order - ++ obj.p2 -- if_then_Pol p obj.p2 [] -- object if it's a pronoun + ++ obj.p2 -- object if it's a pronoun + ++ vp.secObj -- "second object" ++ pred.inf -- potential infinitive/participle ++ pred.fin -- the verb inflected } ;