Merge pull request #246 from inariksit/somali

(Som) Ditransitive verbs
This commit is contained in:
Inari Listenmaa
2019-06-10 16:14:15 +02:00
committed by GitHub
6 changed files with 111 additions and 81 deletions

View File

@@ -105,7 +105,7 @@ lin drink_V2 = mkV2 "cab" ;
-- --
-- lin ear_N = mkN "" ; -- lin ear_N = mkN "" ;
-- lin earth_N = mkN "" ; -- lin earth_N = mkN "" ;
-- lin eat_V2 = mkV2 "" ; lin eat_V2 = mkV2 "cun" ;
-- lin egg_N = mkN "" ; -- lin egg_N = mkN "" ;
-- lin empty_A = mkA "" ; -- lin empty_A = mkA "" ;
-- lin enemy_N = mkN "" ; -- lin enemy_N = mkN "" ;
@@ -148,9 +148,9 @@ lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) Gen ;
-- lin garden_N = mkN "" ; -- lin garden_N = mkN "" ;
lin girl_N = mkN "gabadh" "gabdho" fem ; lin girl_N = mkN "gabadh" "gabdho" fem ;
lin give_V3 = mkV3 "bixiyo" ; lin give_V3 = mkV3 "sii" ;
-- lin glove_N = mkN "" ; -- lin glove_N = mkN "" ;
-- lin go_V = joan_V ; lin go_V = mkV "tag" ;
-- lin gold_N = mkN "" ; -- lin gold_N = mkN "" ;
-- lin good_A = mkA "" ; -- lin good_A = mkA "" ;
-- lin grammar_N = mkN "" ; -- lin grammar_N = mkN "" ;
@@ -395,7 +395,7 @@ lin wait_V2 = mkV2 "sug" ;
-- lin warm_A = mkA "" ; -- lin warm_A = mkA "" ;
-- lin wash_V2 = mkV2 "" ; -- lin wash_V2 = mkV2 "" ;
-- lin watch_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ;
-- lin water_N = mkN "" ; lin water_N = mkN "biya" ;
-- lin wet_A = mkA "" ; -- lin wet_A = mkA "" ;
-- lin white_A = mkA "" ; -- lin white_A = mkA "" ;
-- lin wide_A = mkA "" ; -- lin wide_A = mkA "" ;

View File

@@ -116,7 +116,7 @@ param
-- Prepositions -- Prepositions
param param
Preposition = u | ku | ka | la | noPrep ; Preposition = u | ku | ka | la | noPrep | passive ;
PrepCombination = ugu | uga | ula | kaga | kula | kala PrepCombination = ugu | uga | ula | kaga | kula | kala
| Single Preposition ; | Single Preposition ;
@@ -177,4 +177,10 @@ oper
if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f -> if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f ->
case p of {Pos => t ; Neg => f } ; case p of {Pos => t ; Neg => f } ;
forceAgr : Agreement -> (VForm=>Str) -> (VForm=>Str) = \agr,tbl -> table {
VPres asp _a pol => tbl ! VPres asp agr pol ;
VPast asp _a => tbl ! VPast asp agr ;
x => tbl ! x
} ;
} }

View File

