From ef261ac4d2328a9b13456e8d83da548c1878ce08 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 18 Dec 2018 16:30:57 +0100 Subject: [PATCH] (Ara) replace Agr by AAgr in Obj --- src/arabic/IdiomAra.gf | 4 ++-- src/arabic/ResAra.gf | 15 ++++++++++----- src/arabic/VerbAra.gf | 4 +++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/arabic/IdiomAra.gf b/src/arabic/IdiomAra.gf index ca2ff4369..a7a058b9a 100644 --- a/src/arabic/IdiomAra.gf +++ b/src/arabic/IdiomAra.gf @@ -11,8 +11,8 @@ concrete IdiomAra of Idiom = CatAra ** open -- : VP -> Cl ; -- it is hot ImpersCl vp = let it : ResAra.NP = case vp.isPred of { - True => pron2np (pgn2pron vp.obj.a.pgn) ; - False => pgn2pron vp.obj.a.pgn } ; -- if no obj, Per3 Masc Sg chosen by default + True => pron2np (gn2pron vp.obj.a.gn) ; + False => gn2pron vp.obj.a.gn } ; -- if no obj, Per3 Masc Sg chosen by default in predVP it vp ; -- : VP -> Cl ; -- one sleeps diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index bbfc259ea..34ab1b5b3 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -1388,9 +1388,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> isDecl : Bool }; - Agr = { pgn : PerGenNum; isPron : Bool} ; - AAgr = { g : Gender ; n : Number} ; + Agr = {pgn : PerGenNum; isPron : Bool} ; + AgrLite = {gn : AAgr ; isPron : Bool} ; --used in ImpersCl + AAgr = {g : Gender ; n : Number} ; + agrLite : Agr -> AgrLite = \a -> a ** {gn = pgn2gn a.pgn} ; ----------------------------------------------------------------------------- -- NP, Pron @@ -1481,6 +1483,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> Per3 Masc Pl => theyMasc_Pron } ; + gn2pron : AAgr -> NP = \gn -> + pgn2pron (gn2pgn gn) ; + pron2np : NP -> NP = \np -> np ** { a = np.a ** {isPron=False} -- hack, sometimes we *don't* want prodrop } ; @@ -1694,20 +1699,20 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> Obj : Type = { s : Str ; - a : Agr -- default Agr in a VP without real Obj is Per3 Masc Sg. + a : AgrLite -- default Agr in a VP without real Obj is Per3 Masc Sg. }; -- need isPron for word order in predVP, and pgn for ImpersCl Subj : Type = {s : Case => Str ; isPron : Bool} ; np2subj : NP -> Subj = \np -> np ** {isPron = np.a.isPron} ; subj2np : Subj -> NP = \su -> su ** {a = {pgn = emptyNP.a.pgn ; isPron = su.isPron} ; empty=[]} ; - emptyObj : Obj = emptyNP ** {s=[]} ; + emptyObj : Obj = {a = {gn = {g=Masc ; n=Sg} ; isPron = False}; s = []} ; insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** { obj = {s = vp.obj.s -- old object, if there was one ++ bindIfPron np vp -- new object, bind if pronoun and not pred ++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V - a = np.a} + a = agrLite np.a} } ; bindIf : Bool -> Str = \b -> if_then_Str b BIND [] ; diff --git a/src/arabic/VerbAra.gf b/src/arabic/VerbAra.gf index ad7b178ca..8d29c074d 100644 --- a/src/arabic/VerbAra.gf +++ b/src/arabic/VerbAra.gf @@ -97,7 +97,9 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in { CompCN cn = {s = \\agr,c => cn2str cn agr.n Indef Nom ; obj = emptyObj ; isNP = False} ; - CompNP np = {s = \\_,_ => [] ; obj = np ** {s = np.s ! Nom} ; isNP = True} ; + CompNP np = {s = \\_,_ => [] ; + obj = {s = np.s ! Nom ; a = agrLite np.a} ; + isNP = True} ; -- -- }