diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index 338f4b7a8..538816379 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -23,10 +23,11 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in { -- Constructed in QuestionSom. QCl = ResSom.QClause ; - IP = ResSom.NounPhrase ** {contractSTM : Bool} ; IComp = SS ; -- interrogative complement of copula e.g. "where" IDet = ResSom.Determiner ; -- interrogative determiner e.g. "how many" IQuant = ResSom.Quant ; -- interrogative quantifier e.g. "which" + IP = ResSom.NounPhrase ** {contractSTM : Bool} ; -- like NP but may contract with STM + IAdv = ResSom.IAdv ; --2 Subord clauses and pronouns @@ -116,8 +117,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in { N3 = ResSom.Noun3 ; PN = ResSom.PNoun ; - Adv, - IAdv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb. + Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb. linref -- Cl = linCl ; diff --git a/src/somali/PhraseSom.gf b/src/somali/PhraseSom.gf index dd1e596c9..c9c18c396 100644 --- a/src/somali/PhraseSom.gf +++ b/src/somali/PhraseSom.gf @@ -5,6 +5,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in { UttS s = {s = s.s ! False} ; UttQS qs = qs ; + UttIAdv iadv = iadv ; UttImpSg pol imp = let ma = case pol.p of { Pos => [] ; Neg => "ma" } @@ -15,8 +16,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in { UttIP ip = {s = ip.s ! Abs} ; UttNP np = {s = np.s ! Abs} ; UttVP vp = {s = infVP vp} ; - UttAdv, - UttIAdv = \adv -> {s = linAdv adv} ; + UttAdv adv = {s = linAdv adv} ; UttCN n = {s = linCN n} ; UttCard n = {s = n.s ! Mid} ; UttAP ap = { s = ap.s ! AF Sg Abs } ; diff --git a/src/somali/QuestionSom.gf b/src/somali/QuestionSom.gf index 0cdf05245..bf230a1b6 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -1,5 +1,5 @@ concrete QuestionSom of Question = CatSom ** open - Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (AS=AdverbSom) in { + Prelude, ResSom, ParadigmsSom, (VS=VerbSom), (NS=NounSom), (SS=StructuralSom) in { -- A question can be formed from a clause ('yes-no question') or -- with an interrogative. @@ -24,7 +24,7 @@ concrete QuestionSom of Question = CatSom ** open subj = cls.subj ** {noun = ip.s ! Nom} ; -- place IP first in the sentence, keep old subject pronoun. obj2 = cls.obj2 ** {s = cls.subj.noun ++ cls.obj2.s} -- move old subject noun before object. } ; - in cl2qcl (notB ip.contractSTM) clsIPFocus ; + in cl2qclslash (notB ip.contractSTM) clsIPFocus ; -- : IAdv -> Cl -> QCl ; -- why does John walk @@ -34,14 +34,20 @@ concrete QuestionSom of Question = CatSom ** open cl : ClSlash = clRaw ** { stm = \\clt,p => case of { -- IAdv is focused with baa, and subject comes after - <_,Pos> => "baa" ++ sbj.pron ++ sbj.noun; + <_,Pos> => case iadv.contractSTM of { + True => [] ; _ => "baa"} + ++ sbj.pron ++ sbj.noun ; -- TODO how do negative questions work - _ => clRaw.stm ! Question ! p ++ sbj.pron ++ sbj.noun } ; + _ => case iadv.contractSTM of { + True => [] ; _ => clRaw.stm ! Question ! p} + ++ sbj.pron ++ sbj.noun } ; subj = sbj ** {noun, pron = []} -- to force subject after baa } ; - in cl2qcl True cl ; -- TODO: add contractSTM field to IAdv as well + in cl2qcl True cl ; -- True because we handle STM placement in cl.stm -- : IComp -> NP -> QCl ; -- where is John? + -- Saeed p. 212 Ninkii ay raaceen waa ayo? man-the they accompanied DM who + -- 'The man they travelled with is who?' -- QuestIComp icomp np = ; -- Interrogative pronouns can be formed with interrogative @@ -64,9 +70,7 @@ concrete QuestionSom of Question = CatSom ** open -- Interrogative adverbs can be formed prepositionally. -- : Prep -> IP -> IAdv ; -- with whom - PrepIP prep ip = - let ipAbs : Str = ip.s ! Abs - in prepNP (mkPrep prep ipAbs [] []) emptyNP ; + PrepIP prep ip = SS.prepIP prep (ip.s ! Abs) False ; -- They can be modified with other adverbs. diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index ca8f788bb..8116924f5 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -697,6 +697,11 @@ oper np : NPLite ; -- NP from PrepNP can be promoted into a core argument. } ; + IAdv : Type = Adverb ** { + contractSTM : Bool ; + s : Str -- alone, in one-word question, e.g. Waayo? 'Why?' + } ; + prepNP : Prep -> NounPhrase -> Adverb = \prep,np -> prep ** { np = case prep.isPoss of { True => nplite emptyNP ; @@ -939,6 +944,12 @@ oper isRel : Bool = False ; in mkClause Question isRel hasSubjPron ; + -- Question clauses: subject pronoun is included + cl2qclslash : Bool -> ClSlash -> Clause = + let hasSubjPron : Bool = True ; + isRel : Bool = False ; + in mkClause Question isRel hasSubjPron ; + -- Sentence: include subject pronoun and STM. -- When subordinate, include "in". cl2sentence : Bool -> ClSlash -> Clause = \isSubord,cls -> { diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index c9cadabbb..4429e3b49 100644 --- a/src/somali/StructuralSom.gf +++ b/src/somali/StructuralSom.gf @@ -16,14 +16,14 @@ lin as_CAdv = { s = "" ; p = [] } ; lin less_CAdv = { s = "" ; p = [] } ; lin more_CAdv = { s = "" ; p = [] } ; -} -lin how_IAdv = prepNP (mkPrep (mkPrep u) "sidee" [] []) emptyNP ; -{- -lin how8much_IAdv = ss "" ; -lin when_IAdv = ss "" ; -lin where_IAdv = ss "" ; -lin why_IAdv = ss "" ; +lin how_IAdv = mkIAdv u "sidee" False ; -lin always_AdV = ss "" ; +-- lin how8much_IAdv = ss "" ; +-- lin when_IAdv = ss "" ; +-- lin where_IAdv = ss "" ; +lin why_IAdv = let mx = mkIAdv u "maxaa" True in mx ** {s = "waayo"} ; + +{-lin always_AdV = ss "" ; lin everywhere_Adv = ss "" ; lin here7from_Adv = ss "" ; @@ -148,19 +148,11 @@ lin with_Prep = mkPrep la ; we_Pron = pronTable ! Pl1 Incl ; youPl_Pron = pronTable ! Pl2 ; they_Pron = pronTable ! Pl3 ; -{- -lin whatPl_IP = ; -lin whatSg_IP = ; -lin whoPl_IP = ; --} - -lin whoSg_IP = emptyNP ** { - s = table { - Nom => "yaa" ; -- together with STM - Abs => "ayo" } ; -- alone, no STM (used in UttIP) - contractSTM = True ; - } ; +--lin whatPl_IP = ; +lin whatSg_IP = mkIP "maxay" "maxaa" True ; +--lin whoPl_IP = ; +lin whoSg_IP = mkIP "ayo" "yaa" True ; ------- -- Subj @@ -195,4 +187,20 @@ lin want_VV = mkVV (mkV "rabid" "rab" "rab") subjunctive ; {- lin please_Voc = ss "" ; -} +oper + mkIAdv : Preposition -> Str -> Bool -> ResSom.IAdv = \pr -> + let pr' : Prep = ParadigmsSom.mkPrep pr ; + in prepIP pr' ; + + mkIP : (maxay, maxaa : Str) -> Bool -> IP = \maxay,maxaa,b -> emptyNP ** { + s = table { + Nom => maxaa ; -- together with STM + Abs => maxay } ; -- alone, no STM (used in UttIP and IComp) + contractSTM = b ; + } ; + + prepIP : Prep -> Str -> Bool -> ResSom.IAdv = \pr,str,b -> + let adv : Adverb = prepNP (mkPrep pr str [] []) emptyNP ; + in adv ** {contractSTM = b ; s = linAdv adv} ; + } diff --git a/src/somali/unittest/cl.gftest b/src/somali/unittest/cl.gftest index 8859e3628..75169102b 100644 --- a/src/somali/unittest/cl.gftest +++ b/src/somali/unittest/cl.gftest @@ -83,10 +83,12 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UseP -- Question clauses -- to whom did mother give the meat -LangSom: yaa siisey hooyo hilib BIND ka +-- subject pronoun 'ay' included, because whom is an object +LangSom: yaa ay siisey hooyo hilib BIND ka Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestSlash whoSg_IP (SlashVP (MassNP (UseN2 mother_N2)) (Slash3V3 give_V3 (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc -- LangEng: who wants to go +-- subject pronoun not included, because who is a subject LangSom: yaa rabaa in uu tago Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP whoSg_IP (ComplVV want_VV (UseV go_V))))) NoVoc @@ -99,12 +101,12 @@ LangSom: sidee baa ay hooya BIND daa madow u rinjiyeysaa guri BIND ga Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestIAdv how_IAdv (PredVP (DetCN (DetQuant (PossPron youSg_Pron) NumSg) (UseN2 mother_N2)) (ComplSlash (SlashV2A paint_V2A (PositA black_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N))))))) NoVoc -- Some examples from Nilsson, adjusted to the GF lexicon --- Maxaa ay u samaysay sidaas? Varför gjorde hon så? +-- Maxaa ay u samaysay sidaas? Varför gjorde hon så? --LangEng: why did she eat the meat -LangSom: TODO +LangSom: maxaa ay u cuntay hilib BIND ka Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron she_Pron) (ComplSlash (SlashV2a eat_V2) (DetCN (DetQuant DefArt NumSg) (UseN meat_N))))))) NoVoc --- Maxaa ay ahaa dharka cusub ee Faadumo loo iibiyay? Vad/Vilka var de nya kläder som man köpt åt Fadumo? +-- Maxaa ay ahaa dharka cusub ee Faadumo loo iibiyay? Vad/Vilka var de nya kläder som man köpt åt Fadumo? TODO why is there subject pronoun here? --LangEng: what was the meat that was eaten LangSom: TODO Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetQuant DefArt NumSg) (RelCN (UseN meat_N) (UseRCl (TTAnt TPast ASimul) PPos (RelVP IdRP (PassV2 eat_V2)))))))))) NoVoc