1
0
forked from GitHub/gf-rgl

(Ger) reflexive RNP in ExtraGer completed ;

improved Slash-rules in tests/german/TestLangGer
This commit is contained in:
Hans Leiss
2022-07-16 12:18:13 +02:00
parent 0e8ac21976
commit 1379ba6c77
19 changed files with 266 additions and 97 deletions

View File

@@ -1,8 +1,11 @@
abstract TestLang =
Grammar - [SlashVP, RelSlash],
Grammar - [SlashVP, RelSlash, QuestSlash, AdvSlash, SlashPrep, SlashVS, UseSlash],
TestLexiconGerAbs
, Construction
** {
, Extend [PassVPSlash,PastPartAP
,RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP,AdvRNP,ReflA2RNP,PossPronRNP
,RNPList,ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP]
** {
flags startcat=Phr ;
fun
@@ -21,8 +24,8 @@ abstract TestLang =
ComplSlashSlash: VPSlashSlash -> NP -> VPSlash ;
-- Passive
PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
PassVPSlash : VPSlash -> VP ; -- from ExtraGer, to be corrected
-- PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space
-- PassVPSlash : VPSlash -> VP ; -- from ExtraGer, to be corrected
PassV2S : V2S -> S -> VP ;
PassV2Q : V2Q -> QS -> VP ;
@@ -39,5 +42,12 @@ abstract TestLang =
fun
RelSlash : RP -> ClauseSlash -> RCl ;
SlashVP : NP -> VPSlash -> ClauseSlash ;
QuestSlash : IP -> ClauseSlash -> QCl ; -- whom does John love
-- QCl = {s : Mood => ResGer.Tense => Anteriority => Polarity => QForm => Str} ;
AdvSlash : ClauseSlash -> Adv -> ClauseSlash ;
SlashPrep : Cl -> Prep -> ClauseSlash ;
SlashVS : NP -> VS -> SSlash -> ClauseSlash ;
UseSlash : Temp -> Pol -> ClauseSlash -> SSlash ;
ReflPossPron : Pron -> RNP -> NP ; -- not ReflPossPron : Pron -> Quant of Extend
} ;

View File

@@ -5,7 +5,9 @@ concrete TestLangEng of TestLang =
GrammarEng
, TestLexiconEng
, ConstructionEng
** open (R=ResEng), (P=ParadigmsEng), Prelude, (E=ExtendEng)
, ExtendEng[PastPartAP,PassVPSlash,
RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP,AdvRNP,ReflA2RNP,PossPronRNP,ReflPossPron]
** open (R=ResEng), (P=ParadigmsEng), Prelude --, (E=ExtendEng)
in {
flags
@@ -43,8 +45,8 @@ concrete TestLangEng of TestLang =
let vps = R.insertObj (\\_ => v.s ! R.VPPart ++ v.p) (R.predAux R.auxBe) ** {c2 = v.c2}
in R.insertObj (\\_ => vps.c2 ++ np.s ! R.NPAcc) vps ;
PastPartAP = E.PastPartAP ;
PassVPSlash = E.PassVPSlash ;
-- PastPartAP = E.PastPartAP ;
-- PassVPSlash = E.PassVPSlash ;
Pass2V4 v np =
let vpss = R.insertObj (\\_ => v.s ! R.VPPart ++ v.p) (R.predAux R.auxBe) ** {c2 = v.c3 ; c3 = v.c4}

View File

@@ -2,9 +2,12 @@
-- use the modified files in gf-rgl/src/german
concrete TestLangGer of TestLang =
GrammarGer - [SlashVP, RelSlash]
GrammarGer - [SlashVP,RelSlash,QuestSlash,AdvSlash,SlashPrep,SlashVS,UseSlash]
, TestLexiconGer
, ConstructionGer
, ExtraGer[RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP
,RNPList,ConjRNP --,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP
]
** open ResGer,Prelude,(P=ParadigmsGer) in {
flags startcat = Phr ; unlexer = text ; lexer = text ;
@@ -28,42 +31,34 @@ concrete TestLangGer of TestLang =
(insertObjRefl (predVc v3) ** {c2 = v3.c3});
PassV2Q v q =
let c = case <v.c2.c, v.c2.isPrep> of {
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject
vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
** { c1 = v.c2 ** {c = c} }
let vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
** { c1 = subjPrep v.c2 }
in insertExtrapos (bindComma ++ q.s ! QIndir) vp ;
PassV2S v s =
let c = case <v.c2.c, v.c2.isPrep> of {
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject
vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
** { c1 = v.c2 ** {c = c} }
let vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
** { c1 = subjPrep v.c2 }
in insertExtrapos (bindComma ++ conjThat ++ s.s ! Sub) vp ;
PassV2V v vp =
let
inf = mkInf v.isAux Simul Pos vp ; -- ok for v.isAux=False, v.c2.c=Acc
c = case <v.c2.c, v.c2.isPrep> of { -- v.objCtrl=True HL 3/22
<NPC Acc, False> => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject
let -- ok for v.isAux=False,
inf = mkInf v.isAux Simul Pos vp ; -- v.c2.c=Acc, v.objCtrl=True HL 3/22
vp2 = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass)
** { c1 = v.c2 ** {c = c} } ;
** { c1 = subjPrep v.c2 } ;
in insertInf inf vp2 ; -- v=lassen needs in-place inf instead
PassVPSlash vp =
let c = case <vp.c2.c,vp.c2.isPrep> of {
<NPC Acc, False> => NPC Nom ; _ => vp.c2.c} ;
ctrl = case vp.objCtrl of { True => False ; _ => True } -- always False?
in -- insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass ** {c1 = vp.c2 ** {c = c}})
insertObj (\\_ => vp.s.s ! (VPastPart APred))
(predV werdenPass ** {nn = vp.nn ; c1 = vp.c2 ** {c = c}})
** {ext = vp.ext ; inf = vp.inf ; c2 =vp.c2 ; objCtrl = ctrl } ; -- c2 ?
-- Scharolta: passivised object: acc object -> nom subject; all others: same case/prep
PassVPSlash vp = -- less correct in ExtraGer.gf with inserting
let -- (\\_ => (PastPartAP vp).s ! APred)
ctrl = case vp.objCtrl of { True => False ; _ => True } -- always False?
in
insertObj (\\_ => vp.a2 ++ vp.adj ++ vp.s.s ! (VPastPart APred))
(predV werdenPass ** {nn = vp.nn ; c1 = subjPrep vp.c2})
** {ext = vp.ext ; inf = vp.inf ; c2 = vp.c2 ; objCtrl = ctrl } ; -- c2 ?
-- HL: does not work for vp = (Slash2V3 v np): uns wird *den Beweis erklärt
-- 3/22 works for vp = (SlashV2V v2v reflVP): wir werden gebeten, uns zu waschen
PastPartAP vp = {
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++
(vp.nn ! agrP3 Sg).p3 ++ (vp.nn ! agrP3 Sg).p4 ++ vp.adj ++ vp.a2
++ vp.inf.inpl.p2 ++ vp.s.s ! VPastPart af ;
isPre = True ;
@@ -164,29 +159,49 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa
} ;
lin
SlashVP np vp =
let subj = mkSubj np vp.c1
in mkClSlash subj.p1 subj.p2 vp ** { c2 = vp.c2 } ;
RelSlash rp cls = lin RCl {
s = \\m,t,a,p,gn =>
appPrep cls.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++
cls.s ! m ! t ! a ! p ! Sub ! gn ;
appPrepC cls.c2 (rp.s ! gn) ++
cls.s ! m ! t ! a ! p ! Sub ! gn ;
c = (prepC cls.c2.c).c
} ;
{-
QuestSlash ip slash = {
QuestSlash ip slash = let gn : GenNum = case ip.n of {Sg => GSg Masc ; _ => GPl} in {
s = \\m,t,a,p =>
let
cls = slash.s ! m ! t ! a ! p ;
who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ;
who = appPrepC slash.c2 ip.s ;
in table {
QDir => who ++ cls ! Inv ;
QIndir => who ++ cls ! Sub
QDir => who ++ cls ! Inv ! (RGenNum gn);
QIndir => who ++ cls ! Sub ! (RGenNum gn)
}
} ;
-}
AdvSlash slash adv = {
s = \\m,t,a,b,o,gn => slash.s ! m ! t ! a ! b ! o ! gn ++ adv.s ;
c2 = slash.c2
} ;
SlashPrep cl prep = {
s = \\m,t,a,p,o,gn => cl.s ! m ! t ! a ! p ! o ;
c2 = prep
} ;
SlashVS np vs slash =
let subj = mkSubj np PrepNom ;
vps = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)
** {c2 = slash.c2 ; objCtrl = False} -- default objCtrl guessed
in mkClSlash subj.p1 subj.p2 vps ;
UseSlash t p cl = {
s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o ! RSentence ;
c2 = cl.c2
} ;
oper
gnToAgr : RelGenNum -> Agr = \gn ->

View File

@@ -59,5 +59,7 @@ lin
warnen_V2V = defaultV2V (regV "warn") ; -- typ=VVInf
versprechen_dat_V2V = defaultV2V (regV "promise") ; -- typ=VVInf
lassen_V2V = ParadigmsEng.mkV2V (I.let_V) ; -- typ=VVAux
-- aci verb:
sehen_V2V = mkV2V (I.see_V) ;
hoeren_V2V = mkV2V (I.hear_V) ;
}

View File

@@ -69,5 +69,7 @@ lin
-- subject control verb:
versprechen_dat_V2V = subjV2V (mkV2V (irregV "versprechen" "verspricht"
"versprach" "verspräche" "versprochen") datPrep) ;
-- aci verb:
sehen_V2V = auxV2V (irregV "sehen" "sieht" "sah" "sähe" "gesehen") accPrep ;
hoeren_V2V = auxV2V (regV "hören") accPrep ;
}

View File

@@ -33,6 +33,9 @@ fun
warnen_V2V : V2V ; -- -aux, object control
versprechen_dat_V2V : V2V ; -- -aux, subject control
lassen_V2V : V2V ; -- +aux(inf), object control
-- aci verb: -- +aux(inf), object control
sehen_V2V : V2V ;
hoeren_V2V : V2V ;
cat
V4 ;

View File

@@ -193,3 +193,14 @@ DetCN (DetQuant DefArt NumSg) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) P
PredVP (UsePN john_PN) (ComplVS say_VS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron we_Pron) (ComplVV want_VV (ComplSlash (SlashV2V lassen_V2V (ComplSlash (SlashV2V helfen_V2V (ComplSlash (SlashV2A paint_V2A (PositA blue_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N)))) (UsePron he_Pron))) (DetCN (DetQuant DefArt NumPl) (UseN child_N)))))))
-- aci
PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2V sehen_V2V (UseV sleep_V)) (DetCN (DetQuant DefArt NumSg) (UseN dog_N)))))) NoVoc
PredVP (UsePron we_Pron) (ComplSlash (SlashV2VNP hoeren_V2V (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (Slash2V3 talk_V3 (UsePron he_Pron))) (DetCN (DetQuant (PossPron they_Pron) NumPl) (UseN wife_N)))
PredVP (UsePron we_Pron) (ComplSlash (SlashV2V hoeren_V2V (ComplSlash (Slash2V3 talk_V3 (UsePron he_Pron)) (DetCN (DetQuant (PossPron they_Pron) NumPl) (UseN wife_N)))) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))
PredVP (UsePron we_Pron) (ComplSlash (SlashV2V hoeren_V2V (ComplSlash (Slash3V3 talk_V3 (DetCN (DetQuant (PossPron they_Pron) NumPl) (UseN wife_N))) (UsePron he_Pron))) (DetCN (DetQuant DefArt NumPl) (UseN man_N)))