removed accusative case for nouns in Eng (it is for NP, Pron, IP, RP only)

This commit is contained in:
aarne
2011-02-28 20:59:29 +00:00
parent aad6e864b9
commit f790bd949f
16 changed files with 104 additions and 91 deletions

View File

@@ -7,7 +7,7 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
isPre = True isPre = True
} ; } ;
ComparA a np = { ComparA a np = {
s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! Nom ; s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! npNom ;
isPre = False isPre = False
} ; } ;
UseComparA a = { UseComparA a = {
@@ -21,12 +21,12 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
} ; } ;
CAdvAP ad ap np = { CAdvAP ad ap np = {
s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! Nom ; s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! npNom ;
isPre = False isPre = False
} ; } ;
ComplA2 a np = { ComplA2 a np = {
s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! Acc ; s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ;
isPre = False isPre = False
} ; } ;

View File

@@ -3,13 +3,13 @@ concrete AdverbEng of Adverb = CatEng ** open ResEng, Prelude in {
lin lin
PositAdvAdj a = {s = a.s ! AAdv} ; PositAdvAdj a = {s = a.s ! AAdv} ;
ComparAdvAdj cadv a np = { ComparAdvAdj cadv a np = {
s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ np.s ! Nom s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ np.s ! npNom
} ; } ;
ComparAdvAdjS cadv a s = { ComparAdvAdjS cadv a s = {
s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ s.s s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ s.s
} ; } ;
PrepNP prep np = {s = prep.s ++ np.s ! Acc} ; PrepNP prep np = {s = prep.s ++ np.s ! NPAcc} ;
AdAdv = cc2 ; AdAdv = cc2 ;
PositAdAAdj a = {s = a.s ! AAdv} ; PositAdAAdj a = {s = a.s ! AAdv} ;

View File

@@ -8,7 +8,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
S = {s : Str} ; S = {s : Str} ;
QS = {s : QForm => Str} ; QS = {s : QForm => Str} ;
RS = {s : Agr => Str ; c : Case} ; -- c for it clefts RS = {s : Agr => Str ; c : NPCase} ; -- c for it clefts
SSlash = {s : Str ; c2 : Str} ; SSlash = {s : Str ; c2 : Str} ;
-- Sentence -- Sentence
@@ -23,7 +23,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
-- Question -- Question
QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ; QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ;
IP = {s : Case => Str ; n : Number} ; IP = {s : NPCase => Str ; n : Number} ;
IComp = {s : Str} ; IComp = {s : Str} ;
IDet = {s : Str ; n : Number} ; IDet = {s : Str ; n : Number} ;
IQuant = {s : Number => Str} ; IQuant = {s : Number => Str} ;
@@ -32,7 +32,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
RCl = { RCl = {
s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ;
c : Case c : NPCase
} ; } ;
RP = {s : RCase => Str ; a : RAgr} ; RP = {s : RCase => Str ; a : RAgr} ;
@@ -49,14 +49,14 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
-- Noun -- Noun
CN = {s : Number => Case => Str ; g : Gender} ; CN = {s : Number => Case => Str ; g : Gender} ;
NP = {s : Case => Str ; a : Agr} ; NP = {s : NPCase => Str ; a : Agr} ;
Pron = {s : Case => Str ; sp : Case => Str ; a : Agr} ; Pron = {s : NPCase => Str ; sp : Case => Str ; a : Agr} ;
Det = {s : Str ; sp : Case => Str ; n : Number ; hasNum : Bool} ; Det = {s : Str ; sp : NPCase => Str ; n : Number ; hasNum : Bool} ;
Predet = {s : Str} ; Predet = {s : Str} ;
Ord = { s : Case => Str } ; Ord = { s : Case => Str } ;
Num = {s : Case => Str ; n : Number ; hasCard : Bool} ; Num = {s : Case => Str ; n : Number ; hasCard : Bool} ;
Card = {s : Case => Str ; n : Number} ; Card = {s : Case => Str ; n : Number} ;
Quant = {s : Bool => Number => Str ; sp : Bool => Number => Case => Str} ; Quant = {s : Bool => Number => Str ; sp : Bool => Number => NPCase => Str} ;
-- Numeral -- Numeral

View File

@@ -9,7 +9,7 @@ concrete ConjunctionEng of Conjunction =
ConjAdv = conjunctDistrSS ; ConjAdv = conjunctDistrSS ;
ConjNP conj ss = conjunctDistrTable Case conj ss ** { ConjNP conj ss = conjunctDistrTable NPCase conj ss ** {
a = conjAgr (agrP3 conj.n) ss.a a = conjAgr (agrP3 conj.n) ss.a
} ; } ;
@@ -31,8 +31,8 @@ concrete ConjunctionEng of Conjunction =
ConsS = consrSS comma ; ConsS = consrSS comma ;
BaseAdv = twoSS ; BaseAdv = twoSS ;
ConsAdv = consrSS comma ; ConsAdv = consrSS comma ;
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ; BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ;
ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ; ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ;
BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ; BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ; ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
BaseRS x y = twoTable Agr x y ** {c = y.c} ; BaseRS x y = twoTable Agr x y ** {c = y.c} ;
@@ -46,9 +46,9 @@ concrete ConjunctionEng of Conjunction =
[S] = {s1,s2 : Str} ; [S] = {s1,s2 : Str} ;
[Adv] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Str} ;
[IAdv] = {s1,s2 : Str} ; [IAdv] = {s1,s2 : Str} ;
[NP] = {s1,s2 : Case => Str ; a : Agr} ; [NP] = {s1,s2 : NPCase => Str ; a : Agr} ;
[AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
[RS] = {s1,s2 : Agr => Str ; c : Case} ; [RS] = {s1,s2 : Agr => Str ; c : NPCase} ;
[CN] = {s1,s2 : Number => Case => Str} ; [CN] = {s1,s2 : Number => Case => Str} ;
} }

