1
0
forked from GitHub/gf-rgl

(Ara) Clean up and add comments in QuestionAra

This commit is contained in:
Inari Listenmaa
2019-01-25 10:15:48 +01:00
parent 535be667c7
commit ae51f19459

View File

@@ -2,41 +2,42 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
flags optimize=all_subs ; coding = utf8 ; flags optimize=all_subs ; coding = utf8 ;
lin lin
-- : Cl -> QCl ; -- does John walk
QuestCl cl = {
s = \\t,p =>
table {
QIndir => "إِذا" ++ cl.s ! t ! p ! toOrder QIndir ;
QDir => "هَلْ" ++ cl.s ! t ! p ! Verbal -- yes/no question
}
};
QuestCl cl = { -- : IP -> VP -> QCl ; -- who walks
s = \\t,p => QuestVP qp vp =
table { let np = ip2np qp vp.isPred ;
QIndir => "إِذا" ++ cl.s ! t ! p ! toOrder QIndir ; cl = PredVP np vp ;
QDir => "هَلْ" ++ cl.s ! t ! p ! Verbal -- yes/no question in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
}
};
-- ComplSlashIP vps ip = {} ; -- QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! Verbal} ; -- Verbal word order, because there is no pre-existing question word /IL
QuestVP qp vp =
let np = ip2np qp vp.isPred ;
cl = PredVP np vp ;
in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
QuestIAdv iadv cl = {s = \\t,p,qf => iadv.s ++ cl.s ! t ! p ! Verbal} ; -- Verbal word order, because there is no pre-existing question word /IL
---- IL guessed ---- IL guessed
-- : IComp -> NP -> QCl -- : IComp -> NP -> QCl
QuestIComp ic np = QuestIComp ic np =
let vp = UseComp (CompNP np) ; -- puts NP in nominative let vp = UseComp (CompNP np) ; -- puts NP in nominative
ip : ResAra.IP = np ** { -- NP's s is already present in VP, we only want its agr ip : ResAra.IP = np ** { -- NP's s is already present in VP, we only want its agr
s = \\_,_,_,_ => ic.s ! pgn2gn np.a.pgn } ; s = \\_,_,_,_ => ic.s ! pgn2gn np.a.pgn } ;
in QuestVP ip vp ; in QuestVP ip vp ;
-- : IP -> IComp ; -- : IP -> IComp ;
CompIP ip = ip ** { CompIP ip = ip ** {
s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence
! gn.g -- IComp agrees in gender with eventual head ! gn.g -- IComp agrees in gender with eventual head
! Def ! Nom ; -- IP will be a subject ! Def ! Nom ; -- IP will be a subject
} ; } ;
CompIAdv iadv = { s = \\_ => iadv.s ; a = ResAra.Sg } ; -- : IAdv -> IComp ; -- where (is it)
CompIAdv iadv = { s = \\_ => iadv.s ; a = ResAra.Sg } ;
-- : IP -> ClSlash -> QCl ; -- whom does John love -- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls = { QuestSlash ip cls = {
@@ -48,17 +49,21 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
++ cl.s ! t ! p ! o ++ cl.s ! t ! p ! o
} ; } ;
--IL guessed -- : Prep -> IP -> IAdv ; -- with whom
PrepIP p ip = { PrepIP prep ip = {
s = p.s ++ ip.s ! False -- not used as a subject of predicative sentence s = prep.s ++ bindIf prep.binds
! Masc ---- ++ ip.s ! False -- not used as a subject of predicative sentence
! Def ! Gen ! Masc ----
! Def -- not sure /IL
! prep.c
} ; } ;
-- : IP -> Adv -> IP ; -- who in Paris
AdvIP ip adv = ip ** { AdvIP ip adv = ip ** {
s = \\isPred,g,s,c => ip.s ! isPred ! g ! s ! c ++ adv.s ; s = \\isPred,g,s,c => ip.s ! isPred ! g ! s ! c ++ adv.s ;
} ; } ;
-- : IAdv -> Adv -> IAdv ; -- where in Paris
AdvIAdv iadv adv = {s = iadv.s ++ adv.s} ; AdvIAdv iadv adv = {s = iadv.s ++ adv.s} ;
-- : IDet -> IP -- : IDet -> IP