a shortcut in SentenceRomance.SlashVP to make it more easily compilable. This compromises the correctness of negation with polarity elements (e.g. the omission of "pas" in French when "rien" is present) in slash-type questions and polarity items. The correct version is left in a comment and waiting for optimizations that would enable compiling it into PMCFG.

This commit is contained in:
aarne
2013-11-21 08:48:08 +00:00
parent 254b2f0f40
commit 4ba116d125
2 changed files with 118 additions and 15 deletions

View File

@@ -216,6 +216,7 @@ oper
<True,_,RPos,_> => polNegDirSubj ;
_ => b
} ;
neg = vp.neg ! pol ;
gen = agr.g ;
@@ -226,20 +227,22 @@ oper
True => vp.comp ! {g = gen ; n = Sg ; p = per} ;
_ => vp.comp ! agr
} ;
ext = vp.ext ! pol ;
ext = vp.ext ! b ;
vtyp = vp.s.vtyp ;
refl = case isVRefl vtyp of {
True => reflPron num per Acc ; ---- case ?
_ => []
} ;
clit = refl ++ vp.clit1 ++ vp.clit2 ++ vp.clit3.s ; ---- refl first?
clit = refl ++ vp.clit1 ++ vp.clit2 ++ vp.clit3.s ; ---- refl first?
verb = vp.s.s ;
vaux = auxVerb vp.s.vtyp ;
vagr = appVPAgr vp.agr (aagr gen num) ; --- subtype bug
part = verb ! VPart vagr.g vagr.n ;
part = case vp.agr of {
VPAgrSubj => verb ! VPart agr.g agr.n ;
VPAgrClit g n => verb ! VPart g n
} ;
vps : Str * Str = case <te,a> of {
<RPast,Simul> => <verb ! VFin (VImperf m) num per, []> ; --# notpresent
@@ -261,9 +264,7 @@ oper
DDir =>
subj ++ neg.p1 ++ clit ++ fin ++ neg.p2 ++ inf ++ compl ++ ext ;
DInv =>
---- neg.p1 ++ clit ++ fin ++ neg.p2 ++ inf ++ compl ++ subj ++ ext
invertedClause vp.s.vtyp <te, a, num, per> hasClit neg clit fin inf compl subj ext
---- neg.p1 ++ clit ++ fin ++ preOrPost hasClit subj (neg.p2 ++ inf) ++ compl ++ ext ----
}
} ;

View File

@@ -14,19 +14,121 @@ incomplete concrete SentenceRomance of Sentence =
}
} ;
SlashVP np v2 =
{-
SlashVP np vps =
-- agreement decided afterwards: la fille qu'il a trouvée
{s = \\a =>
{s = \\agr =>
let
----- vp = v2
vp = case <v2.c2.c, v2.c2.isDir> of {
<Acc,True> => insertAgr a v2 ;
_ => v2
vp = case <vps.c2.c, vps.c2.isDir> of {
<Acc,True> => insertAgr agr vps ; -- la fille qu'il a trouvée decided here
_ => vps
}
in (mkClausePol np.isNeg (np.s ! Nom).comp False np.isPol np.a vp).s ;
----- in (mkClausePol np.isNeg (np.s ! Nom).comp np.hasClit np.isPol np.a vp).s ;
c2 = v2.c2
in (mkClausePol np.isNeg (np.s ! Nom).comp np.hasClit np.isPol np.a vp).s ; -- à qui montre-t-il sa maison
c2 = vps.c2 -- np.hasClit decides inversion
} ;
-}
--- inlined mkClausePol to make compilation possible AR 21/11/2013
---- one shortcut left: polarity change from negative elements ("rien" etc) ignored
---- thus we get "la fille que personne ne voit pas"
SlashVP np vps = {
c2 = vps.c2 ;
s = \\agr0,d,te,a,b,m =>
let
isNeg = np.isNeg ;
subj = (np.s ! Nom).comp ;
hasClit = np.hasClit ;
isPol = np.isPol ;
agr = np.a ;
vp : VP = case <vps.c2.c, vps.c2.isDir> of {
<Acc,True> => insertAgr agr0 vps ; -- la fille qu'il a trouvée is decided here
_ => vps
} ;
{- slow to compile
pol : RPolarity = case <isNeg, vp.isNeg, b, d> of {
<_,True,RPos,_> => RNeg True ;
<True,_,RPos,DInv> => RNeg True ;
<True,_,RPos,_> => polNegDirSubj ;
_ => b
} ;
-} --pol = b ; ----
neg = vp.neg ! b ;
{- also too slow
neg : Str * Str = case b of {
RNeg _ => vp.neg ! b ;
RPos => case vp.isNeg of {
True => vp.neg ! RNeg True ;
False => case isNeg of {
True => case d of {
DInv => vp.neg ! RNeg True ;
_ => vp.neg ! polNegDirSubj
} ;
False => vp.neg ! b
}
}
} ;
-}
gen = agr.g ;
num = agr.n ;
per = agr.p ;
compl = case isPol of {
True => vp.comp ! {g = gen ; n = Sg ; p = per} ;
_ => vp.comp ! agr
} ;
ext = vp.ext ! b ;
vtyp = vp.s.vtyp ;
refl = case isVRefl vtyp of {
True => reflPron num per Acc ; ---- case ?
_ => []
} ;
clit = refl ++ vp.clit1 ++ vp.clit2 ++ vp.clit3.s ; ---- refl first?
verb = vp.s.s ;
vaux = auxVerb vp.s.vtyp ;
part = case vp.agr of {
VPAgrSubj => verb ! VPart agr.g agr.n ;
VPAgrClit g n => verb ! VPart g n
} ;
vps : Str * Str = case <te,a> of {
<RPast,Simul> => <verb ! VFin (VImperf m) num per, []> ; --# notpresent
<RPast,Anter> => <vaux ! VFin (VImperf m) num per, part> ; --# notpresent
<RFut,Simul> => <verb ! VFin (VFut) num per, []> ; --# notpresent
<RFut,Anter> => <vaux ! VFin (VFut) num per, part> ; --# notpresent
<RCond,Simul> => <verb ! VFin (VCondit) num per, []> ; --# notpresent
<RCond,Anter> => <vaux ! VFin (VCondit) num per, part> ; --# notpresent
<RPasse,Simul> => <verb ! VFin (VPasse) num per, []> ; --# notpresent
<RPasse,Anter> => <vaux ! VFin (VPasse) num per, part> ; --# notpresent
<RPres,Anter> => <vaux ! VFin (VPres m) num per, part> ; --# notpresent
<RPres,Simul> => <verb ! VFin (VPres m) num per, []>
} ;
fin = vps.p1 ;
inf = vps.p2 ;
in
case d of {
DDir =>
subj ++ neg.p1 ++ clit ++ fin ++ neg.p2 ++ inf ++ compl ++ ext ;
DInv =>
invertedClause vp.s.vtyp <te, a, num, per> hasClit neg clit fin inf compl subj ext
}
} ;
AdvSlash slash adv = {
s = \\ag,d,t,a,b,m => slash.s ! ag ! d ! t ! a ! b ! m ++ adv.s ;