nondependent versions of Pred grammars, implemented by a functor over the dependent version so that no new concrete syntax code is needed. This is at the moment the grammar of choice for translation: NDTransEng is several times faster than TransEng and even faster than the old TranslateEng. The next step is to make sure that all coverage is preserved; some new coverage is already there.

This commit is contained in:
aarne
2014-02-08 14:28:58 +00:00
parent b1aec70571
commit 3c97dc4ed3
8 changed files with 579 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
--# -path=.:../translator
concrete NDTransSwe of NDTrans =
RGLBaseSwe - [Pol,Tense]
,NDPredSwe
,DictionarySwe - [Pol,Tense]
** open CommonScand, ResSwe, PredInstanceSwe, (Pr=PredSwe), Prelude in {
flags
literal=Symb ;
oper
vliftV : Verb -> PrV = \v -> lin PrV (PredInstanceSwe.liftV v) ;
PrV = Pr.PrV ;
lin
LiftV v = vliftV v ;
LiftV2 v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s} ;
LiftVS v = vliftV v ;
LiftVQ v = vliftV v ;
LiftVA v = vliftV v ; ---- c1?
LiftVN v = vliftV v ; ---- c1?
LiftVV v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s} ;
LiftV3 v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s ; c2 = v.c3.s} ;
LiftV2S v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s} ;
LiftV2Q v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s} ;
LiftV2V v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s ; c2 = v.c3.s} ;
LiftV2A v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s} ;
LiftV2N v = <vliftV <v : Verb> : PrV> ** {c1 = v.c2.s} ;
LiftAP ap = lin PrAP {s = \\a => ap.s ! agr2aformpos a ; c1,c2 = [] ; obj1 = \\_ => []} ; --- isPre
LiftCN cn = lin PrCN {s = \\n => cn.s ! n ! DIndef ! Nom ; c1,c2 = [] ; obj1 = \\_ => []} ;
LiftAdv a = lin PrAdv (a ** {isAdV = False ; c1 = []}) ;
LiftAdV a = lin PrAdv (a ** {isAdV = True ; c1 = []}) ;
LiftPrep p = lin PrAdv ({s = [] ; isAdV = False ; c1 = p.s}) ;
}