diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index 338f4b7a8..52af918d0 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" + IComp = ResSom.Complement ; -- 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..8bd064559 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. @@ -10,21 +10,24 @@ 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 ** {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 ; + 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 + } ; + stm = modSTM "baa" cls.stm + } ; + in cl2qclslash (notB ip.contractSTM) clsIPFocus ; -- : IAdv -> Cl -> QCl ; -- why does John walk @@ -34,15 +37,28 @@ 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 } ; + -- Information questions are not commonly used in negative forms. When they occur they have the same forms as negative declaratives with focus (7.4.1). There is however a strong tendency to use positive forms, for example by subordinating the clause under a verb with an inherently negative meaning: + -- Maxaad u tegi weydey? + -- what+FOC+you for go:INF failed + -- 'Why didn't you go?' (lit. 'Why did you fail to go?') + _ => 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? - -- QuestIComp icomp np = ; + QuestIComp icomp np = + let cls = predVP np (VS.UseComp icomp) ; + -- cl = cls ** { -- TODO: neg. questions + -- stm : ClType=>Polarity=>Str = \\_,_ => "waa" + -- } + in cl2sentence False cls ; -- copula is dropped and STM is waa -- Interrogative pronouns can be formed with interrogative -- determiners, with or without a noun. @@ -64,9 +80,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. @@ -77,10 +91,15 @@ concrete QuestionSom of Question = CatSom ** open -- pronouns. -- : IAdv -> IComp ; - --CompIAdv iadv = iadv ; -- where (is it) - + CompIAdv iadv = { -- where (is it) + comp = \\_ => <[], iadv.s> ; + stm = Waa NoCopula ; + } ; -- : IP -> IComp ; - --CompIP ip = { s = ip.s ! Abs } ; -- who (is it) + CompIP ip = { -- who (is it) + comp = \\_ => <[], ip.s ! Abs> ; + stm = Waa NoCopula ; + } ; {- -- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$. diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index ca8f788bb..d1f7032cf 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 ; @@ -872,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 @@ -939,6 +936,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 -> { @@ -1051,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 diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index c9cadabbb..560691693 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 = mkIAdv noPrep "xaggee" False ; +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 64a59f0db..0374a01f5 100644 --- a/src/somali/unittest/cl.gftest +++ b/src/somali/unittest/cl.gftest @@ -79,21 +79,3 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UseP --LangEng: he , that sees the men , is this LangSom: isagu oo niman BIND ka arkaa waa kan Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (RelNP (UsePron he_Pron) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))))) (UseComp (CompNP (DetNP (DetQuant this_Quant NumSg))))))) NoVoc - --- Question clauses - --- to whom did mother give the meat -LangSom: yaa 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 -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 - --- LangEng: which cat teaches him -LangSom: bisad BIND dee baa ku bartaa -Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))))) NoVoc - --- LangEng: how does your mother paint the house black -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 diff --git a/src/somali/unittest/qcl.gftest b/src/somali/unittest/qcl.gftest new file mode 100644 index 000000000..0091209ba --- /dev/null +++ b/src/somali/unittest/qcl.gftest @@ -0,0 +1,60 @@ + +-- Question clauses + +-- LangEng: who wants to go +-- subject pronoun not included, because who is a subject. STM merged to pron. +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 + +-- to whom did mother give the meat +-- subject pronoun 'ay' included, because whom is an object. STM merged. +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: which cat teaches him +-- subject pronoun not included, STM not merged. +LangSom: bisad BIND dee baa ku bartaa +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestVP (IdetCN (IdetQuant which_IQuant NumSg) (UseN cat_N)) (ComplSlash (SlashV2a teach_V2) (UsePron he_Pron))))) NoVoc + +-- LangEng: which woman did you see +-- subject pronoun included, STM not merged. +LangSom: naag BIND tee baa aad aragtay +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestSlash (IdetCN (IdetQuant which_IQuant NumSg) (UseN woman_N)) (SlashVP (UsePron youSg_Pron) (SlashV2a see_V2))))) NoVoc + +-- LangEng: where did you go +-- subject pronoun included, because IAdv xaggee 'where' is fronted and aad 'you' is subject. STM not merged. +LangSom: xaggee baa aad tagtay +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv where_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))))) NoVoc + +-- LangEng: why did you go +-- subject pronoun included, STM merged. +LangSom: maxaa aad u tagtay +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv why_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))))) NoVoc + +-- Negative question -- TODO not implemented yet properly. Saeed p. 203 +-- LangEng: why didn't you go +LangSom: maxaa aad u tagi weydey +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PNeg (QuestIAdv why_IAdv (PredVP (UsePron youSg_Pron) (UseV go_V))))) NoVoc + +-- IComp +-- LangEng: who is the man +-- Saeed p. 212 Ninkii ay raaceen waa ayo? man-the they accompanied DM who +-- 'The man they travelled with is who?' +LangSom: nin BIND ku waa ayo +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestIComp (CompIP whoSg_IP) (DetCN (DetQuant DefArt NumSg) (UseN man_N))))) NoVoc + +--- Longer example, unsure about word order -- TODO check +-- LangEng: how does your mother paint the house black +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å? +--LangEng: why did she eat the meat +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? 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