mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 10:12:51 -06:00
factored English uncontracted negation to one constant, ExtraEng.UncNeg : Pol
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
concrete CatEng of Cat = CommonX - [Pol] ** open ResEng, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
|
||||||
|
-- exception to CommonX, due to the distinction contracted/uncontracted negation
|
||||||
|
|
||||||
|
Pol = {s : Str ; p : CPolarity} ;
|
||||||
|
|
||||||
-- Tensed/Untensed
|
-- Tensed/Untensed
|
||||||
|
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
|
|||||||
@@ -37,26 +37,6 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
let isAux = case vv.typ of {VVAux => True ; _ => False} in
|
let isAux = case vv.typ of {VVAux => True ; _ => False} in
|
||||||
insertObj (\\a => (if_then_Str isAux [] "to") ++ vpi.s ! VPIInf ! a) (predVV vv) ;
|
insertObj (\\a => (if_then_Str isAux [] "to") ++ vpi.s ! VPIInf ! a) (predVV vv) ;
|
||||||
|
|
||||||
UncNegCl t p cl = {
|
|
||||||
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! ODir
|
|
||||||
} ;
|
|
||||||
UncNegQCl t p cl = {
|
|
||||||
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! q
|
|
||||||
} ;
|
|
||||||
UncNegRCl t p cl = {
|
|
||||||
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! r ;
|
|
||||||
c = cl.c
|
|
||||||
} ;
|
|
||||||
|
|
||||||
UncNegImpSg p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Sg False} ;
|
|
||||||
UncNegImpPl p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Pl False} ;
|
|
||||||
|
|
||||||
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
|
||||||
|
|
||||||
oper
|
|
||||||
unc = contrNeg False ;
|
|
||||||
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
that_RP =
|
that_RP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
@@ -89,7 +69,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
MkVPS t p vp = {
|
MkVPS t p vp = {
|
||||||
s = \\a =>
|
s = \\a =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! t.t ! t.a ! contrNeg True p.p ! ODir ! a ;
|
verb = vp.s ! t.t ! t.a ! p.p ! ODir ! a ;
|
||||||
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
||||||
in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.s2 ! a
|
in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.s2 ! a
|
||||||
} ;
|
} ;
|
||||||
@@ -122,4 +102,32 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
typ = VVAux
|
typ = VVAux
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
UncNeg = {s = [] ; p = CNeg False} ;
|
||||||
|
|
||||||
|
--- obsolete: use UncNeg : Pol
|
||||||
|
|
||||||
|
UncNegCl t p cl = {
|
||||||
|
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! ODir
|
||||||
|
} ;
|
||||||
|
UncNegQCl t p cl = {
|
||||||
|
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! q
|
||||||
|
} ;
|
||||||
|
UncNegRCl t p cl = {
|
||||||
|
s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! r ;
|
||||||
|
c = cl.c
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UncNegImpSg p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Sg False} ;
|
||||||
|
UncNegImpPl p imp = {s = p.s ++ imp.s ! unc p.p ! ImpF Pl False} ;
|
||||||
|
|
||||||
|
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
unc : CPolarity -> CPolarity = \x -> case x of {
|
||||||
|
CNeg _ => CNeg False ;
|
||||||
|
_ => x
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
abstract ExtraEngAbs = Extra - [ProDrop] ** {
|
abstract ExtraEngAbs = Extra - [ProDrop] ** {
|
||||||
|
|
||||||
-- uncontracted negations; contracted are the default
|
-- uncontracted negative polarity; contracted is the default for PNeg
|
||||||
fun
|
fun
|
||||||
UncNegCl : Temp -> Pol -> Cl -> S ;
|
UncNeg : Pol ;
|
||||||
UncNegQCl : Temp -> Pol -> QCl -> QS ;
|
|
||||||
UncNegRCl : Temp -> Pol -> RCl -> RS ;
|
|
||||||
|
|
||||||
UncNegImpSg : Pol -> Imp -> Utt; -- do not help yourself
|
|
||||||
UncNegImpPl : Pol -> Imp -> Utt; -- do not help yourselves
|
|
||||||
|
|
||||||
-- freely compounded nouns
|
-- freely compounded nouns
|
||||||
|
|
||||||
@@ -24,4 +19,17 @@ abstract ExtraEngAbs = Extra - [ProDrop] ** {
|
|||||||
-- emphasizing "do", e.g. "John does walk"
|
-- emphasizing "do", e.g. "John does walk"
|
||||||
|
|
||||||
do_VV : VV ;
|
do_VV : VV ;
|
||||||
|
|
||||||
|
|
||||||
|
--- these are obsolete: use UncNeg : Pol instead
|
||||||
|
|
||||||
|
fun
|
||||||
|
UncNegCl : Temp -> Pol -> Cl -> S ;
|
||||||
|
UncNegQCl : Temp -> Pol -> QCl -> QS ;
|
||||||
|
UncNegRCl : Temp -> Pol -> RCl -> RS ;
|
||||||
|
|
||||||
|
UncNegImpSg : Pol -> Imp -> Utt; -- do not help yourself
|
||||||
|
UncNegImpPl : Pol -> Imp -> Utt; -- do not help yourselves
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,17 @@ concrete GrammarEng of Grammar =
|
|||||||
RelativeEng,
|
RelativeEng,
|
||||||
ConjunctionEng,
|
ConjunctionEng,
|
||||||
PhraseEng,
|
PhraseEng,
|
||||||
TextX,
|
TextX - [Pol,PPos,PNeg],
|
||||||
StructuralEng,
|
StructuralEng,
|
||||||
IdiomEng,
|
IdiomEng,
|
||||||
TenseX
|
TenseX - [Pol,PPos,PNeg]
|
||||||
** {
|
** open ResEng, Prelude in {
|
||||||
|
|
||||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
PPos = {s = [] ; p = CPos} ;
|
||||||
|
PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't
|
||||||
|
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in {
|
|||||||
|
|
||||||
UttS s = s ;
|
UttS s = s ;
|
||||||
UttQS qs = {s = qs.s ! QDir} ;
|
UttQS qs = {s = qs.s ! QDir} ;
|
||||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ;
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ;
|
||||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ;
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ;
|
||||||
UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ;
|
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ;
|
||||||
|
|
||||||
UttIP ip = {s = ip.s ! npNom} ; --- Acc also
|
UttIP ip = {s = ip.s ! npNom} ; --- Acc also
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
|||||||
RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
|
RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
ctr = contrNeg True ; -- contracted negations
|
ctr : CPolarity -> CPolarity = \x -> x ;
|
||||||
|
--- ctr = contrNeg True ; -- contracted negations
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user