mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 17:38:54 -06:00
grammar extensions for Codex
This commit is contained in:
@@ -83,6 +83,7 @@ concrete CatGer of Cat =
|
|||||||
|
|
||||||
Num = {s,sp : AForm => Str ; n : Number ; isNum : Bool} ; -- Num,Card.s AForm HL 12/23
|
Num = {s,sp : AForm => Str ; n : Number ; isNum : Bool} ; -- Num,Card.s AForm HL 12/23
|
||||||
Card = {s : AForm => Str ; n : Number} ; -- inflection mainly for: einer,eine,eines
|
Card = {s : AForm => Str ; n : Number} ; -- inflection mainly for: einer,eine,eines
|
||||||
|
ACard = {s : Str ; n : Number} ;
|
||||||
Ord = {s : AForm => Str} ;
|
Ord = {s : AForm => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ lin
|
|||||||
is_wrong_VP = mkVP have_V2 (mkNP (P.mkN "Unrecht")) ;
|
is_wrong_VP = mkVP have_V2 (mkNP (P.mkN "Unrecht")) ;
|
||||||
|
|
||||||
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
|
||||||
|
(mkNP <lin Card card : Card> (lin CN cn))
|
||||||
|
(SyntaxGer.mkAdv P.von_Prep (lin NP np)) ;
|
||||||
n_unit_CN card unit cn = mkCN (invarA (mkUtt (mkNP <lin Card card : Card> (lin CN unit))).s) cn ;
|
n_unit_CN card unit cn = mkCN (invarA (mkUtt (mkNP <lin Card card : Card> (lin CN unit))).s) cn ;
|
||||||
|
|
||||||
bottle_of_CN np = N.ApposCN (mkCN (P.mkN "Flasche")) np ;
|
bottle_of_CN np = N.ApposCN (mkCN (P.mkN "Flasche")) np ;
|
||||||
|
|||||||
@@ -6,15 +6,17 @@ concrete ExtendGer of Extend =
|
|||||||
GenNP, GenRP, EmptyRelSlash, GenIP, GenModIP,
|
GenNP, GenRP, EmptyRelSlash, GenIP, GenModIP,
|
||||||
VPS, ListVPS, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
VPS, ListVPS, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS,
|
||||||
VPI, ListVPI, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
VPI, ListVPI, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV,
|
||||||
|
ListComp, BaseComp, ConsComp, ConjComp,
|
||||||
|
ListImp, BaseImp, ConsImp, ConjImp,
|
||||||
ICompAP, IAdvAdv, CompIQuant, PrepCN,
|
ICompAP, IAdvAdv, CompIQuant, PrepCN,
|
||||||
PastPartAP, PastPartAgentAP,
|
PresPartAP, PastPartAP, PastPartAgentAP,
|
||||||
PassVPSlash, PassAgentVPSlash,
|
PassVPSlash, PassAgentVPSlash,
|
||||||
AdvIsNP,
|
ProgrVPSlash, AdvIsNP, AdvRVP,
|
||||||
RNP, RNPList, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ConjRNP,
|
RNP, RNPList, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ConjRNP,
|
||||||
ReflRNP, ReflPron, ReflPoss, PredetRNP, AdvRNP, ReflA2RNP, PossPronRNP,
|
ReflRNP, ReflPron, ReflPoss, PredetRNP, AdvRNP, ReflA2RNP, PossPronRNP,
|
||||||
CompoundN, DetNPMasc, DetNPFem, UseDAP, UseDAPMasc, UseDAPFem,
|
CompoundN, DetNPMasc, DetNPFem, UseDAP, UseDAPMasc, UseDAPFem,
|
||||||
CardCNCard,
|
CardCNCard, CompoundAP, GerundCN, GerundNP, GerundAdv, ByVP, ApposNP,
|
||||||
InOrderToVP
|
InOrderToVP, PositAdVAdj
|
||||||
]
|
]
|
||||||
with
|
with
|
||||||
(Grammar = GrammarGer) **
|
(Grammar = GrammarGer) **
|
||||||
@@ -188,8 +190,30 @@ concrete ExtendGer of Extend =
|
|||||||
|
|
||||||
-- Conjunction of copula complements
|
-- Conjunction of copula complements
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[Comp] = {s1,s2 : Agr => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseComp x y =
|
||||||
|
twoTable Agr
|
||||||
|
{s = \\a => x.s ! a ++ x.ext ! numberAgr a}
|
||||||
|
{s = \\a => y.s ! a ++ y.ext ! numberAgr a} ;
|
||||||
|
ConsComp x xs =
|
||||||
|
consrTable Agr comma
|
||||||
|
{s = \\a => x.s ! a ++ x.ext ! numberAgr a}
|
||||||
|
xs ;
|
||||||
|
ConjComp conj xs = (conjunctDistrTable Agr conj xs) ** {ext = \\_ => []} ;
|
||||||
|
|
||||||
-- Conjunction of imperatives
|
-- Conjunction of imperatives
|
||||||
|
|
||||||
|
lincat
|
||||||
|
ListImp = {s1,s2 : Polarity => ImpForm => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseImp = twoTable2 Polarity ImpForm ;
|
||||||
|
ConsImp = consrTable2 Polarity ImpForm comma ;
|
||||||
|
ConjImp conj xs = conjunctDistrTable2 Polarity ImpForm conj xs ;
|
||||||
|
|
||||||
ICompAP ap = {
|
ICompAP ap = {
|
||||||
s = \\_ => "wie" ++ ap.s ! APred ;
|
s = \\_ => "wie" ++ ap.s ! APred ;
|
||||||
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext
|
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext
|
||||||
@@ -209,6 +233,16 @@ concrete ExtendGer of Extend =
|
|||||||
|
|
||||||
-- participle constructions
|
-- participle constructions
|
||||||
|
|
||||||
|
PresPartAP vp =
|
||||||
|
let a = agrP3 Sg in {
|
||||||
|
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
|
||||||
|
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPresPart af ;
|
||||||
|
s2 = \\_ => [] ;
|
||||||
|
isPre = True ;
|
||||||
|
c = <[],[]> ;
|
||||||
|
ext = vp.ext
|
||||||
|
} ;
|
||||||
|
|
||||||
PastPartAP vp =
|
PastPartAP vp =
|
||||||
let a = agrP3 Sg in {
|
let a = agrP3 Sg in {
|
||||||
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
|
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj
|
||||||
@@ -246,8 +280,23 @@ concrete ExtendGer of Extend =
|
|||||||
|
|
||||||
-- publishing of the document
|
-- publishing of the document
|
||||||
|
|
||||||
|
GerundCN vp = {
|
||||||
|
s = \\_,_,_ => useInfVP False vp ;
|
||||||
|
rc = \\_ => [] ;
|
||||||
|
ext, adv = [] ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundNP vp = MassNP (GerundCN vp) ;
|
||||||
|
|
||||||
|
GerundAdv vp = {s = useInfVP False vp} ;
|
||||||
|
|
||||||
|
ByVP vp = {s = "durch" ++ useInfVP False vp} ;
|
||||||
|
|
||||||
-- counterpart to ProgrVP, for VPSlash
|
-- counterpart to ProgrVP, for VPSlash
|
||||||
|
|
||||||
|
ProgrVPSlash vp = vp ;
|
||||||
|
|
||||||
-- construct VPSlash from A2 and N2
|
-- construct VPSlash from A2 and N2
|
||||||
|
|
||||||
-- existential for mathematics
|
-- existential for mathematics
|
||||||
@@ -337,6 +386,9 @@ concrete ExtendGer of Extend =
|
|||||||
adv = appPrep 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
|
||||||
|
|
||||||
|
AdvRVP vp prep rnp =
|
||||||
|
insertAdv (appPrep prep (rnp.s ! agrP3 Sg) ++ rnp.ext ++ rnp.rc) vp ;
|
||||||
|
|
||||||
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 = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
|
compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement
|
||||||
@@ -435,9 +487,23 @@ concrete ExtendGer of Extend =
|
|||||||
n = Pl
|
n = Pl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
CompoundAP n a = {
|
||||||
|
s = \\af => n.co ++ Predef.BIND ++ a.s ! Posit ! af ;
|
||||||
|
s2 = \\_ => [] ;
|
||||||
|
isPre = True ;
|
||||||
|
c = <[],[]> ;
|
||||||
|
ext = []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ApposNP np app = np ** {
|
||||||
|
s = \\b,c => np.s ! b ! c ++ embedInCommas (app.s ! False ! c ++ bigNP app) ;
|
||||||
|
w = WHeavy
|
||||||
|
} ;
|
||||||
|
|
||||||
InOrderToVP vp = {s = "um" ++ useInfVP False vp} ;
|
InOrderToVP vp = {s = "um" ++ useInfVP False vp} ;
|
||||||
|
|
||||||
|
PositAdVAdj a = {s = a.s ! Posit ! APred} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
insertObjReflNP : RNP -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022
|
insertObjReflNP : RNP -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022
|
||||||
\rnp,vp -> insertObjRNP rnp vp.c2 vp ;
|
\rnp,vp -> insertObjRNP rnp vp.c2 vp ;
|
||||||
|
|||||||
Reference in New Issue
Block a user