1
0
forked from GitHub/gf-rgl

(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:
Inari Listenmaa
2020-04-26 20:52:09 +02:00
parent c076409f6a
commit a9e02de33e
4 changed files with 18 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in {
-} -}
UttIP, UttIP,
UttNP = \np -> {s = np.s ! NotPossessed ! Nom} ; 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 ; UttAdv adv = adv ;
UttCN cn = {s = linCN cn} ; UttCN cn = {s = linCN cn} ;
UttCard n = {s = n.s ! Indep} ; UttCard n = {s = n.s ! Indep} ;

View File

@@ -457,7 +457,7 @@ oper
-- VP -- VP
VerbPhrase : Type = Verb ** { VerbPhrase : Type = Verb ** {
obj : Person*Number => Str ; obj : Str ; -- Person*Number => Str, if we want open word order in have_V2
adv : Str ; adv : Str ;
c2 : Case ; -- for RelSlash c2 : Case ; -- for RelSlash
} ; -- TODO more fields } ; -- TODO more fields
@@ -467,7 +467,7 @@ oper
} ; } ;
useV : Verb -> VerbPhrase = \v -> v ** { useV : Verb -> VerbPhrase = \v -> v ** {
obj = \\_ => [] ; obj = [] ;
adv = [] ; adv = [] ;
c2 = Acc ; -- TODO check c2 = Acc ; -- TODO check
} ; } ;
@@ -503,7 +503,7 @@ oper
in np.s ! NotPossessed ! subjcase in np.s ! NotPossessed ! subjcase
++ if_then_Pol p [] "nem" ++ if_then_Pol p [] "nem"
++ vp.s ! agr2vf np.agr ++ vp.s ! agr2vf np.agr
++ vp.obj ! np.agr ++ vp.obj -- ! np.agr
++ vp.adv ++ vp.adv
++ np.empty -- standard trick for prodrop+metavariable problem ++ np.empty -- standard trick for prodrop+metavariable problem
} ; } ;
@@ -521,7 +521,7 @@ oper
SCDat => Dat } SCDat => Dat }
in rp.s ! n ! subjcase in rp.s ! n ! subjcase
++ if_then_Pol p [] "nem" ++ if_then_Pol p [] "nem"
++ vp.obj ! <rp.agr.p1,n> ++ vp.obj -- ! <rp.agr.p1,n>
++ vp.adv ++ vp.adv
++ vp.s ! VPres rp.agr.p1 n -- variable by number ++ vp.s ! VPres rp.agr.p1 n -- variable by number
} ; } ;

View File

@@ -15,7 +15,7 @@ lin
--2 Clauses missing object noun phrases --2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ; -- : 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 -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** insertAdv adv cls ; AdvSlash cls adv = cls ** insertAdv adv cls ;

View File

@@ -147,16 +147,21 @@ lin
oper oper
insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { insertObj : ResHun.VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** {
obj = \\agr => obj = case <vps.sc,vps.c2> of {
-- have_V2 needs its object possessed by the subject <SCDat,Nom> => [] ;
case <vps.sc,vps.c2> of { _ => np.s ! NotPossessed ! vps.c2 } ;
<SCDat,Nom> => np.s ! Poss agr.p1 agr.p2 ! vps.c2 ;
_ => np.s ! NotPossessed ! vps.c2 } ;
s = \\vf => s = \\vf =>
-- If verb's subject case is Dat and object Nom, verb agrees with obj. -- If verb's subject case is Dat and object Nom, verb agrees with obj.
case <vps.sc,vps.c2> of { case <vps.sc,vps.c2> of { -- have_V2 needs its object possessed by the subject
<SCDat,Nom> => vps.s ! np.objdef ! agr2vf np.agr; <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 } ; _ => vps.s ! np.objdef ! vf } ;
} ; } ;