1
0
forked from GitHub/gf-rgl

Conflicts with preposition and defart resolved

This commit is contained in:
Hans Leiss
2023-08-05 18:01:03 +02:00
parent c659270fcc
commit e2ce9de503
7 changed files with 41 additions and 38 deletions

View File

@@ -163,7 +163,7 @@ oper
let let
vfin : VForm -> Str = \f -> vfin : VForm -> Str = \f ->
verb.s ! f ++ verb.prefix ; verb.s ! f ++ verb.prefix ;
gforms : Number -> Person -> Str = \n,p -> gforms : ParadigmsGer.Number -> Person -> Str = \n,p ->
td (vfin (VFin False (VPresInd n p))) ++ td (vfin (VFin False (VPresInd n p))) ++
td (vfin (VFin False (VPresSubj n p))) td (vfin (VFin False (VPresSubj n p)))
++ td (vfin (VFin False (VImpfInd n p))) --# notpresent ++ td (vfin (VFin False (VImpfInd n p))) --# notpresent

View File

@@ -210,36 +210,36 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
PredetRNP pred rnp = rnp ** { -- HL 5/2022 PredetRNP pred rnp = rnp ** { -- HL 5/2022
s = \\a,c => let n = case pred.a of {PAg n => n ; _ => numberAgr a} ; s = \\a,c => let n = case pred.a of {PAg n => n ; _ => numberAgr a} ;
g = genderAgr a ; g = genderAgr a ;
d = case pred.c.k of {NoCase => c ; PredCase k => (prepC k).c} ; d = case pred.c.k of {NoCase => c ; PredCase k => k} ;
in case rnp.isPron of { in case rnp.isPron of {
True => pred.s ! Pl ! Masc ! (NPC c) ++ "von" ++ rnp.s ! a ! Dat ; True => pred.s ! Pl ! Masc ! c ++ "von" ++ rnp.s ! a ! Dat ;
_ => pred.s ! n ! genderAgr a ! (NPC c) ++ pred.c.p ++ rnp.s ! a ! d} ; _ => pred.s ! n ! genderAgr a ! c ++ pred.c.p ++ rnp.s ! a ! d} ;
ext = rnp.ext ; rc = rnp.rc ; ext = rnp.ext ; rc = rnp.rc ;
isPron = False} ; isPron = False} ;
-- ok: alle von uns; die meisten von uns ; wrong: *nur von uns =/= nur wir -- ok: alle von uns; die meisten von uns ; wrong: *nur von uns =/= nur wir
AdvRNP np prep rnp = {s = \\a,c => np.s ! (NPC c) AdvRNP np prep rnp = {s = \\a,c => np.s ! False ! c
++ appPrepC prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ; ++ appPrep prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ;
ext = np.ext ; rc = np.rc ; isPron = False} ; ext = np.ext ; rc = np.rc ; isPron = False} ;
AdvRAP ap prep rnp = AdvRAP ap prep rnp =
let -- ? adv ++ ap.s ! af let -- ? adv ++ ap.s ! af
adv = appPrepC prep (rnp.s ! agrP3 Sg) ; -- bug: fixed agreement adv = appPrep prep (rnp.s ! agrP3 Sg) ; -- bug: fixed agreement
in ap ** { s = \\af => ap.s ! af ++ adv } ; -- e.g. unknown in one's youth in ap ** { s = \\af => ap.s ! af ++ adv } ; -- e.g. unknown in one's youth
ReflA2RNP adj rnp = -- would need AP.c : Agr => Str*Str, not AP.c : Str*Str ReflA2RNP adj rnp = -- would need AP.c : Agr => Str*Str, not AP.c : Str*Str
let -- as we have no reflexive AP, let -- as we have no reflexive AP,
compl = appPrepC adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
in { in {
s = adj.s ! Posit ; s = adj.s ! Posit ;
isPre = True ; isPre = True ;
c = case adj.c2.isPrep of {False => <compl, []> ; True => <[], compl>} ; c = case adj.c2.isPrep of {isCase => <compl, []> ; _ => <[], compl>} ;
ext = rnp.ext ++ rnp.rc ext = rnp.ext ++ rnp.rc
} ; } ;
PossPronRNP pron num cn rnp = PossPronRNP pron num cn rnp =
N.DetCN (N.DetQuant (N.PossPron pron) num) N.DetCN (N.DetQuant (N.PossPron pron) num)
(N.PossNP cn (lin NP {s = \\pc => usePrepC pc (\c -> rnp.s ! pron.a ! c) ; (N.PossNP cn (lin NP {s = \\_,c => rnp.s ! pron.a ! c ;
a = pron.a ; a = pron.a ;
w = WLight ; w = WLight ;
ext = rnp.ext ; ext = rnp.ext ;
@@ -253,11 +253,11 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
** {isPron = False ; ext,rc = []} ; ** {isPron = False ; ext,rc = []} ;
Base_rr_RNP x y = twoTable2 Agr Case x y ; Base_rr_RNP x y = twoTable2 Agr Case x y ;
Base_nr_RNP x y = twoTable2 Agr Case {s = \\_,c => x.s ! (NPC c) ++ x.ext ++ x.rc} y ; Base_nr_RNP x y = twoTable2 Agr Case {s = \\_,c => x.s ! False ! c ++ x.ext ++ x.rc} y ;
Base_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! (NPC c) ++ y.ext ++ y.rc} ; Base_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! False ! c ++ y.ext ++ y.rc} ;
Cons_rr_RNP x xs = consrTable2 Agr Case comma x xs ; Cons_rr_RNP x xs = consrTable2 Agr Case comma x xs ;
Cons_nr_RNP x xs = consrTable2 Agr Case comma {s = \\_,c => x.s ! (NPC c) ++ x.ext ++ x.rc} xs ; Cons_nr_RNP x xs = consrTable2 Agr Case comma {s = \\_,c => x.s ! False ! c ++ x.ext ++ x.rc} xs ;
oper oper
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ; reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ;
@@ -269,16 +269,16 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
insertObjReflNP : ResGer.VPSlash -> RNP -> ResGer.VP = -- HL 5/2022 insertObjReflNP : ResGer.VPSlash -> RNP -> ResGer.VP = -- HL 5/2022
\vp,rnp -> -- generalize ResGer.insertObjRefl \vp,rnp -> -- generalize ResGer.insertObjRefl
let prep = vp.c2 ; let prep = vp.c2 ;
c = case prep.c of { NPC cc => cc ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ? c = case prep.isPrep of { isCase => prep.c ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ?
obj : Agr => Str = \\a => prep.s ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc obj : Agr => Str = \\a => prep.s ! GPl ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc
in vp ** { in vp ** {
nn = \\a => nn = \\a =>
let vpnn = vp.nn ! a in let vpnn = vp.nn ! a in
case <prep.isPrep, rnp.isPron, c> of { -- consider non-pron rnp as light, add to vpnn.p2 case <prep.isPrep, rnp.isPron, c> of { -- consider non-pron rnp as light, add to vpnn.p2
<False,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch: <isCase,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
<False,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron <isCase,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
<False,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal <isCase,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
<True,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional <_,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
} ; } ;
-- SS: implementation of some of the relevant Foc rules from Extra -- SS: implementation of some of the relevant Foc rules from Extra

View File

@@ -1,35 +1,35 @@
concrete NamesGer of Names = CatGer ** open ResGer in { concrete NamesGer of Names = CatGer ** open ResGer in {
lin GivenName gn = { lin GivenName gn = {
s = \\c => usePrepC c (\k -> gn.s ! k) ; s = \\_,c => gn.s ! c ;
a = agrgP3 (sex2gender gn.g) Sg ; a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []
} ; } ;
lin MaleSurname sn = { lin MaleSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ; s = \\_,c => sn.s ! Male ! c ;
a = agrgP3 Masc Sg ; a = agrgP3 Masc Sg ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []
} ; } ;
lin FemaleSurname sn = { lin FemaleSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Female ! k) ; s = \\_,c => sn.s ! Female ! c ;
a = agrgP3 Fem Sg ; a = agrgP3 Fem Sg ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []
} ; } ;
lin PlSurname sn = { lin PlSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ; s = \\_,c => sn.s ! Male ! c ;
a = agrgP3 Masc Pl ; a = agrgP3 Masc Pl ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []
} ; } ;
lin FullName gn sn = { lin FullName gn sn = {
s = \\c => usePrepC c (\k -> gn.s ! Nom ++ sn.s ! gn.g ! k) ; s = \\_,c => gn.s ! Nom ++ sn.s ! gn.g ! c ;
a = agrgP3 (sex2gender gn.g) Sg ; a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []

View File

@@ -266,7 +266,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
QuantityNP dig m = { QuantityNP dig m = {
s = \\c => preOrPost m.isPre m.s (dig.s ! invNum) ; s = \\_,c => preOrPost m.isPre m.s (dig.s ! invNum) ;
a = agrP3 Pl ; a = agrP3 Pl ;
w = WLight ; w = WLight ;
rc = "" ; rc = "" ;
@@ -274,7 +274,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ; } ;
QuantityFloatNP dig1 dig2 m = { QuantityFloatNP dig1 dig2 m = {
s = \\c => preOrPost m.isPre m.s (dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! invNum) ; s = \\_,c => preOrPost m.isPre m.s (dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! invNum) ;
a = agrP3 Pl ; a = agrP3 Pl ;
w = WLight ; w = WLight ;
rc = "" ; rc = "" ;

View File

@@ -382,16 +382,20 @@ mkV2 : overload {
-- The definitions should not bother the user of the API. So they are -- The definitions should not bother the user of the API. So they are
-- hidden from the document. -- hidden from the document.
Gender = MorphoGer.Gender ; Gender = MorphoGer.Gender ;
Case = MorphoGer.Case ; Case = MorphoGer.Case ;
Number = MorphoGer.Number ; Number = MorphoGer.Number ;
masculine = Masc ; masculine = Masc ;
feminine = Fem ; feminine = Fem ;
neuter = Neutr ; neuter = Neutr ;
male = Male ; male = Male ;
female = Female ; female = Female ;
nominative = Nom ;
accusative = Acc ;
dative = Dat ;
genitive = Gen ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;

View File

@@ -234,7 +234,7 @@ resource ResGer = ParamX ** open Prelude in {
rc : Str ; -- die Frage , [rc die ich gestellt habe] rc : Str ; -- die Frage , [rc die ich gestellt habe]
ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...] ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...]
a : Agr ; a : Agr ;
w : Weight } ; -- light NPs come before negation in simple clauses (expensive) w : Weight } ; -- light NPs come before negation in simple clauses
mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun = mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun =
\Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> { \Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> {
@@ -466,7 +466,7 @@ resource ResGer = ParamX ** open Prelude in {
subjPrep : Preposition -> Preposition = \prep -> subjPrep : Preposition -> Preposition = \prep ->
case <prep.c,prep.isPrep> of { case <prep.c,prep.isPrep> of {
<NPC Acc,False> => prep ** {c = NPC Nom} ; <Acc,isCase> => prep ** {c = Nom} ;
_ => prep _ => prep
} ; } ;

View File

@@ -61,11 +61,10 @@ concrete StructuralGer of Structural = CatGer **
more_CAdv = X.mkCAdv "mehr" "als" ; more_CAdv = X.mkCAdv "mehr" "als" ;
most_Predet = { -- HL 5/2022 most_Predet = { -- HL 5/2022
s = \\n,g,c => let gn = R.gennum g n ; s = \\n,g,c => let gn = R.gennum g n ;
k = (R.prepC c).c ;
adj = (P.mkA "viel" "mehr" "meiste").s ! Superl adj = (P.mkA "viel" "mehr" "meiste").s ! Superl
in in
R.usePrepC c (\k -> R.artDef ! gn ! k ++ adj ! (agrAdj g Weak n k)) ; R.artDef ! gn ! c ++ adj ! (agrAdj g Weak n c) ;
c = {p = [] ; k = PredCase (NPC Gen)} ; c = {p = [] ; k = PredCase Gen} ;
a = PAg Pl} ; a = PAg Pl} ;
much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ; much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ;
n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ; n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ;
@@ -178,7 +177,7 @@ concrete StructuralGer of Structural = CatGer **
pairTable : (Gender => Case => Str) -> (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) pairTable : (Gender => Case => Str) -> (Gender => Case => Str) -> (Gender => Case => {quant,num:Str})
= \qt,nt -> \\g,c => {quant = qt ! g ! c; num = nt ! g ! c} ; = \qt,nt -> \\g,c => {quant = qt ! g ! c; num = nt ! g ! c} ;
appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => PCase => Str = appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str =
\adj,deg,adjf -> \\n,g,c => R.usePrepC c (\k -> adj.s ! deg ! (agrAdj g adjf n k)) ; \adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ;
} }