mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-05 09:12:51 -06:00
experiment in discontinuous Cl type in Romance, tried in French. The current result is that compilation is twice as fast as before, but parsing becomes slower. Hence not in the main RGL yet.
This commit is contained in:
66
lib/src/romance/exper/RelativeRomance.gf
Normal file
66
lib/src/romance/exper/RelativeRomance.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
incomplete concrete RelativeRomance of Relative =
|
||||
CatRomance ** open Prelude, CommonRomance, ResRomance in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
RelCl cl = cl ** {c2 = complNom ; rp = \\aag => pronSuch ! aag ++ conjThat} ;
|
||||
{-
|
||||
let cl = oldClause ncl in {
|
||||
s = \\ag,t,a,p,m => pronSuch ! complAgr ag ++ conjThat ++
|
||||
cl.s ! DDir ! t ! a ! p ! m ;
|
||||
c = Nom
|
||||
} ;
|
||||
-}
|
||||
|
||||
RelVP rp vp = {
|
||||
np = heavyNP {s = rp.s ! False ! {g = Masc ; n = Sg} ; a = Ag rp.a.g rp.a.n P3} ; ---- agr,agr
|
||||
vp = vp ;
|
||||
rp = \\_ => [] ;
|
||||
c2 = complNom
|
||||
} ;
|
||||
{-
|
||||
--- more efficient to compile than case inside mkClause; see log.txt
|
||||
case rp.hasAgr of {
|
||||
True => {s = \\ag =>
|
||||
(mkClause
|
||||
(rp.s ! False ! complAgr ag ! Nom) False False
|
||||
(Ag rp.a.g rp.a.n P3)
|
||||
vp).s ! DDir ; c = Nom} ;
|
||||
False => {s = \\ag =>
|
||||
(mkClause
|
||||
(rp.s ! False ! complAgr ag ! Nom) False False
|
||||
ag
|
||||
vp).s ! DDir ; c = Nom
|
||||
}
|
||||
} ;
|
||||
-}
|
||||
|
||||
RelSlash rp slash = slash ** {rp = \\aag => rp.s ! False ! aag ! slash.c2.c ; c2 = complAcc} ;
|
||||
|
||||
{-
|
||||
s = \\ag,t,a,p,m =>
|
||||
let
|
||||
aag = complAgr ag ;
|
||||
cl = oldClause slash
|
||||
in
|
||||
slash.c2.s ++
|
||||
rp.s ! False ! aag ! slash.c2.c ++
|
||||
cl.s ! DDir ! t ! a ! p ! m ; --- ragr
|
||||
---- slash.s ! aag ! DDir ! t ! a ! p ! m ; --- ragr
|
||||
c = Acc
|
||||
-}
|
||||
|
||||
FunRP p np rp = {
|
||||
s = \\_,a,c => (np.s ! Nom).ton ++ p.s ++ rp.s ! True ! a ! p.c ;
|
||||
a = complAgr np.a ;
|
||||
hasAgr = True
|
||||
} ;
|
||||
IdRP = {
|
||||
s = relPron ;
|
||||
a = {g = Masc ; n = Sg} ;
|
||||
hasAgr = False
|
||||
} ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user