(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 ;
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 = {
s = \\t,p =>
table {
QIndir => "إِذا" ++ cl.s ! t ! p ! toOrder QIndir ;
QDir => "هَلْ" ++ cl.s ! t ! p ! Verbal -- yes/no question
}
};
-- : IP -> VP -> QCl ; -- who walks
QuestVP qp vp =
let np = ip2np qp vp.isPred ;
cl = PredVP np vp ;
in { s = \\t,p,qf => cl.s ! t ! p ! toOrder qf } ;
-- ComplSlashIP vps ip = {} ;
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
-- 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
---- IL guessed
-- : IComp -> NP -> QCl
QuestIComp ic np =
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
s = \\_,_,_,_ => ic.s ! pgn2gn np.a.pgn } ;
in QuestVP ip vp ;
-- : IComp -> NP -> QCl
QuestIComp ic np =
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
s = \\_,_,_,_ => ic.s ! pgn2gn np.a.pgn } ;
in QuestVP ip vp ;
-- : IP -> IComp ;
CompIP ip = ip ** {
s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence
! gn.g -- IComp agrees in gender with eventual head
! Def ! Nom ; -- IP will be a subject
-- : IP -> IComp ;
CompIP ip = ip ** {
s = \\gn => ip.s ! True -- True=IP will be a subject of predicative sentence
! gn.g -- IComp agrees in gender with eventual head
! 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
QuestSlash ip cls = {
@@ -48,17 +49,21 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA
++ cl.s ! t ! p ! o
} ;
--IL guessed
PrepIP p ip = {
s = p.s ++ ip.s ! False -- not used as a subject of predicative sentence
! Masc ----
! Def ! Gen
-- : Prep -> IP -> IAdv ; -- with whom
PrepIP prep ip = {
s = prep.s ++ bindIf prep.binds
++ ip.s ! False -- not used as a subject of predicative sentence
! Masc ----
! Def -- not sure /IL
! prep.c
} ;
-- : IP -> Adv -> IP ; -- who in Paris
AdvIP ip adv = ip ** {
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} ;
-- : IDet -> IP