1
0
forked from GitHub/gf-rgl

(Som) More fine-grained adverbials

This commit is contained in:
Inari Listenmaa
2019-07-01 14:13:45 +02:00
parent 8115b26947
commit ca06dc4e1d
10 changed files with 98 additions and 42 deletions

View File

@@ -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 <vp.c2,vp.obj2.a,vp.c3> of {
<P NoPrep,Unassigned,_> => 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 <adv.c2, isP3 adv.np.a> of {
<NoPrep,_> -- 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 <vp.c2,vp.obj2.a,vp.c3> of {
-- if free complement slots, introduce adv.np with insertComp
<P NoPrep,Unassigned,_> => 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 ;
}