From a23881f2dc7ecd6fad69326dee8e96b422b5ee71 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 13 Sep 2019 19:13:20 +0200 Subject: [PATCH] (Som) Minor cleanup + better comments --- src/somali/QuestionSom.gf | 21 +++++++---------- src/somali/ResSom.gf | 47 +++++++++++++++------------------------ 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/somali/QuestionSom.gf b/src/somali/QuestionSom.gf index 095d3409..8bd06455 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -10,27 +10,22 @@ concrete QuestionSom of Question = CatSom ** open -- : IP -> VP -> QCl ; QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP - let clRaw : ClSlash = predVP ip vp ; - cl : ClSlash = clRaw ** { - stm = \\clt,p => case of { - <_,Pos> => "baa" ; - _ => clRaw.stm ! clt ! p } - } + let cls : ClSlash = predVP ip vp ; + cl : ClSlash = cls ** { + stm = modSTM "baa" cls.stm + } ; in cl2qcl (notB ip.contractSTM) cl ; -- : IP -> ClSlash -> QCl ; -- whom does John love QuestSlash ip cls = let clsIPFocus = cls ** { - subj = cls.subj ** { -- place IP first in the sentence, - noun = ip.s ! Nom -- keep old subject pronoun. + subj = cls.subj ** { -- keep old subject pronoun, + noun = ip.s ! Nom -- and place IP first. } ; obj2 = cls.obj2 ** { -- move old subject noun before object. - s = cls.subj.noun ++ cls.obj2.s + s = cls.subj.noun ++ cls.obj2.s } ; - stm : ClType=>Polarity=>Str = - \\clt,p => case of { - <_,Pos> => "baa" ; - _ => cls.stm ! clt ! p } + stm = modSTM "baa" cls.stm } ; in cl2qclslash (notB ip.contractSTM) clsIPFocus ; diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 8116924f..d1f7032c 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -877,15 +877,7 @@ oper _ => predRaw -- Any other verb } ; - stm = \\cltyp,pol => - case of { - => showSTM vp.stm ; - => "ma" ; - => "ma" ; - => "sow" ; - => [] ; - => "aan" - } ; + stm = mkStm vp.stm ; comp = vp.comp ! subj.a ; vComp = vp.vComp ** { subcl = vp.vComp.subcl ! subj.a @@ -1062,28 +1054,25 @@ oper infVP : VerbPhrase -> Str = linVP VInf Statement ; - waaContr : Agreement => Polarity => Str = \\a,b => - let stm = if_then_Pol b "w" "m" - in stm + subjpron ! a ; + STMarker : Type = ClType => Polarity => Str ; - waaNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p => - case p of { - Pos => {p1 = "waa" ; p2 = subjpron ! a} ; - Neg => {p1 = "ma" ; p2 = []} } ; - - waxaNoContr : Agreement => Polarity => {p1,p2 : Str} = \\a,p => - case p of { - Pos => {p1 = "waxa" ; p2 = subjpron ! a} ; - Neg => {p1 = "ma" ; p2 = []} } ; -- TODO: find out how to properly negate waxa clauses! - - subjpron : Agreement => Str = table { - Sg1|Pl1 Excl => "aan" ; - Pl1 Incl => "aynu" ; - Sg2|Pl2 => "aad" ; - Sg3 Masc => "uu" ; - Impers => [] ; - _ => "ay" } ; + mkStm : STM -> STMarker = \stm -> + \\cltyp,pol => + case of { + => showSTM stm ; + => "ma" ; + => "ma" ; + => "sow" ; + => [] ; + => "aan" + } ; + modSTM : Str -> STMarker -> STMarker = \str,stm -> + \\cltyp,pol => + case of { + <_,Pos> => str ; + _ => stm ! cltyp ! pol + } ; -------------------------------------------------------------------------------- -- linrefs