diff --git a/src/somali/AdverbSom.gf b/src/somali/AdverbSom.gf index eb5cafa63..0eaaabbd6 100644 --- a/src/somali/AdverbSom.gf +++ b/src/somali/AdverbSom.gf @@ -23,7 +23,7 @@ lin -- PositAdAAdj a = { } ; -- Subordinate clauses can function as adverbs. - --: Subj -> S -> Adv ; + -- : Subj -> S -> Adv ; -- SubjS subj s = {} ; -- Comparison adverbs also work as numeral adverbs. diff --git a/src/somali/MissingSom.gf b/src/somali/MissingSom.gf index bb937ae24..36c75fb68 100644 --- a/src/somali/MissingSom.gf +++ b/src/somali/MissingSom.gf @@ -32,7 +32,6 @@ oper BaseS : S -> S -> ListS = notYet "BaseS" ; oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ; oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ; oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; -oper CompAP : AP -> Comp = notYet "CompAP" ; oper CompAdv : Adv -> Comp = notYet "CompAdv" ; oper CompCN : CN -> Comp = notYet "CompCN" ; oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ; @@ -152,8 +151,6 @@ oper SubjS : Subj -> S -> Adv = notYet "SubjS" ; oper Use2N3 : N3 -> N2 = notYet "Use2N3" ; oper Use3N3 : N3 -> N2 = notYet "Use3N3" ; oper UseA2 : A2 -> AP = notYet "UseA2" ; -oper UseCl : Temp -> Pol -> Cl -> S = notYet "UseCl" ; -oper UseComp : Comp -> VP = notYet "UseComp" ; oper UseComparA : A -> AP = notYet "UseComparA" ; oper UseN2 : N2 -> CN = notYet "UseN2" ; oper UsePN : PN -> NP = notYet "UsePN" ; @@ -169,7 +166,6 @@ oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ; oper UttInterj : Interj -> Utt = notYet "UttInterj" ; oper UttQS : QS -> Utt = notYet "UttQS" ; -oper UttS : S -> Utt = notYet "UttS" ; oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ; oper above_Prep : Prep = notYet "above_Prep" ; oper active2passive : Cl -> Cl = notYet "active2passive" ; diff --git a/src/somali/NounSom.gf b/src/somali/NounSom.gf index babcd6000..4e9941e7c 100644 --- a/src/somali/NounSom.gf +++ b/src/somali/NounSom.gf @@ -117,18 +117,15 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in { OrdNumeral num = num ; -- : A -> Ord ; - OrdSuperl a = { s = a.s ! AF Superl ; n = Sg } ; -- why force Sg? + OrdSuperl a = { } ; -- why force Sg? -- One can combine a numeral and a superlative. -- : Numeral -> A -> Ord ; -- third largest - OrdNumeralSuperl num a = num ** { s = num.s ++ a.s ! AF Superl } ; --TODO: is the word order correct? + OrdNumeralSuperl num a = num ** { } ; -- : Quant - DefArt = { s = artDef ; - indep = False ; - pref = [] ; - isDef = True } ; + DefArt = { } ; -- : Quant IndefArt = { s = artDef ; indep = False ; diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index 31461cdc1..267caf36b 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -14,10 +14,10 @@ oper gbd : pattern Str = #("g" | "b" | "d") ; voiced : Str -> Str = \s -> case s of { - "k" => "g" ; - "t" => "d" ; - "p" => "b" ; - _ => s } ; + "k" => "g" ; + "t" => "d" ; + "p" => "b" ; + _ => s } ; -------------------------------------------------------------------------------- -- Morphophonology @@ -92,6 +92,7 @@ param -- TODO: is this necessary? param CardOrd = NCard | NOrd ; + -------------------------------------------------------------------------------- -- Prepositions @@ -124,13 +125,17 @@ oper param VForm = VInf - | VPres Agreement Bool + | VPres Agreement Polarity | VNegPast | VPast Agreement | VFut -- agreement comes from auxiliary | VRel -- "som är/har/…" TODO is this used in other verbs? | VImp Number ; -- TODO negation +oper + if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f -> + case p of {Pos => t ; Neg => f } ; + -- TODO: -- tre aspekter (enkel, progressiv, habituell), -- fem modus (indikativ, imperativ, konjunktiv, kontiditonalis, optativ) diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 6adafb65e..e5c736cc5 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -269,6 +269,9 @@ oper Verb2 : Type = Verb ** {c2 : Preposition} ; Verb3 : Type = Verb2 ** {c3 : Preposition} ; + -- Saeed page 79: + -- "… the reference form is the imperative singular form + -- since it corresponds to the form of the basic root." mkVerb : (x1,x2 : Str) -> Verb = \ark,qaat -> let stems : {p1 : Str ; p2 : Str} = case ark of { a + r@#c + k@#c => ; @@ -288,11 +291,11 @@ oper _ => "n" } ; in { s = table { VPres (Sg1|Sg3 Masc) pol - => qaat + if_then_Str pol "aa" "o" ; + => qaat + if_then_Pol pol "aa" "o" ; VPres (Sg2|Sg3 Fem) pol - => arag + t + if_then_Str pol "aa" "o" ; + => arag + t + if_then_Pol pol "aa" "o" ; VPres (Pl1 _) pol - => arag + n + if_then_Str pol "aa" "o" ; + => arag + n + if_then_Pol pol "aa" "o" ; VPres Pl2 pol => arag + t + "aan" ; VPres Pl3 pol => qaat + "aan" ; @@ -333,15 +336,15 @@ oper copula : Verb = { s = table { - VPres Sg1 pol => if_then_Str pol "ahay" "ihi" ; - VPres Sg2 pol => if_then_Str pol "tahay" "ihid" ; - VPres (Sg3 Masc) pol => if_then_Str pol "yahay" "aha" ; - VPres (Sg3 Fem) pol => if_then_Str pol "tahay" "aha" ; - VPres (Pl1 _) pol => if_then_Str pol "nahay" "ihin" ; - VPres Pl2 pol => if_then_Str pol "tihiin" "ihidin" ; - VPres Pl3 pol => if_then_Str pol "yihiin" "aha" ; + VPres Sg1 pol => if_then_Pol pol "ahay" "ihi" ; + VPres Sg2 pol => if_then_Pol pol "tahay" "ihid" ; + VPres (Sg3 Masc|Impers) pol => if_then_Pol pol "yahay" "aha" ; + VPres (Sg3 Fem) pol => if_then_Pol pol "tahay" "aha" ; + VPres (Pl1 _) pol => if_then_Pol pol "nahay" "ihin" ; + VPres Pl2 pol => if_then_Pol pol "tihiin" "ihidin" ; + VPres Pl3 pol => if_then_Pol pol "yihiin" "aha" ; - VPast (Sg1|Sg3 Masc) + VPast (Sg1|Sg3 Masc|Impers) => "ahaa" ; VPast (Sg2|Sg3 Fem) => "ahayd" ; @@ -410,17 +413,34 @@ oper prepCombTable ! np.a ! combine vp.c2 noPrep ; -------------------------------------------------------------------------------- -- Sentences etc. - Clause : Type = {s : Bool => Str} ; -- TODO tense + ant + Clause : Type = {s : Tense => Anteriority => Polarity => Str} ; RClause, ClSlash, Sentence : Type = SS ; ---- TODO - stmarker : Agreement => Bool => Str = \\a,b => - let stm = if_then_Str b "w" "m" + vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb + -> {fin : Str ; inf : Str} = \t,ant,p,agr,vp -> + let pastV : Verb -> Str = \v -> + case p of { Neg => v.s ! VNegPast ; + Pos => v.s ! VPast agr } ; + presV : Verb -> Str = \v -> v.s ! VPres agr p ; + in case of { + => {fin = presV vp ; inf = [] } ; + => {fin = presV copula ; inf = vp.s ! VInf } ; ---- just guessing + => {fin = pastV vp ; inf = [] } ; + => {fin = pastV copula ; inf = vp.s ! VInf } ; ---- TODO: habitual aspect + <_Fut,Simul> => {fin = presV copula ; inf = vp.s ! VFut} ; + <_Fut,Anter> => {fin = pastV copula ; inf = vp.s ! VFut} + -- => {fin = ? ; inf = ?} ; -- TODO conditional + -- => {fin = ? ; inf = ?} -- TODO conditional + } ; + + stmarker : Agreement => Polarity => Str = \\a,b => + let stm = if_then_Pol b "w" "m" in stm + subjpron ! a ; - stmarkerNoContr : Agreement => Bool => Str = \\a,b => - let stm = if_then_Str b "waa" "ma" + stmarkerNoContr : Agreement => Polarity => Str = \\a,b => + let stm = if_then_Pol b "waa" "ma" in stm ++ subjpron ! a ; subjpron : Agreement => Str = table { diff --git a/src/somali/SentenceSom.gf b/src/somali/SentenceSom.gf index a537fd604..93d52274c 100644 --- a/src/somali/SentenceSom.gf +++ b/src/somali/SentenceSom.gf @@ -8,22 +8,27 @@ lin --2 Clauses -- : NP -> VP -> Cl - PredVP np vp = let compl = vp.comp ! np.a in { - s = \\b => - if_then_Str np.isPron [] (np.s ! Nom) - ++ compl.p1 - ++ case of { --sentence type marker + subj. pronoun - => "waa" ; - -- _ => stmarker ! np.a ! b } -- marker+pronoun contract - _ => case of { - => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree - => "ma" ++ np.s ! Nom ; - => stmarkerNoContr ! np.a ! b - }} - ++ vp.adv.s - ++ compl.p2 -- object pronoun for pronouns, empty for nouns - ++ vp.s ! VPres np.a b -- the verb inflected - ++ vp.adv.s2 + PredVP np vp = { + s = \\t,a,p => + let pred : {fin : Str ; inf : Str} = vf t a p np.a vp ; + subj : Str = if_then_Str np.isPron [] (np.s ! Nom) ; + obj : {p1,p2 : Str} = vp.comp ! np.a ; + stm : Str = + case of { + => "waa" ; + -- _ => stmarker ! np.a ! b } -- marker+pronoun contract + _ => case of { + => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree + => "ma" ++ np.s ! Nom ; + => stmarkerNoContr ! np.a ! p }} ; + in subj -- subject if it's a noun + ++ obj.p1 -- object if it's a noun + ++ stm -- sentence type marker + possible subj. pronoun + ++ vp.adv.s ---- TODO: can it contract with obj. pronoun? + ++ obj.p2 -- object if it's a pronoun + ++ pred.fin -- the verb inflected + ++ pred.inf -- potential participle + ++ vp.adv.s2 ---- I have no idea /IL } ; {- -- : SC -> VP -> Cl ; -- that she goes is good @@ -63,10 +68,10 @@ lin --2 Sentences - +-} -- : Temp -> Pol -> Cl -> S ; - UseCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p ! Stat } ; - + UseCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p } ; +{- -- : Temp -> Pol -> RCl -> RS ; UseRCl temp pol cl = { s = cl.s ! temp.t ! temp.a ! pol.p } ; diff --git a/src/somali/VerbSom.gf b/src/somali/VerbSom.gf index 142375fbd..d9da09345 100644 --- a/src/somali/VerbSom.gf +++ b/src/somali/VerbSom.gf @@ -79,23 +79,23 @@ lin -- : VPSlash -> VP ; ReflVP vps = ; - +-} -- : Comp -> VP ; - UseComp comp = - insertComp comp.s (copulaVP comp.copula) - ** {isPred = True} ; - + UseComp comp = UseCopula ** comp ** { + isPred = True + } ; +{- -- : V2 -> VP ; -- be loved PassV2 v2 = -- : VP -> Adv -> VP ; -- sleep here - AdvVP vp adv = ResSom.insertAdv adv vp ; + AdvVP vp adv = vp ** {adv = adv} ; ---- TODO: how about combining adverbs? -- : VP -> Adv -> VP ; -- sleep , even though ... - ExtAdvVP vp adv = ResSom.insertAdv (postfixSS (SOFT_BIND ++ ",") adv) vp ; + ExtAdvVP vp adv = ; -- : AdV -> VP -> VP ; -- always sleep - AdVVP adv vp = ResSom.insertAdv adv vp ; + AdVVP adv vp = vp ** {adv = adv} ; -- : VPSlash -> Adv -> VPSlash ; -- use (it) here AdvVPSlash vps adv = vps ** { adv = vps.adv ++ adv.s } ; @@ -110,7 +110,7 @@ lin -- x => x }} ; -{- + --2 Complements to copula @@ -121,13 +121,11 @@ lin -- I am [a house that sleeps here] -- we are [houses that sleep here] - -- Complement : Type = { s : Agreement => {p1,p2 : Str}} ; - -- : AP -> Comp ; CompAP ap = { comp = \\a => <[], ap.s ! AF (getNum a) Abs> ; } ; - +{-} -- : CN -> Comp ; CompCN cn = { } ;