From 29b5ac47fb12b67714727675d4c8b5875f0492e3 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 27 Nov 2018 17:34:16 +0100 Subject: [PATCH 1/3] (Ara) include N2's c2 in ComplN2 --- src/arabic/NounAra.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arabic/NounAra.gf b/src/arabic/NounAra.gf index 0ae1ad137..174a1d817 100644 --- a/src/arabic/NounAra.gf +++ b/src/arabic/NounAra.gf @@ -174,7 +174,7 @@ lin Use2N3 n3 = n3 ; Use3N3 n3 = n3 ** {c2 = n3.c3} ; - ComplN2 n2 np = UseN n2 ** {np=np.s} ; + ComplN2 n2 np = UseN n2 ** {np = \\c => n2.c2.s ++ np.s ! n2.c2.c} ; ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ; From f2e99934257483a393f2a26fbd34b34876dd315f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 27 Nov 2018 17:35:59 +0100 Subject: [PATCH 2/3] (Ara) Fix bug in SlashV2VNP + refactor some related opers --- src/arabic/ResAra.gf | 23 ++++++++++++++--------- src/arabic/VerbAra.gf | 12 +++++++----- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index e1699cf14..0cf91ddbe 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -1545,10 +1545,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> } ; } in wordOrder o vp.obj.a.isPron np.a.isPron - (vStr vp pgn t p) - (case of { - => BIND ++ vp.obj.s ; - _ => vp.obj.s }) + (vStr vp pgn t p) + vp.obj.s (pred vp pgn t p) vp.s2 subj @@ -1626,11 +1624,18 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> subj2np : Subj -> NP = \su -> su ** {a = {pgn = emptyNP.a.pgn ; isPron = su.isPron} ; empty=[]} ; emptyObj : Obj = emptyNP ** {s=[]} ; - insertObj : NP -> VPSlash -> VP = \np,vp -> vp ** - { obj = {s = vp.obj.s -- old object, if there was one - ++ vp.c2.s ++ np.s ! vp.c2.c -- new object - ++ vp.agrObj ! np.a.pgn ; -- only used for SlashV2V - a = np.a} }; + 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} + } ; + + bindIfPron : NP -> {c2:Preposition; isPred:Bool} -> Str = \np,vp -> + let bind = case of { + => BIND ; + _ => [] } + in vp.c2.s ++ bind ++ np.s ! vp.c2.c ; insertPred : Comp -> VP -> VP = \p,vp -> vp ** { pred = p; diff --git a/src/arabic/VerbAra.gf b/src/arabic/VerbAra.gf index 2fe248c3f..abfdc2189 100644 --- a/src/arabic/VerbAra.gf +++ b/src/arabic/VerbAra.gf @@ -14,17 +14,19 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in { agrObj = \\pgn => v2v.c3.s -- أَنْ ++ vp.s ! pgn ! VPImpf Cnj ; isPred = False ; - c2 = v2v.c2 ; -- for the direct object + c2 = v2v.c2 ; -- preposition for the direct object sc = v2v.sc } ; -- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy - SlashV2VNP v2v np vps = let v2vVP = predV v2v in -- IL + SlashV2VNP v2v np vps = let v2vVP = slashV2 v2v in -- IL vps ** { - s = \\pgn,vpf => v2vVP.s ! pgn ! vpf - ++ v2v.c2.s ++ np.s ! v2v.c2.c + s = \\pgn,vpf => v2vVP.s ! pgn ! vpf -- main verb agrees with subject + ++ bindIfPron np v2vVP ++ v2v.c3.s -- أَنْ - ++ vps.s ! pgn ! VPImpf Cnj ; + ++ vps.s ! np.a.pgn ! VPImpf Cnj -- verb from old VP agrees with object + ++ vps.obj.s ; -- otherwise obj appears in a weird place /IL + obj = emptyObj ; isPred = False ; -- preposition for the direct object comes from VP sc = v2v.sc From 19129aa420231655534428dba7bbda36157308d5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 27 Nov 2018 17:36:23 +0100 Subject: [PATCH 3/3] (Ara) misc. small fixes and additions --- src/arabic/IdiomAra.gf | 9 ++++++--- src/arabic/ResAra.gf | 4 ++++ src/arabic/SentenceAra.gf | 6 ++---- src/arabic/StructuralAra.gf | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/arabic/IdiomAra.gf b/src/arabic/IdiomAra.gf index c46bbadd4..7a18b1334 100644 --- a/src/arabic/IdiomAra.gf +++ b/src/arabic/IdiomAra.gf @@ -10,7 +10,9 @@ concrete IdiomAra of Idiom = CatAra ** open -- : VP -> Cl ; -- it is hot ImpersCl vp = - let it : ResAra.NP = pron2np (pgn2pron vp.obj.a.pgn) ; -- if no obj, Per3 Masc Sg chosen by default + 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 in predVP it vp ; -- : VP -> Cl ; -- one sleeps @@ -21,8 +23,9 @@ concrete IdiomAra of Idiom = CatAra ** open -- : Adv -> S -> Cl ; -- it is here she slept CleftAdv adv s = - let comp : Comp = CompAdv adv in - predVP he_Pron (UseComp comp) ; + let comp : Comp = CompAdv (lin Adv {s = adv.s ++ s.s ! Verbal}) ; -- no idea about word order /IL + pass_V = mkV "مضي" va vi ; -- switch to copula or some other verb if better /IL + in predVP emptyNP (UseV pass_V ** {isPred=True ; pred=comp}) ; -- very hacky /IL -- : NP -> Cl ; -- there is a house ExistNP np = diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index 0cf91ddbe..6156d4357 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -1656,6 +1656,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> VPSlash : Type = VP ** {c2 : Preposition ; agrObj : PerGenNum => Str} ; ClSlash : Type = VPSlash ** {subj : Subj} ; + emptyVPslash : VP -> VPSlash = \vp -> vp ** { + c2 = noPrep ; agrObj = \\_ => [] + } ; + slashV2 : Verb2 -> VPSlash = \v -> predV v ** {c2 = v.c2 ; agrObj = \\_ => []} ; diff --git a/src/arabic/SentenceAra.gf b/src/arabic/SentenceAra.gf index e6c7fbdc9..854daaf4c 100644 --- a/src/arabic/SentenceAra.gf +++ b/src/arabic/SentenceAra.gf @@ -52,10 +52,8 @@ concrete SentenceAra of Sentence = CatAra ** open SlashVP = predVPSlash ; AdvSlash slash adv = slash ** { s2 = slash.s2 ++ adv.s } ; --- SlashPrep : Cl -> Prep -> ClSlash --- Will be awkward to implement in the way ClSlash is now. --- ClSlash is implemented the way it is now for a good reason: --- we need to support different word orders. +-- : Cl -> Prep -> ClSlash +-- SlashPrep cl prep = TODO -- SlashVS np vs sslash = TODO diff --git a/src/arabic/StructuralAra.gf b/src/arabic/StructuralAra.gf index f4abefa28..c6c8aaafc 100644 --- a/src/arabic/StructuralAra.gf +++ b/src/arabic/StructuralAra.gf @@ -46,7 +46,7 @@ concrete StructuralAra of Structural = CatAra ** n = Pl ; d = Def } ; -- IL --- if_Subj = ss "ِف" ; + if_Subj = mkSubj "إِذَا" Verbal ; in8front_Prep = mkPrep "مُقَابِلَ" ; i_Pron = ResAra.i_Pron ; in_Prep = mkPrep "فِي" ;