1
0
forked from GitHub/gf-rgl
Files
gf-rgl/src/german/SentenceGer.gf
Hans Leiss 8fb8ddd808 Ger: improved infinitives (and passives); tests with more verbs in testing/german
- NP: added field isLight in order to push negation behind light nps;
  this had been done in gf-3.9 using field isPron, but isPron is now
  used to put accusative pronoun before dative pronoun. Removed field
  adv: adverbial extensions cannot be extracted (todo: also for CN).
  Reduced isLight*isPron to w:Weight with 3 values: WPron, WLight, WHeavy.

- added param Control and field ctrl:Control to classify V2V-verbs into
  subject- and object-contol verbs, use ctrl to make reflexives agree
  with subject resp. object in VPSlash, and refine ComplSlash.

- Verb: new versions of ComplVV, SlashV2V and SlashVV to give better
  (nested) infinitives (extracting infzu and correcting object order).
  a) nested SlashVV doesn't work properly;
  b) SlashV2VNP may have to be commented out to prevent a stack overflow
     when compiling.
  Intended change of SlashV2VNP in tests/german/TestLangGer could not
  be tested due to size problems with the compiler.

- VP: changed field a1 : Polarity => Str to a1:Str to collect the adverbs
  coming before negation, using (negation : Polarity => Str) in mkClause.
  Use objCtrl:Bool instead of missingAdv to let reflexives agree with object.

- ResGer: insertObjNP reorganized, infzuVP added

- DictVerbsGer: some corrections (helft -> hilft, *sprecht -> *spricht)

- Some potential passive rules in tests/german/TestLangGer|Eng

- ExtraGer needs to be cleaned up with repect to the modified mkClause.
2019-09-18 15:16:42 +02:00

82 lines
2.5 KiB
Plaintext

concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in {
flags optimize=all_subs ;
lin
PredVP np vp =
let subj = mkSubj np vp.subjc
in mkClause subj.p1 subj.p2 vp ;
{- applies verb's subject case to subject ;
forces 3rd person sg agreement for any non-nom subjects -->
"uns graut" "*uns grauen"
allows pre/post-positions in subjects -->
"nach mir wurde gedürstet" "*mir wurde gedürstet"
can't think of case of postpositions in subject -}
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
ImpVP vp = let vps = useVP vp 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 ;
inf = vp.inf.s ++ verb.inf ; -- HL .nn
obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4
in
-- verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ negation ! pol ++ obj ++ vp.a2 ++ inf ++ vp.ext
} ;
SlashVP np vp =
let subj = mkSubj np vp.subjc
in mkClause subj.p1 subj.p2 vp ** {c2 = vp.c2} ;
AdvSlash slash adv = {
s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ;
c2 = slash.c2
} ;
SlashPrep cl prep = cl ** {c2 = prep} ;
SlashVS np vs slash =
let subj = mkSubj np PrepNom
in mkClause subj.p1 subj.p2
(insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) **
{c2 = slash.c2} ;
EmbedS s = {s = conjThat ++ s.s ! Sub} ; -- no leading comma, if sentence-initial
EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = useInfVP False vp} ;
UseCl t p cl = {
s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o
} ;
UseQCl t p cl = {
s = \\q => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! q
} ;
UseRCl t p cl = {
s = \\r => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! r ;
c = cl.c
} ;
UseSlash t p cl = {
s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o ;
c2 = cl.c2
} ;
AdvS a s = {s = table {Sub => a.s ++ s.s ! Sub ; o => a.s ++ s.s ! Inv}} ;
ExtAdvS a s =
{s = table {Sub => a.s ++ "," ++ s.s ! Sub ; o => a.s ++ "," ++ s.s ! Inv}} ;
SSubjS a s b = {s = \\o => a.s ! o ++ "," ++ s.s ++ b.s ! Sub} ;
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was"
}