diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index a5cd1b11..25bd4ded 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -156,14 +156,18 @@ param -- Prepositions param - Preposition = u | ku | ka | la | noPrep | passive ; + Preposition = u | ku | ka | la | noPrep ; + PrepositionPlus = P Preposition | Passive ; -- Hack: RGL only supports V2s as passive, so I can reuse V2's preposition slot for passives as well, and save >200 parameters. (Don't ask.) PrepCombination = ugu | uga | ula | kaga | kula | kala - | Single Preposition ; + | Single PrepositionPlus ; oper - combine : Preposition -> Preposition -> PrepCombination = \p1,p2 -> - let oneWay : Preposition => Preposition => PrepCombination = + combine : PrepositionPlus -> Preposition -> PrepCombination = \p1,p2 -> + let oneWay : PrepositionPlus => Preposition => PrepCombination = \\x,y => case of { + => Single Passive ; + => Single (P p) ; -- TODO check if this ever happens +

=> case of { => ugu ; => uga ; => ula ; @@ -171,13 +175,15 @@ oper ku|ka> => kaga ; => kula ; => kala ; - => Single p ; - => Single p ; - => Single p } -- for trying both ways - in case oneWay ! p2 ! p1 of { + => Single (P p) ; + => Single x ; + => Single x }} -- for trying both ways + in case oneWay ! P p2 ! (pp2prep p1) of { Single _ => oneWay ! p1 ! p2 ; - x => x } ; + z => z } ; + pp2prep : PrepositionPlus -> Preposition = \pp -> + case pp of {P p => p ; Passive => noPrep} ; -------------------------------------------------------------------------------- -- Verbs diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 275198a0..d55bfc08 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -322,16 +322,16 @@ oper _ => ku } } ; - prep : Preposition -> (Prep ** {c2 : Preposition}) = \p -> prepTable ! p ** {c2 = p} ; + prep : Preposition -> (Prep ** {c2 : Preposition}) = \p -> prepTable ! P p ** {c2 = p} ; - prepTable : Preposition => Prep = table { - ku => mkPrep "ku" "igu" "kugu" "nagu" "idinku" "lagu" ; - ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ; - la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ; - u => mkPrep "u" "ii" "kuu" "noo" "idiin" "loo" ; - noPrep => mkPrep [] "i" "ku" "na" "idin" "la" ; + prepTable : PrepositionPlus => Prep = table { + P ku => mkPrep "ku" "igu" "kugu" "nagu" "idinku" "lagu" ; + P ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ; + P la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ; + P u => mkPrep "u" "ii" "kuu" "noo" "idiin" "loo" ; + P noPrep => mkPrep [] "i" "ku" "na" "idin" "la" ; -- impersonal subject clitic combining with object clitics. - passive => mkPrep "la" "la i" "lagu" "nala" "laydin" "la" + Passive => mkPrep "la" "la i" "lagu" "nala" "laydin" "la" } ; prepCombTable : Agreement => PrepCombination => Str = table { @@ -620,7 +620,8 @@ oper VerbPhrase : Type = Verb ** Complement ** { adv : Str ; - c2, c3 : Preposition ; -- can combine together and with object pronoun(s?) + c2 : PrepositionPlus ; -- hack to allow passives + c3 : Preposition ; -- can combine together and with object pronoun(s?) obj2 : {s : Str ; a : AgreementPlus} ; secObj : Str ; -- if two overt pronoun objects } ; @@ -631,17 +632,18 @@ oper comp = \\_ => <[],[]> ; pred = NoPred ; adv = [] ; - c2,c3 = noPrep ; + c2 = P noPrep ; + c3 = noPrep ; obj2 = {s = [] ; a = Unassigned} ; secObj = [] } ; useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** { - c2 = v2.c2 + c2 = P v2.c2 } ; passV2 : Verb2 -> VerbPhrase = \v2 -> useV v2 ** { - c2 = passive ; + c2 = Passive ; c3 = v2.c2 ; } ; @@ -689,10 +691,10 @@ oper case adv.c2 of { noPrep => vp ** {adv = adv.s} ; -- The adverb is not formed with PrepNP prep => case of { - => insertComp adv.np ; -- should cover for obligatory argument that is not introduced with a preposition - <_,_, noPrep> => insertComp (vp ** {c3 = adv.c2}) adv.np ; +

=> 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 ! adv.c2).s ! adv.np.a ++ adv.np.s ! Abs} + _ => vp ** {adv = (prepTable ! P adv.c2).s ! adv.np.a ++ adv.np.s ! Abs} } } ; -------------------------------------------------------------------------------- diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index 9308d7ed..5d1298e1 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -10,34 +10,34 @@ lin -- : NP -> VP -> Cl PredVP np vps = let vp = case vps.c2 of { - passive => complSlash (insertComp vps np) ; + Passive => complSlash (insertComp vps np) ; _ => complSlash vps } ; - subj = case vps.c2 of {passive => impersNP ; _ => np} ; + 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 vp.pred of { - NoCopula => {fin,inf = []} ; - _ => predRaw + 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} = vp.comp ! subj.a ; stm : Str = case of { - => "ma" ; - <_,Pos,Copula|NoCopula,Sg3 _|Impers> => "waa" ; - -- _ => stmarker ! np.a ! b } -- marker+pronoun contract + => "waa" ; + => "ma" ; _ => case of { => "waa" ++ subjpron ; -- to force some string from NP to show in the tree - => "ma" ++ subjpron ; + => {-glue obj.p2-} "ma" ++ subjpron ; => stmarkerNoContr ! subj.a ! p }} ; + in 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 + ++ obj.p2 -- if_then_Pol p obj.p2 [] -- object if it's a pronoun + ++ pred.inf -- potential infinitive/participle ++ pred.fin -- the verb inflected - ++ pred.inf -- potential participle } ; {- -- : SC -> VP -> Cl ; -- that she goes is good diff --git a/src/somali/VerbSom.gf b/src/somali/VerbSom.gf index 29baad2d..d47df66d 100644 --- a/src/somali/VerbSom.gf +++ b/src/somali/VerbSom.gf @@ -12,7 +12,7 @@ lin PassV2 = ResSom.passV2 ; {- -- : VV -> VP -> VP ; - ComplVV vv vp = ; + ComplVV vv vp = ; -- TODO Sayeed p. 169 -- : VS -> S -> VP ; ComplVS vs s = ; @@ -133,7 +133,7 @@ lin CompAdv adv = { comp = \\a => ; + , adv.s ++ prepCombTable ! adv.np.a ! Single (P adv.c2)> ; pred = Copula ; } ;