forked from GitHub/gf-rgl
Implement contraction of certain noun phrases and prepositions, e.g. met + dat -> daarmee
This commit is contained in:
@@ -30,12 +30,12 @@ concrete AdjectiveDut of Adjective = CatDut ** open ResDut, Prelude in
|
|||||||
-- $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 ;
|
s = \\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 (\\_ => reflPron ! agrP3 Sg) ; --- agr
|
s = \\af => a.s ! Posit ! APred ++ appPrep a.c2 (npLite (\\_ => reflPron ! agrP3 Sg)) ; --- agr
|
||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ concrete AdverbDut of Adverb = CatDut ** open ResDut, Prelude in {
|
|||||||
s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub
|
s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepNP prep np = {s = appPrep prep.s np.s} ;
|
PrepNP prep np = {s = appPrep prep np} ;
|
||||||
|
|
||||||
AdAdv = cc2 ;
|
AdAdv = cc2 ;
|
||||||
|
|
||||||
|
|||||||
@@ -44,15 +44,12 @@ concrete CatDut of Cat =
|
|||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
CN = {s : Adjf => NForm => Str ; g : Gender} ;
|
CN = {s : Adjf => NForm => Str ; g : Gender} ;
|
||||||
NP = {s : NPCase => Str ; a : Agr ; isPron : Bool} ;
|
NP = NounPhrase ;
|
||||||
|
|
||||||
Pron = Pronoun ;
|
Pron = Pronoun ;
|
||||||
|
|
||||||
Det = {s,sp : Gender => Str ; n : Number ; a : Adjf} ;
|
Det = Determiner ;
|
||||||
Quant = {
|
Quant = Quantifier ;
|
||||||
s : Bool => Number => Gender => Str ;
|
|
||||||
sp : Number => Gender => Str ;
|
|
||||||
a : Adjf
|
|
||||||
} ;
|
|
||||||
Predet = {s : Number => Gender => Str} ;
|
Predet = {s : Number => Gender => Str} ;
|
||||||
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
Num = {s : Str ; n : Number ; isNum : Bool} ;
|
||||||
Card = {s : Gender => Case => Str ; n : Number} ;
|
Card = {s : Gender => Case => Str ; n : Number} ;
|
||||||
@@ -67,7 +64,7 @@ concrete CatDut of Cat =
|
|||||||
|
|
||||||
Conj = {s1,s2 : Str ; n : Number} ;
|
Conj = {s1,s2 : Str ; n : Number} ;
|
||||||
Subj = {s : Str} ;
|
Subj = {s : Str} ;
|
||||||
Prep = {s : Str} ;
|
Prep = Preposition ;
|
||||||
|
|
||||||
-- Open lexical classes, e.g. Lexicon
|
-- Open lexical classes, e.g. Lexicon
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ concrete ConjunctionDut of Conjunction =
|
|||||||
|
|
||||||
ConjAdv conj ss = conjunctDistrSS conj ss ;
|
ConjAdv conj ss = conjunctDistrSS conj ss ;
|
||||||
|
|
||||||
ConjNP conj ss = heavyNP (conjunctDistrTable NPCase conj ss ** {
|
ConjNP conj ss = noMerge ** heavyNP (conjunctDistrTable NPCase conj ss ** {
|
||||||
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}
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete ExtraDut of ExtraDutAbs = CatDut **
|
concrete ExtraDut of ExtraDutAbs = CatDut **
|
||||||
open ResDut, MorphoDut, Coordination, Prelude, IrregDut, (P = ParadigmsDut) in
|
open ResDut, MorphoDut, Coordination, Prelude, IrregDut, (P = ParadigmsDut), NounDut in
|
||||||
{
|
{
|
||||||
|
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
@@ -117,12 +117,12 @@ lin
|
|||||||
PassVPSlash vps =
|
PassVPSlash vps =
|
||||||
insertInf (vps.s.s ! VPerf) (predV ResDut.worden_V) ;
|
insertInf (vps.s.s ! VPerf) (predV ResDut.worden_V) ;
|
||||||
PassAgentVPSlash vps np =
|
PassAgentVPSlash vps np =
|
||||||
insertAdv (appPrep "door" np.s) (insertInf (vps.s.s ! VPerf) (predV ResDut.worden_V)) ;
|
insertAdv (appPrep (P.mkPrep "door") np) (insertInf (vps.s.s ! VPerf) (predV ResDut.worden_V)) ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
NominalizeVPSlashNP vpslash np =
|
NominalizeVPSlashNP vpslash np =
|
||||||
--False for negation place; doesn't matter because vp.a1 ! Pos is chosen
|
--False for negation place; doesn't matter because vp.a1 ! Pos is chosen
|
||||||
let vp : ResDut.VP = insertObjNP np.isPron AfterObjs (\\_ => appPrep vpslash.c2.p1 np.s) vpslash ;
|
let vp : ResDut.VP = insertObjNP np.isPron AfterObjs (\\_ => appPrep vpslash.c2.p1 np) vpslash ;
|
||||||
agrDef : Agr = agrP3 Sg ;
|
agrDef : Agr = agrP3 Sg ;
|
||||||
compl : Str = vp.n0 ! agrDef ++ vp.a1 ! Pos ++ vp.n2 ! agrDef ++ vp.s.prefix ;
|
compl : Str = vp.n0 ! agrDef ++ vp.a1 ! Pos ++ vp.n2 ! agrDef ++ vp.s.prefix ;
|
||||||
inf : Str = vp.inf.p1 ;
|
inf : Str = vp.inf.p1 ;
|
||||||
@@ -134,10 +134,7 @@ lin
|
|||||||
lin
|
lin
|
||||||
zullen_VV = lin VV (zullen_V ** {isAux = True}) ;
|
zullen_VV = lin VV (zullen_V ** {isAux = True}) ;
|
||||||
|
|
||||||
StressedPron pron = {
|
StressedPron pron = UsePron pron ** {
|
||||||
s = table {NPNom => pron.stressed.nom ; NPAcc => pron.stressed.acc} ;
|
s = table {NPNom => pron.stressed.nom ; NPAcc => pron.stressed.acc} } ;
|
||||||
a = pron.a ;
|
|
||||||
isPron = True
|
|
||||||
} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,43 +3,47 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
DetCN det cn = {
|
DetCN det cn = noMerge ** {
|
||||||
s = \\c => det.s ! cn.g ++ cn.s ! det.a ! NF det.n Nom ;
|
s = \\c => det.s ! cn.g ++ cn.s ! det.a ! NF det.n Nom ;
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n ;
|
||||||
isPron = False
|
isPron = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetNP det = {
|
DetNP det = {
|
||||||
s = \\_ => det.sp ! Neutr ;
|
s = \\_ => det.sp ! Neutr ;
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n ;
|
||||||
isPron = False
|
isPron = False ;
|
||||||
|
mergesWithPrep = det.mergesWithPrep ;
|
||||||
|
mergeForm = det.mergeForm
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
UsePN pn = {s = pn.s ; a = agrP3 Sg ; isPron = False} ;
|
UsePN pn = noMerge ** {s = pn.s ; a = agrP3 Sg ; isPron = False} ;
|
||||||
|
|
||||||
UsePron pron = {
|
UsePron pron = {
|
||||||
s = table {NPNom => pron.unstressed.nom ; NPAcc => pron.unstressed.acc} ;
|
s = table {NPNom => pron.unstressed.nom ; NPAcc => pron.unstressed.acc} ;
|
||||||
a = pron.a ;
|
a = pron.a ;
|
||||||
isPron = True
|
isPron = True ;
|
||||||
|
mergesWithPrep = pron.mergesWithPrep ;
|
||||||
|
mergeForm = pron.mergeForm
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PredetNP pred np = heavyNP {
|
PredetNP pred np = np ** heavyNP {
|
||||||
s = \\c =>
|
s = \\c =>
|
||||||
pred.s ! np.a.n ! np.a.g ++ np.s ! c ; ---- g
|
pred.s ! np.a.n ! np.a.g ++ np.s ! c ; ---- g
|
||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PPartNP np v2 = 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 = heavyNP {
|
AdvNP np adv = np ** heavyNP {
|
||||||
s = \\c => np.s ! c ++ adv.s ;
|
s = \\c => np.s ! c ++ adv.s ;
|
||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ExtAdvNP np adv = heavyNP {
|
ExtAdvNP np adv = np ** heavyNP {
|
||||||
s = \\c => np.s ! c ++ embedInCommas adv.s ;
|
s = \\c => np.s ! c ++ embedInCommas adv.s ;
|
||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
@@ -54,7 +58,9 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
sp = \\g => quant.sp ! n ! g ++
|
sp = \\g => quant.sp ! n ! g ++
|
||||||
num.s ++ ord.s ! agrAdj g quant.a (NF n Nom) ;
|
num.s ++ ord.s ! agrAdj g quant.a (NF n Nom) ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a ;
|
||||||
|
mergesWithPrep = quant.mergesWithPrep ;
|
||||||
|
mergeForm = quant.mergeForm
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuant quant num =
|
DetQuant quant num =
|
||||||
@@ -68,12 +74,14 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
True => quant.s ! True ! n ! g ++ num.s
|
True => quant.s ! True ! n ! g ++ num.s
|
||||||
} ;
|
} ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a ;
|
||||||
|
mergesWithPrep = quant.mergesWithPrep ;
|
||||||
|
mergeForm = quant.mergeForm
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = noMerge ** {
|
||||||
s = \\_,n,g => p.unstressed.poss ;
|
s = \\_,n,g => p.unstressed.poss ;
|
||||||
sp = \\n,g => p.substposs ;
|
sp = \\n,g => DefArt.s ! True ! n ! g ++ p.substposs ! n ;
|
||||||
a = Weak
|
a = Weak
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -94,13 +102,13 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
|
|
||||||
OrdNumeralSuperl n a = {s = \\af => n.s ! NOrd af ++ a.s ! Superl ! af} ;
|
OrdNumeralSuperl n a = {s = \\af => n.s ! NOrd af ++ a.s ! Superl ! af} ;
|
||||||
|
|
||||||
DefArt = {
|
DefArt = noMerge ** {
|
||||||
s = \\_,n,g => case <n,g> of {<Sg,Neutr> => "het" ; _ => "de"} ;
|
s = \\_,n,g => case <n,g> of {<Sg,Neutr> => "het" ; _ => "de"} ;
|
||||||
sp = \\n,g => "die" ;
|
sp = \\n,g => "die" ;
|
||||||
a = Weak
|
a = Weak
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IndefArt = {
|
IndefArt = noMerge ** {
|
||||||
s = table {
|
s = table {
|
||||||
True => \\_,_ => [] ;
|
True => \\_,_ => [] ;
|
||||||
False => table {
|
False => table {
|
||||||
@@ -115,7 +123,7 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
a = Strong
|
a = Strong
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassNP cn = {
|
MassNP cn = noMerge ** {
|
||||||
s = \\c => cn.s ! Strong ! NF Sg Nom ;
|
s = \\c => cn.s ! Strong ! NF Sg Nom ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
isPron = False
|
||||||
@@ -127,12 +135,12 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN2 f x = {
|
ComplN2 f x = {
|
||||||
s = \\_,nc => f.s ! nc ++ appPrep f.c2 x.s ;
|
s = \\_,nc => f.s ! nc ++ appPrep f.c2 x ;
|
||||||
g = f.g
|
g = f.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN3 f x = {
|
ComplN3 f x = {
|
||||||
s = \\nc => f.s ! nc ++ appPrep f.c2 x.s ;
|
s = \\nc => f.s ! nc ++ appPrep f.c2 x ;
|
||||||
g = f.g ;
|
g = f.g ;
|
||||||
c2 = f.c3
|
c2 = f.c3
|
||||||
} ;
|
} ;
|
||||||
@@ -165,7 +173,7 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelNP np rs = {
|
RelNP np rs = np ** {
|
||||||
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a.g ! np.a.n ;
|
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a.g ! np.a.n ;
|
||||||
a = np.a ;
|
a = np.a ;
|
||||||
isPron = False
|
isPron = False
|
||||||
|
|||||||
@@ -231,11 +231,11 @@ oper
|
|||||||
|
|
||||||
mkN2 = overload {
|
mkN2 = overload {
|
||||||
mkN2 : N -> N2
|
mkN2 : N -> N2
|
||||||
= \n -> lin N2 (n ** {c2 = "van"}) ;
|
= \n -> lin N2 (n ** {c2 = mkPrep "van"}) ;
|
||||||
mkN2 : N -> Prep -> N2
|
mkN2 : N -> Prep -> N2
|
||||||
= \n,p -> lin N2 (n ** {c2 = p.s}) ;
|
= \n,p -> lin N2 (n ** {c2 = p}) ;
|
||||||
} ;
|
} ;
|
||||||
mkN3 n p q = lin N3 (n ** {c2 = p.s ; c3 = q.s}) ;
|
mkN3 n p q = lin N3 (n ** {c2 = p ; c3 = q}) ;
|
||||||
|
|
||||||
mkPN = overload {
|
mkPN = overload {
|
||||||
mkPN : Str -> PN = \s -> lin PN {s = \\_ => s} ;
|
mkPN : Str -> PN = \s -> lin PN {s = \\_ => s} ;
|
||||||
@@ -255,7 +255,10 @@ oper
|
|||||||
mkA : (goed,goede,goeds,beter,best : Str) -> A = \a,b,c,d,e -> lin A (mkAdjective a b c d e) ;
|
mkA : (goed,goede,goeds,beter,best : Str) -> A = \a,b,c,d,e -> lin A (mkAdjective a b c d e) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPrep s = lin Prep (ss s) ;
|
mkPrep s = lin Prep { s, mergeForm = s ; mergesWithPrep = True } ;
|
||||||
|
|
||||||
|
nomergePrep : Str -> Prep = \s -> lin Prep (noMerge ** ss s);
|
||||||
|
|
||||||
van_Prep = mkPrep "van" ;
|
van_Prep = mkPrep "van" ;
|
||||||
te_Prep = mkPrep "te" ;
|
te_Prep = mkPrep "te" ;
|
||||||
|
|
||||||
@@ -305,9 +308,9 @@ oper
|
|||||||
hebben_V : V = lin V ResDut.hebben_V ;
|
hebben_V : V = lin V ResDut.hebben_V ;
|
||||||
|
|
||||||
mkV2 = overload {
|
mkV2 = overload {
|
||||||
mkV2 : Str -> V2 = \s -> lin V2 (v2vv (regVerb s) ** {c2 = <[],False>}) ;
|
mkV2 : Str -> V2 = \s -> lin V2 (v2vv (regVerb s) ** {c2 = <noPrep,False>}) ;
|
||||||
mkV2 : V -> V2 = \s -> lin V2 (s ** {c2 = <[],False>}) ;
|
mkV2 : V -> V2 = \s -> lin V2 (s ** {c2 = <noPrep,False>}) ;
|
||||||
mkV2 : V -> Prep -> V2 = \s,p -> lin V2 (s ** {c2 = <p.s,True>}) ;
|
mkV2 : V -> Prep -> V2 = \s,p -> lin V2 (s ** {c2 = <p,True>}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -323,7 +326,7 @@ oper
|
|||||||
mkV3 : V -> Prep -> V3 = \v,p -> mkmaxV3 v (mkPrep []) p ;
|
mkV3 : V -> Prep -> V3 = \v,p -> mkmaxV3 v (mkPrep []) p ;
|
||||||
mkV3 : V -> V3 = \v -> mkmaxV3 v (mkPrep []) (mkPrep []) ;
|
mkV3 : V -> V3 = \v -> mkmaxV3 v (mkPrep []) (mkPrep []) ;
|
||||||
} ;
|
} ;
|
||||||
mkmaxV3 : V -> Prep -> Prep -> V3 = \v,c,d -> lin V3 (v ** {c2 = <c.s,True> ; c3 = <d.s,True>}) ;
|
mkmaxV3 : V -> Prep -> Prep -> V3 = \v,c,d -> lin V3 (v ** {c2 = <c,True> ; c3 = <d,True>}) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -427,7 +430,7 @@ oper
|
|||||||
|
|
||||||
invarA = \s -> lin A {s = \\_,_ => s} ; ---- comparison
|
invarA = \s -> lin A {s = \\_,_ => s} ; ---- comparison
|
||||||
|
|
||||||
mkA2 = \a,p -> lin A2 (a ** {c2 = p.s}) ;
|
mkA2 = \a,p -> lin A2 (a ** {c2 = p}) ;
|
||||||
|
|
||||||
mkAdv s = {s = s ; lock_Adv = <>} ;
|
mkAdv s = {s = s ; lock_Adv = <>} ;
|
||||||
--
|
--
|
||||||
@@ -489,10 +492,10 @@ oper
|
|||||||
-- werden_V = MorphoDut.werden_V ** {lock_V = <>} ;
|
-- werden_V = MorphoDut.werden_V ** {lock_V = <>} ;
|
||||||
--
|
--
|
||||||
prepV2 : V -> Prep -> V2 ;
|
prepV2 : V -> Prep -> V2 ;
|
||||||
prepV2 v c = lin V2 (v ** {c2 = <c.s,True>}) ; --if it has prep, needed for word order (place of negation)
|
prepV2 v c = lin V2 (v ** {c2 = <c,True>}) ; --if it has prep, needed for word order (place of negation)
|
||||||
|
|
||||||
noprepV2 : V -> V2 ;
|
noprepV2 : V -> V2 ;
|
||||||
noprepV2 v = lin V2 (v ** {c2 = <[],False>}) ;
|
noprepV2 v = lin V2 (v ** {c2 = <noPrep,False>}) ;
|
||||||
-- dirV2 v = prepV2 v (mkPrep [] accusative) ;
|
-- dirV2 v = prepV2 v (mkPrep [] accusative) ;
|
||||||
-- datV2 v = prepV2 v (mkPrep [] dative) ;
|
-- datV2 v = prepV2 v (mkPrep [] dative) ;
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ concrete QuestionDut of Question = CatDut ** open ResDut in {
|
|||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
let
|
||||||
cls = slash.s ! t ! a ! p ;
|
cls = slash.s ! t ! a ! p ;
|
||||||
who = appPrep slash.c2 ip.s
|
who = appPrep slash.c2 (noMerge ** ip)
|
||||||
in table {
|
in table {
|
||||||
QDir => who ++ cls ! Inv ;
|
QDir => who ++ cls ! Inv ;
|
||||||
QIndir => who ++ cls ! Sub
|
QIndir => who ++ cls ! Sub
|
||||||
@@ -60,7 +60,7 @@ concrete QuestionDut of Question = CatDut ** open ResDut in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepIP p ip = {
|
PrepIP p ip = {
|
||||||
s = appPrep p.s ip.s
|
s = appPrep p (noMerge ** ip)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvIP ip adv = {
|
AdvIP ip adv = {
|
||||||
|
|||||||
@@ -23,12 +23,13 @@ concrete RelativeDut of Relative = CatDut ** open ResDut in {
|
|||||||
|
|
||||||
RelSlash rp slash = {
|
RelSlash rp slash = {
|
||||||
s = \\t,a,p,g,n =>
|
s = \\t,a,p,g,n =>
|
||||||
appPrep slash.c2 (\\_ => rp.s ! g ! n) ++ slash.s ! t ! a ! p ! Sub ;
|
appPrep slash.c2 (npLite (\\_ => rp.s ! g ! n))
|
||||||
|
++ slash.s ! t ! a ! p ! Sub ;
|
||||||
c = slash.c2.c
|
c = slash.c2.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
s = \\g,n => np.s ! NPNom ++ appPrep p.s (\\_ => rp.s ! g ! n) ;
|
s = \\g,n => np.s ! NPNom ++ appPrep p (npLite (\\_ => rp.s ! g ! n)) ;
|
||||||
a = RAg np.a.n np.a.p
|
a = RAg np.a.n np.a.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ resource ResDut = ParamX ** open Prelude, Predef in {
|
|||||||
|
|
||||||
NPCase = NPNom | NPAcc ;
|
NPCase = NPNom | NPAcc ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Noun = {s : NForm => Str ; g : Gender} ;
|
Noun = {s : NForm => Str ; g : Gender} ;
|
||||||
|
|
||||||
mkNoun : (_,_ : Str) -> Gender -> Noun = \sg,pl,g -> {
|
mkNoun : (_,_ : Str) -> Gender -> Noun = \sg,pl,g -> {
|
||||||
@@ -380,23 +380,25 @@ param
|
|||||||
worden_V = irregVerb2 "worden" "werd" "werden" "geworden" ** {
|
worden_V = irregVerb2 "worden" "werd" "werden" "geworden" ** {
|
||||||
aux = VZijn ; prefix = [] ; particle = [] ; vtype = VAct} ;
|
aux = VZijn ; prefix = [] ; particle = [] ; vtype = VAct} ;
|
||||||
|
|
||||||
Pronoun : Type = {
|
Pronoun : Type = MergesWithPrep ** {
|
||||||
unstressed,stressed : {nom, acc, poss : Str} ;
|
unstressed,stressed : {nom, acc, poss : Str} ;
|
||||||
substposs : Str ;
|
substposs : Number => Str ;
|
||||||
a : Agr
|
a : Agr ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPronoun : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Number -> Person -> Pronoun =
|
mkPronoun : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Number -> Person -> Pronoun =
|
||||||
\ik,me,mn,Ik,mij,mijn,mijne,g,n,p -> {
|
\ik,me,mn,Ik,mij,mijn,mijne,g,n,p -> noMerge ** {
|
||||||
unstressed = {nom = ik ; acc = me ; poss = mn} ;
|
unstressed = {nom = ik ; acc = me ; poss = mn} ;
|
||||||
stressed = {nom = Ik ; acc = mij ; poss = mijn} ;
|
stressed = {nom = Ik ; acc = mij ; poss = mijn} ;
|
||||||
substposs = mijne ;
|
substposs = table {Sg => mijne ; Pl => mijne + "n" } ; --overgenerates *jullien /IL2018
|
||||||
a = {g = g ; n = n ; p = p}
|
a = {g = g ; n = n ; p = p}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
het_Pron : Pronoun = mkPronoun "het" "het" "ze" "hij" "hem" "zijn" "zijne" Neutr Sg P3 ; -- cunger: 't -> het
|
het_Pron : Pronoun = mkPronoun "het" "het" "ze" "hij" "hem" "zijn" "zijne" Neutr Sg P3 ; -- cunger: 't -> het
|
||||||
|
|
||||||
|
|
||||||
|
MergesWithPrep = { mergesWithPrep : Bool ; mergeForm : Str } ;
|
||||||
|
noMerge : MergesWithPrep = { mergesWithPrep = False ; mergeForm = [] } ;
|
||||||
-- Complex $CN$s, like adjectives, have strong and weak forms.
|
-- Complex $CN$s, like adjectives, have strong and weak forms.
|
||||||
|
|
||||||
param
|
param
|
||||||
@@ -423,8 +425,22 @@ param
|
|||||||
---- clause, inverted, or subordinate.
|
---- clause, inverted, or subordinate.
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Preposition = Str ;
|
Preposition : Type = MergesWithPrep ** { s : Str } ;
|
||||||
appPrep : Preposition -> (NPCase => Str) -> Str = \p,np -> p ++ np ! NPAcc ; ----
|
|
||||||
|
-- This is a hack for appPrep: sometimes we don't really need a full NP
|
||||||
|
NPLite : Type = MergesWithPrep ** { s : NPCase => Str } ;
|
||||||
|
npLite : (NPCase => Str) -> NPLite = \nplite -> noMerge ** {s = nplite} ;
|
||||||
|
|
||||||
|
-- Applying a preposition to a noun phrase
|
||||||
|
-- In order to decide whether to merge, have to check both NP and Prep:
|
||||||
|
-- e.g. deze + met -> hiermee , but zonder + met -> "met zonder"
|
||||||
|
appPrep : Preposition -> NPLite -> Str
|
||||||
|
= \prep,np ->
|
||||||
|
case <np.mergesWithPrep,prep.mergesWithPrep> of {
|
||||||
|
<True,True> => glue np.mergeForm prep.mergeForm ;
|
||||||
|
_ => prep.s ++ np.s ! NPAcc } ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
param
|
param
|
||||||
Order = Main | Inv | Sub ;
|
Order = Main | Inv | Sub ;
|
||||||
@@ -685,20 +701,22 @@ param
|
|||||||
|
|
||||||
infPart : Bool -> Str = \b -> if_then_Str b [] "te" ;
|
infPart : Bool -> Str = \b -> if_then_Str b [] "te" ;
|
||||||
|
|
||||||
mkDet : Str -> Str -> Number -> {s,sp : Gender => Str ; n : Number ; a : Adjf} =
|
Determiner : Type = MergesWithPrep ** {s,sp : Gender => Str ; n : Number ; a : Adjf} ;
|
||||||
\deze,dit,n -> {
|
|
||||||
|
mkDet : Str -> Str -> Number -> Determiner =
|
||||||
|
\deze,dit,n -> noMerge ** {
|
||||||
s = \\g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
s = \\g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
||||||
sp = \\g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
sp = \\g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = Weak
|
a = Weak
|
||||||
} ;
|
} ;
|
||||||
|
Quantifier : Type = MergesWithPrep ** {
|
||||||
mkQuant : Str -> Str -> {
|
s : Bool => Number => Gender => Str ;
|
||||||
s : Bool => Number => Gender => Str ;
|
sp : Number => Gender => Str ;
|
||||||
sp : Number => Gender => Str ;
|
a : Adjf
|
||||||
a : Adjf
|
} ;
|
||||||
} =
|
mkQuant : Str -> Str -> Quantifier =
|
||||||
\deze,dit -> {
|
\deze,dit -> noMerge ** {
|
||||||
s = \\_ ,n,g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
s = \\_ ,n,g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
||||||
sp = \\ n,g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
sp = \\ n,g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze} ;
|
||||||
a = Weak
|
a = Weak
|
||||||
@@ -709,8 +727,9 @@ param
|
|||||||
s = \\n,g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze}
|
s = \\n,g => case <n,g> of {<Sg,Neutr> => dit ; _ => deze}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkNP : Str -> Gender -> Number -> {s : NPCase => Str ; a : Agr ; isPron : Bool} =
|
NounPhrase : Type = MergesWithPrep ** {s : NPCase => Str ; a : Agr ; isPron : Bool } ;
|
||||||
\s,g,n -> heavyNP {
|
mkNP : Str -> Gender -> Number -> NounPhrase =
|
||||||
|
\s,g,n -> noMerge ** heavyNP {
|
||||||
s = \\_ => s ;
|
s = \\_ => s ;
|
||||||
a = agrgP3 g n ;
|
a = agrgP3 g n ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ concrete SentenceDut of Sentence = CatDut ** open ResDut, Prelude in {
|
|||||||
c2 = slash.c2
|
c2 = slash.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashPrep cl prep = cl ** {c2 = prep.s} ;
|
SlashPrep cl prep = cl ** {c2 = prep} ;
|
||||||
|
|
||||||
SlashVS np vs slash =
|
SlashVS np vs slash =
|
||||||
mkClause (np.s ! NPNom) np.a
|
mkClause (np.s ! NPNom) np.a
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
|||||||
both7and_DConj = {s1 = "zowel" ; s2 = "als" ; n = Pl} ;
|
both7and_DConj = {s1 = "zowel" ; s2 = "als" ; n = Pl} ;
|
||||||
but_PConj = ss "maar" ;
|
but_PConj = ss "maar" ;
|
||||||
by8agent_Prep = mkPrep "door" ;
|
by8agent_Prep = mkPrep "door" ;
|
||||||
by8means_Prep = mkPrep "met" ;
|
by8means_Prep = mkPrep "met" ** {mergeForm = "mee"} ;
|
||||||
can8know_VV, can_VV = auxVV kunnen_V ;
|
can8know_VV, can_VV = auxVV kunnen_V ;
|
||||||
during_Prep = mkPrep "tijdens" ;
|
during_Prep = nomergePrep "tijdens" ; -- doesn't combine
|
||||||
either7or_DConj = {s1 = "ofwel" ; s2 = "of" ; n = Pl} ;
|
either7or_DConj = {s1 = "ofwel" ; s2 = "of" ; n = Pl} ;
|
||||||
everybody_NP = mkNP "alle" Utr Pl ; ----
|
everybody_NP = mkNP "alle" Utr Pl ; ----
|
||||||
every_Det = mkDet "elke" "elk" Sg ; ----
|
every_Det = mkDet "elke" "elk" Sg ; ----
|
||||||
@@ -43,7 +43,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
|||||||
if_Subj = ss "als" ;
|
if_Subj = ss "als" ;
|
||||||
in8front_Prep = mkPrep "voor" ;
|
in8front_Prep = mkPrep "voor" ;
|
||||||
i_Pron = mkPronoun "ik" "me" "mijn" "ik" "mij" "mijn" "mijne" Utr Sg P1 ;
|
i_Pron = mkPronoun "ik" "me" "mijn" "ik" "mij" "mijn" "mijne" Utr Sg P1 ;
|
||||||
in_Prep = ss "in" ;
|
in_Prep = mkPrep "in" ;
|
||||||
it_Pron = mkPronoun "het" "het" "zijn" "het" "het" "zijn" "zijne" Neutr Sg P3 ;
|
it_Pron = mkPronoun "het" "het" "zijn" "het" "het" "zijn" "zijne" Neutr Sg P3 ;
|
||||||
|
|
||||||
less_CAdv = X.mkCAdv "minder" "dan" ;
|
less_CAdv = X.mkCAdv "minder" "dan" ;
|
||||||
@@ -71,7 +71,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
|||||||
someSg_Det = mkDet "enige" "enig" Sg ;
|
someSg_Det = mkDet "enige" "enig" Sg ;
|
||||||
something_NP = mkNP "iets" Utr Sg ;
|
something_NP = mkNP "iets" Utr Sg ;
|
||||||
somewhere_Adv = ss "ergens" ;
|
somewhere_Adv = ss "ergens" ;
|
||||||
that_Quant = mkQuant "die" "dat" ;
|
that_Quant = mkQuant "die" "dat" ** { mergesWithPrep = True ; mergeForm = "daar" } ;
|
||||||
that_Subj = ss "dat" ;
|
that_Subj = ss "dat" ;
|
||||||
there_Adv = ss "daar" ;
|
there_Adv = ss "daar" ;
|
||||||
there7to_Adv = ss "daar" ;
|
there7to_Adv = ss "daar" ;
|
||||||
@@ -80,7 +80,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
|||||||
|
|
||||||
they_Pron = mkPronoun "ze" "ze" "hun" "zij" "hen" "hun" "hunne" Utr Pl P3 ; ----
|
they_Pron = mkPronoun "ze" "ze" "hun" "zij" "hen" "hun" "hunne" Utr Pl P3 ; ----
|
||||||
|
|
||||||
this_Quant = mkQuant "deze" "dit" ;
|
this_Quant = mkQuant "deze" "dit" ** { mergesWithPrep = True ; mergeForm = "hier" } ;
|
||||||
through_Prep = mkPrep "door" ;
|
through_Prep = mkPrep "door" ;
|
||||||
too_AdA = ss "te" ;
|
too_AdA = ss "te" ;
|
||||||
to_Prep = mkPrep "naar" ;
|
to_Prep = mkPrep "naar" ;
|
||||||
@@ -101,8 +101,8 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
|||||||
whoSg_IP = {s = \\_ => "wie" ; n = Sg} ;
|
whoSg_IP = {s = \\_ => "wie" ; n = Sg} ;
|
||||||
whoPl_IP = {s = \\_ => "wie" ; n = Pl} ;
|
whoPl_IP = {s = \\_ => "wie" ; n = Pl} ;
|
||||||
why_IAdv = ss "waarom" ;
|
why_IAdv = ss "waarom" ;
|
||||||
without_Prep = mkPrep "zonder" ;
|
without_Prep = nomergePrep "zonder" ; -- doesn't combine
|
||||||
with_Prep = mkPrep "met" ;
|
with_Prep = mkPrep "met" ** { mergeForm = "mee" } ;
|
||||||
youSg_Pron = mkPronoun "je" "je" "je" "jij" "jou" "je" "jouwe" Neutr Sg P2 ; --- Neutr as hack for familiarity
|
youSg_Pron = mkPronoun "je" "je" "je" "jij" "jou" "je" "jouwe" Neutr Sg P2 ; --- Neutr as hack for familiarity
|
||||||
youPl_Pron = mkPronoun "jullie" "jullie" "je" "jullie" "jullie" "jullie" "uwe" Utr Pl P2 ;
|
youPl_Pron = mkPronoun "jullie" "jullie" "je" "jullie" "jullie" "jullie" "uwe" Utr Pl P2 ;
|
||||||
youPol_Pron = mkPronoun "u" "u" "uw" "u" "u" "uw" "uwe" Utr Sg P2 ;
|
youPol_Pron = mkPronoun "u" "u" "uw" "u" "u" "uw" "uwe" Utr Sg P2 ;
|
||||||
@@ -115,7 +115,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
|||||||
nothing_NP = mkNP "niets" Neutr Sg ;
|
nothing_NP = mkNP "niets" Neutr Sg ;
|
||||||
at_least_AdN = ss "ten minste" ;
|
at_least_AdN = ss "ten minste" ;
|
||||||
at_most_AdN = ss "hooguit" ;
|
at_most_AdN = ss "hooguit" ;
|
||||||
except_Prep = mkPrep "met uitzondering van" ;
|
except_Prep = nomergePrep "met uitzondering van" ; -- doesn't combine like "met dat" -> "daarmee"
|
||||||
|
|
||||||
as_CAdv = X.mkCAdv "zo" "als" ;
|
as_CAdv = X.mkCAdv "zo" "als" ;
|
||||||
have_V2 = mkV2 ParadigmsDut.hebben_V ;
|
have_V2 = mkV2 ParadigmsDut.hebben_V ;
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ lin
|
|||||||
FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c
|
FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c
|
||||||
NumPN i = {s = \\_ => i.s ! Neutr ! Nom ; g = Neutr} ; --- c
|
NumPN i = {s = \\_ => i.s ! Neutr ! Nom ; g = Neutr} ; --- c
|
||||||
|
|
||||||
CNIntNP cn i = {
|
CNIntNP cn i = noMerge ** {
|
||||||
s = \\c => cn.s ! Weak ! NF Sg Nom ++ i.s ;
|
s = \\c => cn.s ! Weak ! NF Sg Nom ++ i.s ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = let g = cn.g in {
|
CNSymbNP det cn xs = let g = cn.g in noMerge ** {
|
||||||
s = \\c => det.s ! g ++ cn.s ! det.a ! NF det.n Nom ++ xs.s ;
|
s = \\c => det.s ! g ++ cn.s ! det.a ! NF det.n Nom ++ xs.s ;
|
||||||
a = agrP3 det.n ;
|
a = agrP3 det.n ;
|
||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = noMerge ** {
|
||||||
s = \\c => artDef Sg cn.g ++ cn.s ! Weak ! NF Sg Nom ++ i.s ! Neutr ! Nom ;
|
s = \\c => artDef Sg cn.g ++ cn.s ! Weak ! NF Sg Nom ++ i.s ! Neutr ! Nom ;
|
||||||
a = agrP3 Sg ;
|
a = agrP3 Sg ;
|
||||||
isPron = False
|
isPron = False
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
SlashV2a v = predV (v2v v) ** {c2 = v.c2} ;
|
SlashV2a v = predV (v2v v) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
Slash2V3 v np =
|
Slash2V3 v np =
|
||||||
insertObj (\\_ => appPrep v.c2.p1 np.s) (predVv v) ** {c2 = v.c3} ;
|
insertObj (\\_ => appPrep v.c2.p1 np) (predVv v) ** {c2 = v.c3} ;
|
||||||
Slash3V3 v np =
|
Slash3V3 v np =
|
||||||
insertObj (\\_ => appPrep v.c3.p1 np.s) (predVv v) ** {c2 = v.c2} ;
|
insertObj (\\_ => appPrep v.c3.p1 np) (predVv v) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
SlashV2S v s =
|
SlashV2S v s =
|
||||||
insertExtrapos (conjThat ++ s.s ! Sub) (predVv v) ** {c2 = v.c2} ;
|
insertExtrapos (conjThat ++ s.s ! Sub) (predVv v) ** {c2 = v.c2} ;
|
||||||
@@ -48,7 +48,7 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
insertObj (\\_ => ap.s ! APred) (predVGen False BetweenObjs (v2v v)) ** {c2 = v.c2} ;
|
insertObj (\\_ => ap.s ! 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.s) 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
|
||||||
@@ -66,7 +66,7 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
insertExtrapos vpi.p3 (
|
insertExtrapos vpi.p3 (
|
||||||
insertInf vpi.p2 (
|
insertInf vpi.p2 (
|
||||||
insertObj vpi.p1 (
|
insertObj vpi.p1 (
|
||||||
insertObj (\\_ => appPrep v.c2.p1 np.s) (
|
insertObj (\\_ => appPrep v.c2.p1 np) (
|
||||||
predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
|
predVGen v.isAux vp.negPos v)))) ** {c2 = v.c2} ;
|
||||||
|
|
||||||
-- BeforeObjs, because negation comes before copula complement
|
-- BeforeObjs, because negation comes before copula complement
|
||||||
@@ -87,11 +87,13 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
|||||||
|
|
||||||
AdVVP adv vp = insertAdV adv.s vp ;
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
ReflVP vp = insertObj (\\a => appPrep vp.c2.p1 (\\_ => reflPron ! a)) vp ;
|
ReflVP vp = insertObj (\\a => appPrep vp.c2.p1
|
||||||
|
(npLite (\\_ => reflPron ! a))
|
||||||
|
) vp ;
|
||||||
|
|
||||||
PassV2 v = insertInf (v.s ! VPerf) (predV worden_V) ;
|
PassV2 v = insertInf (v.s ! VPerf) (predV worden_V) ;
|
||||||
|
|
||||||
VPSlashPrep vp prep = vp ** {c2 = <prep.s,True>} ;
|
VPSlashPrep vp prep = vp ** {c2 = <prep,True>} ;
|
||||||
|
|
||||||
---- workaround for a subtyping bug
|
---- workaround for a subtyping bug
|
||||||
oper
|
oper
|
||||||
|
|||||||
Reference in New Issue
Block a user