forked from GitHub/gf-rgl
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 ;
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = { s : Gender => Number => Str } ; -- Sentence ;
|
||||
-- RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
||||
-- SSlash = {s : Str ; c2 : Str} ;
|
||||
--
|
||||
@@ -28,11 +29,11 @@ concrete CatLat of Cat = CommonX-[Adv] ** open ResLat, ParamX, Prelude in {
|
||||
--
|
||||
---- Relative
|
||||
--
|
||||
-- RCl = {
|
||||
RCl = Gender => Number => Clause ;
|
||||
-- s : ResLat.Tense => Anteriority => CPolarity => Agr => Str ;
|
||||
-- c : Case
|
||||
-- } ;
|
||||
-- RP = {s : RCase => Str ; a : RAgr} ;
|
||||
RP = {s : Agr => Str } ;
|
||||
--
|
||||
---- Verb
|
||||
--
|
||||
|
||||
@@ -62,8 +62,12 @@ concrete ConjunctionLat of Conjunction =
|
||||
-- isPre = ss.isPre
|
||||
-- } ;
|
||||
---}
|
||||
--
|
||||
---- These fun's are generated from the list cat's.
|
||||
--
|
||||
|
||||
-- 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.
|
||||
--
|
||||
|
||||
-- BaseS : S -> S -> ListS
|
||||
@@ -131,13 +135,21 @@ concrete ConjunctionLat of Conjunction =
|
||||
-- -- ConsAP : AP -> ListAP -> ListAP
|
||||
-- ConsAP x xs =
|
||||
-- { 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
|
||||
[S] = { s : Coordinator => {init,last : SAdvPos => AdvPos => ComplPos => Order => Str} ; p : Pol ; t : Tense } ; -- TO FIX
|
||||
[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 } ;
|
||||
[AP] = {s : Coordinator => {init,last : Agr => Str } } ;
|
||||
|
||||
[RS] = { s : Coordinator => { init, last : Gender => Number => Str }} ;
|
||||
oper
|
||||
-- Generates a new number value given two number values.
|
||||
-- Pl if any of the two is Pl
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
concrete LangLat of Lang =
|
||||
GrammarLat,
|
||||
ParadigmsLat,
|
||||
LexiconLat
|
||||
LexiconLat,
|
||||
RelativeLat
|
||||
-- ConstructionLat
|
||||
** {
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ concrete RelativeLat of Relative = CatLat ** open ResLat in {
|
||||
--
|
||||
-- flags optimize=all_subs ;
|
||||
--
|
||||
-- lin
|
||||
lin
|
||||
--
|
||||
-- RelCl cl = {
|
||||
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
|
||||
-- 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 =>
|
||||
-- let
|
||||
-- agr = case rp.a of {
|
||||
@@ -25,19 +25,43 @@ concrete RelativeLat of Relative = CatLat ** open ResLat in {
|
||||
---- Pied piping: "at which we are looking". Stranding and empty
|
||||
---- relative are defined in $ExtraLat.gf$ ("that 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 =>
|
||||
-- slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
|
||||
-- c = Acc
|
||||
-- } ;
|
||||
--
|
||||
-- FunRP p np rp = {
|
||||
-- s = \\c => (combineNounPhrase np) ! PronNonDrop ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
|
||||
-- a = RAg np.a
|
||||
-- } ;
|
||||
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 ;
|
||||
-- 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
|
||||
-- in {
|
||||
-- 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
|
||||
}
|
||||
} ;
|
||||
|
||||
-- UseRCl t p cl = {
|
||||
-- UseRCl : Temp -> Pol -> RCl -> RS ;
|
||||
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 ;
|
||||
-- c = cl.c
|
||||
-- } ;
|
||||
} ;
|
||||
-- UseSlash t p cl = {
|
||||
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ;
|
||||
-- c2 = cl.c2
|
||||
@@ -75,7 +76,7 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in {
|
||||
-- TO FIX
|
||||
-- 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
|
||||
-- ctr = contrNeg True ; -- contracted negations
|
||||
|
||||
Reference in New Issue
Block a user