mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 13:09:33 -06:00
removed accusative case for nouns in Eng (it is for NP, Pron, IP, RP only)
This commit is contained in:
@@ -7,7 +7,7 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
|
||||
isPre = True
|
||||
} ;
|
||||
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
|
||||
} ;
|
||||
UseComparA a = {
|
||||
@@ -21,12 +21,12 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ concrete AdverbEng of Adverb = CatEng ** open ResEng, Prelude in {
|
||||
lin
|
||||
PositAdvAdj a = {s = a.s ! AAdv} ;
|
||||
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 = {
|
||||
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 ;
|
||||
PositAdAAdj a = {s = a.s ! AAdv} ;
|
||||
|
||||
@@ -8,7 +8,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
|
||||
S = {s : 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} ;
|
||||
|
||||
-- Sentence
|
||||
@@ -23,7 +23,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
-- Question
|
||||
|
||||
QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ;
|
||||
IP = {s : Case => Str ; n : Number} ;
|
||||
IP = {s : NPCase => Str ; n : Number} ;
|
||||
IComp = {s : Str} ;
|
||||
IDet = {s : Str ; n : Number} ;
|
||||
IQuant = {s : Number => Str} ;
|
||||
@@ -32,7 +32,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
|
||||
RCl = {
|
||||
s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ;
|
||||
c : Case
|
||||
c : NPCase
|
||||
} ;
|
||||
RP = {s : RCase => Str ; a : RAgr} ;
|
||||
|
||||
@@ -49,14 +49,14 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
-- Noun
|
||||
|
||||
CN = {s : Number => Case => Str ; g : Gender} ;
|
||||
NP = {s : Case => Str ; a : Agr} ;
|
||||
Pron = {s : Case => Str ; sp : Case => Str ; a : Agr} ;
|
||||
Det = {s : Str ; sp : Case => Str ; n : Number ; hasNum : Bool} ;
|
||||
NP = {s : NPCase => Str ; a : Agr} ;
|
||||
Pron = {s : NPCase => Str ; sp : Case => Str ; a : Agr} ;
|
||||
Det = {s : Str ; sp : NPCase => Str ; n : Number ; hasNum : Bool} ;
|
||||
Predet = {s : Str} ;
|
||||
Ord = { s : Case => Str } ;
|
||||
Num = {s : Case => Str ; n : Number ; hasCard : Bool} ;
|
||||
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
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ concrete ConjunctionEng of Conjunction =
|
||||
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
ConjNP conj ss = conjunctDistrTable NPCase conj ss ** {
|
||||
a = conjAgr (agrP3 conj.n) ss.a
|
||||
} ;
|
||||
|
||||
@@ -31,8 +31,8 @@ concrete ConjunctionEng of Conjunction =
|
||||
ConsS = consrSS comma ;
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||
ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.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} ;
|
||||
ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||
BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
||||
@@ -46,9 +46,9 @@ concrete ConjunctionEng of Conjunction =
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {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} ;
|
||||
[RS] = {s1,s2 : Agr => Str ; c : Case} ;
|
||||
[RS] = {s1,s2 : Agr => Str ; c : NPCase} ;
|
||||
[CN] = {s1,s2 : Number => Case => Str} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
open ResEng, Coordination, Prelude, MorphoEng in {
|
||||
|
||||
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) ;
|
||||
|
||||
StrandRelSlash rp slash = {
|
||||
s = \\t,a,p,ag =>
|
||||
rp.s ! RC (fromAgr ag).g Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = Acc
|
||||
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = NPAcc
|
||||
} ;
|
||||
EmptyRelSlash slash = {
|
||||
s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = Acc
|
||||
c = NPAcc
|
||||
} ;
|
||||
|
||||
StrandQuestSlash ip slash =
|
||||
{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
|
||||
@@ -60,7 +60,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
lin
|
||||
that_RP =
|
||||
{ s = table {
|
||||
RC _ Gen => "whose" ;
|
||||
RC _ (NCase Gen) => "whose" ;
|
||||
RC _ _ => "that" ;
|
||||
_ => "that" ---- "in that" ?
|
||||
-- RPrep Neutr => "which" ;
|
||||
@@ -84,7 +84,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
BaseVPS = twoTable Agr ;
|
||||
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 = {
|
||||
s = \\a =>
|
||||
|
||||
@@ -16,17 +16,17 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
ExistNP np =
|
||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||
(insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
|
||||
(insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
|
||||
|
||||
ExistIP ip =
|
||||
mkQuestion (ss (ip.s ! Nom))
|
||||
mkQuestion (ss (ip.s ! npNom))
|
||||
(mkClause "there" (agrP3 ip.n) (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)} ;
|
||||
|
||||
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} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
|
||||
oper
|
||||
|
||||
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;
|
||||
sp = regGenitiveS s ;
|
||||
sp = \\c => regGenitiveS s ! npcase2case c ;
|
||||
n = n ;
|
||||
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 ->
|
||||
{s : Case => Str ; sp : Case => Str ; a : Agr} =
|
||||
{s : NPCase => Str ; sp : Case => Str ; a : Agr} =
|
||||
\i,me,my,mine,n,p,g -> {
|
||||
s = table {
|
||||
Nom => i ;
|
||||
Acc => me ;
|
||||
Gen => my
|
||||
NCase Nom => i ;
|
||||
NPAcc => me ;
|
||||
NCase Gen => my
|
||||
} ;
|
||||
a = toAgr n p g ;
|
||||
sp = regGenitiveS mine
|
||||
|
||||
@@ -4,11 +4,11 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
|
||||
lin
|
||||
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
|
||||
} ;
|
||||
|
||||
UsePN pn = pn ** {a = agrgP3 Sg pn.g} ;
|
||||
UsePN pn = {s = \\c => pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ;
|
||||
UsePron p = p ;
|
||||
|
||||
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;
|
||||
sp = \\c => case num.hasCard of {
|
||||
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 ;
|
||||
hasNum = num.hasCard
|
||||
@@ -43,19 +43,19 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
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 ;
|
||||
hasNum = True
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s = \\_,_ => p.s ! Gen ;
|
||||
sp = \\_,_ => p.sp
|
||||
s = \\_,_ => p.s ! NCase Gen ;
|
||||
sp = \\_,_,c => p.sp ! npcase2case c
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\c => []; n = Sg ; hasCard = False} ;
|
||||
@@ -77,8 +77,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
DefArt = {
|
||||
s = \\hasCard,n => artDef ;
|
||||
sp = \\hasCard,n => case <n,hasCard> of {
|
||||
<Sg,False> => table { Gen => "its"; _ => "it" } ;
|
||||
<Pl,False> => table { Nom => "they"; Acc => "them"; Gen => "theirs" } ;
|
||||
<Sg,False> => table { NCase Gen => "its"; _ => "it" } ;
|
||||
<Pl,False> => table { NCase Nom => "they"; NPAcc => "them"; NCase Gen => "theirs" } ;
|
||||
_ => \\c => artDef
|
||||
}
|
||||
} ;
|
||||
@@ -89,14 +89,14 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
_ => []
|
||||
} ;
|
||||
sp = \\hasCard,n => case <n,hasCard> of {
|
||||
<Sg,False> => table { Gen => "one's"; _ => "one" };
|
||||
<Pl,False> => table { Gen => "ones'"; _ => "ones" } ;
|
||||
<Sg,False> => table {NCase Gen => "one's"; _ => "one" };
|
||||
<Pl,False> => table {NCase Gen => "ones'"; _ => "ones" } ;
|
||||
_ => \\c => []
|
||||
}
|
||||
} ;
|
||||
|
||||
MassNP cn = {
|
||||
s = cn.s ! Sg ;
|
||||
s = \\c => cn.s ! Sg ! npcase2case c ;
|
||||
a = agrP3 Sg
|
||||
} ;
|
||||
|
||||
@@ -116,9 +116,9 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
||||
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 = {
|
||||
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 ;
|
||||
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} ;
|
||||
|
||||
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} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -337,15 +337,15 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
|
||||
|
||||
Gender = ResEng.Gender ;
|
||||
Number = ResEng.Number ;
|
||||
Case = ResEng.Case ;
|
||||
Case = ResEng.NPCase ;
|
||||
human = Masc ;
|
||||
nonhuman = Neutr ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
nominative = npNom ;
|
||||
genitive = npGen ;
|
||||
|
||||
npNumber np = (fromAgr np.a).n ;
|
||||
|
||||
@@ -429,7 +429,8 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
|
||||
mkQuantifier : Str -> Str -> Str -> Str -> Quant =
|
||||
\sg,pl,sg',pl' -> lin Quant {
|
||||
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};
|
||||
|
||||
@@ -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} ;
|
||||
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 ;
|
||||
UttNP np = {s = np.s ! Nom} ;
|
||||
UttNP np = {s = np.s ! npNom} ;
|
||||
UttVP vp = {s = infVP VVInf vp (agrP3 Sg)} ;
|
||||
UttAdv adv = adv ;
|
||||
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} ; ---
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = "," ++ np.s ! Nom} ;
|
||||
VocNP np = {s = "," ++ np.s ! npNom} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,20 +14,20 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
||||
} ;
|
||||
|
||||
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} ;
|
||||
|
||||
QuestSlash ip slash =
|
||||
mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ;
|
||||
mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ;
|
||||
--- stranding in ExratEng
|
||||
|
||||
QuestIAdv iadv cl = mkQuestion iadv cl ;
|
||||
|
||||
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 = {
|
||||
s = \\c => ip.s ! c ++ adv.s ;
|
||||
@@ -35,7 +35,7 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
@@ -52,17 +52,17 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
||||
AdvIAdv i a = ss (i.s ++ a.s) ;
|
||||
|
||||
CompIAdv a = a ;
|
||||
CompIP p = ss (p.s ! Nom) ;
|
||||
CompIP p = ss (p.s ! npNom) ;
|
||||
|
||||
lincat
|
||||
QVP = ResEng.VP ;
|
||||
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 ;
|
||||
AddAdvQVP vp adv = insertObj (\\_ => adv.s) 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} ;
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
||||
|
||||
RelCl cl = {
|
||||
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
|
||||
c = Nom
|
||||
c = npNom
|
||||
} ;
|
||||
|
||||
RelVP rp vp = {
|
||||
@@ -16,10 +16,10 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
||||
RNoAg => ag ;
|
||||
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
|
||||
cl.s ! t ! ant ! b ! ODir ;
|
||||
c = Nom
|
||||
c = npNom
|
||||
} ;
|
||||
|
||||
-- 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 = {
|
||||
s = \\t,a,p,agr =>
|
||||
slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
|
||||
c = Acc
|
||||
c = NPAcc
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
IdRP =
|
||||
{ s = table {
|
||||
RC _ Gen => "whose" ;
|
||||
RC _ (NCase Gen) => "whose" ;
|
||||
RC Neutr _ => "which" ;
|
||||
RC _ Acc => "whom" ;
|
||||
RC _ Nom => "who" ;
|
||||
RC _ NPAcc => "whom" ;
|
||||
RC _ (NCase Nom) => "who" ;
|
||||
RPrep Neutr => "which" ;
|
||||
RPrep _ => "whom"
|
||||
} ;
|
||||
|
||||
@@ -16,10 +16,22 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
--2 For $Noun$
|
||||
|
||||
-- This is the worst-case $Case$ needed for pronouns.
|
||||
-- This is case as needed when inflecting nouns.
|
||||
|
||||
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
|
||||
-- for "himself"/"herself"/"itself".
|
||||
@@ -67,7 +79,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg Agr ;
|
||||
RCase = RPrep Gender | RC Gender Case ;
|
||||
RCase = RPrep Gender | RC Gender NPCase ;
|
||||
|
||||
--2 For $Numeral$
|
||||
|
||||
@@ -145,23 +157,23 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
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 {
|
||||
s = who.s ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
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 {
|
||||
Nom => i ;
|
||||
Acc => me ;
|
||||
Gen => my
|
||||
NCase Nom => i ;
|
||||
NPAcc => me ;
|
||||
NCase Gen => my
|
||||
} ;
|
||||
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 ;
|
||||
|
||||
regGenitiveS : Str -> Case => Str = \s ->
|
||||
|
||||
@@ -4,7 +4,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
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 ;
|
||||
|
||||
@@ -23,7 +23,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
||||
} ;
|
||||
|
||||
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 = {
|
||||
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} ;
|
||||
|
||||
SlashVS np vs slash =
|
||||
mkClause (np.s ! Nom) np.a
|
||||
mkClause (np.s ! npNom) np.a
|
||||
(insertObj (\\_ => conjThat ++ slash.s) (predV vs)) **
|
||||
{c2 = slash.c2} ;
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ lin
|
||||
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
NumPN i = {s = i.s ; g = Neutr} ;
|
||||
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
|
||||
} ;
|
||||
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
|
||||
} ;
|
||||
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
|
||||
} ;
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ concrete VerbEng of Verb = CatEng ** open ResEng in {
|
||||
|
||||
SlashV2a v = predVc v ;
|
||||
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 =
|
||||
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) ;
|
||||
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) ;
|
||||
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 =
|
||||
insertObj (\\a => infVP vv.typ vp a) (predVV vv) **
|
||||
{c2 = vp.c2} ;
|
||||
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)) **
|
||||
{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"
|
||||
|
||||
CompAP ap = ap ;
|
||||
CompNP np = {s = \\_ => np.s ! Acc} ;
|
||||
CompNP np = {s = \\_ => np.s ! NPAcc} ;
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
CompCN cn = {s = \\a => case (fromAgr a).n of {
|
||||
Sg => artIndef ++ cn.s ! Sg ! Nom ;
|
||||
|
||||
Reference in New Issue
Block a user