View File

@@ -2,22 +2,22 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
open ResEng, Coordination, Prelude, MorphoEng in { open ResEng, Coordination, Prelude, MorphoEng in {
lin lin
GenNP np = {s = \\_,_ => np.s ! Gen ; sp = \\_,_,_ => np.s ! Gen} ; GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_ => np.s ! npGen} ;
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ; ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
StrandRelSlash rp slash = { StrandRelSlash rp slash = {
s = \\t,a,p,ag => s = \\t,a,p,ag =>
rp.s ! RC (fromAgr ag).g Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ; rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
c = Acc c = NPAcc
} ; } ;
EmptyRelSlash slash = { EmptyRelSlash slash = {
s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ; s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
c = Acc c = NPAcc
} ; } ;
StrandQuestSlash ip slash = StrandQuestSlash ip slash =
{s = \\t,a,b,q => {s = \\t,a,b,q =>
(mkQuestion (ss (ip.s ! Acc)) slash).s ! t ! a ! b ! q ++ slash.c2 (mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
}; };
lincat lincat
@@ -60,7 +60,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
lin lin
that_RP = that_RP =
{ s = table { { s = table {
RC _ Gen => "whose" ; RC _ (NCase Gen) => "whose" ;
RC _ _ => "that" ; RC _ _ => "that" ;
_ => "that" ---- "in that" ? _ => "that" ---- "in that" ?
-- RPrep Neutr => "which" ; -- RPrep Neutr => "which" ;
@@ -84,7 +84,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
BaseVPS = twoTable Agr ; BaseVPS = twoTable Agr ;
ConsVPS = consrTable Agr comma ; ConsVPS = consrTable Agr comma ;
PredVPS np vpi = {s = np.s ! Nom ++ vpi.s ! np.a} ; PredVPS np vpi = {s = np.s ! npNom ++ vpi.s ! np.a} ;
MkVPS t p vp = { MkVPS t p vp = {
s = \\a => s = \\a =>

View File

@@ -16,17 +16,17 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
ExistNP np = ExistNP np =
mkClause "there" (agrP3 (fromAgr np.a).n) mkClause "there" (agrP3 (fromAgr np.a).n)
(insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ; (insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
ExistIP ip = ExistIP ip =
mkQuestion (ss (ip.s ! Nom)) mkQuestion (ss (ip.s ! npNom))
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
ImpPl1 vp = {s = "let's" ++ infVP VVAux vp (AgP1 Pl)} ; ImpPl1 vp = {s = "let's" ++ infVP VVAux vp (AgP1 Pl)} ;
ImpP3 np vp = {s = "let" ++ np.s ! Acc ++ infVP VVAux vp np.a} ; ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp np.a} ;
} }

View File

@@ -17,9 +17,9 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
oper oper
mkDeterminer : Number -> Str -> mkDeterminer : Number -> Str ->
{s : Str ; sp : Case => Str; n : Number ; hasNum : Bool} = \n,s -> {s : Str ; sp : NPCase => Str; n : Number ; hasNum : Bool} = \n,s ->
{s = s; {s = s;
sp = regGenitiveS s ; sp = \\c => regGenitiveS s ! npcase2case c ;
n = n ; n = n ;
hasNum = True ; -- doesn't matter since s = sp hasNum = True ; -- doesn't matter since s = sp
} ; } ;
@@ -28,12 +28,12 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender -> mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
{s : Case => Str ; sp : Case => Str ; a : Agr} = {s : NPCase => Str ; sp : Case => Str ; a : Agr} =
\i,me,my,mine,n,p,g -> { \i,me,my,mine,n,p,g -> {
s = table { s = table {
Nom => i ; NCase Nom => i ;
Acc => me ; NPAcc => me ;
Gen => my NCase Gen => my
} ; } ;
a = toAgr n p g ; a = toAgr n p g ;
sp = regGenitiveS mine sp = regGenitiveS mine

View File

@@ -4,11 +4,11 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
lin lin
DetCN det cn = { DetCN det cn = {
s = \\c => det.s ++ cn.s ! det.n ! c ; s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ;
a = agrgP3 det.n cn.g a = agrgP3 det.n cn.g
} ; } ;
UsePN pn = pn ** {a = agrgP3 Sg pn.g} ; UsePN pn = {s = \\c => pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ;
UsePron p = p ; UsePron p = p ;
PredetNP pred np = { PredetNP pred np = {
@@ -35,7 +35,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom; s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom;
sp = \\c => case num.hasCard of { sp = \\c => case num.hasCard of {
False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ; False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ;
True => quant.sp ! num.hasCard ! num.n ! Nom ++ num.s ! c True => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! npcase2case c
} ; } ;
n = num.n ; n = num.n ;
hasNum = num.hasCard hasNum = num.hasCard
@@ -43,19 +43,19 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
DetQuantOrd quant num ord = { DetQuantOrd quant num ord = {
s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom; s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom;
sp = \\c => quant.sp ! num.hasCard ! num.n ! Nom ++ num.s ! Nom ++ ord.s ! c ; sp = \\c => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! Nom ++ ord.s ! npcase2case c ;
n = num.n ; n = num.n ;
hasNum = True hasNum = True
} ; } ;
DetNP det = { DetNP det = {
s = case det.hasNum of {True => \\_ => det.s ; _ => det.sp} ; s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ;
a = agrP3 det.n a = agrP3 det.n
} ; } ;
PossPron p = { PossPron p = {
s = \\_,_ => p.s ! Gen ; s = \\_,_ => p.s ! NCase Gen ;
sp = \\_,_ => p.sp sp = \\_,_,c => p.sp ! npcase2case c
} ; } ;
NumSg = {s = \\c => []; n = Sg ; hasCard = False} ; NumSg = {s = \\c => []; n = Sg ; hasCard = False} ;
@@ -77,8 +77,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
DefArt = { DefArt = {
s = \\hasCard,n => artDef ; s = \\hasCard,n => artDef ;
sp = \\hasCard,n => case <n,hasCard> of { sp = \\hasCard,n => case <n,hasCard> of {
<Sg,False> => table { Gen => "its"; _ => "it" } ; <Sg,False> => table { NCase Gen => "its"; _ => "it" } ;
<Pl,False> => table { Nom => "they"; Acc => "them"; Gen => "theirs" } ; <Pl,False> => table { NCase Nom => "they"; NPAcc => "them"; NCase Gen => "theirs" } ;
_ => \\c => artDef _ => \\c => artDef
} }
} ; } ;
@@ -89,14 +89,14 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
_ => [] _ => []
} ; } ;
sp = \\hasCard,n => case <n,hasCard> of { sp = \\hasCard,n => case <n,hasCard> of {
<Sg,False> => table { Gen => "one's"; _ => "one" }; <Sg,False> => table {NCase Gen => "one's"; _ => "one" };
<Pl,False> => table { Gen => "ones'"; _ => "ones" } ; <Pl,False> => table {NCase Gen => "ones'"; _ => "ones" } ;
_ => \\c => [] _ => \\c => []
} }
} ; } ;
MassNP cn = { MassNP cn = {
s = cn.s ! Sg ; s = \\c => cn.s ! Sg ! npcase2case c ;
a = agrP3 Sg a = agrP3 Sg
} ; } ;
@@ -116,9 +116,9 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
c2 = f.c3 c2 = f.c3
} ; } ;
ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; g = f.g} ; ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! NPAcc ; g = f.g} ;
ComplN3 f x = { ComplN3 f x = {
s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! NPAcc ;
g = f.g ; g = f.g ;
c2 = f.c3 c2 = f.c3
} ; } ;
@@ -135,6 +135,6 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ; SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ;
ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! c ; g = cn.g} ; ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! NCase c ; g = cn.g} ;
} }

