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
vfin : VForm -> Str = \f ->
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 (VPresSubj n p)))
++ 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
s = \\a,c => let n = case pred.a of {PAg n => n ; _ => numberAgr 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 {
True => pred.s ! Pl ! Masc ! (NPC c) ++ "von" ++ rnp.s ! a ! Dat ;
_ => pred.s ! n ! genderAgr a ! (NPC c) ++ pred.c.p ++ rnp.s ! a ! d} ;
True => pred.s ! Pl ! Masc ! c ++ "von" ++ rnp.s ! a ! Dat ;
_ => pred.s ! n ! genderAgr a ! c ++ pred.c.p ++ rnp.s ! a ! d} ;
ext = rnp.ext ; rc = rnp.rc ;
isPron = False} ;
-- 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)
++ appPrepC prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ;
AdvRNP np prep rnp = {s = \\a,c => np.s ! False ! c
++ appPrep prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ;
ext = np.ext ; rc = np.rc ; isPron = False} ;
AdvRAP ap prep rnp =
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
ReflA2RNP adj rnp = -- would need AP.c : Agr => Str*Str, not AP.c : Str*Str
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 {
s = adj.s ! Posit ;
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
} ;
PossPronRNP pron num cn rnp =
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 ;
w = WLight ;
ext = rnp.ext ;
@@ -253,11 +253,11 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
** {isPron = False ; ext,rc = []} ;
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_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! (NPC c) ++ y.ext ++ y.rc} ;
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 ! False ! c ++ y.ext ++ y.rc} ;
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
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
\vp,rnp -> -- generalize ResGer.insertObjRefl
let prep = vp.c2 ;
c = case prep.c of { NPC cc => cc ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ?
obj : Agr => Str = \\a => prep.s ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc
c = case prep.isPrep of { isCase => prep.c ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ?
obj : Agr => Str = \\a => prep.s ! GPl ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc
in vp ** {
nn = \\a =>
let vpnn = vp.nn ! a in
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:
<False,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
<True,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
<isCase,True,Acc> => <obj ! a ++ vpnn.p1, vpnn.p2, vpnn.p3, vpnn.p4> ; -- pronoun switch:
<isCase,True,_> => <vpnn.p1 ++ obj ! a, vpnn.p2, vpnn.p3, vpnn.p4> ; -- accPron < pron
<isCase,False,_> => <vpnn.p1, vpnn.p2 ++ obj ! a, vpnn.p3, vpnn.p4> ; -- < non-pron nominal
<_,_,_> => <vpnn.p1, vpnn.p2, vpnn.p3 ++ obj ! a, vpnn.p4> } -- or prepositional
} ;
-- 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 {
lin GivenName gn = {
s = \\c => usePrepC c (\k -> gn.s ! k) ;
s = \\_,c => gn.s ! c ;
a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ;
rc, ext = []
} ;
lin MaleSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ;
s = \\_,c => sn.s ! Male ! c ;
a = agrgP3 Masc Sg ;
w = WLight ;
rc, ext = []
} ;
lin FemaleSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Female ! k) ;
s = \\_,c => sn.s ! Female ! c ;
a = agrgP3 Fem Sg ;
w = WLight ;
rc, ext = []
} ;
lin PlSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ;
s = \\_,c => sn.s ! Male ! c ;
a = agrgP3 Masc Pl ;
w = WLight ;
rc, ext = []
} ;
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 ;
w = WLight ;
rc, ext = []

View File

@@ -266,7 +266,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
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 ;
w = WLight ;
rc = "" ;
@@ -274,7 +274,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
} ;
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 ;
w = WLight ;
rc = "" ;

View File

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

View File

@@ -234,7 +234,7 @@ resource ResGer = ParamX ** open Prelude in {
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 ...]
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 =
\Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> {
@@ -466,7 +466,7 @@ resource ResGer = ParamX ** open Prelude in {
subjPrep : Preposition -> Preposition = \prep ->
case <prep.c,prep.isPrep> of {
<NPC Acc,False> => prep ** {c = NPC Nom} ;
<Acc,isCase> => prep ** {c = Nom} ;
_ => prep
} ;

View File

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