From 4ee46171a918b57ce297581ebd63607bca53a38e Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 23 Sep 2019 22:04:23 +0200 Subject: [PATCH 1/8] (Som) WIP negative questions --- src/somali/ResSom.gf | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index d1f7032cf..8a692c986 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -1017,7 +1017,9 @@ oper -> Str ; vf : ClType -> VFun = \clt -> case clt of { - Subord => vfSubord ; _ => vfStatement } ; + Subord => vfSubord ; + Question => vfQuestion ; + _ => vfStatement } ; vfStatement : VFun = \t,ant,p,agr,vp -> case of { @@ -1030,20 +1032,28 @@ oper => vp.s ! VInf ++ presV (cSug "doon") ; => vp.s ! VInf ++ pastV (cSug "doon") } - where { - agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ; - pastV : BaseVerb -> Str = \v -> - case p of { Neg => v.s ! VNegPast Simple ; - Pos => v.s ! VPast Simple (agr2vagr agr) } ; + where { + agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ; + pastV : BaseVerb -> Str = \v -> + case p of { Neg => v.s ! VNegPast Simple ; + Pos => v.s ! VPast Simple (agr2vagr agr) } ; - presV : BaseVerb -> Str = \v -> v.s ! VPres Simple (agr2vagr agr) p ; + presV : BaseVerb -> Str = \v -> v.s ! VPres Simple (agr2vagr agr) p ; - condNegV : BaseVerb -> Str = \v -> case agr of { - Sg2|Sg3 Fem - |Pl2 => v.s ! VNegCond SgFem ; - Pl1 _ => v.s ! VNegCond PlInv ; - _ => v.s ! VNegCond SgMasc --Sg1|Sg3 Masc|Pl3|Impers -} + condNegV : BaseVerb -> Str = \v -> case agr of { + Sg2|Sg3 Fem + |Pl2 => v.s ! VNegCond SgFem ; + Pl1 _ => v.s ! VNegCond PlInv ; + _ => v.s ! VNegCond SgMasc --Sg1|Sg3 Masc|Pl3|Impers + } + } ; + + vfQuestion : VFun = \t,ant,p,agr,vp -> + case of { + <_,_,Neg> => vp.s ! VInf ++ vfStatement t ant p agr (useV waa_V) ; + _ => vfStatement t ant p agr vp + } where { + waa_V = cSug "waa" ; ---- TODO irregular verb } ; vfSubord : VFun = \t,ant,p,agr,vp -> From 4dd9b92354d8186f78b830e6255c32a607086939 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 24 Sep 2019 17:28:48 +0200 Subject: [PATCH 2/8] (Som) more on negative questions --- src/somali/ResSom.gf | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 8a692c986..c564ddc93 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -682,6 +682,23 @@ oper x => hold_V.s ! x } } ; + fail_V : Verb = + let waa_V : Verb = cSug "waay" in waa_V ** { + s = table { + VPres _ Sg2_Sg3Fem _ + => "waayday" ; + VPast _ Sg1_Sg3Masc + => "waayey" ; + VPast _ Sg2_Sg3Fem + => "weydey" ; + VPast _ Pl1_ => "weyney" ; + VPast _ Pl2_ => "weydeen" ; + VPast _ Pl3_ => "waayeen" ; + VInf => "waayi" ; + x => waa_V.s ! x -- TODO actual forms + } + } ; + ------------------ -- Adv @@ -1050,10 +1067,8 @@ oper vfQuestion : VFun = \t,ant,p,agr,vp -> case of { - <_,_,Neg> => vp.s ! VInf ++ vfStatement t ant p agr (useV waa_V) ; + <_,_,Neg> => vp.s ! VInf ++ vfStatement t ant Pos agr (useV fail_V) ; _ => vfStatement t ant p agr vp - } where { - waa_V = cSug "waa" ; ---- TODO irregular verb } ; vfSubord : VFun = \t,ant,p,agr,vp -> @@ -1071,8 +1086,8 @@ oper case of { => showSTM stm ; => "ma" ; - => "ma" ; - => "sow" ; + => "ma" ; -- neg. questions are formed with waayaa 'fail to do X', so they are syntactically positive +-- => "sow" ; -- for true negative questions => [] ; => "aan" } ; From 9973349270ee1382d2d717926d0b48cfff0e69bf Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 25 Sep 2019 10:47:21 +0200 Subject: [PATCH 3/8] (Som) Minor cleanup --- src/somali/LexiconSom.gf | 2 +- src/somali/ParadigmsSom.gf | 30 ++++++++++++++++-------------- src/somali/ParamSom.gf | 4 ++-- src/somali/ResSom.gf | 6 ------ 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/somali/LexiconSom.gf b/src/somali/LexiconSom.gf index 8e3bf3439..585b1fcc3 100644 --- a/src/somali/LexiconSom.gf +++ b/src/somali/LexiconSom.gf @@ -253,7 +253,7 @@ lin name_N = mkN "magac" ; -- lin oil_N = mkN "" ; -- lin old_A = mkA "" ; -- lin open_V2 = mkV2 "" ; -lin paint_V2A = mkV2 "rinjiyee" ; +lin paint_V2A = mkV2A "rinjiyee" ; -- lin paper_N = mkN "" ; -- lin paris_PN = mkPN "Paris" ; -- lin peace_N = mkN "" ; diff --git a/src/somali/ParadigmsSom.gf b/src/somali/ParadigmsSom.gf index 68ae50476..075709608 100644 --- a/src/somali/ParadigmsSom.gf +++ b/src/somali/ParadigmsSom.gf @@ -32,7 +32,6 @@ oper u : Preposition ; noPrep : Preposition ; - -- TODO: add subjunctive too! VVForm : Type ; -- Argument to give to mkVV infinitive : VVForm ; -- Takes its complement in infinitive subjunctive : VVForm ; -- Takes its complement as a clause in subjunctive @@ -46,7 +45,6 @@ oper mkN : (shimbir : Str) -> (fem : Gender) -> N ; -- Unpredictable gender -- mkN : (nin, niman : Str) -> N ; -- Monosyllable word with unpredictable plural mkN : (maalin,maalmo : Str) -> Gender -> N ; -- Consonant cluster in stem - --mkN : N -> Gender -> N ; -- Otherwise predictable but not gender (TODO does this even happen?) } ; mkN2 : overload { @@ -94,21 +92,25 @@ oper mkVV : overload { mkVV : (kar : Str) -> VV ; -- VV that takes its complement in infinitive. mkVV : (rab : Str) -> VVForm -> VV ; -- Specify complement type: infinitive or subjunctive. - mkVV : V -> VVForm -> VV ; -- VV out of an existing V + mkVV : V -> VVForm -> VV ; -- VV out of an existing V } ; - -- TODO: actual constructors - -- mkVA : Str -> VA = \s -> lin VA (mkVerb s) ; - -- - -- mkV2A : Str -> V2A = \s -> lin V2A (mkVerb s) ; - -- mkVQ : Str -> VQ = \s -> lin VQ (mkVerb s) ; - -- mkVS : Str -> VS = \s -> lin VS (mkVerb s) ; - -- - -- mkV2V : Str -> V2V = \s -> lin V2V (mkVerb s) ; - -- mkV2S : Str -> V2S = \s -> lin V2S (mkVerb s) ; - -- mkV2Q : Str -> V2Q = \s -> lin V2Q (mkVerb s) ; - -- mkV3 : Str -> V3 = \s -> lin V3 (mkVerb s) ; + mkVA : Str -> VA + = \s -> lin VA (regV s) ; + mkVQ : Str -> VQ + = \s -> lin VQ (regV s) ; + mkVS : Str -> VS + = \s -> lin VS (regV s) ; + + mkV2A : Str -> V2A + = \s -> lin V2A (regV s ** {c2 = noPrep}) ; + mkV2V : Str -> V2V + = \s -> lin V2V (regV s ** {c2 = noPrep}) ; + mkV2S : Str -> V2S + = \s -> lin V2S (regV s ** {c2 = noPrep}) ; + mkV2Q : Str -> V2Q + = \s -> lin V2Q (regV s ** {c2 = noPrep}) ; ----- diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index a0807732f..692f758eb 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -192,7 +192,7 @@ oper case n.gda of {FM _ _ => Fem ; _ => Masc} ; gennum : {gda : GenderDefArt} -> Number -> GenNum = \gda,n -> - case n of {Pl => PlInv ; Sg => + case n of {Pl => PlInv ; Sg => case gda.gda of {FM _ _ => SgFem ; _ => SgMasc} } ; @@ -223,7 +223,7 @@ param Preposition = U | Ku | Ka | La | NoPrep ; PrepCombination = Ugu | Uga | Ula | Kaga | Kula | Kala - | Passive | Lagu | Laga | Loo | Lala -- TODO all combinations with impersonal la + | Passive | Loo | Lagu | Laga | Lala -- TODO all combinations with impersonal la: Loogu, Looga, Loola, Lagaga, Lagula, Lagala | Single Preposition ; oper diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index c564ddc93..bb07ed0d7 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -404,12 +404,6 @@ oper Passive => "laydin" ; Loo => "laydiin" ; Lala => "laydinla" ; Lagu => "laydinku" ; Laga => "laydinka" ; Single p => (prepTable ! p).s ! Pl2_Prep } ; - -- Impers_Prep => -- TODO: put these later into other tables - -- table { Ugu => "loogu" ; Uga => "looga" ; - -- Ula => "loola" ; Kaga => "lagaga" ; - -- Kula => "lagula" ; Kala => "lagala" ; - -- Passive => "la" ; - -- Lagu => "lagu" ; Laga => "laga" ; } ; Reflexive_Prep => -- TODO check every form table { Ugu => "isugu" ; Uga => "isuga" ; Ula => "isula" ; Kaga => "iskaga" ; Kula => "iskula" ; Kala => "iskala" ; From 1f62af0e2c42a37c6ea5b86828a4f37d13c7b12a Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 25 Sep 2019 11:53:27 +0200 Subject: [PATCH 4/8] (Som) Add ImpVP and UttImp{Sg,Pl,Pol} --- src/somali/CatSom.gf | 2 +- src/somali/PhraseSom.gf | 8 +++++--- src/somali/SentenceSom.gf | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index 52af918d0..eb1747c78 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -16,7 +16,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in { Cl = ResSom.ClSlash ; ClSlash = ResSom.ClSlash ; SSlash = ResSom.Sentence ; -- sentence missing NP; e.g. "she has looked at" - Imp = SS ; -- imperative e.g. "look at this" + Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this" --2 Questions and interrogatives diff --git a/src/somali/PhraseSom.gf b/src/somali/PhraseSom.gf index c9c18c396..0a20b76e4 100644 --- a/src/somali/PhraseSom.gf +++ b/src/somali/PhraseSom.gf @@ -8,9 +8,11 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in { UttIAdv iadv = iadv ; UttImpSg pol imp = - let ma = case pol.p of { Pos => [] ; Neg => "ma" } - in { s = ma ++ imp.s } ; - UttImpPl = UttImpSg ; + let ha = case pol.p of {Pos => [] ; Neg => "ha"} + in {s = ha ++ imp.s ! Sg ! pol.p} ; + UttImpPl pol imp = + let ha = case pol.p of {Pos => [] ; Neg => "ha"} + in {s = ha ++ imp.s ! Pl ! pol.p} ; UttImpPol = UttImpSg ; UttIP ip = {s = ip.s ! Abs} ; diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index e09de077b..27167f21f 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -29,12 +29,12 @@ lin -- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen UseSlash t p cls = { s = \\isSubord => let cl = cl2sentence isSubord cls in - t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p + t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p } ; --2 Imperatives -- : VP -> Imp ; - --ImpVP vp = { s = linVP vp } ; + ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ; --2 Embedded sentences @@ -54,7 +54,7 @@ lin -- : Temp -> Pol -> Cl -> S ; UseCl t p cls = { s = \\isSubord => let cl = cl2sentence isSubord cls in - t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p + t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p } ; -- : Temp -> Pol -> QCl -> QS ; From 36997f0dd493c9a50f3d2793813d3a5a1cbfadb3 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 25 Sep 2019 12:06:05 +0200 Subject: [PATCH 5/8] (Som) Add unit tests for all TAM inflections of a single verb --- src/somali/unittest/inflection.gftest | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/somali/unittest/inflection.gftest diff --git a/src/somali/unittest/inflection.gftest b/src/somali/unittest/inflection.gftest new file mode 100644 index 000000000..69b9be7ce --- /dev/null +++ b/src/somali/unittest/inflection.gftest @@ -0,0 +1,62 @@ +-- Examples from Saeed p. 119 + +-------------- +-- Positive -- +-------------- + +-- Declarative +-- LangEng: he/she/it waits (for him/her/it) +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc +LangSom: waa sugaa + +-- Interrogative +-- LangEng: does he/she/it wait (for him/her/it) +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc +LangSom: ma sugaa + +-- Imperative +-- LangEng: wait for it (sg and pl) +Lang: PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc +LangSom: sug + +Lang: PhrUtt NoPConj (UttImpPl PPos (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc +LangSom: suga + +-- Conditional +-- LangEng: he/she/it would wait (for him/her/it) +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TCond ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc +LangSom: waa sugi lahaa + +-- Optative and potential not implemented (yet?) + + +-------------- +-- Negative -- +-------------- + +-- Declarative +-- LangEng: he/she/it doesn't wait (for him/her/it) +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PNeg (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc +LangSom: ma sugo + +-- Interrogative 1: TODO +-- LangEng: does he/she/it wait (for him/her/it) +-- Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc +-- LangSom: ma sugaa + +-- LangEng: why doesn't it wait for it +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestIAdv why_IAdv (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc +LangSom: maxaa u sugi waayaa + +-- Imperative +-- LangEng: don't wait for it (sg and pl) +Lang: PhrUtt NoPConj (UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc +LangSom: ha sugin + +Lang: PhrUtt NoPConj (UttImpPl PNeg (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc +LangSom: ha sugina + +-- Conditional +-- LangEng: he/she/it wouldn't wait (for him/her/it) +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TCond ASimul) PNeg (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc +LangSom: ma sugeen From 0a5e9f426643614d98f1d99c334ead147c5f11b7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 25 Sep 2019 12:21:09 +0200 Subject: [PATCH 6/8] (Som) Some notes about conjunctions --- src/somali/StructuralSom.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index 560691693..c66b9f9fe 100644 --- a/src/somali/StructuralSom.gf +++ b/src/somali/StructuralSom.gf @@ -40,10 +40,10 @@ lin there_Adv = ss "" ; -- Conj lin and_Conj = {s2 = table {Definite => "ee" ; Indefinite => "oo"} ; s1 = [] ; n = Pl} ; -lin or_Conj = {s2 = \\_ => "ama" ; s1 = [] ; n = Sg} ; -- mise with interrogatives +lin or_Conj = {s2 = \\_ => "ama" ; s1 = [] ; n = Sg} ; -- mise with interrogatives; Saeed p. 122-123: "Note that the clause introduced by misé has the form of a declarative not an interrogative though the whole sentence is interpreted as a question." -- lin if_then_Conj = mkConj -- lin both7and_DConj = mkConj "" "" pl ; --- lin either7or_DConj = mkConj "" "" pl ; +lin either7or_DConj = {s2 = \\_ => "ama" ; s1 = "ama" ; n = Sg} ; -- -- lin but_PConj = ss "" ; -- lin otherwise_PConj = ss "" ; From 51c4f1bce75a0811763633430ef9086f2c582bc4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 25 Sep 2019 16:50:20 +0200 Subject: [PATCH 7/8] (Som) Split polar questions and wh-questions to separate types --- src/somali/ParamSom.gf | 2 +- src/somali/QuestionSom.gf | 22 ++++++++----------- src/somali/ResSom.gf | 46 +++++++++++++++++++++++++-------------- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index 692f758eb..1c93f6815 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -336,6 +336,6 @@ oper param - ClType = Statement | Question | Subord ; + ClType = Statement | PolarQuestion | WhQuestion | Subord ; } diff --git a/src/somali/QuestionSom.gf b/src/somali/QuestionSom.gf index 8bd064559..f1dd7f17a 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -6,30 +6,31 @@ concrete QuestionSom of Question = CatSom ** open lin -- : Cl -> QCl ; - QuestCl = cl2qcl True; + QuestCl = cl2qcl PolarQuestion True; -- : IP -> VP -> QCl ; QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP let cls : ClSlash = predVP ip vp ; + baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ; cl : ClSlash = cls ** { - stm = modSTM "baa" cls.stm + stm = modSTM "baa" baan cls.stm } ; - in cl2qcl (notB ip.contractSTM) cl ; + in cl2qcl PolarQuestion (notB ip.contractSTM) cl ; -- : IP -> ClSlash -> QCl ; -- whom does John love QuestSlash ip cls = - let clsIPFocus = cls ** { + let baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ; + clsIPFocus = cls ** { 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 + stm = modSTM "baa" baan cls.stm } ; in cl2qclslash (notB ip.contractSTM) clsIPFocus ; - -- : IAdv -> Cl -> QCl ; -- why does John walk QuestIAdv iadv cls = let clRaw : ClSlash = insertIAdv iadv cls ; @@ -40,17 +41,12 @@ concrete QuestionSom of Question = CatSom ** open <_,Pos> => case iadv.contractSTM of { True => [] ; _ => "baa"} ++ sbj.pron ++ sbj.noun ; - -- TODO how do negative questions work - -- 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} + True => [] ; _ => clRaw.stm ! WhQuestion ! p} ++ sbj.pron ++ sbj.noun } ; subj = sbj ** {noun, pron = []} -- to force subject after baa } ; - in cl2qcl True cl ; -- True because we handle STM placement in cl.stm + in cl2qcl WhQuestion True cl ; -- True because we handle STM placement in cl.stm -- : IComp -> NP -> QCl ; -- where is John? QuestIComp icomp np = diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index bb07ed0d7..2cf004fcf 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -888,7 +888,7 @@ oper _ => predRaw -- Any other verb } ; - stm = mkStm vp.stm ; + stm = mkStm subj.a vp.stm ; comp = vp.comp ! subj.a ; vComp = vp.vComp ** { subcl = vp.vComp.subcl ! subj.a @@ -942,16 +942,16 @@ oper in mkClause Subord isRel hasSubjPron hasSTM ; -- Question clauses: subject pronoun not included, STM is - cl2qcl : Bool -> ClSlash -> Clause = + cl2qcl : ClType -> Bool -> ClSlash -> Clause = \cltyp -> let hasSubjPron : Bool = False ; isRel : Bool = False ; - in mkClause Question isRel hasSubjPron ; + in mkClause cltyp isRel hasSubjPron ; -- Question clauses: subject pronoun is included cl2qclslash : Bool -> ClSlash -> Clause = let hasSubjPron : Bool = True ; isRel : Bool = False ; - in mkClause Question isRel hasSubjPron ; + in mkClause PolarQuestion isRel hasSubjPron ; -- Sentence: include subject pronoun and STM. -- When subordinate, include "in". @@ -990,7 +990,7 @@ oper Subord => obj.p1 ; _ => [] } ; questionNounObj = case cltyp of { - Question => obj.p1 ; + PolarQuestion|WhQuestion => obj.p1 ; _ => [] } ; -- Control whether to include subject pronoun and STM @@ -1028,9 +1028,9 @@ oper -> Str ; vf : ClType -> VFun = \clt -> case clt of { - Subord => vfSubord ; - Question => vfQuestion ; - _ => vfStatement } ; + Subord => vfSubord ; + WhQuestion => vfQuestion ; -- INF + waayaa 'why did you fail to go' + _ => vfStatement } ; vfStatement : VFun = \t,ant,p,agr,vp -> case of { @@ -1075,22 +1075,36 @@ oper STMarker : Type = ClType => Polarity => Str ; - mkStm : STM -> STMarker = \stm -> + -- NB. Agreement is used only for negative questions. If we want to change it + -- in other sentence types, we need to change predVP and mkClause accordingly; + -- certain VVs put stuff between STM and subject pronoun. Some VVs render now + -- incorrectly in negative questions. + mkStm : Agreement -> STM -> STMarker = \agr,stm -> \\cltyp,pol => case of { => showSTM stm ; => "ma" ; - => "ma" ; -- neg. questions are formed with waayaa 'fail to do X', so they are syntactically positive --- => "sow" ; -- for true negative questions => [] ; - => "aan" + => "aan" ; + => "ma" ; -- neg. wh-questions are formed with waayaa 'fail to do sth', so they are syntactically positive + => "ma" ; + => case agr of { -- Negative question in past tense has only one form, need subject pronoun to know what the subject is. + Sg1 => "miyaanan" ; -- Saeed p. 200 + Sg2 => "miyaanad" ; -- Saeed p. 200 + Sg3 Masc => "miyaanu" ; -- Saeed p. 200 + Sg3 Fem => "miyaanay" ; -- ??? + Pl1 Excl => "miyaanaannu" ; -- ??? + Pl1 Incl => "miyaanaynu" ; -- ??? + Pl2 => "miyaanaydin" ; -- ??? + Pl3 => "miyaanay" ; -- ??? + Impers => "ma aan" } -- not merged } ; - modSTM : Str -> STMarker -> STMarker = \str,stm -> + modSTM : (pos, neg : Str) -> STMarker -> STMarker = \pos,neg,stm -> \\cltyp,pol => - case of { - <_,Pos> => str ; - _ => stm ! cltyp ! pol + case pol of { + Pos => pos ; + _ => neg } ; -------------------------------------------------------------------------------- -- linrefs From b18890896950b50f9917bcd1720fc71b4ce6e534 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 25 Sep 2019 16:50:33 +0200 Subject: [PATCH 8/8] (Som) Updates to some unit tests --- src/somali/unittest/inflection.gftest | 4 ++-- src/somali/unittest/qcl.gftest | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/somali/unittest/inflection.gftest b/src/somali/unittest/inflection.gftest index 69b9be7ce..9f544c856 100644 --- a/src/somali/unittest/inflection.gftest +++ b/src/somali/unittest/inflection.gftest @@ -41,8 +41,8 @@ LangSom: ma sugo -- Interrogative 1: TODO -- LangEng: does he/she/it wait (for him/her/it) --- Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc --- LangSom: ma sugaa +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc +LangSom: ma aan sugo -- LangEng: why doesn't it wait for it Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestIAdv why_IAdv (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc diff --git a/src/somali/unittest/qcl.gftest b/src/somali/unittest/qcl.gftest index 0091209ba..10d16b155 100644 --- a/src/somali/unittest/qcl.gftest +++ b/src/somali/unittest/qcl.gftest @@ -1,6 +1,16 @@ -- Question clauses +-- Polar questions +-- LangEng: do you teach the cat +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestCl (PredVP (UsePron youSg_Pron) (ComplSlash (SlashV2a teach_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))) NoVoc +LangSom: ma ku bartaa bisad BIND da + +-- LangEng: don't you teach the cat +Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PNeg (QuestCl (PredVP (UsePron youSg_Pron) (ComplSlash (SlashV2a teach_V2) (DetCN (DetQuant DefArt NumSg) (UseN cat_N))))))) NoVoc +LangSom: miyaanad ku barto bisad BIND da + +-- Wh-questions -- LangEng: who wants to go -- subject pronoun not included, because who is a subject. STM merged to pron. LangSom: yaa rabaa in uu tago @@ -31,7 +41,7 @@ Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPast ASimul) PPos (QuestIAdv where_I 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 +-- Negative wh-question, 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