fine-tuning Romance for efficiency

This commit is contained in:
aarne
2006-02-27 19:46:48 +00:00
parent 6eb14fa20f
commit b7703b8460
10 changed files with 54 additions and 23 deletions

View File

@@ -30,7 +30,7 @@ incomplete concrete CatRomance of Cat =
-- Relative
RCl = {s : Tense => Anteriority => Polarity => Mood => Agr => Str} ;
RCl = {s : Agr => Tense => Anteriority => Polarity => Mood => Str} ;
RP = {s : Bool => AAgr => Case => Str ; a : RAgr} ;
-- Verb

View File

@@ -6,29 +6,28 @@ incomplete concrete RelativeRomance of Relative =
lin
RelCl cl = {
s = \\t,a,p,m,ag => pronSuch ! ag ++ conjThat ++ cl.s ! t ! a ! p ! m
s = \\ag,t,a,p,m => pronSuch ! ag ++ conjThat ++ cl.s ! t ! a ! p ! m
} ;
RelVP rp vp = {
s = \\t,ant,b,m,ag =>
let
agr = case rp.a of {
RNoAg => ag ;
RAg a => a ** {p = P3}
} ;
cl = mkClause (rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom) agr vp
in
cl.s ! t ! ant ! b ! m
s = \\ag =>
(mkClause
(rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom)
(
case rp.a of {
RNoAg => ag ;
RAg a => a ** {p = P3}
}) vp).s
} ;
RelSlash rp slash = {
s = \\t,a,p,m,ag =>
s = \\ag,t,a,p,m =>
slash.c2.s ++ rp.s ! False ! ag ! slash.c2.c ++ slash.s ! t ! a ! p ! m
} ;
FunRP p np rp = {
s = \\_,a,c => np.s ! Ton Nom ++ p.s ++ rp.s ! True ! a ! p.c ;
a = RAg np.a
a = RAg {g = np.a.g ; n = np.a.n}
} ;
IdRP = {
s = relPron ;

View File

@@ -145,6 +145,17 @@ oper
ext = vp.ext ;
} ;
insertAdV : Str -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit2 = vp.clit2 ;
neg = \\b => let vpn = vp.neg ! b in {p1 = vpn.p1 ; p2 = vpn.p2 ++ co} ;
comp = vp.comp ;
ext = vp.ext ;
} ;
insertClit2 : Str -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
@@ -193,7 +204,7 @@ oper
inf = (vp.s ! VPInfinit Simul).inf ! (aagr agr.g agr.n) ;
neg = vp.neg ! Pos ; --- Neg not in API
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
obj = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
in
clitInf (clpr.p1 ++ vp.clit2) inf ++ obj ;

View File

@@ -36,6 +36,6 @@ incomplete concrete SentenceRomance of Sentence =
UseCl t a p cl = {s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o} ;
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ;
UseRCl t a p cl =
{s = \\r,ag => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ! ag} ;
{s = \\r,ag => t.s ++ a.s ++ p.s ++ cl.s ! ag ! t.t ! a.a ! p.p ! r} ;
}

View File

@@ -35,7 +35,7 @@ incomplete concrete VerbRomance of Verb =
CompAdv a = {s = \\_ => a.s} ;
AdvVP vp adv = insertAdv adv.s vp ;
AdVVP adv vp = insertAdv adv.s vp ;
AdVVP adv vp = insertAdV adv.s vp ;
ReflV2 v = case v.c2.isDir of {
True => predV {s = v.s ; vtyp = vRefl} ;