From ca06dc4e1d33e27ac5cd0f30b7d4137da8d8d097 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 1 Jul 2019 14:13:45 +0200 Subject: [PATCH 1/2] (Som) More fine-grained adverbials --- src/somali/AdverbSom.gf | 2 +- src/somali/CatSom.gf | 3 +- src/somali/ParadigmsSom.gf | 19 +++++++--- src/somali/ParamSom.gf | 11 ++++++ src/somali/PhraseSom.gf | 2 +- src/somali/QuestionSom.gf | 4 +- src/somali/ResSom.gf | 74 ++++++++++++++++++++++++++----------- src/somali/SentenceSom.gf | 13 +++++-- src/somali/StructuralSom.gf | 8 ++-- src/somali/VerbSom.gf | 4 +- 10 files changed, 98 insertions(+), 42 deletions(-) diff --git a/src/somali/AdverbSom.gf b/src/somali/AdverbSom.gf index 5c77c6588..329d17a0f 100644 --- a/src/somali/AdverbSom.gf +++ b/src/somali/AdverbSom.gf @@ -16,7 +16,7 @@ lin -- Adverbs can be modified by 'adadjectives', just like adjectives. --AdAdv : AdA -> Adv -> Adv ; -- very quickly - AdAdv ada adv = adv ** {s = ada.s ++ adv.s} ; + AdAdv ada adv = adv ** {berri = ada.s ++ adv.berri} ; -- Like adverbs, adadjectives can be produced by adjectives. -- : A -> AdA ; -- extremely diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index da1e65f9a..1222c151b 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -86,7 +86,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in { -- Constructed in StructuralSom. Conj = { s1,s2 : Str ; n : Number } ; Subj = { s : Str ; isPre : Bool } ; --ba+dut vs. dut+en - Prep = ResSom.Prep ** {c2 : Preposition} ; + Prep = ResSom.Prep ** {c2 : Preposition ; berri, sii, dhex : Str} ; @@ -123,4 +123,5 @@ linref -- Cl = linCl ; VP = linVP ; CN = linCN ; + Prep = \prep -> prep.s ! Pl3 ++ prep.sii ++ prep.dhex ; } diff --git a/src/somali/ParadigmsSom.gf b/src/somali/ParadigmsSom.gf index a2df4b7d2..4a814fce9 100644 --- a/src/somali/ParadigmsSom.gf +++ b/src/somali/ParadigmsSom.gf @@ -103,12 +103,16 @@ oper mkPrep = overload { mkPrep : Str -> CatSom.Prep = \s -> - lin Prep ((ResSom.mkPrep s s s s s s) ** {c2=noPrep}) ; + lin Prep ((ResSom.mkPrep s s s s s s) ** { + c2=noPrep ; sii,dhex,berri=[]}) ; mkPrep : (x1,_,_,_,_,x6 : Str) -> CatSom.Prep = \a,b,c,d,e,f -> - lin Prep ((ResSom.mkPrep a b c d e f) ** {c2=noPrep}) ; + lin Prep ((ResSom.mkPrep a b c d e f) ** { + c2=noPrep ; sii,dhex,berri=[]}) ; mkPrep : Preposition -> CatSom.Prep = \p -> - lin Prep (prep p) ; - } ; + lin Prep ((prep p) ** {sii,dhex,berri=[]}) ; + mkPrep : CatSom.Prep -> (x1,x2,x3 : Str) -> CatSom.Prep = \p,s,t,u -> + p ** {berri = s ; sii = t ; dhex = u} ; + } ; -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> -- lin Conj { s = s1 ; s2 = s2 } ; @@ -116,7 +120,12 @@ oper -- mkSubj : Str -> Bool -> Subj = \s,b -> -- lin Subj { } ; - mkAdv : Str -> Adv = \s -> lin Adv {s = s ; c2=noPrep ; np = emptyNP} ; + mkAdv : Str -> Adv = \s -> lin Adv { + berri = s ; + c2 = noPrep ; + np = emptyNP ; + sii,dhex = [] + } ; mkAdV : Str -> AdV = \s -> lin AdV {s = s} ; diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index bc0cdb248..94ed42b7d 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -130,6 +130,17 @@ oper agr2agrplus : (isPron : Bool) -> Agreement -> AgreementPlus = \isPron,a -> case isPron of {True => IsPron a ; False => NotPronP3} ; + isP3 = overload { + isP3 : Agreement -> Bool = \agr -> + case agr of {Sg3 _ | Pl3 | Impers => True ; _ => False} ; + isP3 : AgreementPlus -> Bool = \agr -> + case agr of { + IsPron (Sg3 _ | Pl3 | Impers) => True ; + NotPronP3 => True ; + Unassigned => True ; -- meaningful for "does it leave an overt pronoun" + _ => False} + } ; + -- gn2gennum : Gender -> Number -> GenNum = \g,n -> -- case of { -- => SgMasc ; diff --git a/src/somali/PhraseSom.gf b/src/somali/PhraseSom.gf index c0c620b4b..02ceafa37 100644 --- a/src/somali/PhraseSom.gf +++ b/src/somali/PhraseSom.gf @@ -16,7 +16,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in { UttIAdv iadv = iadv ; UttNP np = { s = np.s ! Abs} ; UttVP vp = { s = linVP vp } ; - UttAdv adv = 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 ca28087bb..ccf9be937 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -40,12 +40,12 @@ concrete QuestionSom of Question = CatSom ** open -- Interrogative adverbs can be formed prepositionally. -- : Prep -> IP -> IAdv ; -- with whom - PrepIP = AS.PrepNP ; + PrepIP prep ip = let a = AS.PrepNP prep ip in a ** {s = a.berri} ; -- They can be modified with other adverbs. -- : IAdv -> Adv -> IAdv ; -- where in Paris - AdvIAdv = AS.AdAdv ; + AdvIAdv iadv adv = iadv ** {s = iadv.s ++ adv.berri} ; -- Interrogative complements to copulas can be both adverbs and -- pronouns. diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 0ee9adf6d..63ca2a2cd 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -419,7 +419,11 @@ oper -------------------------------------------------------------------------------- -- Verbs - Verb : Type = {s : VForm => Str} ; + Verb : Type = { + s : VForm => Str ; + sii : Str ; -- closed class of particles: sii, soo, kala, wada (Sayeed 171) + dhex : Str ; -- closed class of adverbials: hoos, kor, dul, dhex, … + } ; Verb2 : Type = Verb ** {c2 : Preposition} ; Verb3 : Type = Verb2 ** {c3 : Preposition} ; @@ -509,6 +513,7 @@ oper VInf => arki ; VRel => arki } ; -- TODO does this exist? + sii, dhex = [] ; } ; ------------------------- @@ -543,7 +548,7 @@ oper (qaa + "da") ; -- Per2 Pl and others -- Constructs verbs like u baahan+ahay - prefixV : Str -> Verb -> Verb = \s,v -> { + prefixV : Str -> Verb -> Verb = \s,v -> v ** { s = \\vf => s + v.s ! vf } ; @@ -571,14 +576,15 @@ oper VPast _ Pl3 => "ahaayeen" ; VNegPast _ => "ahi" ; VRel => "ah" ; - VInf => "ahaan" } + VInf => "ahaan" } ; + sii, dhex = [] } ; -- I somaliskan används inte något kopulaverb motsvarande svenskans är mellan -- två substantivfraser som utgör subjekt respektive predikatsfyllnad. -- Observera också att kopulaverbet vara alltid hamnar efter det adjektiv -- som utgör predikatsfyllnaden. have_V : Verb = - let hold_V = mkVerb "hayso" "haysat" "haysa" in { + let hold_V = mkVerb "hayso" "haysat" "haysa" in hold_V ** { s = table { VPres _ Sg1 Pos => "leeyahay" ; VPres _ Sg2 Pos => "leedahay" ; @@ -606,9 +612,17 @@ oper ------------------ -- VP - Adverb : Type = { - s : Str ; - c2 : Preposition ; np : NounPhrase} ; -- So that adverbs can also contribute to preposition contraction + + BaseAdv : Type = { + sii, -- sii, soo, wala, kada go inside VP. + dhex, -- dhex, hoos, koor, dul, … go inside VP. + berri : Str -- e.g. "tomorrow"; goes before VP. + } ; + + Adverb : Type = BaseAdv ** { + c2 : Preposition ; -- adverbs can contribute to preposition contraction. + np : NounPhrase -- NP from PrepNP can be promoted into a core argument. + } ; Complement : Type = { comp : Agreement => {p1,p2 : Str} ; -- Agreement for AP complements @@ -616,19 +630,21 @@ oper } ; VerbPhrase : Type = Verb ** Complement ** { - adv : Str ; - c2 : PrepositionPlus ; -- hack to allow passives - c3 : Preposition ; -- can combine together and with object pronoun(s?) + -- Prepositions can combine together and with object pronoun. + c2 : PrepositionPlus ; -- hack to implement passives more efficiently: + c3 : Preposition ; -- if c2 is Passive, the real preposition is in c3. obj2 : {s : Str ; a : AgreementPlus} ; secObj : Str ; -- if two overt pronoun objects - } ; + berri : Str ; -- adverb that goes before verbal group + miscAdv : Str ; -- dump for any other kind of adverb, that isn't + } ; -- in a closed class of particles or made with PrepNP. VPSlash : Type = VerbPhrase ; useV : Verb -> VerbPhrase = \v -> v ** { comp = \\_ => <[],[]> ; pred = NoPred ; - adv = [] ; + berri,miscAdv = [] ; c2 = P NoPrep ; c3 = NoPrep ; obj2 = {s = [] ; a = Unassigned} ; @@ -685,15 +701,24 @@ oper } ; insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv -> - case adv.c2 of { - NoPrep => vp ** {adv = adv.s} ; -- The adverb is not formed with PrepNP - prep => case of { -

=> insertComp (vp ** {c2 = P adv.c2}) adv.np ; -- should cover for obligatory argument that is not introduced with a preposition - <_ ,_ ,NoPrep> => insertComp (vp ** {c3 = adv.c2}) adv.np ; - -- if complement slots are full, put preposition just as a string. TODO check word order. - _ => vp ** {adv = (prepTable ! P adv.c2).s ! adv.np.a ++ adv.np.s ! Abs} - } - } ; + case of { + -- a) the adverb is not formed with PrepNP, e.g. "tomorrow" + | <_,True> -- b) is formed with PrepNP, and has 3rd person obj. + => vp ** adv'' ; + _ => case of { + -- if free complement slots, introduce adv.np with insertComp +

=> insertComp (vp ** {c2 = P adv.c2}) adv.np ** adv' ; + <_ ,_ ,NoPrep> => insertComp (vp ** {c3 = adv.c2}) adv.np ** adv' ; + + -- if complement slots are full, just insert strings. + _ => vp ** adv'' + } + } where { + adv' : {sii,dhex,berri : Str} = adv ; -- adv.np done with insertComp + adv'' : {sii,dhex,berri,miscAdv : Str} -- adv.np inserted into miscAdv + = adv ** {dhex = (prepTable ! P adv.c2).s ! adv.np.a ++ adv.dhex ; + miscAdv = adv.np.s ! Abs} -- TODO: check case + } ; -------------------------------------------------------------------------------- -- Sentences etc. Clause : Type = {s : Bool {-is question-} => Tense => Anteriority => Polarity => Str} ; @@ -744,4 +769,11 @@ oper oper linVP : VerbPhrase -> Str = \vp -> let obj = vp.comp ! Sg3 Masc in obj.p1 ++ obj.p2 ++ vp.s ! VInf ; ---- linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ; + linAdv : Adverb -> Str = \adv -> + adv.berri + ++ adv.sii + ++ (prepTable ! P adv.c2).s ! adv.np.a + ++ adv.dhex + ++ adv.np.s ! Abs ; + } diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index c8bc9dcc1..d05027cdf 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -23,9 +23,10 @@ lin subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ; obj : {p1,p2 : Str} = let o : {p1,p2 : Str} = vp.comp ! subj.a ; + bind : Str = if_then_Str (isP3 vp.obj2.a) [] BIND ; in case p of { Pos => o ; - Neg => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ BIND} -- object pronoun, prepositions and negation all contract + Neg => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} -- object pronoun, prepositions and negation all contract } ; stm : Str = case of { => "waa" ; @@ -37,14 +38,18 @@ lin } } ; - in subjnoun -- subject if it's a noun - ++ obj.p1 -- object if it's a noun + in vp.berri -- AdV + ++ subjnoun -- subject if it's a noun + ++ obj.p1 -- object if it's a noun ++ stm -- sentence type marker + possible subj. pronoun - ++ vp.adv ---- TODO word order ++ obj.p2 -- object if it's a pronoun + ++ vp.sii -- restricted set of particles + ++ vp.dhex -- restricted set of nouns/adverbials ++ vp.secObj -- "second object" ++ pred.inf -- potential infinitive/participle ++ pred.fin -- the verb inflected + ++ vp.miscAdv ---- NB. Only used if there are several adverbs. + ---- Primary places for adverbs are obj, sii or dhex. } ; {- -- : SC -> VP -> Cl ; -- that she goes is good diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index aff865978..17230ae65 100644 --- a/src/somali/StructuralSom.gf +++ b/src/somali/StructuralSom.gf @@ -92,7 +92,7 @@ oper ------- -- Prep --- lin above_Prep = mkPrep "" ; +lin above_Prep = mkPrep (mkPrep ka) [] [] "dul" ; -- lin after_Prep = mkPrep "" ; -- lin before_Prep = mkPrep "" ; -- lin behind_Prep = mkPrep "" ; @@ -104,14 +104,14 @@ oper -- lin for_Prep = mkPrep ; -- lin from_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ; -lin in_Prep = prep ku ; -lin on_Prep = prep ku ; +lin in_Prep = mkPrep ku ; +lin on_Prep = mkPrep ku ; -- lin part_Prep = mkPrep ; -- lin possess_Prep = mkPrep ; -- lin through_Prep = mkPrep ; -- lin to_Prep = mkPrep ; -- lin under_Prep = mkPrep "" ; -lin with_Prep = prep la ; +lin with_Prep = mkPrep la ; -- lin without_Prep = mkPrep ; diff --git a/src/somali/VerbSom.gf b/src/somali/VerbSom.gf index a90699265..d740fca71 100644 --- a/src/somali/VerbSom.gf +++ b/src/somali/VerbSom.gf @@ -131,9 +131,7 @@ lin -- : Adv -> Comp ; CompAdv adv = { - comp = \\a => - ; + comp = \\a => <[], linAdv adv> ; pred = Copula ; } ; From e4394b633c0fdcb82269577ab4a4810b661afd5a Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 1 Jul 2019 20:30:06 +0200 Subject: [PATCH 2/2] (Som) VV complements + some restructuring. --- src/somali/ResSom.gf | 90 ++++++++++++++++++++++++++++++------- src/somali/SentenceSom.gf | 43 +----------------- src/somali/StructuralSom.gf | 9 ++-- src/somali/VerbSom.gf | 8 ++-- 4 files changed, 83 insertions(+), 67 deletions(-) diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 63ca2a2cd..b983f3119 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -419,8 +419,11 @@ oper -------------------------------------------------------------------------------- -- Verbs - Verb : Type = { + BaseVerb : Type = { s : VForm => Str ; + } ; + + Verb : Type = BaseVerb ** { sii : Str ; -- closed class of particles: sii, soo, kala, wada (Sayeed 171) dhex : Str ; -- closed class of adverbials: hoos, kor, dul, dhex, … } ; @@ -629,13 +632,13 @@ oper pred : PredType ; -- to choose right sentence type marker and copula } ; - VerbPhrase : Type = Verb ** Complement ** { + VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** { -- Prepositions can combine together and with object pronoun. c2 : PrepositionPlus ; -- hack to implement passives more efficiently: c3 : Preposition ; -- if c2 is Passive, the real preposition is in c3. obj2 : {s : Str ; a : AgreementPlus} ; secObj : Str ; -- if two overt pronoun objects - berri : Str ; -- adverb that goes before verbal group + vComp : Str ; -- VV complement miscAdv : Str ; -- dump for any other kind of adverb, that isn't } ; -- in a closed class of particles or made with PrepNP. @@ -644,7 +647,7 @@ oper useV : Verb -> VerbPhrase = \v -> v ** { comp = \\_ => <[],[]> ; pred = NoPred ; - berri,miscAdv = [] ; + vComp,berri,miscAdv = [] ; c2 = P NoPrep ; c3 = NoPrep ; obj2 = {s = [] ; a = Unassigned} ; @@ -674,7 +677,7 @@ oper insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np -> let noun : Str = case of { => np.s ! Abs ; - => (pronTable ! np.a).sp ; -- long object pronoun for 3rd person object + -- => (pronTable ! np.a).sp ; -- uncomment if you want to add long object pronoun for 3rd person object _ => [] } -- no long object for other pronouns in case vp.obj2.a of { Unassigned => @@ -701,10 +704,9 @@ oper } ; insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv -> - case of { - -- a) the adverb is not formed with PrepNP, e.g. "tomorrow" - | <_,True> -- b) is formed with PrepNP, and has 3rd person obj. - => vp ** adv'' ; + case of { + => vp ** adv'' ; -- a) the adverb is not formed with PrepNP, e.g. "tomorrow" + <_,True,False> => vp ** adv'' ; -- b) is formed with PrepNP, and has 3rd person obj, which is a noun. _ => case of { -- if free complement slots, introduce adv.np with insertComp

=> insertComp (vp ** {c2 = P adv.c2}) adv.np ** adv' ; @@ -713,12 +715,12 @@ oper -- if complement slots are full, just insert strings. _ => vp ** adv'' } - } where { - adv' : {sii,dhex,berri : Str} = adv ; -- adv.np done with insertComp - adv'' : {sii,dhex,berri,miscAdv : Str} -- adv.np inserted into miscAdv - = adv ** {dhex = (prepTable ! P adv.c2).s ! adv.np.a ++ adv.dhex ; - miscAdv = adv.np.s ! Abs} -- TODO: check case - } ; + } where { + adv' : {sii,dhex,berri : Str} = adv ; -- adv.np done with insertComp + adv'' : {sii,dhex,berri,miscAdv : Str} -- adv.np inserted into miscAdv + = adv ** {dhex = (prepTable ! P adv.c2).s ! adv.np.a ++ adv.dhex ; + miscAdv = adv.np.s ! Abs} -- TODO: check case + } ; -------------------------------------------------------------------------------- -- Sentences etc. Clause : Type = {s : Bool {-is question-} => Tense => Anteriority => Polarity => Str} ; @@ -727,6 +729,56 @@ oper ClSlash, Sentence : Type = SS ; ---- TODO + predVP : NounPhrase -> VerbPhrase -> Clause = \np,vps -> { + s = \\isQ,t,a,p => + let predRaw : {fin : Str ; inf : Str} = vf t a p subj.a vp ; + pred : {fin : Str ; inf : Str} = case of { + => {fin,inf = []} ; + _ => predRaw + } ; + subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ; + subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ; + obj : {p1,p2 : Str} = + let o : {p1,p2 : Str} = vp.comp ! subj.a ; + bind : Str = case of { + => [] ; + _ => BIND } ; + 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 ; -- TODO check subj pron or not? + => stmarkerNoContr ! subj.a ! p + } + } ; + in wordOrder subjnoun subjpron stm obj pred vp ; + } where { + vp = case vps.c2 of { + Passive => complSlash (insertComp vps np) ; + _ => complSlash vps } ; + subj = case vps.c2 of {Passive => impersNP ; _ => np} ; + } ; + + wordOrder : (sn,sp,stm : Str) -> {p1,p2 : Str} -> {fin,inf : Str} -> VerbPhrase -> Str = + \subjnoun,subjpron,stm,obj,pred,vp -> vp.berri -- AdV + ++ subjnoun -- subject if it's a noun + ++ obj.p1 -- object if it's a noun + ++ stm -- sentence type marker + possible subj. pronoun + ++ obj.p2 -- object if it's a pronoun + ++ vp.sii -- restricted set of particles + ++ vp.dhex -- restricted set of nouns/adverbials + ++ vp.secObj -- "second object" + ++ vp.vComp -- VV complement + ++ pred.inf -- potential infinitive/participle + ++ pred.fin -- the verb inflected + ++ vp.miscAdv ; ---- NB. Only used if there are several adverbs. + ---- Primary places for adverbs are obj, sii or dhex. + vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb -> {fin : Str ; inf : Str} = \t,ant,p,agr,vp -> case of { @@ -736,7 +788,7 @@ oper => {fin = pastV (cSug "jir") ; inf = vp.s ! VInf} ; => {fin = presV (cSug "doon") ; inf = vp.s ! VInf} ; => {fin = pastV (cSug "doon") ; inf = vp.s ! VInf} ; - => {fin = presV have_V ; inf = vp.s ! VInf} ; -- TODO check + => {fin = pastV have_V ; inf = vp.s ! VInf} ; -- TODO check => {fin = pastV have_V ; inf = vp.s ! VInf} -- TODO check } where { @@ -747,6 +799,10 @@ oper presV : Verb -> Str = \v -> v.s ! VPres Simple agr p ; } ; + infVP : VerbPhrase -> Str = \vp -> + let inf = (vf Past Anter Pos (Sg3 Masc) vp) ** {fin=[]} + in wordOrder [] [] [] (vp.comp ! Pl3) inf vp ; + stmarker : Agreement => Polarity => Str = \\a,b => let stm = if_then_Pol b "w" "m" in stm + subjpron ! a ; @@ -767,7 +823,7 @@ oper -- linrefs oper - linVP : VerbPhrase -> Str = \vp -> let obj = vp.comp ! Sg3 Masc in obj.p1 ++ obj.p2 ++ vp.s ! VInf ; ---- + linVP : VerbPhrase -> Str = infVP ; linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ; linAdv : Adverb -> Str = \adv -> adv.berri diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index d05027cdf..4dd5b7c9c 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -8,49 +8,8 @@ lin --2 Clauses -- : NP -> VP -> Cl - PredVP np vps = - let vp = case vps.c2 of { - Passive => complSlash (insertComp vps np) ; - _ => complSlash vps } ; - subj = case vps.c2 of {Passive => impersNP ; _ => np} ; - in { s = \\isQ,t,a,p => - let predRaw : {fin : Str ; inf : Str} = vf t a p subj.a vp ; - pred : {fin : Str ; inf : Str} = case of { - => {fin,inf = []} ; - _ => predRaw - } ; - subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ; - subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ; - obj : {p1,p2 : Str} = - let o : {p1,p2 : Str} = vp.comp ! subj.a ; - bind : Str = if_then_Str (isP3 vp.obj2.a) [] BIND ; - 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 - } - } ; + PredVP = predVP ; - in vp.berri -- AdV - ++ subjnoun -- subject if it's a noun - ++ obj.p1 -- object if it's a noun - ++ stm -- sentence type marker + possible subj. pronoun - ++ obj.p2 -- object if it's a pronoun - ++ vp.sii -- restricted set of particles - ++ vp.dhex -- restricted set of nouns/adverbials - ++ vp.secObj -- "second object" - ++ pred.inf -- potential infinitive/participle - ++ pred.fin -- the verb inflected - ++ vp.miscAdv ---- NB. Only used if there are several adverbs. - ---- Primary places for adverbs are obj, sii or dhex. - } ; {- -- : SC -> VP -> Cl ; -- that she goes is good PredSCVP sc vp = ; diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index 17230ae65..4715ec0bf 100644 --- a/src/somali/StructuralSom.gf +++ b/src/somali/StructuralSom.gf @@ -119,7 +119,7 @@ lin with_Prep = mkPrep la ; -- Pron -- Pronouns are closed class, no constructor in ParadigmsSom. - it_Pron = he_Pron ** {s = \\_ => []} ; + it_Pron = he_Pron ** {s = \\_ => [] ; sp = []} ; i_Pron = pronTable ! Sg1 ; youPol_Pron, -- TODO check youSg_Pron = pronTable ! Sg2 ; @@ -160,10 +160,9 @@ lin yes_Utt = ss "yes" ; -- Verb lin have_V2 = mkV2 have_V noPrep ; -{- -lin can8know_VV = mkV "" ; -- can (capacity) -lin can_VV = mkV "" ; -- can (possibility) -lin must_VV = mkV "" ; +lin can8know_VV = can_VV ; -- can (capacity) +lin can_VV = mkV "kar" ; -- can (possibility) +{-lin must_VV = mkV "" ; lin want_VV = mkV "" ; diff --git a/src/somali/VerbSom.gf b/src/somali/VerbSom.gf index d740fca71..512459a20 100644 --- a/src/somali/VerbSom.gf +++ b/src/somali/VerbSom.gf @@ -10,10 +10,12 @@ lin -- : V2 -> VP ; -- be loved PassV2 = ResSom.passV2 ; -{- - -- : VV -> VP -> VP ; - ComplVV vv vp = ; -- TODO Sayeed p. 169 + -- : VV -> VP -> VP ; + ComplVV vv vp = useV vv ** { -- check Sayeed p. 169 + vComp = infVP vp + } ; +{- -- : VS -> S -> VP ; ComplVS vs s = ;