From 2c680eb79222cfad4428babc92fd586d968517a5 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 16 Jun 2006 16:51:02 +0000 Subject: [PATCH] English uncontracted negations in ExtraEng --- lib/resource-1.0/abstract/Sentence.gf | 1 + lib/resource-1.0/english/CatEng.gf | 15 ++-- lib/resource-1.0/english/ExtraEng.gf | 15 +++- lib/resource-1.0/english/ExtraEngAbs.gf | 9 +++ lib/resource-1.0/english/PhraseEng.gf | 4 +- lib/resource-1.0/english/ResEng.gf | 103 +++++++++++++----------- lib/resource-1.0/english/SentenceEng.gf | 11 ++- 7 files changed, 98 insertions(+), 60 deletions(-) diff --git a/lib/resource-1.0/abstract/Sentence.gf b/lib/resource-1.0/abstract/Sentence.gf index d5d9e7bc5..53b845156 100644 --- a/lib/resource-1.0/abstract/Sentence.gf +++ b/lib/resource-1.0/abstract/Sentence.gf @@ -62,6 +62,7 @@ abstract Sentence = Cat ** { } +--. -- Examples for English $S$/$Cl$: {- Pres Simul Pos ODir : he sleeps diff --git a/lib/resource-1.0/english/CatEng.gf b/lib/resource-1.0/english/CatEng.gf index 204e8f7c0..fc90f9eaf 100644 --- a/lib/resource-1.0/english/CatEng.gf +++ b/lib/resource-1.0/english/CatEng.gf @@ -12,26 +12,29 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in { -- Sentence - Cl = {s : Tense => Anteriority => Polarity => Order => Str} ; - Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ; - Imp = {s : Polarity => Number => Str} ; + Cl = {s : Tense => Anteriority => CPolarity => Order => Str} ; + Slash = { + s : Tense => Anteriority => CPolarity => Order => Str ; + c2 : Str + } ; + Imp = {s : CPolarity => Number => Str} ; -- Question - QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; + QCl = {s : Tense => Anteriority => CPolarity => QForm => Str} ; IP = {s : Case => Str ; n : Number} ; IComp = {s : Str} ; IDet = {s : Str ; n : Number} ; -- 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} ; -- Verb VP = { - s : Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ; + s : Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ; prp : Str ; -- present participle inf : Str ; -- infinitive ad : Str ; diff --git a/lib/resource-1.0/english/ExtraEng.gf b/lib/resource-1.0/english/ExtraEng.gf index e0bbb8da7..bcb1a6b2b 100644 --- a/lib/resource-1.0/english/ExtraEng.gf +++ b/lib/resource-1.0/english/ExtraEng.gf @@ -1,7 +1,20 @@ -concrete ExtraEng of ExtraEngAbs = CatEng ** open ResEng in { +concrete ExtraEng of ExtraEngAbs = CatEng ** open ResEng, Prelude in { lin GenNP np = {s = \\_ => np.s ! Gen} ; 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 ; + } diff --git a/lib/resource-1.0/english/ExtraEngAbs.gf b/lib/resource-1.0/english/ExtraEngAbs.gf index f4a9c9289..7b7db1d4e 100644 --- a/lib/resource-1.0/english/ExtraEngAbs.gf +++ b/lib/resource-1.0/english/ExtraEngAbs.gf @@ -1,3 +1,12 @@ 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 + } diff --git a/lib/resource-1.0/english/PhraseEng.gf b/lib/resource-1.0/english/PhraseEng.gf index 0c46df574..936bfdff9 100644 --- a/lib/resource-1.0/english/PhraseEng.gf +++ b/lib/resource-1.0/english/PhraseEng.gf @@ -5,8 +5,8 @@ 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 ! pol.p ! Sg} ; - UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! Sg} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! Pl} ; UttIP ip = {s = ip.s ! Nom} ; --- Acc also UttIAdv iadv = iadv ; diff --git a/lib/resource-1.0/english/ResEng.gf b/lib/resource-1.0/english/ResEng.gf index 4e70cc8e4..c7dc27391 100644 --- a/lib/resource-1.0/english/ResEng.gf +++ b/lib/resource-1.0/english/ResEng.gf @@ -169,8 +169,19 @@ resource ResEng = ParamX ** open Prelude in { 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 = - Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ; + Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ; VP : Type = { s : VerbForms ; @@ -181,35 +192,32 @@ resource ResEng = ParamX ** open Prelude in { } ; - predV : Verb -> VP = predGenV False ; - - predGenV : Bool -> Verb -> VP = \contr, verb -> { + predV : Verb -> VP = \verb -> { s = \\t,ant,b,ord,agr => let inf = verb.s ! VInf ; fin = presVerb verb agr ; part = verb.s ! VPPart ; - vn = vfn contr ; in case of { - => vf fin [] ; - => vf (does agr) inf ; - => vf (have agr) part ; --# notpresent - => vn (have agr) (havent agr) part ; --# notpresent - => vf (verb.s ! VPast) [] ; --# notpresent - => vf "did" inf ; --# notpresent - => vn "did" "didn't" inf ; --# notpresent - => vf "had" part ; --# notpresent - => vn "had" "hadn't" part ; --# notpresent - => vf "will" inf ; --# notpresent - => vn "will" "won't" inf ; --# notpresent - => vf "will" ("have" ++ part) ; --# notpresent - => vn "will" "won't"("have" ++ part) ; --# notpresent - => vf "would" inf ; --# notpresent - => vn "would" "wouldn't" inf ; --# notpresent - => vf "would" ("have" ++ part) ; --# notpresent - => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent - => vn (does agr) (doesnt agr) inf + => vf fin [] ; + => vf (does agr) inf ; + => vf (have agr) part ; --# notpresent + => vfn c (have agr) (havent agr) part ; --# notpresent + => vf (verb.s ! VPast) [] ; --# notpresent + => vf "did" inf ; --# notpresent + => vfn c "did" "didn't" inf ; --# notpresent + => vf "had" part ; --# notpresent + => vfn c "had" "hadn't" part ; --# notpresent + => vf "will" inf ; --# notpresent + => vfn c "will" "won't" inf ; --# notpresent + => vf "will" ("have" ++ part) ; --# notpresent + => vfn c "will" "won't"("have" ++ part) ; --# notpresent + => vf "would" inf ; --# notpresent + => vfn c "would" "wouldn't" inf ; --# notpresent + => vf "would" ("have" ++ part) ; --# notpresent + => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent + => vfn c (does agr) (doesnt agr) inf } ; prp = verb.s ! VPresPart ; inf = verb.s ! VInf ; @@ -217,34 +225,35 @@ resource ResEng = ParamX ** open Prelude in { s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] } ; - predAux : Aux -> VP = predGenAux False ; - - predGenAux : Bool -> Aux -> VP = \contr, verb -> { - s = \\t,ant,b,ord,agr => + predAux : Aux -> VP = \verb -> { + s = \\t,ant,cb,ord,agr => let + b = case cb of { + CPos => Pos ; + _ => Neg + } ; inf = verb.inf ; fin = verb.pres ! b ! agr ; finp = verb.pres ! Pos ! agr ; part = verb.ppart ; - vn = vfn contr ; in - case of { - => vf (have agr) part ; --# notpresent - => vn (have agr) (havent agr) part ; --# notpresent - => vf (verb.past ! b ! agr) [] ; --# notpresent - => vn (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent - => vf "had" part ; --# notpresent - => vn "had" "hadn't" part ; --# notpresent - => vf "will" inf ; --# notpresent - => vn "will" "won't" inf ; --# notpresent - => vf "will" ("have" ++ part) ; --# notpresent - => vn "will" "won't"("have" ++ part) ; --# notpresent - => vf "would" inf ; --# notpresent - => vn "would" "wouldn't" inf ; --# notpresent - => vf "would" ("have" ++ part) ; --# notpresent - => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent - => vf fin [] ; - => vn finp fin [] + case of { + => vf (have agr) part ; --# notpresent + => vfn c (have agr) (havent agr) part ; --# notpresent + => vf (verb.past ! b ! agr) [] ; --# notpresent + => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent + => vf "had" part ; --# notpresent + => vfn c "had" "hadn't" part ; --# notpresent + => vf "will" inf ; --# notpresent + => vfn c "will" "won't" inf ; --# notpresent + => vf "will" ("have" ++ part) ; --# notpresent + => vfn c "will" "won't"("have" ++ part) ; --# notpresent + => vf "would" inf ; --# notpresent + => vfn c "would" "wouldn't" inf ; --# notpresent + => vf "would" ("have" ++ part) ; --# notpresent + => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent + => vf fin [] ; + => vfn c finp fin [] } ; prp = verb.prpart ; inf = verb.inf ; @@ -358,7 +367,7 @@ resource ResEng = ParamX ** open Prelude in { -- For $Sentence$. Clause : Type = { - s : Tense => Anteriority => Polarity => Order => Str + s : Tense => Anteriority => CPolarity => Order => Str } ; mkClause : Str -> Agr -> VP -> Clause = @@ -403,7 +412,7 @@ resource ResEng = ParamX ** open Prelude in { mkQuestion : {s : Str} -> Clause -> - {s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl -> + {s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl -> { s = \\t,a,p => let diff --git a/lib/resource-1.0/english/SentenceEng.gf b/lib/resource-1.0/english/SentenceEng.gf index 130100285..791732873 100644 --- a/lib/resource-1.0/english/SentenceEng.gf +++ b/lib/resource-1.0/english/SentenceEng.gf @@ -14,7 +14,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in { agr = {n = n ; p = P2} ; verb = infVP True vp agr ; dont = case pol of { - Neg => "don't" ; + CNeg True => "don't" ; + CNeg False => "do" ++ "not" ; _ => [] } in @@ -40,11 +41,13 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in { EmbedQS qs = {s = qs.s ! QIndir} ; 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} ; - UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ; + 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 ! ctr p.p ! q} ; 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 } ; + oper + ctr = contrNeg True ; -- contracted negations }