mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 00:52:51 -06:00
improved performance of RelativeFre in compilation
This commit is contained in:
@@ -9,29 +9,35 @@ incomplete concrete RelativeRomance of Relative =
|
||||
s = \\ag,t,a,p,m => pronSuch ! ag ++ conjThat ++ cl.s ! t ! a ! p ! m
|
||||
} ;
|
||||
|
||||
RelVP rp vp = {
|
||||
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
|
||||
--- more efficient to compile than case inside mkClause; see log.txt
|
||||
RelVP rp vp = case rp.hasAgr of {
|
||||
True => {s = \\ag =>
|
||||
(mkClause
|
||||
(rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom)
|
||||
{g = rp.a.g ; n = rp.a.n ; p = P3}
|
||||
vp).s} ;
|
||||
False => {s = \\ag =>
|
||||
(mkClause
|
||||
(rp.s ! False ! {g = ag.g ; n = ag.n} ! Nom)
|
||||
ag
|
||||
vp).s
|
||||
}
|
||||
} ;
|
||||
|
||||
RelSlash rp slash = {
|
||||
s = \\ag,t,a,p,m =>
|
||||
slash.c2.s ++ rp.s ! False ! ag ! slash.c2.c ++ slash.s ! t ! a ! p ! m
|
||||
slash.c2.s ++ rp.s ! False ! {g = ag.g ; n = ag.n} ! 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 {g = np.a.g ; n = np.a.n}
|
||||
a = {g = np.a.g ; n = np.a.n} ;
|
||||
hasAgr = True
|
||||
} ;
|
||||
IdRP = {
|
||||
s = relPron ;
|
||||
a = RNoAg
|
||||
a = {g = Masc ; n = Sg} ;
|
||||
hasAgr = False
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user