@@ -139,28 +139,32 @@ oper
a = Pl3 ; a = Pl3 ;
isPron = False isPron = False
} ; } ;
impersNP : NounPhrase = emptyNP ** {
a = Impers ;
isPron = True
} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Pronouns -- Pronouns
-- De somaliska possessiva pronomenen, precis som de svenska, har två olika genusformer i singular och en enda form i plural.
-- ägaren då det ägda föremålet är
-- m.sg. f.sg.plural
-- kayga tayda kuwayga
-- kaaga taada kuwaaga
-- kiisa tiisa kuwiisa
-- keeda teeda kuweeda
--
-- kaayaga taayada kuwayaga (1 pl. exkl.)
-- keenna teenna kuweenna (1 pl. inkl.)
-- kiinna tiinna kuwiinna
-- kooda tooda kuwooda
Pronoun : Type = NounPhrase ** { Pronoun : Type = NounPhrase ** {
poss : { -- for PossPron : Pron -> Quant poss : { -- for PossPron : Pron -> Quant
--s, -- possessive suffix sp : GenNum => Str ; -- independent forms, e.g. M:kayga F:tayda Pl:kuwayga
sp : GenNum => Str ; -- independent forms s : Str ; -- short possessive suffix: e.g. family members, my/your name
s : Str ; -- special case: e.g. family members, name
v : Vowel} v : Vowel}
} ; } ;
-- Second series object pronouns, Sayeed p. 74-75
-- For two non-3rd person object pronouns, e.g. "They took you away from me"
secondObject : Agreement => Str = table {
Sg1 => "kay" ;
Sg2 => "kaa" ;
Pl1 Excl => "kayo" ;
Pl1 Incl => "keen" ;
Pl2 => "kiin" ;
_ => []
} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Det, Quant, Card, Ord -- Det, Quant, Card, Ord
@@ -245,7 +249,9 @@ oper
ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ; ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ;
la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ; la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ;
u => mkPrep "u" "ii" "kuu" "noo" "idiin" "loo" ; u => mkPrep "u" "ii" "kuu" "noo" "idiin" "loo" ;
noPrep => mkPrep [] "i" "ku" "na" "idin" "la" noPrep => mkPrep [] "i" "ku" "na" "idin" "la" ;
-- impersonal subject clitic combining with object clitics. TODO find out the rest of the forms.
passive => mkPrep [] "la <1sg.obj>" "lagu" "la <1pl.obj>" "la <2pl.obj>" "la"
} ; } ;
prepCombTable : Agreement => PrepCombination => Str = table { prepCombTable : Agreement => PrepCombination => Str = table {
@@ -536,6 +542,7 @@ oper
adv : Str ; adv : Str ;
c2, c3 : Preposition ; -- can combine together and with object pronoun(s?) c2, c3 : Preposition ; -- can combine together and with object pronoun(s?)
obj2 : {s : Str ; a : AgreementPlus} ; obj2 : {s : Str ; a : AgreementPlus} ;
secObj : Str ; -- if two overt pronoun objects
} ; } ;
VPSlash : Type = VerbPhrase ; VPSlash : Type = VerbPhrase ;
@@ -546,6 +553,7 @@ oper
adv = [] ; adv = [] ;
c2,c3 = noPrep ; c2,c3 = noPrep ;
obj2 = {s = [] ; a = Unassigned} ; obj2 = {s = [] ; a = Unassigned} ;
secObj = []
} ; } ;
useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** { useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
@@ -553,49 +561,65 @@ oper
} ; } ;
complSlash : VPSlash -> VerbPhrase = \vps -> let np = vps.obj2 in vps ** { complSlash : VPSlash -> VerbPhrase = \vps -> let np = vps.obj2 in vps ** {
comp = \\a => comp = \\agr =>
case np.a of { case np.a of {
Unassigned => vps.comp ! a ; Unassigned => vps.comp ! agr ;
IsPron ag => {p1 = [] ; -- object is a pronoun => nothing is placed before the verb _ => {p1 = np.s ; -- if object is a noun, it will come before verb in the sentence.
p2 = compl np.a vps} ; -- object combines with the preposition of the verb -- if object is a pronoun, np.s is empty.
NotPronP3 => {p1 = np.s ; -- object is a noun => it will come before verb in the sentence p2 = compl np.a vps ++ vps.secObj} -- object combines with the preposition of the verb.
p2 = compl np.a vps} -- object combines with the preposition of the verb -- secObj in case there was a ditransitive verb.
-- IsPron ag => {p1 = [] ; -- object is a pronoun => nothing is placed before the verb
-- p2 = compl np.a vps ++ vps.secObj} ; -- object combines with the preposition of the verb
-- NotPronP3 => {p1 = np.s ; -- object is a noun => it will come before verb in the sentence
-- p2 = compl np.a vps ++ vps.secObj} -- object combines with the preposition of the verb
} }
} ; } ;
compl : AgreementPlus -> VerbPhrase -> Str = \a,vp -> compl : AgreementPlus -> VerbPhrase -> Str = \a,vp ->
let agr = case a of {IsPron x => x ; _ => Pl3} ; let agr = case a of {IsPron x => x ; _ => Pl3} ;
in "<" ++ prepCombTable ! agr ! combine vp.c2 vp.c3 ++ ">" ; in prepCombTable ! agr ! combine vp.c2 vp.c3 ;
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np -> insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
let nps = if_then_Str np.isPron [] (np.s ! Abs) ; let noun = if_then_Str np.isPron [] (np.s ! Abs) ;
in case vp.obj2.a of { in case vp.obj2.a of {
Unassigned => Unassigned =>
vp ** {obj2 = {s = nps ; vp ** {obj2 = {
s = noun ;
a = agr2agrplus np.isPron np.a} a = agr2agrplus np.isPron np.a}
} ; } ;
-- If the old object in obj2 is 3rd person, we can safely replace its agreement, but keep its string. -- If the old object is 3rd person, we can safely replace its agreement.
NotPronP3|IsPron (Sg3 _|Pl3) => -- We keep both old and new string (=noun, if there was one) in obj2.s.
vp ** {obj2 = vp.obj2 ** {a = agr2agrplus np.isPron np.a} ; NotPronP3|IsPron (Sg3 _|Pl3|Impers) =>
adv = vp.adv ++ nps} ; vp ** {obj2 = {
s = vp.obj2.s ++ noun ;
a = agr2agrplus np.isPron np.a} ; --
} ; -- no secObj, because there's ≤1 non-3rd-person pronoun.
-- This happens in two cases: -- If old object was non-3rd person, we keep its agreement.
-- 1) insertAdv placed the preposition into vp.adv and called insertComp. _ =>
-- 2) ditransitive verb where both objects are non-3rd person. (Not implemented yet.) vp ** {obj2 = vp.obj2 ** {
_ => vp ** {adv = vp.adv ++ nps} s = vp.obj2.s ++ noun
} ;
secObj = vp.secObj ++ secondObject ! np.a}
} ;
passV2 : Verb2 -> VerbPhrase = \v2 -> useVc v2 ** {
--s = forceAgr Impers v2.s ;
c2 = passive ;
c3 = v2.c2 ;
} ; } ;
insertAdv : Adverb -> VerbPhrase -> VerbPhrase = \adv,vp -> insertAdv : Adverb -> VerbPhrase -> VerbPhrase = \adv,vp ->
case adv.c2 of { case adv.c2 of {
noPrep => vp ** {adv = adv.s} ; -- The adverb is not formed with PrepNP noPrep => vp ** {adv = adv.s} ; -- The adverb is not formed with PrepNP
prep => insertComp vp' adv.np } prep => case <vp.c2,vp.obj2.a,vp.c3> of {
where { vp' : VerbPhrase = <noPrep,Unassigned,_> => insertComp <vp ** {c2 = adv.c2}:VerbPhrase> adv.np ; -- should cover for obligatory argument that is not introduced with a preposition
case <vp.c2,vp.obj2.a,vp.c3> of { -- NB. This is a safe assumption only for AdvVP, no guarantees for AdvVPSlash. <_,_, noPrep> => insertComp (vp ** {c3 = adv.c2}) adv.np ;
<noPrep,Unassigned,_> => vp ** {c2 = adv.c2} ; -- should cover for obligatory argument that is not introduced with a preposition
<_,_,noPrep> => vp ** {c3 = adv.c2} ;
-- if complement slots are full, put preposition just as a string. TODO check word order. -- if complement slots are full, put preposition just as a string. TODO check word order.
_ => vp ** {adv = (prepTable ! adv.c2).s ! adv.np.a} --only preposition inserted here, adv.np.s ! Abs will be inserted in insertComp! _ => vp ** {adv = (prepTable ! adv.c2).s ! adv.np.a ++ adv.np.s ! Abs}
} }
} ; } ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@@ -637,9 +661,11 @@ oper
in stm ++ subjpron ! a ; in stm ++ subjpron ! a ;
subjpron : Agreement => Str = table { subjpron : Agreement => Str = table {
Sg1|Pl1 _ => "aan" ; Sg1|Pl1 Excl => "aan" ;
Pl1 Incl => "aynu" ;
Sg2|Pl2 => "aad" ; Sg2|Pl2 => "aad" ;
Sg3 Masc => "uu" ; Sg3 Masc => "uu" ;
Impers => [] ;
_ => "ay" } ; _ => "ay" } ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@@ -8,20 +8,25 @@ lin
--2 Clauses --2 Clauses
-- : NP -> VP -> Cl -- : NP -> VP -> Cl
PredVP np vps = let vp = complSlash vps in { PredVP np vps =
s = \\t,a,p => let vp = case vps.c2 of {
let pred : {fin : Str ; inf : Str} = vf t a p np.a vp ; passive => complSlash (insertComp vps np) ;
subj : Str = if_then_Str np.isPron [] (np.s ! Nom) ; _ => complSlash vps } ;
obj : {p1,p2 : Str} = vp.comp ! np.a ; subj = case vps.c2 of {passive => impersNP ; _ => np} ;
in { s = \\t,a,p =>
let pred : {fin : Str ; inf : Str} = vf t a p subj.a vp ;
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 = stm : Str =
case <p,vp.isPred,np.a> of { case <p,vp.isPred,subj.a> of {
<Pos,True,Sg3 _> => "waa" ; <Pos,True,Sg3 _|Impers> => "waa" ;
-- _ => stmarker ! np.a ! b } -- marker+pronoun contract -- _ => stmarker ! np.a ! b } -- marker+pronoun contract
_ => case <np.isPron,p> of { _ => case <np.isPron,p> of {
<True,Pos> => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree <True,Pos> => "waa" ++ subjpron ; -- to force some string from NP to show in the tree
<True,Neg> => "ma" ++ np.s ! Nom ; <True,Neg> => "ma" ++ subjpron ;
<False> => stmarkerNoContr ! np.a ! p }} ; <False> => stmarkerNoContr ! subj.a ! p }} ;
in subj -- subject if it's a noun in subjnoun -- subject if it's a noun
++ obj.p1 -- object if it's a noun ++ obj.p1 -- object if it's a noun
++ stm -- sentence type marker + possible subj. pronoun ++ stm -- sentence type marker + possible subj. pronoun
++ vp.adv ---- TODO word order ++ vp.adv ---- TODO word order

