mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
work on relative clauses
This commit is contained in:
@@ -8,6 +8,7 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
|
|||||||
--
|
--
|
||||||
S = Sentence ;
|
S = Sentence ;
|
||||||
QS = {s : QForm => Str} ;
|
QS = {s : QForm => Str} ;
|
||||||
|
RS = { s : Gender => Number => Str } ; -- Sentence ;
|
||||||
-- RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
-- RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
||||||
-- SSlash = {s : Str ; c2 : Str} ;
|
-- SSlash = {s : Str ; c2 : Str} ;
|
||||||
--
|
--
|
||||||
@@ -28,11 +29,11 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
|
|||||||
--
|
--
|
||||||
---- Relative
|
---- Relative
|
||||||
--
|
--
|
||||||
-- RCl = {
|
RCl = Gender => Number => Clause ;
|
||||||
-- s : ResLat.Tense => Anteriority => CPolarity => Agr => Str ;
|
-- s : ResLat.Tense => Anteriority => CPolarity => Agr => Str ;
|
||||||
-- c : Case
|
-- c : Case
|
||||||
-- } ;
|
-- } ;
|
||||||
-- RP = {s : RCase => Str ; a : RAgr} ;
|
RP = {s : Agr => Str } ;
|
||||||
--
|
--
|
||||||
---- Verb
|
---- Verb
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
-- } ;
|
-- } ;
|
||||||
---}
|
---}
|
||||||
--
|
--
|
||||||
|
|
||||||
|
-- ConjRS : Conj -> ListRS -> RS
|
||||||
|
ConjRS conj rss = { s = \\g,n => conj.s1 ++ (rss.s ! conj.c).init ! g ! n ++ conj.s2 ++ (rss.s ! conj.c).last ! g ! n++ conj.s3 };
|
||||||
|
|
||||||
---- These fun's are generated from the list cat's.
|
---- These fun's are generated from the list cat's.
|
||||||
--
|
--
|
||||||
|
|
||||||
@@ -131,13 +135,21 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
-- -- ConsAP : AP -> ListAP -> ListAP
|
-- -- ConsAP : AP -> ListAP -> ListAP
|
||||||
-- ConsAP x xs =
|
-- ConsAP x xs =
|
||||||
-- { l = \\_ => consrTable Agr and_Conj.s2 x (xs.l ! Comma ) } ;
|
-- { l = \\_ => consrTable Agr and_Conj.s2 x (xs.l ! Comma ) } ;
|
||||||
|
|
||||||
|
-- BaseRS : RS -> RS -> ListRS ;
|
||||||
|
BaseRS rs1 rs2 = { s = \\co => { init = rs1.s ; last = rs2.s }} ;
|
||||||
|
|
||||||
|
-- ConsRS : RS -> List RS -> ListRS ;
|
||||||
|
ConsRS rs rss = { s = \\co => { init = rs.s ; last = \\g,n => coord co { init = (rss.s ! co).init ! g ! n ; last = (rss.s ! co).last ! g ! n } } } ;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
lincat
|
lincat
|
||||||
[S] = { s : Coordinator => {init,last : SAdvPos => AdvPos => ComplPos => Order => Str} ; p : Pol ; t : Tense } ; -- TO FIX
|
[S] = { s : Coordinator => {init,last : SAdvPos => AdvPos => ComplPos => Order => Str} ; p : Pol ; t : Tense } ; -- TO FIX
|
||||||
[Adv] = { s: Coordinator => {init,last : Str}} ;
|
[Adv] = { s: Coordinator => {init,last : Str}} ;
|
||||||
[NP] = { s : Coordinator => {init,last : PronDropForm => Case => Str} ; g : Gender ; n : Number ; p : Person ; adv : Str ; preap : AP ; postap : AP ; isBase : Bool ; det : Det } ;
|
[NP] = { s : Coordinator => {init,last : PronDropForm => Case => Str} ; g : Gender ; n : Number ; p : Person ; adv : Str ; preap : AP ; postap : AP ; isBase : Bool ; det : Det } ;
|
||||||
[AP] = {s : Coordinator => {init,last : Agr => Str } } ;
|
[AP] = {s : Coordinator => {init,last : Agr => Str } } ;
|
||||||
|
[RS] = { s : Coordinator => { init, last : Gender => Number => Str }} ;
|
||||||
oper
|
oper
|
||||||
-- Generates a new number value given two number values.
|
-- Generates a new number value given two number values.
|
||||||
-- Pl if any of the two is Pl
|
-- Pl if any of the two is Pl
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
concrete LangLat of Lang =
|
concrete LangLat of Lang =
|
||||||
GrammarLat,
|
GrammarLat,
|
||||||
ParadigmsLat,
|
ParadigmsLat,
|
||||||
LexiconLat
|
LexiconLat,
|
||||||
|
RelativeLat
|
||||||
-- ConstructionLat
|
-- ConstructionLat
|
||||||
** {
|
** {
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ concrete RelativeLat of Relative = CatLat ** open ResLat in {
|
|||||||
--
|
--
|
||||||
-- flags optimize=all_subs ;
|
-- flags optimize=all_subs ;
|
||||||
--
|
--
|
||||||
-- lin
|
lin
|
||||||
--
|
--
|
||||||
-- RelCl cl = {
|
-- RelCl cl = {
|
||||||
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
|
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
|
||||||
-- c = Nom
|
-- c = Nom
|
||||||
-- } ;
|
-- } ;
|
||||||
--
|
--
|
||||||
-- RelVP rp vp = {
|
RelVP rp vp = \\g,n => mkClause (emptyNP ** { s = \\_,c => rp.s ! (Ag g n c) ; g = g ; n = n } ) vp ;
|
||||||
-- s = \\t,ant,b,ag =>
|
-- s = \\t,ant,b,ag =>
|
||||||
-- let
|
-- let
|
||||||
-- agr = case rp.a of {
|
-- agr = case rp.a of {
|
||||||
@@ -26,18 +26,42 @@ concrete RelativeLat of Relative = CatLat ** open ResLat in {
|
|||||||
---- relative are defined in $ExtraLat.gf$ ("that we are looking at",
|
---- relative are defined in $ExtraLat.gf$ ("that we are looking at",
|
||||||
---- "we are looking at").
|
---- "we are looking at").
|
||||||
--
|
--
|
||||||
-- RelSlash rp slash = {
|
-- RelSlash : RP -> ClSlash -> RCl ;
|
||||||
|
RelSlash rp slash = \\g,n => slash ** { adv = rp.s ! Ag g n Gen } ; -- abuse adverbs again
|
||||||
-- s = \\t,a,p,agr =>
|
-- s = \\t,a,p,agr =>
|
||||||
-- slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
|
-- slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
|
||||||
-- c = Acc
|
-- c = Acc
|
||||||
-- } ;
|
|
||||||
--
|
--
|
||||||
-- FunRP p np rp = {
|
FunRP p np rp = {
|
||||||
|
s = \\a => case a of { Ag g n c => rp.s ! a ++ p.s ++ (combineNounPhrase np) ! PronNonDrop ! APostN ! DPreN ! Acc };
|
||||||
-- s = \\c => (combineNounPhrase np) ! PronNonDrop ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
|
-- s = \\c => (combineNounPhrase np) ! PronNonDrop ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
|
||||||
-- a = RAg np.a
|
-- a = RAg np.a
|
||||||
-- } ;
|
} ;
|
||||||
--
|
--
|
||||||
-- IdRP =
|
IdRP = {
|
||||||
|
s = table {
|
||||||
|
Ag Masc Sg (Nom | Voc) => "qui" ;
|
||||||
|
Ag Fem Sg (Nom | Voc) => "quae" ;
|
||||||
|
Ag Neutr Sg (Nom | Voc) => "quod" ;
|
||||||
|
Ag _ Sg Gen => "cuius" ;
|
||||||
|
Ag _ Sg Dat => "cui" ;
|
||||||
|
Ag Masc Sg Acc => "quem" ;
|
||||||
|
Ag Fem Sg Acc => "quam" ;
|
||||||
|
Ag Neutr Sg Acc => "quod" ;
|
||||||
|
Ag (Masc | Neutr) Sg Abl => "quo" ;
|
||||||
|
Ag Fem Sg Abl => "qua" ;
|
||||||
|
Ag Masc Pl (Nom | Voc) => "qui" ;
|
||||||
|
Ag (Fem | Neutr) Pl (Nom | Voc) => "quae" ;
|
||||||
|
Ag (Masc | Neutr) Pl Gen => "quorum" ;
|
||||||
|
Ag Fem Pl Gen => "quarum" ;
|
||||||
|
Ag _ Pl Dat => "quibus" ;
|
||||||
|
Ag Masc Pl Acc => "quos" ;
|
||||||
|
Ag Fem Pl Acc => "quas" ;
|
||||||
|
Ag Neutr Pl Acc => "quae" ;
|
||||||
|
Ag _ Pl Abl => "cui"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;
|
||||||
-- let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc
|
-- let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc
|
||||||
-- in {
|
-- in {
|
||||||
-- s = table {
|
-- s = table {
|
||||||
|
|||||||
@@ -56,11 +56,12 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in {
|
|||||||
QIndir => cl.q ++ combineSentence qs ! SPreS ! PreV ! CPostV ! SOV -- t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.o ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV
|
QIndir => cl.q ++ combineSentence qs ! SPreS ! PreV ! CPostV ! SOV -- t.s ++ p.s ++ cl.q ++ cl.s ! PreV ++ cl.o ! PreV ++ cl.v ! t.t ! t.a ! VQTrue ! PreV ! CPostV
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
-- UseRCl : Temp -> Pol -> RCl -> RS ;
|
||||||
-- UseRCl t p cl = {
|
UseRCl t p cl = {
|
||||||
|
s = \\g,n => defaultSentence (combineClause (cl ! g ! n) (lin Tense t) t.a (lin Pol p) VQFalse) ! SOV ;
|
||||||
-- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ;
|
-- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ;
|
||||||
-- c = cl.c
|
-- c = cl.c
|
||||||
-- } ;
|
} ;
|
||||||
-- UseSlash t p cl = {
|
-- UseSlash t p cl = {
|
||||||
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ;
|
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ;
|
||||||
-- c2 = cl.c2
|
-- c2 = cl.c2
|
||||||
@@ -75,7 +76,7 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in {
|
|||||||
-- TO FIX
|
-- TO FIX
|
||||||
-- SSubjS s1 subj s2 = { s = \\_ => subj.s ++ s2.s ! PreS ++ s1.s ! PreS ; sadv = lin Adv (mkAdverb []) } ;
|
-- SSubjS s1 subj s2 = { s = \\_ => subj.s ++ s2.s ! PreS ++ s1.s ! PreS ; sadv = lin Adv (mkAdverb []) } ;
|
||||||
|
|
||||||
-- RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
|
-- RelS s r = {s = s.s ! APreV ++ "," ++ r.s } ;
|
||||||
--
|
--
|
||||||
-- oper
|
-- oper
|
||||||
-- ctr = contrNeg True ; -- contracted negations
|
-- ctr = contrNeg True ; -- contracted negations
|
||||||
|
|||||||
Reference in New Issue
Block a user