View File

@@ -337,15 +337,15 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
Gender = ResEng.Gender ; Gender = ResEng.Gender ;
Number = ResEng.Number ; Number = ResEng.Number ;
Case = ResEng.Case ; Case = ResEng.NPCase ;
human = Masc ; human = Masc ;
nonhuman = Neutr ; nonhuman = Neutr ;
masculine = Masc ; masculine = Masc ;
feminine = Fem ; feminine = Fem ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
nominative = Nom ; nominative = npNom ;
genitive = Gen ; genitive = npGen ;
npNumber np = (fromAgr np.a).n ; npNumber np = (fromAgr np.a).n ;
@@ -429,7 +429,8 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
mkQuantifier : Str -> Str -> Str -> Str -> Quant = mkQuantifier : Str -> Str -> Str -> Str -> Quant =
\sg,pl,sg',pl' -> lin Quant { \sg,pl,sg',pl' -> lin Quant {
s = \\_ => table { Sg => sg ; Pl => pl } ; s = \\_ => table { Sg => sg ; Pl => pl } ;
sp = \\_ => table { Sg => regGenitiveS sg' ; Pl => regGenitiveS pl'} sp = \\_ => table {
Sg => \\c => regGenitiveS sg' ! npcase2case c ; Pl => \\c => regGenitiveS pl' ! npcase2case c}
} ; } ;
mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x}; mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x};

