1
0
forked from GitHub/gf-rgl

(Extend) Add AdvIsNP + implement it in Eng,Fin,Pes,Romance,Swe

This commit is contained in:
Inari Listenmaa
2019-03-19 09:34:26 +01:00
parent e35abeac6b
commit 82937227bc
7 changed files with 108 additions and 95 deletions

View File

@@ -3,8 +3,8 @@
concrete ExtendEng of Extend =
CatEng ** ExtendFunctor -
[
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
AdAdV, AdjAsCN, AdjAsNP, ApposNP,
VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
AdAdV, AdjAsCN, AdjAsNP, ApposNP, AdvIsNP,
BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2,
MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV,
MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
@@ -33,23 +33,23 @@ concrete ExtendEng of Extend =
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen ; isDef = True} ;
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
GenRP nu cn = {
s = \\c => "whose" ++ nu.s ! False ! Nom ++
s = \\c => "whose" ++ nu.s ! False ! Nom ++
case c of {
RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
_ => cn.s ! nu.n ! Nom
} ;
a = RAg (agrP3 nu.n)
} ;
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
StrandQuestSlash ip slash =
{s = \\t,a,b,q =>
StrandQuestSlash ip slash =
{s = \\t,a,b,q =>
(mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
};
StrandRelSlash rp slash = {
s = \\t,a,p,ag =>
s = \\t,a,p,ag =>
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
c = NPAcc
} ;
@@ -70,14 +70,14 @@ concrete ExtendEng of Extend =
lincat
VPS = {s : Agr => Str} ;
[VPS] = {s1,s2 : Agr => Str} ;
[VPS] = {s1,s2 : Agr => Str} ;
VPI = {s : VVType => Agr => Str} ;
[VPI] = {s1,s2 : VVType => Agr => Str} ;
lin
BaseVPS = twoTable Agr ;
ConsVPS = consrTable Agr comma ;
BaseVPI = twoTable2 VVType Agr ;
ConsVPI = consrTable2 VVType Agr comma ;
@@ -85,7 +85,7 @@ concrete ExtendEng of Extend =
ConjVPS c xs = conjunctDistrTable Agr c xs ;
PredVPS np vps = {s = np.s ! npNom ++ vps.s ! np.a} ;
MkVPI vp = mkVPI (lin VP vp) ;
ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ;
ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
@@ -94,8 +94,8 @@ concrete ExtendEng of Extend =
-------- two-place verb conjunction
lincat
VPS2 = {s : Agr => Str ; c2 : Str} ;
[VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ;
VPS2 = {s : Agr => Str ; c2 : Str} ;
[VPS2] = {s1,s2 : Agr => Str ; c2 : Str} ;
VPI2 = {s : VVType => Agr => Str ; c2 : Str} ;
[VPI2] = {s1,s2 : VVType => Agr => Str ; c2 : Str} ;
@@ -105,7 +105,7 @@ concrete ExtendEng of Extend =
BaseVPS2 x y = twoTable Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
ConsVPS2 x xs = consrTable Agr comma x xs ** {c2 = xs.c2} ;
BaseVPI2 x y = twoTable2 VVType Agr x y ** {c2 = y.c2} ; ---- just remembering the prep of the latter verb
ConsVPI2 x xs = consrTable2 VVType Agr comma x xs ** {c2 = xs.c2} ;
@@ -121,15 +121,15 @@ concrete ExtendEng of Extend =
s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2 ++ np.s ! NPAcc
} ;
oper
oper
mkVPS : Temp -> Pol -> VP -> VPS = \t,p,vp -> lin VPS {
s = \\a =>
let
s = \\a =>
let
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 ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
} ;
mkVPI : VP -> VPI = \vp -> lin VPI {
s = table {
VVAux => \\a => vp.ad ! a ++ vp.inf ++ vp.p ++ vp.s2 ! a ;
@@ -152,11 +152,11 @@ concrete ExtendEng of Extend =
EmbedPresPart vp = {s = \\a => infVP VVPresPart vp False Simul CPos a} ;
PastPartAP vp = {
PastPartAP vp = {
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ vp.ext ;
isPre = vp.isSimple -- depends on whether there are complements
} ;
PastPartAgentAP vp np = {
PastPartAgentAP vp np = {
s = \\a => vp.ad ! a ++ vp.ptp ++ vp.p ++ vp.c2 ++ vp.s2 ! a ++ "by" ++ np.s ! NPAcc ++ vp.ext ;
isPre = False
} ;
@@ -168,45 +168,45 @@ concrete ExtendEng of Extend =
<Sg,Gen> => Predef.BIND ++ "'s" ;
<Pl,Nom> => Predef.BIND ++ "s" ;
<Pl,Gen> => Predef.BIND ++ "s'"
} ++
vp.p ++ vp.s2 ! AgP3Sg Neutr ++ vp.ext ;
} ++
vp.p ++ vp.s2 ! AgP3Sg Neutr ++ vp.ext ;
g = Neutr
} ;
GerundNP vp =
GerundNP vp =
let a = AgP3Sg Neutr ---- agr
in
in
{s = \\_ => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext ; a = a} ;
GerundAdv vp =
GerundAdv vp =
let a = AgP3Sg Neutr
in
in
{s = vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a ++ vp.ext} ;
WithoutVP vp = {s = "without" ++ (GerundAdv (lin VP vp)).s} ;
WithoutVP vp = {s = "without" ++ (GerundAdv (lin VP vp)).s} ;
InOrderToVP vp = {s = ("in order" | []) ++ infVP VVInf vp False Simul CPos (AgP3Sg Neutr)} ;
PurposeVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ; --- agr
ByVP vp = {s = "by" ++ (GerundAdv (lin VP vp)).s} ;
ByVP vp = {s = "by" ++ (GerundAdv (lin VP vp)).s} ;
NominalizeVPSlashNP vpslash np =
NominalizeVPSlashNP vpslash np =
let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ;
a = AgP3Sg Neutr
in
lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ;
in
lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ;
oper passVPSlash : VPSlash -> Str -> ResEng.VP =
\vps,ag ->
let
oper passVPSlash : VPSlash -> Str -> ResEng.VP =
\vps,ag ->
let
be = predAux auxBe ;
ppt = vps.ptp
in {
s = be.s ;
p = [] ;
p = [] ;
prp = be.prp ;
ptp = be.ptp ;
inf = be.inf ;
@@ -216,7 +216,7 @@ concrete ExtendEng of Extend =
ext = vps.ext
} ;
lin
lin
PassVPSlash vps = passVPSlash (lin VPS vps) [] ;
PassAgentVPSlash vps np = passVPSlash (lin VPS vps) ("by" ++ np.s ! NPAcc) ;
@@ -226,8 +226,8 @@ concrete ExtendEng of Extend =
} ;
--- AR 22/5/2013
ExistsNP np =
mkClause "there" (agrP3 (fromAgr np.a).n)
ExistsNP np =
mkClause "there" (agrP3 (fromAgr np.a).n)
(insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ;
ExistCN cn =
@@ -263,8 +263,8 @@ concrete ExtendEng of Extend =
} ;
FrontExtPredVP np vp = {
s = \\t,a,b,o =>
let
s = \\t,a,b,o =>
let
subj = np.s ! npNom ;
agr = np.a ;
verb = vp.s ! t ! a ! b ! o ! agr ;
@@ -277,8 +277,8 @@ concrete ExtendEng of Extend =
} ;
InvFrontExtPredVP np vp = {
s = \\t,a,b,o =>
let
s = \\t,a,b,o =>
let
subj = np.s ! npNom ;
agr = np.a ;
verb = vp.s ! t ! a ! b ! o ! agr ;
@@ -311,7 +311,7 @@ concrete ExtendEng of Extend =
RNP = {s : Agr => Str} ;
RNPList = {s1,s2 : Agr => Str} ;
lin
lin
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
ReflPron = {s = reflPron} ;
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
@@ -328,21 +328,23 @@ concrete ExtendEng of Extend =
lin
ApposNP np1 np2 = {s = \\c => np1.s ! c ++ comma ++ np2.s ! c; a = np1.a} ;
AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a} (UseComp (CompNP np)) ;
---- TODO: RNPList construction
lin
ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++
infVP v.typ vp False a.a p.p agr)
(predVV v) ;
CompS s = {s = \\_ => "that" ++ s.s} ;
CompQS qs = {s = \\_ => qs.s ! QIndir} ;
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
CompVP ant p vp = {s = \\a => ant.s ++ p.s ++
infVP VVInf vp False ant.a p.p a} ;
-- quite specific for English anyway
UncontractedNeg = {s = [] ; p = CNeg False} ;
UncontractedNeg = {s = [] ; p = CNeg False} ;
UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ;