mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
(Hun) Make VP smaller by forcing object of have_V2 in s field.
Probably bad decision, makes word order fixed at VP already. But works for a particular application grammar.
This commit is contained in:
@@ -13,7 +13,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in {
|
||||
-}
|
||||
UttIP,
|
||||
UttNP = \np -> {s = np.s ! NotPossessed ! Nom} ;
|
||||
UttVP vp = {s = vp.obj ! <P3,Sg> ++ vp.adv ++ vp.s ! VInf} ;
|
||||
UttVP vp = {s = vp.obj ++ vp.adv ++ vp.s ! VInf} ;
|
||||
UttAdv adv = adv ;
|
||||
UttCN cn = {s = linCN cn} ;
|
||||
UttCard n = {s = n.s ! Indep} ;
|
||||
|
||||
@@ -457,7 +457,7 @@ oper
|
||||
-- VP
|
||||
|
||||
VerbPhrase : Type = Verb ** {
|
||||
obj : Person*Number => Str ;
|
||||
obj : Str ; -- Person*Number => Str, if we want open word order in have_V2
|
||||
adv : Str ;
|
||||
c2 : Case ; -- for RelSlash
|
||||
} ; -- TODO more fields
|
||||
@@ -467,7 +467,7 @@ oper
|
||||
} ;
|
||||
|
||||
useV : Verb -> VerbPhrase = \v -> v ** {
|
||||
obj = \\_ => [] ;
|
||||
obj = [] ;
|
||||
adv = [] ;
|
||||
c2 = Acc ; -- TODO check
|
||||
} ;
|
||||
@@ -503,7 +503,7 @@ oper
|
||||
in np.s ! NotPossessed ! subjcase
|
||||
++ if_then_Pol p [] "nem"
|
||||
++ vp.s ! agr2vf np.agr
|
||||
++ vp.obj ! np.agr
|
||||
++ vp.obj -- ! np.agr
|
||||
++ vp.adv
|
||||
++ np.empty -- standard trick for prodrop+metavariable problem
|
||||
} ;
|
||||
@@ -521,7 +521,7 @@ oper
|
||||
SCDat => Dat }
|
||||
in rp.s ! n ! subjcase
|
||||
++ if_then_Pol p [] "nem"
|
||||
++ vp.obj ! <rp.agr.p1,n>
|
||||
++ vp.obj -- ! <rp.agr.p1,n>
|
||||
++ vp.adv
|
||||
++ vp.s ! VPres rp.agr.p1 n -- variable by number
|
||||
} ;
|
||||
|
||||
@@ -15,7 +15,7 @@ lin
|
||||
|
||||
--2 Clauses missing object noun phrases
|
||||
-- : NP -> VPSlash -> ClSlash ;
|
||||
SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = \\_ => []}) ;
|
||||
SlashVP np vps = predVP np (vps ** {s = vps.s ! Indef ; obj = []}) ;
|
||||
{-
|
||||
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
||||
AdvSlash cls adv = cls ** insertAdv adv cls ;
|
||||
|
||||
@@ -147,16 +147,21 @@ lin
|
||||
|
||||
oper
|
||||
insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** {
|
||||
obj = \\agr =>
|
||||
-- have_V2 needs its object possessed by the subject
|
||||
case <vps.sc,vps.c2> of {
|
||||
<SCDat,Nom> => np.s ! Poss agr.p1 agr.p2 ! vps.c2 ;
|
||||
_ => np.s ! NotPossessed ! vps.c2 } ;
|
||||
obj = case <vps.sc,vps.c2> of {
|
||||
<SCDat,Nom> => [] ;
|
||||
_ => np.s ! NotPossessed ! vps.c2 } ;
|
||||
|
||||
s = \\vf =>
|
||||
-- If verb's subject case is Dat and object Nom, verb agrees with obj.
|
||||
case <vps.sc,vps.c2> of {
|
||||
<SCDat,Nom> => vps.s ! np.objdef ! agr2vf np.agr;
|
||||
case <vps.sc,vps.c2> of { -- have_V2 needs its object possessed by the subject
|
||||
<SCDat,Nom> =>
|
||||
let agr : Person*Number = case vf of {
|
||||
VPres p n => <p,n> ;
|
||||
_ => <P3,Sg> } ;
|
||||
in np.s ! Poss agr.p1 agr.p2 ! vps.c2
|
||||
++ vps.s ! np.objdef ! agr2vf np.agr ;
|
||||
|
||||
-- Default case: Verb agrees in person and number with subject
|
||||
_ => vps.s ! np.objdef ! vf } ;
|
||||
} ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user