forked from GitHub/gf-rgl
(Ara) Add relative clauses
This commit is contained in:
@@ -12,7 +12,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
-- RS = {s : Agr => Str} ;
|
||||
RS = {s : Agr => Case => Str} ;
|
||||
|
||||
-- Sentence
|
||||
|
||||
@@ -27,12 +27,12 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
|
||||
IP = ResAra.IP ; -- {s : (isPred : Bool) => State => Case => Str ; n : Number} ;
|
||||
IComp = ResAra.IComp ; --
|
||||
IQuant = {s : State => Case => Str} ;
|
||||
--
|
||||
---- Relative
|
||||
--
|
||||
-- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
|
||||
-- RP = {s : Case => Str ; a : RAgr} ;
|
||||
--
|
||||
|
||||
-- Relative
|
||||
|
||||
RCl = ResAra.RCl ;
|
||||
RP = ResAra.RP ;
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = ResAra.VP ;
|
||||
|
||||
@@ -188,7 +188,8 @@ lin
|
||||
AdjCN ap cn = cn ** {
|
||||
adj = \\n,d,c => ap.s ! cn.h ! cn.g ! n ! (definite ! d) ! c
|
||||
};
|
||||
-- RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||
|
||||
RelCN cn rs = cn ** {s = \\n,s,c => cn.s ! n ! s ! c ++ rs.s ! {pgn=Per3 cn.g n ; isPron=False} ! c};
|
||||
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
--
|
||||
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
|
||||
@@ -1,35 +1,45 @@
|
||||
concrete RelativeAra of Relative = CatAra ** open ResAra in {
|
||||
flags coding=utf8;
|
||||
--
|
||||
-- flags optimize=all_subs ;
|
||||
--
|
||||
-- lin
|
||||
--
|
||||
-- RelCl cl = {
|
||||
-- s = \\t,a,p,_ => "سُعه" ++ "تهَت" ++ cl.s ! t ! a ! p ! ODir
|
||||
-- } ;
|
||||
--
|
||||
-- RelVP rp vp = {
|
||||
-- s = \\t,ant,b,ag =>
|
||||
-- let
|
||||
-- agr = case rp.a of {
|
||||
-- RNoAg => ag ;
|
||||
-- RAg a => a
|
||||
-- } ;
|
||||
-- cl = mkClause (rp.s ! Nom) agr vp
|
||||
-- in
|
||||
-- cl.s ! t ! ant ! b ! ODir
|
||||
-- } ;
|
||||
--
|
||||
concrete RelativeAra of Relative = CatAra ** open ResAra, SentenceAra in {
|
||||
flags coding=utf8;
|
||||
|
||||
lin
|
||||
|
||||
-- RelCl cl = {
|
||||
-- s = \\t,p,agr,c => IdRP.s ! agr2ragr agr c ++ cl.s ! t ! p ! Nominal
|
||||
-- } ;
|
||||
|
||||
-- : RP -> VP -> RCl ; -- who loves John
|
||||
RelVP rp vp = {
|
||||
s = \\t,p,agr,c =>
|
||||
let
|
||||
npS : Case => Str = \\_ => rp.s ! agr2ragr agr c ;
|
||||
np = {s = npS ; a = agr} ;
|
||||
cl = PredVP np vp ;
|
||||
in
|
||||
cl.s ! t ! p ! Nominal
|
||||
} ;
|
||||
|
||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||
-- TODO: add resumptive pronouns
|
||||
-- RelSlash rp slash = {
|
||||
-- s = \\t,a,p,_ => slash.c2 ++ rp.s ! Acc ++ slash.s ! t ! a ! p ! ODir
|
||||
-- } ;
|
||||
--
|
||||
-- FunRP p np rp = {
|
||||
-- s = \\c => np.s ! c ++ p.s ++ rp.s ! Acc ;
|
||||
-- a = RAg np.a
|
||||
-- } ;
|
||||
--
|
||||
-- IdRP = mkIP "وهِعه" "وهِعه" "وهْسي" Sg ** {a = RNoAg} ;
|
||||
--
|
||||
|
||||
IdRP =
|
||||
{ s = table {
|
||||
RSg Masc => "اَلَّذِي" ;
|
||||
RSg Fem => "اَلَّتِي" ;
|
||||
RPl Masc => "اَلَّذِين" ;
|
||||
RPl Fem => "اَللَّاتِي" ;
|
||||
RDl Masc Bare => "اَللَّذَيْن" ;
|
||||
RDl Masc Nom => "اَللَّذَانِ" ;
|
||||
RDl Masc _ => "اَللَّذَيْنِ" ;
|
||||
RDl Fem Bare => "اَللَّتَيْن" ;
|
||||
RDl Fem Nom => "اَللَّتَانِ" ;
|
||||
RDl Fem _ => "اَللَّتَيْنِ"
|
||||
}
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -1296,6 +1296,34 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
||||
Cl : Type = {s : Tense => Polarity => Order => Str} ;
|
||||
QCl : Type = {s : Tense => Polarity => QForm => Str} ;
|
||||
|
||||
-- Relative
|
||||
param
|
||||
RAgr = RSg Gender | RPl Gender | RDl Gender Case ;
|
||||
|
||||
oper
|
||||
agr2ragr = overload {
|
||||
agr2ragr : Agr -> Case -> RAgr = \a,c ->
|
||||
let gn = pgn2gn a.pgn in case <gn.n,gn.g,a> of {
|
||||
<Sg,x> => RSg x ;
|
||||
<Pl,x> => RPl x ;
|
||||
<Dl,x> => RDl x c ;
|
||||
_ => Predef.error "agr2ragr"} ;
|
||||
agr2ragr : Number -> Case -> Gender -> RAgr = \n,c,g ->
|
||||
case n of {
|
||||
Sg => RSg g ;
|
||||
Dl => RDl g c ;
|
||||
Pl => RPl g }
|
||||
} ;
|
||||
|
||||
-- ragr2agr : Number -> Case -> Gender -> RAgr = \ra ->
|
||||
-- case ra of {
|
||||
-- RSg x => Per3 Sg x ;
|
||||
-- RPl x => Per3 Pl x ;
|
||||
-- RDl x => Per3 Dl x } ;
|
||||
|
||||
RCl : Type = {s : Tense => Polarity => Agr => Case => Str} ;
|
||||
RP : Type = {s : RAgr => Str } ;
|
||||
|
||||
--TODO: slashRCl : ClSlash -> RP -> RCl ;
|
||||
|
||||
param
|
||||
|
||||
@@ -129,6 +129,6 @@ concrete SentenceAra of Sentence = CatAra ** open
|
||||
}
|
||||
};
|
||||
|
||||
-- UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ;
|
||||
UseRCl t p cl = {s = \\agr,c => t.s ++ p.s ++ cl.s ! t.t ! p.p ! agr ! c} ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user