mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-10-02 07:03:39 -06:00
extensions by Codex
This commit is contained in:
@@ -53,6 +53,7 @@ concrete CatDut of Cat =
|
|||||||
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} ;
|
||||||
|
ACard = {s : Str} ;
|
||||||
Ord = {s : AForm => Str} ;
|
Ord = {s : AForm => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ lin
|
|||||||
|
|
||||||
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
||||||
|
|
||||||
|
n_units_of_NP card cn np =
|
||||||
|
G.AdvNP (G.DetCN (G.DetQuant G.IndefArt (G.NumCard card)) cn)
|
||||||
|
(G.PrepNP (mkPrep "van") np) ;
|
||||||
|
|
||||||
bottle_of_CN np = N.ApposCN (mkCN (mkN "vles")) np ; --- vlesje for beer
|
bottle_of_CN np = N.ApposCN (mkCN (mkN "vles")) np ; --- vlesje for beer
|
||||||
cup_of_CN np = N.ApposCN (mkCN (mkN "kopje")) np ;
|
cup_of_CN np = N.ApposCN (mkCN (mkN "kopje")) np ;
|
||||||
glass_of_CN np = N.ApposCN (mkCN (mkN "glas")) np ;
|
glass_of_CN np = N.ApposCN (mkCN (mkN "glas")) np ;
|
||||||
|
|||||||
+148
-2
@@ -2,12 +2,18 @@
|
|||||||
|
|
||||||
concrete ExtendDut of Extend =
|
concrete ExtendDut of Extend =
|
||||||
CatDut ** ExtendFunctor
|
CatDut ** ExtendFunctor
|
||||||
- [PastPartAP,ICompAP,IAdvAdv,
|
- [PastPartAP,PastPartAgentAP,PresPartAP,ProgrVPSlash,ICompAP,IAdvAdv,
|
||||||
VPS,
|
VPS,
|
||||||
BaseVPS, ConsVPS,
|
BaseVPS, ConsVPS,
|
||||||
MkVPS, ConjVPS, PredVPS,
|
MkVPS, ConjVPS, PredVPS,
|
||||||
|
VPI,BaseVPI,ConsVPI,MkVPI,ConjVPI,ComplVPIVV,
|
||||||
PassVPSlash, PassAgentVPSlash,
|
PassVPSlash, PassAgentVPSlash,
|
||||||
CompoundN
|
RNP,RNPList,ReflRNP,ReflPron,ReflPoss,PredetRNP,
|
||||||
|
AdvRNP,AdvRVP,AdvRAP,ReflA2RNP,PossPronRNP,
|
||||||
|
ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP,
|
||||||
|
CompoundN,CompoundAP,GerundCN,GerundNP,GerundAdv,ByVP,InOrderToVP,
|
||||||
|
ApposNP,PositAdVAdj,
|
||||||
|
BaseComp,ConsComp,ConjComp,BaseImp,ConsImp,ConjImp
|
||||||
]
|
]
|
||||||
with
|
with
|
||||||
(Grammar = GrammarDut) **
|
(Grammar = GrammarDut) **
|
||||||
@@ -27,9 +33,31 @@ lin --# notpresent
|
|||||||
isPre = notB vp.isHeavy ; --# notpresent
|
isPre = notB vp.isHeavy ; --# notpresent
|
||||||
} ; --# notpresent
|
} ; --# notpresent
|
||||||
|
|
||||||
|
lin
|
||||||
|
PresPartAP vp = {
|
||||||
|
s = \\agr,af =>
|
||||||
|
(infClause [] agr vp (case vp.isHeavy of {True => APred ; False => af})).s !
|
||||||
|
Pres ! Simul ! Pos ! Sub ;
|
||||||
|
isPre = notB vp.isHeavy
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PastPartAgentAP vp np = {
|
||||||
|
s = \\agr,af =>
|
||||||
|
(infClause [] agr vp APred).s ! Past ! Anter ! Pos ! Sub ++
|
||||||
|
"door" ++ np.s ! NPAcc ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ProgrVPSlash vp =
|
||||||
|
let vpi = infVP True vp in
|
||||||
|
insertAdv ("aan het" ++ vpi.inf ++ vpi.ext)
|
||||||
|
(insertObj vpi.obj (compV zijn_V)) ** {c2 = vp.c2} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
VPS = {s : Order => Agr => Str} ;
|
VPS = {s : Order => Agr => Str} ;
|
||||||
[VPS] = {s1,s2 : Order => Agr => Str} ;
|
[VPS] = {s1,s2 : Order => Agr => Str} ;
|
||||||
|
VPI = {s : Bool => Agr => Str} ;
|
||||||
|
[VPI] = {s1,s2 : Bool => Agr => Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseVPS = twoTable2 Order Agr ;
|
BaseVPS = twoTable2 Order Agr ;
|
||||||
@@ -100,6 +128,14 @@ lin
|
|||||||
lin
|
lin
|
||||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||||
|
|
||||||
|
BaseVPI = twoTable2 Bool Agr ;
|
||||||
|
ConsVPI = consrTable2 Bool Agr comma ;
|
||||||
|
MkVPI vp = {s = \\bare => useInfVP bare vp} ;
|
||||||
|
ConjVPI = conjunctDistrTable2 Bool Agr ;
|
||||||
|
ComplVPIVV vv vpi =
|
||||||
|
insertObj (\\agr => vpi.s ! vv.isAux ! agr)
|
||||||
|
(predVGen vv.isAux AfterObjs vv) ;
|
||||||
|
|
||||||
ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ;
|
ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ;
|
||||||
|
|
||||||
IAdvAdv adv = {s = "hoe" ++ adv.s} ;
|
IAdvAdv adv = {s = "hoe" ++ adv.s} ;
|
||||||
@@ -127,4 +163,114 @@ lin CompoundN n1 n2 = {
|
|||||||
g = n2.g
|
g = n2.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
lin CompoundAP noun adj = {
|
||||||
|
s = \\agr,af => noun.s ! NF Sg Nom ++ BIND ++ adj.s ! Posit ! af ;
|
||||||
|
isPre = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
RNP = {s : Agr => Str ; isPron : Bool} ;
|
||||||
|
RNPList = {s1,s2 : Agr => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ReflRNP vps rnp =
|
||||||
|
insertObjNP (andB rnp.isPron (notB vps.c2.p2)) vps.negPos
|
||||||
|
(\\agr => appPrep vps.c2.p1 (npLite (\\_ => rnp.s ! agr))) vps ;
|
||||||
|
|
||||||
|
ReflPron = {s = reflPron ; isPron = True} ;
|
||||||
|
|
||||||
|
ReflPoss num cn = {
|
||||||
|
s = \\agr => reflPossDet agr num.n cn.g ++ num.s ++
|
||||||
|
cn.s ! Strong ! NF num.n Nom ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PredetRNP pred rnp = {
|
||||||
|
s = \\agr => pred.s ! agr.n ! agr.g ++ rnp.s ! agr ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvRNP np prep rnp = {
|
||||||
|
s = \\agr => np.s ! NPAcc ++
|
||||||
|
appPrep prep (npLite (\\_ => rnp.s ! agr)) ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvRVP vp prep rnp =
|
||||||
|
insertObj (\\agr => appPrep prep (npLite (\\_ => rnp.s ! agr))) vp ;
|
||||||
|
|
||||||
|
AdvRAP ap prep rnp = {
|
||||||
|
s = \\agr,af => ap.s ! agr ! af ++
|
||||||
|
appPrep prep (npLite (\\_ => rnp.s ! agr)) ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflA2RNP adj rnp = {
|
||||||
|
s = \\agr,af => adj.s ! Posit ! af ++
|
||||||
|
appPrep adj.c2 (npLite (\\_ => rnp.s ! agr)) ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PossPronRNP pron num cn rnp = heavyNP {
|
||||||
|
s = \\_ => pron.stressed.poss ++ num.s ++
|
||||||
|
cn.s ! Strong ! NF num.n Nom ++ "van" ++ rnp.s ! pron.a ;
|
||||||
|
a = agrP3 num.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjRNP conj rnps = conjunctDistrTable Agr conj rnps ** {isPron = False} ;
|
||||||
|
Base_rr_RNP = twoTable Agr ;
|
||||||
|
Base_nr_RNP np rnp = twoTable Agr {s = \\_ => np.s ! NPAcc} rnp ;
|
||||||
|
Base_rn_RNP rnp np = twoTable Agr rnp {s = \\_ => np.s ! NPAcc} ;
|
||||||
|
Cons_rr_RNP = consrTable Agr comma ;
|
||||||
|
Cons_nr_RNP np rnps = consrTable Agr comma {s = \\_ => np.s ! NPAcc} rnps ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
GerundCN vp = {
|
||||||
|
s = \\_,_ => useInfVP True vp ! agrP3 Sg ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundNP vp = heavyNP {
|
||||||
|
s = \\_ => useInfVP True vp ! agrP3 Sg ;
|
||||||
|
a = agrP3 Sg
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundAdv vp = {
|
||||||
|
s = (infClause [] (agrP3 Sg) vp APred).s ! Pres ! Simul ! Pos ! Sub
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ByVP vp = {s = "door" ++ useInfVP True vp ! agrP3 Sg} ;
|
||||||
|
InOrderToVP vp = {s = "om" ++ useInfVP False vp ! agrP3 Sg} ;
|
||||||
|
|
||||||
|
ApposNP np1 np2 = heavyNP {
|
||||||
|
s = \\c => np1.s ! c ++ bindComma ++ np2.s ! c ;
|
||||||
|
a = np1.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PositAdVAdj adj = {s = adj.s ! Posit ! APred} ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[Comp] = {s1,s2 : Agr => Str} ;
|
||||||
|
[Imp] = {s1,s2 : Polarity => ImpForm => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseComp = twoTable Agr ;
|
||||||
|
ConsComp = consrTable Agr comma ;
|
||||||
|
ConjComp = conjunctDistrTable Agr ;
|
||||||
|
BaseImp = twoTable2 Polarity ImpForm ;
|
||||||
|
ConsImp = consrTable2 Polarity ImpForm comma ;
|
||||||
|
ConjImp = conjunctDistrTable2 Polarity ImpForm ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
reflPossDet : Agr -> Number -> Gender -> Str = \agr,n,g ->
|
||||||
|
case <agr.n,agr.p,n,g> of {
|
||||||
|
<Sg,P1,_,_> => "mijn" ;
|
||||||
|
<Sg,P2,_,_> => "jouw" ;
|
||||||
|
<Sg,P3,_,_> => "zijn" ;
|
||||||
|
<Pl,P1,Sg,Neutr> => "ons" ;
|
||||||
|
<Pl,P1,_,_> => "onze" ;
|
||||||
|
<Pl,P2,_,_> => "jullie" ;
|
||||||
|
<Pl,P3,_,_> => "hun"
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ concrete IdiomDut of Idiom = CatDut **
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
ExistNPAdv np adv =
|
||||||
|
mkClause "er" (agrP3 np.a.n)
|
||||||
|
(insertAdv adv.s
|
||||||
|
(insertObj (\\_ => np.s ! NPNom) (predV zijn_V))) ;
|
||||||
|
|
||||||
ProgrVP vp = let vpi = infVP True vp in
|
ProgrVP vp = let vpi = infVP True vp in
|
||||||
insertAdv ("aan het" ++ vpi.inf ++ vpi.ext)
|
insertAdv ("aan het" ++ vpi.inf ++ vpi.ext)
|
||||||
(insertObj vpi.obj (compV zijn_V)) ;
|
(insertObj vpi.obj (compV zijn_V)) ;
|
||||||
|
|||||||
@@ -199,8 +199,25 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
|
|||||||
g = cn.g
|
g = cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
PartNP cn np = {
|
||||||
|
s = \\a,nc => cn.s ! a ! nc ++ "van" ++ np.s ! NPAcc ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CountNP det np = heavyNP {
|
||||||
|
s = \\c => det.s ! Neutr ++ "van" ++ np.s ! c ;
|
||||||
|
a = agrP3 det.n
|
||||||
|
} ;
|
||||||
|
|
||||||
DetDAP det = det ;
|
DetDAP det = det ;
|
||||||
|
|
||||||
|
AdjDAP dap ap = dap ** {
|
||||||
|
s = \\g => dap.s ! g ++
|
||||||
|
ap.s ! agrgP3 g dap.n ! agrAdj g dap.a (NF dap.n Nom) ;
|
||||||
|
sp = \\g => dap.sp ! g ++
|
||||||
|
ap.s ! agrgP3 g dap.n ! agrAdj g dap.a (NF dap.n Nom)
|
||||||
|
} ;
|
||||||
|
|
||||||
QuantityNP n m = noMerge ** {
|
QuantityNP n m = noMerge ** {
|
||||||
s = \\c => preOrPost m.isPre m.s (n.s ! NCard Utr Nom) ;
|
s = \\c => preOrPost m.isPre m.s (n.s ! NCard Utr Nom) ;
|
||||||
a = agrP3 n.n ;
|
a = agrP3 n.n ;
|
||||||
|
|||||||
@@ -39,18 +39,50 @@ lin
|
|||||||
pot1plus d e = addAttr {s = \\g =>
|
pot1plus d e = addAttr {s = \\g =>
|
||||||
e.s ! DUnit ! invNum ++ BIND ++ e.en ++ BIND ++ d.s ! DTen ! g ; n = Pl} ;
|
e.s ! DUnit ! invNum ++ BIND ++ e.en ++ BIND ++ d.s ! DTen ! g ; n = Pl} ;
|
||||||
pot1as2 n = n ;
|
pot1as2 n = n ;
|
||||||
|
pot21 = addAttr {s = cardOrd "honderd" "honderdste" ; n = Pl} ;
|
||||||
pot2 d =
|
pot2 d =
|
||||||
addAttr {s = \\g => d.attr ++ cardOrd "honderd" "honderdste" ! g ; n = Pl} ;
|
addAttr {s = \\g => d.attr ++ cardOrd "honderd" "honderdste" ! g ; n = Pl} ;
|
||||||
pot2plus d e =
|
pot2plus d e =
|
||||||
addAttr {s = \\g => d.attr ++ "honderd" ++ BIND ++ e.s ! g ; n = Pl} ;
|
addAttr {s = \\g => d.attr ++ "honderd" ++ BIND ++ e.s ! g ; n = Pl} ;
|
||||||
pot2as3 n = n ;
|
pot2as3 n = n ;
|
||||||
|
pot31 = addAttr {s = cardOrd "duizend" "duizendste" ; n = Pl} ;
|
||||||
pot3 n =
|
pot3 n =
|
||||||
addAttr {s = \\g => n.attr ++ cardOrd "duizend" "duizendste" ! g ; n = Pl} ;
|
addAttr {s = \\g => n.attr ++ cardOrd "duizend" "duizendste" ! g ; n = Pl} ;
|
||||||
pot3plus n m =
|
pot3plus n m =
|
||||||
addAttr {s = \\g => n.attr ++ "duizend" ++ m.s ! g ; n = Pl} ;
|
addAttr {s = \\g => n.attr ++ "duizend" ++ m.s ! g ; n = Pl} ;
|
||||||
|
|
||||||
pot3as4 n = n ;
|
pot3as4 n = n ;
|
||||||
|
|
||||||
|
pot3decimal d = addAttr {s = d.s ; n = d.n} ;
|
||||||
|
|
||||||
|
pot41 = addAttr {s = cardOrd "een miljoen" "miljoenste" ; n = Pl} ;
|
||||||
|
pot4 n = addAttr {
|
||||||
|
s = \\g => n.s ! invNum ++ cardOrd "miljoen" "miljoenste" ! g ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
pot4plus n m = addAttr {
|
||||||
|
s = \\g => n.s ! invNum ++ "miljoen" ++ m.s ! g ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
pot4as5 n = n ;
|
pot4as5 n = n ;
|
||||||
|
pot4decimal d = addAttr {
|
||||||
|
s = \\g => d.s ! invNum ++ cardOrd "miljoen" "miljoenste" ! g ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
pot51 = addAttr {s = cardOrd "een miljard" "miljardste" ; n = Pl} ;
|
||||||
|
pot5 n = addAttr {
|
||||||
|
s = \\g => n.s ! invNum ++ cardOrd "miljard" "miljardste" ! g ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
pot5plus n m = addAttr {
|
||||||
|
s = \\g => n.s ! invNum ++ "miljard" ++ m.s ! g ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
pot5decimal d = addAttr {
|
||||||
|
s = \\g => d.s ! invNum ++ cardOrd "miljard" "miljardste" ! g ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Dig = TDigit ;
|
Dig = TDigit ;
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ concrete SentenceDut of Sentence = CatDut ** open ResDut, Prelude in {
|
|||||||
UseCl t p cl = {
|
UseCl t p cl = {
|
||||||
s = \\o => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! o
|
s = \\o => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! o
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
AdvImp adv imp = {
|
||||||
|
s = \\pol,form => adv.s ++ imp.s ! pol ! form
|
||||||
|
} ;
|
||||||
UseQCl t p cl = {
|
UseQCl t p cl = {
|
||||||
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! q
|
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! q
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user