forked from GitHub/gf-core
English uncontracted negations in ExtraEng
This commit is contained in:
@@ -62,6 +62,7 @@ abstract Sentence = Cat ** {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--.
|
||||||
-- Examples for English $S$/$Cl$:
|
-- Examples for English $S$/$Cl$:
|
||||||
{-
|
{-
|
||||||
Pres Simul Pos ODir : he sleeps
|
Pres Simul Pos ODir : he sleeps
|
||||||
|
|||||||
@@ -12,26 +12,29 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = {s : Tense => Anteriority => Polarity => Order => Str} ;
|
Cl = {s : Tense => Anteriority => CPolarity => Order => Str} ;
|
||||||
Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ;
|
Slash = {
|
||||||
Imp = {s : Polarity => Number => Str} ;
|
s : Tense => Anteriority => CPolarity => Order => Str ;
|
||||||
|
c2 : Str
|
||||||
|
} ;
|
||||||
|
Imp = {s : CPolarity => Number => Str} ;
|
||||||
|
|
||||||
-- Question
|
-- Question
|
||||||
|
|
||||||
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
|
QCl = {s : Tense => Anteriority => CPolarity => QForm => Str} ;
|
||||||
IP = {s : Case => Str ; n : Number} ;
|
IP = {s : Case => Str ; n : Number} ;
|
||||||
IComp = {s : Str} ;
|
IComp = {s : Str} ;
|
||||||
IDet = {s : Str ; n : Number} ;
|
IDet = {s : Str ; n : Number} ;
|
||||||
|
|
||||||
-- Relative
|
-- Relative
|
||||||
|
|
||||||
RCl = {s : Tense => Anteriority => Polarity => Agr => Str ; c : Case} ;
|
RCl = {s : Tense => Anteriority => CPolarity => Agr => Str ; c : Case} ;
|
||||||
RP = {s : RCase => Str ; a : RAgr} ;
|
RP = {s : RCase => Str ; a : RAgr} ;
|
||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = {
|
VP = {
|
||||||
s : Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ;
|
s : Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ;
|
||||||
prp : Str ; -- present participle
|
prp : Str ; -- present participle
|
||||||
inf : Str ; -- infinitive
|
inf : Str ; -- infinitive
|
||||||
ad : Str ;
|
ad : Str ;
|
||||||
|
|||||||
@@ -1,7 +1,20 @@
|
|||||||
concrete ExtraEng of ExtraEngAbs = CatEng ** open ResEng in {
|
concrete ExtraEng of ExtraEngAbs = CatEng ** open ResEng, Prelude in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
GenNP np = {s = \\_ => np.s ! Gen} ;
|
GenNP np = {s = \\_ => np.s ! Gen} ;
|
||||||
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
||||||
|
|
||||||
|
UncNegCl t a cl = {s = t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg ! ODir} ;
|
||||||
|
UncNegQCl t a cl = {s = \\q => t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg !q} ;
|
||||||
|
UncNegRCl t a cl = {
|
||||||
|
s = \\r => t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg ! r ;
|
||||||
|
c = cl.c
|
||||||
|
} ;
|
||||||
|
UncNegImpSg imp = {s = imp.s ! neg ! Sg} ;
|
||||||
|
UncNegImpPl imp = {s = imp.s ! neg ! Pl} ;
|
||||||
|
|
||||||
|
|
||||||
|
oper
|
||||||
|
neg = CNeg False ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
abstract ExtraEngAbs = Extra ** {
|
abstract ExtraEngAbs = Extra ** {
|
||||||
|
|
||||||
|
-- uncontracted negations; contracted are the default
|
||||||
|
fun
|
||||||
|
UncNegCl : Tense -> Ant -> Cl -> S ;
|
||||||
|
UncNegQCl : Tense -> Ant -> QCl -> QS ;
|
||||||
|
UncNegRCl : Tense -> Ant -> RCl -> RS ;
|
||||||
|
|
||||||
|
UncNegImpSg : Imp -> Utt; -- do not help yourself
|
||||||
|
UncNegImpPl : Imp -> Utt; -- do not help yourselves
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ 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 ! pol.p ! Sg} ;
|
UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! Sg} ;
|
||||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! Pl} ;
|
||||||
|
|
||||||
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
|
|||||||
@@ -169,8 +169,19 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
isRefl : Bool
|
isRefl : Bool
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
CPolarity =
|
||||||
|
CPos
|
||||||
|
| CNeg Bool ; -- contracted or not
|
||||||
|
|
||||||
|
oper
|
||||||
|
contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of {
|
||||||
|
Pos => CPos ;
|
||||||
|
Neg => CNeg b
|
||||||
|
} ;
|
||||||
|
|
||||||
VerbForms : Type =
|
VerbForms : Type =
|
||||||
Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ;
|
Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ;
|
||||||
|
|
||||||
VP : Type = {
|
VP : Type = {
|
||||||
s : VerbForms ;
|
s : VerbForms ;
|
||||||
@@ -181,35 +192,32 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
predV : Verb -> VP = predGenV False ;
|
predV : Verb -> VP = \verb -> {
|
||||||
|
|
||||||
predGenV : Bool -> Verb -> VP = \contr, verb -> {
|
|
||||||
s = \\t,ant,b,ord,agr =>
|
s = \\t,ant,b,ord,agr =>
|
||||||
let
|
let
|
||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
fin = presVerb verb agr ;
|
fin = presVerb verb agr ;
|
||||||
part = verb.s ! VPPart ;
|
part = verb.s ! VPPart ;
|
||||||
vn = vfn contr ;
|
|
||||||
in
|
in
|
||||||
case <t,ant,b,ord> of {
|
case <t,ant,b,ord> of {
|
||||||
<Pres,Simul,Pos,ODir> => vf fin [] ;
|
<Pres,Simul,CPos,ODir> => vf fin [] ;
|
||||||
<Pres,Simul,Pos,OQuest> => vf (does agr) inf ;
|
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
|
||||||
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
|
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||||
<Pres,Anter,Neg,_> => vn (have agr) (havent agr) part ; --# notpresent
|
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||||
<Past,Simul,Pos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent
|
<Past,Simul,CPos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent
|
||||||
<Past,Simul,Pos,OQuest> => vf "did" inf ; --# notpresent
|
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
|
||||||
<Past,Simul,Neg,_> => vn "did" "didn't" inf ; --# notpresent
|
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
|
||||||
<Past,Anter,Pos,_> => vf "had" part ; --# notpresent
|
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||||
<Past,Anter,Neg,_> => vn "had" "hadn't" part ; --# notpresent
|
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
|
||||||
<Fut, Simul,Pos,_> => vf "will" inf ; --# notpresent
|
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
|
||||||
<Fut, Simul,Neg,_> => vn "will" "won't" inf ; --# notpresent
|
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
|
||||||
<Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
||||||
<Fut, Anter,Neg,_> => vn "will" "won't"("have" ++ part) ; --# notpresent
|
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
|
||||||
<Cond,Simul,Pos,_> => vf "would" inf ; --# notpresent
|
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
|
||||||
<Cond,Simul,Neg,_> => vn "would" "wouldn't" inf ; --# notpresent
|
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
|
||||||
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||||
<Cond,Anter,Neg,_> => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||||
<Pres,Simul,Neg,_> => vn (does agr) (doesnt agr) inf
|
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
|
||||||
} ;
|
} ;
|
||||||
prp = verb.s ! VPresPart ;
|
prp = verb.s ! VPresPart ;
|
||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
@@ -217,34 +225,35 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predAux : Aux -> VP = predGenAux False ;
|
predAux : Aux -> VP = \verb -> {
|
||||||
|
s = \\t,ant,cb,ord,agr =>
|
||||||
predGenAux : Bool -> Aux -> VP = \contr, verb -> {
|
|
||||||
s = \\t,ant,b,ord,agr =>
|
|
||||||
let
|
let
|
||||||
|
b = case cb of {
|
||||||
|
CPos => Pos ;
|
||||||
|
_ => Neg
|
||||||
|
} ;
|
||||||
inf = verb.inf ;
|
inf = verb.inf ;
|
||||||
fin = verb.pres ! b ! agr ;
|
fin = verb.pres ! b ! agr ;
|
||||||
finp = verb.pres ! Pos ! agr ;
|
finp = verb.pres ! Pos ! agr ;
|
||||||
part = verb.ppart ;
|
part = verb.ppart ;
|
||||||
vn = vfn contr ;
|
|
||||||
in
|
in
|
||||||
case <t,ant,b,ord> of {
|
case <t,ant,cb,ord> of {
|
||||||
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
|
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||||
<Pres,Anter,Neg,_> => vn (have agr) (havent agr) part ; --# notpresent
|
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||||
<Past,Simul,Pos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
|
<Past,Simul,CPos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
|
||||||
<Past,Simul,_, _> => vn (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
|
<Past,Simul,CNeg c, _> => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
|
||||||
<Past,Anter,Pos,_> => vf "had" part ; --# notpresent
|
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||||
<Past,Anter,Neg,_> => vn "had" "hadn't" part ; --# notpresent
|
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
|
||||||
<Fut, Simul,Pos,_> => vf "will" inf ; --# notpresent
|
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
|
||||||
<Fut, Simul,Neg,_> => vn "will" "won't" inf ; --# notpresent
|
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
|
||||||
<Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
||||||
<Fut, Anter,Neg,_> => vn "will" "won't"("have" ++ part) ; --# notpresent
|
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
|
||||||
<Cond,Simul,Pos,_> => vf "would" inf ; --# notpresent
|
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
|
||||||
<Cond,Simul,Neg,_> => vn "would" "wouldn't" inf ; --# notpresent
|
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
|
||||||
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||||
<Cond,Anter,Neg,_> => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||||
<Pres,Simul,Pos, _> => vf fin [] ;
|
<Pres,Simul,CPos, _> => vf fin [] ;
|
||||||
<Pres,Simul,_, _> => vn finp fin []
|
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
||||||
} ;
|
} ;
|
||||||
prp = verb.prpart ;
|
prp = verb.prpart ;
|
||||||
inf = verb.inf ;
|
inf = verb.inf ;
|
||||||
@@ -358,7 +367,7 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
-- For $Sentence$.
|
-- For $Sentence$.
|
||||||
|
|
||||||
Clause : Type = {
|
Clause : Type = {
|
||||||
s : Tense => Anteriority => Polarity => Order => Str
|
s : Tense => Anteriority => CPolarity => Order => Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkClause : Str -> Agr -> VP -> Clause =
|
mkClause : Str -> Agr -> VP -> Clause =
|
||||||
@@ -403,7 +412,7 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
mkQuestion :
|
mkQuestion :
|
||||||
{s : Str} -> Clause ->
|
{s : Str} -> Clause ->
|
||||||
{s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl ->
|
{s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl ->
|
||||||
{
|
{
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
let
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
|||||||
agr = {n = n ; p = P2} ;
|
agr = {n = n ; p = P2} ;
|
||||||
verb = infVP True vp agr ;
|
verb = infVP True vp agr ;
|
||||||
dont = case pol of {
|
dont = case pol of {
|
||||||
Neg => "don't" ;
|
CNeg True => "don't" ;
|
||||||
|
CNeg False => "do" ++ "not" ;
|
||||||
_ => []
|
_ => []
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
@@ -40,11 +41,13 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
|||||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||||
EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr
|
EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr
|
||||||
|
|
||||||
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! ODir} ;
|
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir} ;
|
||||||
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ;
|
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! q} ;
|
||||||
UseRCl t a p cl = {
|
UseRCl t a p cl = {
|
||||||
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ;
|
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! r ;
|
||||||
c = cl.c
|
c = cl.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
ctr = contrNeg True ; -- contracted negations
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user