View File

@@ -9,9 +9,9 @@ concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in {
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl 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} ; UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ;
UttIP ip = {s = ip.s ! Nom} ; --- Acc also UttIP ip = {s = ip.s ! npNom} ; --- Acc also
UttIAdv iadv = iadv ; UttIAdv iadv = iadv ;
UttNP np = {s = np.s ! Nom} ; UttNP np = {s = np.s ! npNom} ;
UttVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; UttVP vp = {s = infVP VVInf vp (agrP3 Sg)} ;
UttAdv adv = adv ; UttAdv adv = adv ;
UttCN n = {s = n.s ! Sg ! Nom} ; UttCN n = {s = n.s ! Sg ! Nom} ;
@@ -23,6 +23,6 @@ concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in {
PConjConj conj = {s = conj.s2} ; --- PConjConj conj = {s = conj.s2} ; ---
NoVoc = {s = []} ; NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! Nom} ; VocNP np = {s = "," ++ np.s ! npNom} ;
} }

View File

@@ -14,20 +14,20 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
} ; } ;
QuestVP qp vp = QuestVP qp vp =
let cl = mkClause (qp.s ! Nom) (agrP3 qp.n) vp let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
QuestSlash ip slash = QuestSlash ip slash =
mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ; mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ;
--- stranding in ExratEng --- stranding in ExratEng
QuestIAdv iadv cl = mkQuestion iadv cl ; QuestIAdv iadv cl = mkQuestion iadv cl ;
QuestIComp icomp np = QuestIComp icomp np =
mkQuestion icomp (mkClause (np.s ! Nom) np.a (predAux auxBe)) ; mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ;
PrepIP p ip = {s = p.s ++ ip.s ! Acc} ; PrepIP p ip = {s = p.s ++ ip.s ! NPAcc} ;
AdvIP ip adv = { AdvIP ip adv = {
s = \\c => ip.s ! c ++ adv.s ; s = \\c => ip.s ! c ++ adv.s ;
@@ -35,7 +35,7 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
} ; } ;
IdetCN idet cn = { IdetCN idet cn = {
s = \\c => idet.s ++ cn.s ! idet.n ! c ; s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ;
n = idet.n n = idet.n
} ; } ;
@@ -52,17 +52,17 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
AdvIAdv i a = ss (i.s ++ a.s) ; AdvIAdv i a = ss (i.s ++ a.s) ;
CompIAdv a = a ; CompIAdv a = a ;
CompIP p = ss (p.s ! Nom) ; CompIP p = ss (p.s ! npNom) ;
lincat lincat
QVP = ResEng.VP ; QVP = ResEng.VP ;
lin lin
ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! Acc) vp ; ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ;
AdvQVP vp adv = insertObj (\\_ => adv.s) vp ; AdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ; AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
QuestQVP qp vp = QuestQVP qp vp =
let cl = mkClause (qp.s ! Nom) (agrP3 qp.n) vp let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;

