1
0
forked from GitHub/gf-core

factored English uncontracted negation to one constant, ExtraEng.UncNeg : Pol

This commit is contained in:
aarne
2011-06-02 08:05:31 +00:00
parent 5782bea01d
commit 20966efd85
6 changed files with 63 additions and 37 deletions

View File

@@ -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 ;
lincat
-- exception to CommonX, due to the distinction contracted/uncontracted negation
Pol = {s : Str ; p : CPolarity} ;
-- Tensed/Untensed
S = {s : Str} ;

View File

@@ -37,26 +37,6 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
let isAux = case vv.typ of {VVAux => True ; _ => False} in
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
that_RP =
{ s = table {
@@ -89,7 +69,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
MkVPS t p vp = {
s = \\a =>
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 ;
in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.s2 ! a
} ;
@@ -122,4 +102,32 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
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
} ;
}

View File

@@ -1,13 +1,8 @@
abstract ExtraEngAbs = Extra - [ProDrop] ** {
-- uncontracted negations; contracted are the default
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
-- uncontracted negative polarity; contracted is the default for PNeg
fun
UncNeg : Pol ;
-- freely compounded nouns
@@ -24,4 +19,17 @@ abstract ExtraEngAbs = Extra - [ProDrop] ** {
-- emphasizing "do", e.g. "John does walk"
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
}

View File

@@ -11,12 +11,17 @@ concrete GrammarEng of Grammar =
RelativeEng,
ConjunctionEng,
PhraseEng,
TextX,
TextX - [Pol,PPos,PNeg],
StructuralEng,
IdiomEng,
TenseX
** {
TenseX - [Pol,PPos,PNeg]
** open ResEng, Prelude in {
flags startcat = Phr ; unlexer = text ; lexer = text ;
lin
PPos = {s = [] ; p = CPos} ;
PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't
} ;

View File

@@ -5,9 +5,9 @@ concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in {
UttS s = s ;
UttQS qs = {s = qs.s ! QDir} ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ;
UttIP ip = {s = ip.s ! npNom} ; --- Acc also
UttIAdv iadv = iadv ;

View File

@@ -63,7 +63,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
oper
ctr = contrNeg True ; -- contracted negations
ctr : CPolarity -> CPolarity = \x -> x ;
--- ctr = contrNeg True ; -- contracted negations
}