mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 09:28:54 -06:00
(Som) VV complements + some restructuring.
This commit is contained in:
@@ -419,8 +419,11 @@ oper
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Verbs
|
-- Verbs
|
||||||
|
|
||||||
Verb : Type = {
|
BaseVerb : Type = {
|
||||||
s : VForm => Str ;
|
s : VForm => Str ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Verb : Type = BaseVerb ** {
|
||||||
sii : Str ; -- closed class of particles: sii, soo, kala, wada (Sayeed 171)
|
sii : Str ; -- closed class of particles: sii, soo, kala, wada (Sayeed 171)
|
||||||
dhex : Str ; -- closed class of adverbials: hoos, kor, dul, dhex, …
|
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
|
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.
|
-- Prepositions can combine together and with object pronoun.
|
||||||
c2 : PrepositionPlus ; -- hack to implement passives more efficiently:
|
c2 : PrepositionPlus ; -- hack to implement passives more efficiently:
|
||||||
c3 : Preposition ; -- if c2 is Passive, the real preposition is in c3.
|
c3 : Preposition ; -- if c2 is Passive, the real preposition is in c3.
|
||||||
obj2 : {s : Str ; a : AgreementPlus} ;
|
obj2 : {s : Str ; a : AgreementPlus} ;
|
||||||
secObj : Str ; -- if two overt pronoun objects
|
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
|
miscAdv : Str ; -- dump for any other kind of adverb, that isn't
|
||||||
} ; -- in a closed class of particles or made with PrepNP.
|
} ; -- in a closed class of particles or made with PrepNP.
|
||||||
|
|
||||||
@@ -644,7 +647,7 @@ oper
|
|||||||
useV : Verb -> VerbPhrase = \v -> v ** {
|
useV : Verb -> VerbPhrase = \v -> v ** {
|
||||||
comp = \\_ => <[],[]> ;
|
comp = \\_ => <[],[]> ;
|
||||||
pred = NoPred ;
|
pred = NoPred ;
|
||||||
berri,miscAdv = [] ;
|
vComp,berri,miscAdv = [] ;
|
||||||
c2 = P NoPrep ;
|
c2 = P NoPrep ;
|
||||||
c3 = NoPrep ;
|
c3 = NoPrep ;
|
||||||
obj2 = {s = [] ; a = Unassigned} ;
|
obj2 = {s = [] ; a = Unassigned} ;
|
||||||
@@ -674,7 +677,7 @@ oper
|
|||||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
||||||
let noun : Str = case <np.isPron,np.a> of {
|
let noun : Str = case <np.isPron,np.a> of {
|
||||||
<False,_> => np.s ! Abs ;
|
<False,_> => np.s ! Abs ;
|
||||||
<True,(Sg3 _|Pl3)> => (pronTable ! np.a).sp ; -- long object pronoun for 3rd person object
|
-- <True,(Sg3 _|Pl3)> => (pronTable ! np.a).sp ; -- uncomment if you want to add long object pronoun for 3rd person object
|
||||||
_ => [] } -- no long object for other pronouns
|
_ => [] } -- no long object for other pronouns
|
||||||
in case vp.obj2.a of {
|
in case vp.obj2.a of {
|
||||||
Unassigned =>
|
Unassigned =>
|
||||||
@@ -701,10 +704,9 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
||||||
case <adv.c2, isP3 adv.np.a> of {
|
case <adv.c2, isP3 adv.np.a, adv.np.isPron> of {
|
||||||
<NoPrep,_> -- a) the adverb is not formed with PrepNP, e.g. "tomorrow"
|
<NoPrep,_,_> => vp ** adv'' ; -- a) the adverb is not formed with PrepNP, e.g. "tomorrow"
|
||||||
| <_,True> -- b) is formed with PrepNP, and has 3rd person obj.
|
<_,True,False> => vp ** adv'' ; -- b) is formed with PrepNP, and has 3rd person obj, which is a noun.
|
||||||
=> vp ** adv'' ;
|
|
||||||
_ => case <vp.c2,vp.obj2.a,vp.c3> of {
|
_ => case <vp.c2,vp.obj2.a,vp.c3> of {
|
||||||
-- if free complement slots, introduce adv.np with insertComp
|
-- if free complement slots, introduce adv.np with insertComp
|
||||||
<P NoPrep,Unassigned,_> => insertComp (vp ** {c2 = P adv.c2}) adv.np ** adv' ;
|
<P NoPrep,Unassigned,_> => insertComp (vp ** {c2 = P adv.c2}) adv.np ** adv' ;
|
||||||
@@ -727,6 +729,56 @@ oper
|
|||||||
ClSlash,
|
ClSlash,
|
||||||
Sentence : Type = SS ; ---- TODO
|
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 <isQ,p,vp.pred> of {
|
||||||
|
<False,Pos,NoCopula> => {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 <isP3 vp.obj2.a, vp.c2> of {
|
||||||
|
<True,P NoPrep> => [] ;
|
||||||
|
_ => 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 <isQ,p,vp.pred,subj.a> of {
|
||||||
|
<False,Pos,Copula|NoCopula,Sg3 _|Impers> => "waa" ;
|
||||||
|
<True ,Pos,_ ,_ > => "ma" ;
|
||||||
|
_ => case <np.isPron,p> of {
|
||||||
|
<True,Pos> => "waa" ++ subjpron ; -- to force some string from NP to show in the tree
|
||||||
|
<True,Neg> => "ma" ; -- ++ subjpron ; -- TODO check subj pron or not?
|
||||||
|
<False> => 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
|
vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb
|
||||||
-> {fin : Str ; inf : Str} = \t,ant,p,agr,vp ->
|
-> {fin : Str ; inf : Str} = \t,ant,p,agr,vp ->
|
||||||
case <t,ant> of {
|
case <t,ant> of {
|
||||||
@@ -736,7 +788,7 @@ oper
|
|||||||
<Past,Anter> => {fin = pastV (cSug "jir") ; inf = vp.s ! VInf} ;
|
<Past,Anter> => {fin = pastV (cSug "jir") ; inf = vp.s ! VInf} ;
|
||||||
<Fut,Simul> => {fin = presV (cSug "doon") ; inf = vp.s ! VInf} ;
|
<Fut,Simul> => {fin = presV (cSug "doon") ; inf = vp.s ! VInf} ;
|
||||||
<Fut,Anter> => {fin = pastV (cSug "doon") ; inf = vp.s ! VInf} ;
|
<Fut,Anter> => {fin = pastV (cSug "doon") ; inf = vp.s ! VInf} ;
|
||||||
<Cond,Simul> => {fin = presV have_V ; inf = vp.s ! VInf} ; -- TODO check
|
<Cond,Simul> => {fin = pastV have_V ; inf = vp.s ! VInf} ; -- TODO check
|
||||||
<Cond,Anter> => {fin = pastV have_V ; inf = vp.s ! VInf} -- TODO check
|
<Cond,Anter> => {fin = pastV have_V ; inf = vp.s ! VInf} -- TODO check
|
||||||
}
|
}
|
||||||
where {
|
where {
|
||||||
@@ -747,6 +799,10 @@ oper
|
|||||||
presV : Verb -> Str = \v -> v.s ! VPres Simple agr p ;
|
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 =>
|
stmarker : Agreement => Polarity => Str = \\a,b =>
|
||||||
let stm = if_then_Pol b "w" "m"
|
let stm = if_then_Pol b "w" "m"
|
||||||
in stm + subjpron ! a ;
|
in stm + subjpron ! a ;
|
||||||
@@ -767,7 +823,7 @@ oper
|
|||||||
-- linrefs
|
-- linrefs
|
||||||
|
|
||||||
oper
|
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 ;
|
linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ;
|
||||||
linAdv : Adverb -> Str = \adv ->
|
linAdv : Adverb -> Str = \adv ->
|
||||||
adv.berri
|
adv.berri
|
||||||
|
|||||||
@@ -8,49 +8,8 @@ lin
|
|||||||
--2 Clauses
|
--2 Clauses
|
||||||
|
|
||||||
-- : NP -> VP -> Cl
|
-- : NP -> VP -> Cl
|
||||||
PredVP np vps =
|
PredVP = predVP ;
|
||||||
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 <isQ,p,vp.pred> of {
|
|
||||||
<False,Pos,NoCopula> => {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 <isQ,p,vp.pred,subj.a> of {
|
|
||||||
<False,Pos,Copula|NoCopula,Sg3 _|Impers> => "waa" ;
|
|
||||||
<True ,Pos,_ ,_ > => "ma" ;
|
|
||||||
_ => case <np.isPron,p> of {
|
|
||||||
<True,Pos> => "waa" ++ subjpron ; -- to force some string from NP to show in the tree
|
|
||||||
<True,Neg> => "ma" ++ subjpron ;
|
|
||||||
<False> => stmarkerNoContr ! subj.a ! p
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
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
|
-- : SC -> VP -> Cl ; -- that she goes is good
|
||||||
PredSCVP sc vp = ;
|
PredSCVP sc vp = ;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ lin with_Prep = mkPrep la ;
|
|||||||
-- Pron
|
-- Pron
|
||||||
|
|
||||||
-- Pronouns are closed class, no constructor in ParadigmsSom.
|
-- Pronouns are closed class, no constructor in ParadigmsSom.
|
||||||
it_Pron = he_Pron ** {s = \\_ => []} ;
|
it_Pron = he_Pron ** {s = \\_ => [] ; sp = []} ;
|
||||||
i_Pron = pronTable ! Sg1 ;
|
i_Pron = pronTable ! Sg1 ;
|
||||||
youPol_Pron, -- TODO check
|
youPol_Pron, -- TODO check
|
||||||
youSg_Pron = pronTable ! Sg2 ;
|
youSg_Pron = pronTable ! Sg2 ;
|
||||||
@@ -160,10 +160,9 @@ lin yes_Utt = ss "yes" ;
|
|||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
lin have_V2 = mkV2 have_V noPrep ;
|
lin have_V2 = mkV2 have_V noPrep ;
|
||||||
{-
|
lin can8know_VV = can_VV ; -- can (capacity)
|
||||||
lin can8know_VV = mkV "" ; -- can (capacity)
|
lin can_VV = mkV "kar" ; -- can (possibility)
|
||||||
lin can_VV = mkV "" ; -- can (possibility)
|
{-lin must_VV = mkV "" ;
|
||||||
lin must_VV = mkV "" ;
|
|
||||||
lin want_VV = mkV "" ;
|
lin want_VV = mkV "" ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ lin
|
|||||||
|
|
||||||
-- : V2 -> VP ; -- be loved
|
-- : V2 -> VP ; -- be loved
|
||||||
PassV2 = ResSom.passV2 ;
|
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 ;
|
-- : VS -> S -> VP ;
|
||||||
ComplVS vs s = ;
|
ComplVS vs s = ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user