View File

@@ -6,7 +6,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
RelCl cl = { RelCl cl = {
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ; s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
c = Nom c = npNom
} ; } ;
RelVP rp vp = { RelVP rp vp = {
@@ -16,10 +16,10 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
RNoAg => ag ; RNoAg => ag ;
RAg a => a RAg a => a
} ; } ;
cl = mkClause (rp.s ! RC (fromAgr agr).g Nom) agr vp cl = mkClause (rp.s ! RC (fromAgr agr).g npNom) agr vp
in in
cl.s ! t ! ant ! b ! ODir ; cl.s ! t ! ant ! b ! ODir ;
c = Nom c = npNom
} ; } ;
-- Pied piping: "at which we are looking". Stranding and empty -- Pied piping: "at which we are looking". Stranding and empty
@@ -29,20 +29,20 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
RelSlash rp slash = { RelSlash rp slash = {
s = \\t,a,p,agr => s = \\t,a,p,agr =>
slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ; slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
c = Acc c = NPAcc
} ; } ;
FunRP p np rp = { FunRP p np rp = {
s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
a = RAg np.a a = RAg np.a
} ; } ;
IdRP = IdRP =
{ s = table { { s = table {
RC _ Gen => "whose" ; RC _ (NCase Gen) => "whose" ;
RC Neutr _ => "which" ; RC Neutr _ => "which" ;
RC _ Acc => "whom" ; RC _ NPAcc => "whom" ;
RC _ Nom => "who" ; RC _ (NCase Nom) => "who" ;
RPrep Neutr => "which" ; RPrep Neutr => "which" ;
RPrep _ => "whom" RPrep _ => "whom"
} ; } ;

View File

@@ -16,10 +16,22 @@ resource ResEng = ParamX ** open Prelude in {
--2 For $Noun$ --2 For $Noun$
-- This is the worst-case $Case$ needed for pronouns. -- This is case as needed when inflecting nouns.
param param
Case = Nom | Acc | Gen ; Case = Nom | Gen ;
-- This is the worst-case $Case$ needed for pronouns.
NPCase = NCase Case | NPAcc ;
-- Useful macros and conversions:
oper
npNom : NPCase = NCase Nom ;
npGen : NPCase = NCase Gen ;
npcase2case : NPCase -> Case = \nc -> case nc of {NCase c => c ; _ => Nom} ;
-- Agreement of $NP$ has 8 values. $Gender$ is needed for "who"/"which" and -- Agreement of $NP$ has 8 values. $Gender$ is needed for "who"/"which" and
-- for "himself"/"herself"/"itself". -- for "himself"/"herself"/"itself".
@@ -67,7 +79,7 @@ resource ResEng = ParamX ** open Prelude in {
--2 For $Relative$ --2 For $Relative$
RAgr = RNoAg | RAg Agr ; RAgr = RNoAg | RAg Agr ;
RCase = RPrep Gender | RC Gender Case ; RCase = RPrep Gender | RC Gender NPCase ;
--2 For $Numeral$ --2 For $Numeral$
@@ -145,23 +157,23 @@ resource ResEng = ParamX ** open Prelude in {
isRefl = False isRefl = False
} ; } ;
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} = mkIP : (i,me,my : Str) -> Number -> {s : NPCase => Str ; n : Number} =
\i,me,my,n -> let who = mkNP i me my n P3 Neutr in { \i,me,my,n -> let who = mkNP i me my n P3 Neutr in {
s = who.s ; s = who.s ;
n = n n = n
} ; } ;
mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
{s : Case => Str ; a : Agr} = \i,me,my,n,p,g -> {s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g ->
{ s = table { { s = table {
Nom => i ; NCase Nom => i ;
Acc => me ; NPAcc => me ;
Gen => my NCase Gen => my
} ; } ;
a = toAgr n p g ; a = toAgr n p g ;
}; };
regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n -> regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n ->
mkNP that that (that + "'s") n P3 Neutr ; mkNP that that (that + "'s") n P3 Neutr ;
regGenitiveS : Str -> Case => Str = \s -> regGenitiveS : Str -> Case => Str = \s ->

View File

@@ -4,7 +4,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
lin lin
PredVP np vp = mkClause (np.s ! Nom) np.a vp ; PredVP np vp = mkClause (np.s ! npNom) np.a vp ;
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
@@ -23,7 +23,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
} ; } ;
SlashVP np vp = SlashVP np vp =
mkClause (np.s ! Nom) np.a vp ** {c2 = vp.c2} ; mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ;
AdvSlash slash adv = { AdvSlash slash adv = {
s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
@@ -33,7 +33,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
SlashPrep cl prep = cl ** {c2 = prep.s} ; SlashPrep cl prep = cl ** {c2 = prep.s} ;
SlashVS np vs slash = SlashVS np vs slash =
mkClause (np.s ! Nom) np.a mkClause (np.s ! npNom) np.a
(insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) **
{c2 = slash.c2} ; {c2 = slash.c2} ;

View File

@@ -8,15 +8,15 @@ lin
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ; FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
NumPN i = {s = i.s ; g = Neutr} ; NumPN i = {s = i.s ; g = Neutr} ;
CNIntNP cn i = { CNIntNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ; s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! npcase2case c ;
a = agrgP3 Sg cn.g a = agrgP3 Sg cn.g
} ; } ;
CNSymbNP det cn xs = { CNSymbNP det cn xs = {
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ; s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! npcase2case c ;
a = agrgP3 det.n cn.g a = agrgP3 det.n cn.g
} ; } ;
CNNumNP cn i = { CNNumNP cn i = {
s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ; s = \\c => cn.s ! Sg ! Nom ++ i.s ! npcase2case c ;
a = agrgP3 Sg cn.g a = agrgP3 Sg cn.g
} ; } ;

View File

@@ -7,9 +7,9 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
SlashV2a v = predVc v ; SlashV2a v = predVc v ;
Slash2V3 v np = Slash2V3 v np =
insertObjc (\\_ => v.c2 ++ np.s ! Acc) (predV v ** {c2 = v.c3}) ; insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predV v ** {c2 = v.c3}) ;
Slash3V3 v np = Slash3V3 v np =
insertObjc (\\_ => v.c3 ++ np.s ! Acc) (predVc v) ; ---- insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ----
ComplVV v vp = insertObj (\\a => infVP v.typ vp a) (predVV v) ; ComplVV v vp = insertObj (\\a => infVP v.typ vp a) (predVV v) ;
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ; ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
@@ -21,13 +21,13 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ; SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ;
SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ---- SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ----
ComplSlash vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! Acc) vp ; ComplSlash vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ;
SlashVV vv vp = SlashVV vv vp =
insertObj (\\a => infVP vv.typ vp a) (predVV vv) ** insertObj (\\a => infVP vv.typ vp a) (predVV vv) **
{c2 = vp.c2} ; {c2 = vp.c2} ;
SlashV2VNP vv np vp = SlashV2VNP vv np vp =
insertObjPre (\\_ => vv.c2 ++ np.s ! Acc) insertObjPre (\\_ => vv.c2 ++ np.s ! NPAcc)
(insertObjc (\\a => vv.c3 ++ infVP vv.typ vp a) (predVc vv)) ** (insertObjc (\\a => vv.c3 ++ infVP vv.typ vp a) (predVc vv)) **
{c2 = vp.c2} ; {c2 = vp.c2} ;
@@ -46,7 +46,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
---b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to" ---b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to"
CompAP ap = ap ; CompAP ap = ap ;
CompNP np = {s = \\_ => np.s ! Acc} ; CompNP np = {s = \\_ => np.s ! NPAcc} ;
CompAdv a = {s = \\_ => a.s} ; CompAdv a = {s = \\_ => a.s} ;
CompCN cn = {s = \\a => case (fromAgr a).n of { CompCN cn = {s = \\a => case (fromAgr a).n of {
Sg => artIndef ++ cn.s ! Sg ! Nom ; Sg => artIndef ++ cn.s ! Sg ! Nom ;