View File

@@ -131,6 +131,7 @@ lin with_Prep = prep la ;
a = Sg2 ; isPron = True ; a = Sg2 ; isPron = True ;
poss = {s = "aa" ; v = vA ; sp = gnTable "aag" "aad" "uwaag"} poss = {s = "aa" ; v = vA ; sp = gnTable "aag" "aad" "uwaag"}
} ; } ;
it_Pron = he_Pron ** {s = \\_ => []} ;
he_Pron = { he_Pron = {
s = table {Nom => "uu" ; Voc => "isaga" ; _Abs => []} ; s = table {Nom => "uu" ; Voc => "isaga" ; _Abs => []} ;
a = Sg3 Masc ; isPron = True ; a = Sg3 Masc ; isPron = True ;
@@ -143,7 +144,7 @@ lin with_Prep = prep la ;
} ; } ;
we_Pron = { we_Pron = {
s = table {Nom => "aan" ; Voc => "innaga" ; _Abs => "na"} ; s = table {Nom => "aan" ; Voc => "innaga" ; _Abs => "na"} ;
a = Pl1 Incl ; isPron = True ; a = Pl1 Excl ; isPron = True ;
poss = {s = "een" ; v = vE ; sp = gnTable "eenn" "eenn" "uweenn"} poss = {s = "een" ; v = vE ; sp = gnTable "eenn" "eenn" "uweenn"}
} ; } ;
youPl_Pron = { youPl_Pron = {

View File

@@ -7,10 +7,10 @@ lin
-- VP -- VP
-- : V -> VP -- : V -> VP
UseV = ResSom.useV ; UseV = ResSom.useV ;
{-
-- : V2 -> VP ; -- be loved
PassV2 v2 =
-- : V2 -> VP ; -- be loved
PassV2 = ResSom.passV2 ;
{-
-- : VV -> VP -> VP ; -- : VV -> VP -> VP ;
ComplVV vv vp = ; ComplVV vv vp = ;
@@ -30,22 +30,14 @@ lin
-- : V2 -> VPSlash -- : V2 -> VPSlash
SlashV2a = useVc ; SlashV2a = useVc ;
{-
-- : V3 -> NP -> VPSlash ; -- give it (to her) -- : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 npNori = slashDObj v3 **
{ iobj = { s = npNori.s ! Dat ;
agr = npNori.agr }
} ;
-- : V3 -> NP -> VPSlash ; -- give (it) to her -- : V3 -> NP -> VPSlash ; -- give (it) to her
Slash3V3 v3 npNor = slashIObj v3 ** Slash2V3,
{ dobj = npNor ** { s = mkDObj npNor } Slash3V3 = \v3 -> insertComp (useVc v3) ;
} ; {-
-- : V2V -> VP -> VPSlash ; -- beg (her) to go -- : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2V v2v vp = ; SlashV2V v2v vp = ;
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
SlashV2S v2s s = ; SlashV2S v2s s = ;