forked from GitHub/gf-rgl
(Dut) make APs depend on agreement -- needed for reflexives
This commit is contained in:
@@ -7,50 +7,52 @@ concrete AdjectiveDut of Adjective = CatDut ** open ResDut, Prelude in
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
PositA a = {
|
PositA a = {
|
||||||
s = a.s ! Posit ;
|
s = \\agr => a.s ! Posit ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
ComparA a np = {
|
ComparA a np = {
|
||||||
s = \\af => a.s ! Compar ! af ++ "dan" ++ np.s ! NPNom ;
|
s = \\agr,af => a.s ! Compar ! af ++ "dan" ++ np.s ! NPNom ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
CAdvAP ad ap np = {
|
CAdvAP ad ap np = {
|
||||||
s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ np.s ! NPNom ;
|
s = \\agr,af => ad.s ++ ap.s ! agr ! af ++ ad.p ++ np.s ! NPNom ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
UseComparA a = {
|
UseComparA a = {
|
||||||
s = \\af => a.s ! Compar ! af ;
|
s = \\agr => a.s ! Compar ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
AdjOrd a = {
|
AdjOrd a = {
|
||||||
s = a.s ;
|
s = \\agr => a.s ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||||
|
|
||||||
ComplA2 a np = {
|
ComplA2 a np = {
|
||||||
s = \\af => a.s ! Posit ! af ++ appPrep a.c2 np ;
|
s = \\agr,af => a.s ! Posit ! af ++ appPrep a.c2 np ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflA2 a = {
|
ReflA2 a = {
|
||||||
s = \\af => a.s ! Posit ! APred ++ appPrep a.c2 (npLite (\\_ => reflPron ! agrP3 Sg)) ; --- agr
|
s = \\agr,af => a.s ! Posit ! APred ++
|
||||||
|
appPrep a.c2 (npLite (\\_ => reflPron ! agr)) ;
|
||||||
|
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SentAP ap sc = {
|
SentAP ap sc = {
|
||||||
s = \\a => ap.s ! a ++ sc.s ;
|
s = \\agr,af => ap.s ! agr ! af ++ sc.s ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdAP ada ap = {
|
AdAP ada ap = {
|
||||||
s = \\a => ada.s ++ ap.s ! a ;
|
s = \\agr,af => ada.s ++ ap.s ! agr ! af ;
|
||||||
isPre = ap.isPre
|
isPre = ap.isPre
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UseA2 a = {
|
UseA2 a = {
|
||||||
s = a.s ! Posit ;
|
s = \\agr => a.s ! Posit ;
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ concrete CatDut of Cat =
|
|||||||
|
|
||||||
-- Adjective
|
-- Adjective
|
||||||
|
|
||||||
AP = {s : AForm => Str ; isPre : Bool} ;
|
AP = {s : Agr => AForm => Str ; isPre : Bool} ;
|
||||||
|
|
||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ concrete ConjunctionDut of Conjunction =
|
|||||||
a = {g = Utr ; n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
a = {g = Utr ; n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
ConjAP conj ss = conjunctDistrTable AForm conj ss ** {
|
ConjAP conj ss = conjunctDistrTable2 Agr AForm conj ss ** {
|
||||||
isPre = ss.isPre
|
isPre = ss.isPre
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -27,8 +27,8 @@ concrete ConjunctionDut of Conjunction =
|
|||||||
ConsAdv = consrSS comma ;
|
ConsAdv = consrSS comma ;
|
||||||
BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ;
|
BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ;
|
||||||
ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ;
|
ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||||
BaseAP x y = twoTable AForm x y ** {isPre = andB x.isPre y.isPre} ;
|
BaseAP x y = twoTable2 Agr AForm x y ** {isPre = andB x.isPre y.isPre} ;
|
||||||
ConsAP xs x = consrTable AForm comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
ConsAP xs x = consrTable2 Agr AForm comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||||
BaseRS x y = twoTable2 Gender Number x y ** {c = y.c} ;
|
BaseRS x y = twoTable2 Gender Number x y ** {c = y.c} ;
|
||||||
ConsRS xs x = consrTable2 Gender Number comma xs x ;
|
ConsRS xs x = consrTable2 Gender Number comma xs x ;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ concrete ConjunctionDut of Conjunction =
|
|||||||
[S] = {s1,s2 : Order => Str} ;
|
[S] = {s1,s2 : Order => Str} ;
|
||||||
[Adv] = {s1,s2 : Str} ;
|
[Adv] = {s1,s2 : Str} ;
|
||||||
[NP] = {s1,s2 : NPCase => Str ; a : Agr} ;
|
[NP] = {s1,s2 : NPCase => Str ; a : Agr} ;
|
||||||
[AP] = {s1,s2 : AForm => Str ; isPre : Bool} ;
|
[AP] = {s1,s2 : Agr => AForm => Str ; isPre : Bool} ;
|
||||||
[RS] = {s1,s2 : Gender => Number => Str} ;
|
[RS] = {s1,s2 : Gender => Number => Str} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ concrete ExtraDut of ExtraDutAbs = CatDut **
|
|||||||
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ICompAP ap = {s = \\_ => "hoe" ++ ap.s ! APred} ;
|
ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ;
|
||||||
|
|
||||||
IAdvAdv adv = {s = "hoe" ++ adv.s} ;
|
IAdvAdv adv = {s = "hoe" ++ adv.s} ;
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
|
|
||||||
PPartNP np v2 = np ** heavyNP {
|
PPartNP np v2 = np ** heavyNP {
|
||||||
s = \\c => np.s ! c ++ v2.s ! VPerf ; -- invar part
|
s = \\c => np.s ! c ++ v2.s ! VPerf ; -- invar part
|
||||||
a = np.a
|
a = np.a ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvNP np adv = np ** heavyNP {
|
AdvNP np adv = np ** heavyNP {
|
||||||
@@ -163,7 +163,7 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
in {
|
in {
|
||||||
s = \\a,n =>
|
s = \\a,n =>
|
||||||
preOrPost ap.isPre
|
preOrPost ap.isPre
|
||||||
(ap.s ! agrAdj g a n)
|
(ap.s ! agrP3 Sg ! agrAdj g a n)
|
||||||
(cn.s ! a ! n) ;
|
(cn.s ! a ! n) ;
|
||||||
g = g
|
g = g
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ concrete PhraseDut of Phrase = CatDut ** open Prelude, ResDut in
|
|||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
UttCN n = {s = n.s ! Strong ! NF Sg Nom} ;
|
UttCN n = {s = n.s ! Strong ! NF Sg Nom} ;
|
||||||
UttCard n = {s = n.s ! Utr ! Nom} ;
|
UttCard n = {s = n.s ! Utr ! Nom} ;
|
||||||
UttAP ap = {s = ap.s ! APred} ;
|
UttAP ap = {s = ap.s ! agrP3 Sg ! APred} ;
|
||||||
|
|
||||||
UttInterj i = i ;
|
UttInterj i = i ;
|
||||||
UttAdV a = a ;
|
UttAdV a = a ;
|
||||||
|
|||||||
@@ -479,11 +479,16 @@ param
|
|||||||
|
|
||||||
--2 Transformations between parameter types
|
--2 Transformations between parameter types
|
||||||
|
|
||||||
oper Agr : Type = {g : Gender ; n : Number ; p : Person} ;
|
-- IL2018-02: a whole lot of times we only need number and person, not gender
|
||||||
|
-- maybe switch to PersAgr at some point and halve the number of fields
|
||||||
|
oper PersAgr : Type = {n : Number ; p : Person} ;
|
||||||
|
oper Agr : Type = PersAgr ** {g : Gender} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
agrP3 : Number -> Agr = agrgP3 Neutr ;
|
pagr : Agr -> PersAgr = \agr -> { p = agr.p ; n = agr.n } ;
|
||||||
|
pagrP3 : Number -> PersAgr = \num -> {p = P3; n = num } ;
|
||||||
|
|
||||||
|
agrP3 : Number -> Agr = agrgP3 Neutr ;
|
||||||
agrgP3 : Gender -> Number -> Agr = \g,n ->
|
agrgP3 : Gender -> Number -> Agr = \g,n ->
|
||||||
{g = g ; n = n ; p = P3} ;
|
{g = g ; n = n ; p = P3} ;
|
||||||
|
|
||||||
@@ -677,12 +682,12 @@ param
|
|||||||
vpi.p1 ! agrP3 Sg ++ vpi.p2 ++ vpi.p3 ; -- TODO
|
vpi.p1 ! agrP3 Sg ++ vpi.p2 ++ vpi.p3 ; -- TODO
|
||||||
|
|
||||||
reflPron : Agr => Str = table {
|
reflPron : Agr => Str = table {
|
||||||
{n = Sg ; p = P1} => "me" ;
|
{n = Sg ; p = P1} => "mijzelf" ;
|
||||||
{n = Sg ; p = P2} => "je" ;
|
{n = Sg ; p = P2} => "jezelf" ;
|
||||||
{n = Sg ; p = P3} => "zich" ;
|
{n = Sg ; p = P3} => "zichzelf" ;
|
||||||
{n = Pl ; p = P1} => "ons" ;
|
{n = Pl ; p = P1} => "onszelf" ;
|
||||||
{n = Pl ; p = P2} => "je" ;
|
{n = Pl ; p = P2} => "jezelf" ;
|
||||||
{n = Pl ; p = P3} => "zich"
|
{n = Pl ; p = P3} => "zichzelf"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
conjThat : Str = "dat" ;
|
conjThat : Str = "dat" ;
|
||||||
@@ -749,6 +754,6 @@ param
|
|||||||
|
|
||||||
heavyNP :
|
heavyNP :
|
||||||
{s : NPCase => Str ; a : Agr} -> {s : NPCase => Str ; a : Agr ; isPron : Bool} = \np ->
|
{s : NPCase => Str ; a : Agr} -> {s : NPCase => Str ; a : Agr ; isPron : Bool} = \np ->
|
||||||
np ** {isPron = False} ;
|
np ** {isPron = False ; mergesWithPrep = False ; mergeForm = [] } ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ;
|
insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ;
|
||||||
ComplVQ v q =
|
ComplVQ v q =
|
||||||
insertExtrapos (q.s ! QIndir) (predV v) ;
|
insertExtrapos (q.s ! QIndir) (predV v) ;
|
||||||
ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predVGen False BetweenObjs v) ;
|
ComplVA v ap =
|
||||||
|
insertObj (\\agr => ap.s ! agr ! APred) (predVGen False BetweenObjs v) ;
|
||||||
|
|
||||||
SlashV2a v = predV (v2v v) ** {c2 = v.c2} ;
|
SlashV2a v = predV (v2v v) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
@@ -43,13 +44,12 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
insertExtrapos vpi.p3 (
|
insertExtrapos vpi.p3 (
|
||||||
insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObj vpi.p1 ((predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
|
insertObj vpi.p1 ((predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
SlashV2A v ap =
|
SlashV2A v ap =
|
||||||
insertObj (\\_ => ap.s ! APred) (predVGen False BetweenObjs (v2v v)) ** {c2 = v.c2} ;
|
insertObj (\\agr => ap.s ! agr ! APred)
|
||||||
|
(predVGen False BetweenObjs (v2v v)) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
--vp.c2.p2: if the verb has a preposition or not
|
--vp.c2.p2: if the verb has a preposition or not
|
||||||
ComplSlash vp np = insertObjNP np.isPron (case vp.c2.p2 of {True => BeforeObjs; False => vp.negPos}) (\\_ => appPrep vp.c2.p1 np) vp ;
|
ComplSlash vp np = insertObjNP np.isPron (case vp.c2.p2 of {True => BeforeObjs; False => vp.negPos}) (\\_ => appPrep vp.c2.p1 np) vp ;
|
||||||
|
|
||||||
SlashVV v vp =
|
SlashVV v vp =
|
||||||
let
|
let
|
||||||
vpi = infVP v.isAux vp
|
vpi = infVP v.isAux vp
|
||||||
@@ -78,7 +78,7 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
CompCN cn = {s = \\a => case a.n of {
|
CompCN cn = {s = \\a => case a.n of {
|
||||||
Sg => "een" ++ cn.s ! Strong ! NF Sg Nom ;
|
Sg => "een" ++ cn.s ! Strong ! NF Sg Nom ;
|
||||||
Pl => cn.s ! Strong ! NF Pl Nom }} ;
|
Pl => cn.s ! Strong ! NF Pl Nom }} ;
|
||||||
CompAP ap = {s = \\_ => ap.s ! APred} ;
|
CompAP ap = {s = \\agr => ap.s ! agr ! APred} ; -- agr needed for reflexives: "married to my/your/...self"
|
||||||
CompNP np = {s = \\_ => np.s ! NPNom} ;
|
CompNP np = {s = \\_ => np.s ! NPNom} ;
|
||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
@@ -95,10 +95,10 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
|
|
||||||
VPSlashPrep vp prep = vp ** {c2 = <prep,True>} ;
|
VPSlashPrep vp prep = vp ** {c2 = <prep,True>} ;
|
||||||
|
|
||||||
|
|
||||||
---- workaround for a subtyping bug
|
---- workaround for a subtyping bug
|
||||||
oper
|
oper
|
||||||
v2v : VVerb -> VVerb = \v ->
|
v2v : VVerb -> VVerb = \v ->
|
||||||
{s = v.s ; aux = v.aux ; prefix = v.prefix ; particle = v.particle ; vtype = v.vtype} ;
|
{s = v.s ; aux = v.aux ; prefix = v.prefix ; particle = v.particle ; vtype = v.vtype} ;
|
||||||
predVv : VVerb -> ResDut.VP = \v -> predV (v2v v) ;
|
predVv : VVerb -> ResDut.VP = \v -> predV (v2v v) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user