mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-30 02:58:35 -06:00
(Ger) Shrink Agr = Ag Gender Number Person from 3*2*3 = 18 values to 2+3+1+3+1 = 10 by
Agr = AgSgP1 | AgSgP2 | AgSgP3 Gender | AgSgP3Gen | AgPl Person | AgPlPol ;
with AgSgP3Gen resp. AgPlPol used for reflexive,possessive forms of "man", "Sie".
Compiles AllGer from src in 162sec with 15M VerbGer.gfo vs. 380sec with 17M VerbGer.gfo
This commit is contained in:
+18
-13
@@ -21,17 +21,22 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
||||
s = \\pol,n =>
|
||||
let
|
||||
ps = case n of {
|
||||
ImpF _ True => <P3,"Sie",True> ; -- setzen Sie sich
|
||||
_ => <P2,[],False>
|
||||
} ;
|
||||
agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter
|
||||
verb = vps.s ! False ! agr ! VPImperat ps.p3 ;
|
||||
neg = negation ! pol ;
|
||||
ImpF _ True => <P3,"Sie",True> ; -- setzen Sie sich Ihren Hut auf
|
||||
_ => <P2,[],False> -- but: nimm [ihren | deinen | *Ihren] Hut
|
||||
} ; -- vp should be reflexive, ComplRSlash
|
||||
vagr = VAg (numImp n) ps.p1 ;
|
||||
verb = vps.s ! False ! vagr ! VPImperat ps.p3 ;
|
||||
agr = case <numImp n, ps.p1, ps.p3> of {
|
||||
<_, P3,True> => AgPlPol ; -- sich | Ihr-
|
||||
<Sg,P2,False> => AgSgP2 ; -- dich | dein-
|
||||
<Pl,P2,False> => AgPl P2 ; -- euch | euer-
|
||||
_ => AgSgP1 -- default, does not occur
|
||||
} ;
|
||||
inf = vp.inf.inpl.p2 ++ verb.inf ; -- HL .s/.inpl.p2
|
||||
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.adj
|
||||
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
|
||||
in
|
||||
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ neg ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
||||
} ;
|
||||
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
|
||||
} ;
|
||||
|
||||
AdvImp adv imp = {
|
||||
s = \\pol,impform => adv.s ++ imp.s ! pol ! impform
|
||||
@@ -42,9 +47,9 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
||||
-- + SlashVP 414720 (28224,204)
|
||||
|
||||
SlashVP np vp =
|
||||
let subj = mkSubject np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
|
||||
in mkClause subj.s subj.a vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
|
||||
-- cf. tests/german/TestLangGer.gf
|
||||
let subj = mkSubject np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent
|
||||
in mkClause subj.s subj.a vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a
|
||||
-- cf. tests/german/TestLangGer.gf
|
||||
AdvSlash slash adv = {
|
||||
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
|
||||
c2 = slash.c2
|
||||
@@ -54,7 +59,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
|
||||
|
||||
SlashVS np vs slash =
|
||||
let subj = mkSubject np PrepNom ;
|
||||
vp = (insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs))
|
||||
vp = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)
|
||||
in mkClause subj.s subj.a vp ** {c2 = slash.c2} ;
|
||||
|
||||
EmbedS s = {s = conjThat ++ s.s ! Sub} ; -- no leading comma, if sentence-initial
|
||||
|
||||
Reference in New Issue
Block a user