From 50200f3e0c6a92844ffe16e3d621fed9b48baca3 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 22 Feb 2019 15:18:59 +0100 Subject: [PATCH] (Pes) Word order regarding ra + cleanup and renaming --- src/persian/ConjunctionPes.gf | 2 +- src/persian/IdiomPes.gf | 11 +-- src/persian/NounPes.gf | 34 ++++--- src/persian/ParadigmsPes.gf | 1 + src/persian/PhrasePes.gf | 26 ++--- src/persian/RelativePes.gf | 7 +- src/persian/ResPes.gf | 170 +++++++++++++++------------------ src/persian/SentencePes.gf | 4 +- src/persian/SymbolPes.gf | 9 +- src/persian/VerbPes.gf | 50 +++++----- src/persian/src/IdiomPes.gf | 4 +- src/persian/src/ResPes.gf | 10 +- src/persian/src/SentencePes.gf | 2 +- 13 files changed, 156 insertions(+), 174 deletions(-) diff --git a/src/persian/ConjunctionPes.gf b/src/persian/ConjunctionPes.gf index 1e303666f..4d79b8a5d 100644 --- a/src/persian/ConjunctionPes.gf +++ b/src/persian/ConjunctionPes.gf @@ -39,7 +39,7 @@ concrete ConjunctionPes of Conjunction = lincat [S] = {s1,s2 : Str} ; [Adv] = {s1,s2 : Str} ; - [NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ; + [NP] = {s1,s2 : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool; compl:Str} ; [AP] = {s1,s2 : Mod => Str ; adv : Str} ; [RS] = {s1,s2 : Agr => Str }; diff --git a/src/persian/IdiomPes.gf b/src/persian/IdiomPes.gf index 41273de11..213217ea9 100644 --- a/src/persian/IdiomPes.gf +++ b/src/persian/IdiomPes.gf @@ -17,16 +17,15 @@ lin ExistNP np = mkSClause " " (agrP3 (fromAgr np.a).n) - (insertObj (\\_ => np.s ! Bare) (predAux auxBe)) ; + (insertComp (\\_ => np.s ! Bare) (predAux auxBe)) ; ExistIP ip = let cl = mkSClause ( ip.s ) (agrP3 ip.n) (predAux auxBe); - in { - s = \\t,p,qf => case qf of { - QDir => cl.s ! t ! p ! ODir; + in {s = \\t,p,qf => case qf of { + QDir => cl.s ! t ! p ! ODir; QIndir => cl.s ! t! p ! ODir - } - }; + } + }; ProgrVP vp = predProg vp ; diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index ea4f3826e..4210cbcbf 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -9,13 +9,14 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { True => Sg ; -- noun modified by a number is invariably singular False => det.n } ; in case det.mod of { - Bare => det.s ++ cn.s ! num ! m ++ cn.compl ; -- det doesn't require a special form, keep the Mod=>Str table - x => cn.s ! num ! x ++ det.s ++ cn.compl } ; -- det requires a special form + Bare => det.s ++ cn.s ! num ! m ; -- det doesn't require a special form, keep the Mod=>Str table + x => cn.s ! num ! x ++ det.s } ; -- det requires a special form a = agrP3 det.n ; + compl = cn.compl ! det.n } ; - UsePN pn = pn ** {s = \\_ => pn.s ; a = agrP3 Sg ; hasAdj = False} ; - UsePron p = p ** {s = \\_ => p.s ; animacy = Animate ; hasAdj = False} ; + UsePN pn = emptyNP ** pn ** {s = \\_ => pn.s} ; + UsePron p = emptyNP ** p ** {s = \\_ => p.s ; animacy = Animate} ; PredetNP pred np = np ** { s = \\ez => pred.s ++ np.s ! ez @@ -51,7 +52,8 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { s = \\_ => det.s ; ---- case a = agrP3 det.n ; hasAdj = False ; - animacy = Inanimate + animacy = Inanimate ; + compl = [] } ; PossPron p = {s = \\_ => BIND ++ p.ps ; a = p.a ; mod = Poss} ; @@ -76,25 +78,26 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { MassNP cn = cn ** { s = cn.s ! Sg ; - a = agrP3 Sg + a = agrP3 Sg ; + compl = cn.compl ! Sg } ; - UseN n = n ** {hasAdj=False; compl=[]}; - UseN2 n = n ** {hasAdj=False; compl=[]}; + UseN, + UseN2 = useN ; - Use2N3 f = f ** { - c = f.c2; + Use2N3 n3 = useN n3 ** { + c = n3.c2 ; compl = [] } ; - Use3N3 f = f ** { - c = f.c3; + Use3N3 n3 = useN n3 ** { + c = n3.c3 ; compl = [] } ; ComplN2 n2 np = n2 ** { s = \\n,m => n2.s ! n ! Ezafe ; - compl = n2.compl ++ n2.c ++ np.s ! Bare ; + compl = \\_ => n2.compl ++ n2.c ++ np.s ! Bare ; hasAdj = False }; @@ -110,12 +113,13 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { } ; RelCN cn rs = cn ** { - s = \\n,ez => cn.s ! n ! Clitic ++ rs.s ! agrP3 n ; + s = \\n,ez => cn.s ! n ! Clitic ; + compl = \\n => rs.s ! agrP3 n ; } ; AdvCN cn ad = cn ** {s = \\n,m => cn.s ! n ! Ezafe ++ ad.s} ; - SentCN cn sc = cn ** {s = \\n,m => cn.s ! n ! m ++ sc.s} ; + SentCN cn sc = cn ** {compl = \\n => sc.s} ; -- correct for /city Paris/, incorrect for /king John/ -- ApposNP in ExtendPes works for /king John/ (no ezafe). diff --git a/src/persian/ParadigmsPes.gf b/src/persian/ParadigmsPes.gf index a4ffc6839..35c9317a7 100644 --- a/src/persian/ParadigmsPes.gf +++ b/src/persian/ParadigmsPes.gf @@ -92,6 +92,7 @@ oper = lin V M.haveVerb ; beVerb : V -- The verb "be", to be used for light verb constructions: e.g. compoundV "عاشق" beVerb. = lin V M.beVerb ; + mkV2 : overload { mkV2 : Str -> V2 ; -- Predictable V2 out of string. No preposition, را for direct object. mkV2 : V -> V2 ; -- V2 out of V. No preposition, را for direct object. diff --git a/src/persian/PhrasePes.gf b/src/persian/PhrasePes.gf index 603875762..7e63d6c6b 100644 --- a/src/persian/PhrasePes.gf +++ b/src/persian/PhrasePes.gf @@ -3,25 +3,25 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in { lin PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; - UttS s = s ; UttQS qs = {s = qs.s ! QDir} ; UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ; UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ; UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ; - UttIP ip = {s = ip.s } ; --- Acc also - UttIAdv iadv = iadv ; - UttNP np = {s = np.s ! Bare} ; - UttVP vp = {s = vp.ad ++ vp.comp ! Ag Sg P3 ++ vp.obj.s ++ vp.inf ++ vp.vComp ! Ag Sg P3 ++ vp.embComp} ; - UttAdv adv = {s = adv.s } ; - UttCN cn = {s = cn.s ! Sg ! Bare }; - UttCard n = n ; + UttS, + UttIP, --- Acc also + UttAdv, + UttIAdv, + UttCard = \ss -> ss ; + + UttNP np = {s = np2str np} ; + UttCN cn = {s = cn2str cn}; UttAP ap = {s = ap.s ! Bare} ; + UttVP vp = {s = showVPH VPInf defaultAgr vp} ; + PConjConj conj = {s = conj.s2} ; + + NoVoc, NoPConj = {s = []} ; - PConjConj conj = {s = conj.s2} ; --- - - NoVoc = {s = []} ; - VocNP np = {s = np.s ! Bare} ; - + VocNP = UttNP ; } diff --git a/src/persian/RelativePes.gf b/src/persian/RelativePes.gf index 935751140..d0156dc9b 100644 --- a/src/persian/RelativePes.gf +++ b/src/persian/RelativePes.gf @@ -27,11 +27,6 @@ concrete RelativePes of Relative = CatPes ** open ResPes in { cl.s ! t ! p ! ODir ; -- c = Dir } ; - - ----- Pied piping: "ت wهعه we رe لْْکنگ". Stranding and empty ----- relative are defined in $ExtraHin.gf$ ("تهت we رe لْْکنگ ت", ----- "we رe لْْکنگ ت"). -- RelSlash rp slash = { s = \\t,p,o,agr => rp.s ++ slash.c2.s ++ slash.subj ++ slash.vp ! t ! p ! o ;--case t of { ---- AR 18/8/2017 is this the right place of subj? @@ -42,7 +37,7 @@ concrete RelativePes of Relative = CatPes ** open ResPes in { } ; FunRP p np rp = { - s = np.s ! Clitic ++ rp.s ++ p.s ++ getPron np.animacy (fromAgr np.a).n ; -- need to make a special form of relative np by addY + s = np.s ! Clitic ++ rp.s ++ p.s ++ getPron np.animacy (fromAgr np.a).n ; -- need to make a special form of relative np by addY a = RAg np.a } ; diff --git a/src/persian/ResPes.gf b/src/persian/ResPes.gf index 9f428415a..14fc1539f 100644 --- a/src/persian/ResPes.gf +++ b/src/persian/ResPes.gf @@ -22,16 +22,40 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { | CNeg Bool; -- contracted or not oper - - Compl : Type = {s : Str ; ra : Str ; c : VType} ; CN : Type = Noun ** { - hasAdj : Bool ; -- to get the right form when CN is a predicate - compl : Str -- to make possessive suffix attach to the right word + hasAdj : Bool ; -- to get the right form when CN is a predicate + compl : Number => Str -- to make possessive suffix attach to the right word + -- dep. on Agr because of RelCN + } ; + + NP : Type = { + s : Mod => Str ; -- NP can appear with a clitic, need to keep Mod open + a : Agr ; + hasAdj : Bool ; -- to get the right form when NP is a predicate + compl : Str ; -- to make possessive suffix attach to the right word + animacy : Animacy -- to get the right relative pronoun } ; - NP : Type = {s : Mod => Str ; a : Agr ; animacy : Animacy ; hasAdj : Bool} ; - VPHSlash : Type = VPH ** {c2 : Compl} ; oper + emptyNP : NP = { + s = \\_ => [] ; + a = defaultAgr ; + hasAdj = False ; + animacy = Inanimate ; + compl = [] + } ; + + useN : Noun -> CN = \n -> n ** { + hasAdj = False ; + compl = \\_ => [] + } ; + + np2str : NP -> Str = \np -> + np.s ! Bare ++ np.compl ; + + cn2str : CN -> Str = \cn -> + cn.s ! Sg ! Bare ++ cn.compl ! Sg ; + contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { Pos => CPos ; Neg => CNeg b @@ -48,17 +72,24 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { oper - VPH : Type = { - s : VPHForm => Str ; -- {inf : Str} ; - obj : {s : Str ; a : Agr} ; + VPH : Type = { + s : VPHForm => Str ; + obj : {s : Str ; a : Agr} ; -- direct object of a verb subj : VType ; - comp : Agr => Str; - vComp : Agr => Str; - inf : Str; + comp : Agr => Str; -- complements of a verb; those other than a direct object. e.g. indirect object of ditransitive verbs. + vComp : Agr => Str; -- when a verb is used as a complement of an auxiliary verb, we store it in this field. Unlike ‘comp’ or ‘obj’, this type of complement follows the auxiliary verb. ad : Str; - embComp : Str ; + embComp : Str ; -- when a declarative or interrogative sentence is used as a complement of a verb. wish : Bool ; } ; + + showVPH : VPHForm -> Agr -> VPH -> Str = \vf,agr,vp -> + vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vp.s ! vf ++ vp.vComp ! agr ++ vp.embComp ; + + Compl : Type = {s : Str ; ra : Str} ; + + VPHSlash : Type = VPH ** {c2 : Compl} ; + param VPHForm = @@ -69,6 +100,7 @@ oper | VVForm Agr | VPStem1 | VPStem2 + | VPInf ; VPHTense = @@ -84,7 +116,6 @@ oper | VRoot1 -- AR 22/3/2018 for mustCl past after Nasrin ; - VType = VIntrans | VTrans | VTransPost ; VPPTense = @@ -93,8 +124,6 @@ oper |VPFutr Anteriority |VPCond Anteriority ; oper ---s (Vvform (Ag Sg P1)) : بخوانم - predV : Verb -> VPH = \verb -> { s = \\vh => @@ -110,10 +139,10 @@ oper VVForm agr => verb.s ! Vvform agr ; VPStem1 => verb.s ! Root1 ; VPStem2 => verb.s ! Root2 ; + VPInf => verb.s ! Inf; VPImp pol n =>verb.s ! Imp pol n }; obj = {s = [] ; a = defaultAgr} ; subj = VIntrans ; - inf = verb.s ! Inf; ad = []; embComp = []; wish = False ; @@ -122,88 +151,51 @@ oper } ; predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb -> - predV verb ** {c2 = {s = verb.c1 ; ra = [] ; c = VTrans} } ; ----------------------- --- Verb Phrase complimantation ------------------------- -{- - insertObject : NP -> VPHSlash -> VPH = \np,vps -> vps ** { --- obj = {s = variants { vps.obj.s ++ np.s ++ vps.c2.s ; vps.obj.s ++ np.s } ; a = np.a} ; - obj = {s = case vps.c2.s of { - "را" => np.s ++ vps.c2.s ++ vps.obj.s; - _ => vps.c2.s ++ np.s ++ vps.obj.s - }; - a = np.a} ; - subj = vps.c2.c ; - } ; --} - insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj obj vp ** {c2 = vp.c2} ; - insertVVc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> - insertVV obj vp ** {c2 = vp.c2} ; + predV verb ** {c2 = {s = verb.c1 ; ra = []} } ; - {- - insertSubj : Person -> Str -> Str = \p,s -> - case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; - -} - insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> vp ** { - comp = \\a => vp.comp ! a ++ obj1 ! a + + +--------------------- +-- VP complementation +--------------------- + + insertComp : (Agr => Str) -> VPH -> VPH = \obj,vp -> vp ** { + comp = \\a => vp.comp ! a ++ obj ! a } ; + insertCompPre : (Agr=>Str) -> VPHSlash -> VPH = \obj,vp -> vp ** { + comp = \\a => vp.c2.s ++ obj ! a ++ vp.c2.ra ++ vp.comp ! a + } ; + insertVV : (Agr => Str) -> VPH -> VPH = \obj1,vp -> vp ** { wish = True ; --- vComp = \\a => vp.comp ! a ++ conjThat ++ obj1 ! a ; -- TODO: do we insert conjThat here or in infVV? /IL - vComp = \\a => vp.comp ! a ++ obj1 ! a ; + vComp = \\a => vp.comp ! a ++ obj1 ! a ; -- IL why this is vp.comp and not vp.vComp?? } ; - insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> vp ** { - embComp = vp.embComp ++ obj1; + embComp : Str -> VPH -> VPH = \str,vp -> vp ** { + embComp = vp.embComp ++ str ; } ; - insertObj3 : (Str) -> VPH -> VPH = \obj1,vp -> vp ** { - obj = {s = obj1 ++ vp.obj.s ; a = vp.obj.a }; + insertObj : Str -> VPH -> VPH = \str,vp -> vp ** { + obj = vp.obj ** {s = str ++ vp.obj.s} + } ; + + -- TODO: comp or obj? /IL + insertObjPre : NP -> VPHSlash -> VPH = \np,vp -> vp ** { + comp = \\a => vp.c2.s ++ np.s ! Bare ++ vp.c2.ra ++ np.compl ++ vp.comp ! a } ; - - insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj2 obj vp ** {c2 = vp.c2} ; - insertObjc3 : Str -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj3 obj vp ** {c2 = vp.c2} ; -{- - infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a -> - vp.obj.s ++ vp.inf ++ vp.comp ! a ; - -} - ---- AR 14/9/2017 trying to fix isAux = True case by inserting conjThat ---- but don't know yet how False should be affect - infVV : Bool -> VPH -> {s : Agr => Str} = \isAux,vp -> { - s = \\agr => case isAux of { - True => conjThat ++ vp.ad ++ vp.comp ! agr ++ vp.s ! VVForm agr ; - False => vp.ad ++ vp.comp ! agr ++ vp.s ! VVForm agr } - } ; + infVV : Bool -> VPH -> (Agr => Str) = \isAux,vp -> + \\agr => if_then_Str isAux conjThat [] ++ showVPH (VVForm agr) agr vp ; - insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> vp ** { - -- comp = \\a => case vp.c2.s of {"را" => obj ! a ++ vp.c2.s ++ vp.comp ! a ; _ => vp.c2.s ++ obj ! a ++ vp.comp ! a} -- gives linking error - comp = \\a => vp.c2.s ++ obj ! a ++ vp.c2.ra ++ vp.comp ! a - } ; + insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** { + ad = vp.ad ++ ad ; + } ; - insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** { - ad = vp.ad ++ ad ; - } ; + conjThat : Str = "که" ; - conjThat : Str = "که" ; - {- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of { - True => np.s ! Obl; - False => np.s ! Obl ++ str} ; - - insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> vp ** { - embComp = vp.embComp ++ emb; - } ; - - insertTrans : VPH -> VType -> VPH = \vp,vtype -> vp ** { - subj = case vtype of {VIntrans => VTransPost ; VTrans => VTrans ; _ => vtype} ; -- still some problem not working properly - } ; --} --------------------------- --- Clauses --------------------------- @@ -277,12 +269,11 @@ oper VVForm agr => []; -- to be checked => verb.s ! Vvform agr ; VPStem1 => []; VPStem2 => "بود" ; + VPInf => "بودن"; VPImp _ _ => [] -- need to be confirmed --- _ => [] }; obj = {s = [] ; a = defaultAgr} ; subj = VIntrans ; - inf = "بودن"; ad = []; embComp = []; wish = False ; @@ -363,16 +354,8 @@ taryn = "ترین" ; ----------------------------- -- Noun Phrase ----------------------------- -{-toNP : Str -> Str = \pn, -> case of { - c => pn ! c ; - NPObj => pn ! Dir ; - NPErg => pn ! Obl - } ; --} partNP : Str -> Str = \str -> (Prelude.glue str "ه") ++ "شده" ; --- partNP : Str -> Str = \str -> str + "ه" ++ "شده" ; - ----------------------------------- -- Reflexive Pronouns @@ -396,5 +379,4 @@ taryn = "ترین" ; => zwnj "آن" "ها" }; - } diff --git a/src/persian/SentencePes.gf b/src/persian/SentencePes.gf index 2b48d2b5f..ade5cb56e 100644 --- a/src/persian/SentencePes.gf +++ b/src/persian/SentencePes.gf @@ -34,12 +34,12 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { SlashVS np vs slash = mkSlClause np - (insertObj2 (conjThat ++ slash.s) (predV vs)) ** + (embComp (conjThat ++ slash.s) (predV vs)) ** {c2 = slash.c2} ; EmbedS s = {s = conjThat ++ s.s} ; EmbedQS qs = {s = qs.s ! QIndir} ; - EmbedVP vp = {s = vp.obj.s ++ vp.inf ++ vp.comp ! defaultAgr} ; --- agr + EmbedVP vp = {s = showVPH VPInf defaultAgr vp} ; --- agr UseCl temp p cl = diff --git a/src/persian/SymbolPes.gf b/src/persian/SymbolPes.gf index 28d18e005..bcce24df5 100644 --- a/src/persian/SymbolPes.gf +++ b/src/persian/SymbolPes.gf @@ -12,15 +12,18 @@ concrete SymbolPes of Symbol = CatPes ** open Prelude, ResPes in { NumPN i = {s = i.s ; animacy = Inanimate} ; CNIntNP cn i = cn ** { s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ; - a = agrP3 Sg + a = agrP3 Sg ; + compl = cn.compl ! Sg } ; CNSymbNP det cn xs = cn ** { s = \\ez => det.s ++ cn.s ! det.n ! Ezafe ++ xs.s ; - a = agrP3 det.n + a = agrP3 det.n ; + compl = cn.compl ! det.n } ; CNNumNP cn i = cn ** { s = \\ez => cn.s ! Sg ! Ezafe ++ i.s ; - a = agrP3 Sg + a = agrP3 Sg ; + compl = cn.compl ! Sg } ; SymbS sy = sy ; diff --git a/src/persian/VerbPes.gf b/src/persian/VerbPes.gf index 0620c9ea8..bd5a0e2ba 100644 --- a/src/persian/VerbPes.gf +++ b/src/persian/VerbPes.gf @@ -5,40 +5,39 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in { lin UseV v = predV v ; - SlashV2a v = predV v ** {c2 = {s = v.c2.s ; ra = v.c2.ra ; c = VTrans}} ; - Slash2V3 v np = - insertObjc (\\_ => np.s ! Bare ++ v.c2 ) (predV v ** {c2 = {s = [] ; ra = v.c3 ; c = VTrans}}) ; + SlashV2a v = predV v ** {c2 = v.c2} ; --{s = v.c2.s ; ra = v.c2.ra ; c = VTrans}} ; + Slash2V3 v np = {c2 = {s = [] ; ra = v.c3}} ** + insertObj (np.s ! Bare ++ v.c2) (predV v) ; -- ** ; c = VTrans}}) ; - Slash3V3 v np = - insertObjc (\\_ => v.c3 ++ np.s ! Bare) (predV v ** {c2 = {s = [] ; ra = v.c2 ; c = VTrans}}) ; + Slash3V3 v np = {c2 = {s = [] ; ra = v.c2}} ** + insertObj (v.c3 ++ np.s ! Bare) (predV v) ; -- ** ; c = VTrans}}) ; - ComplVV v vp = insertVV (infVV v.isAux vp).s (predV v) ; - ComplVS v s = insertObj2 (conjThat ++ s.s) (predV v) ; - ComplVQ v q = insertObj2 (conjThat ++ q.s ! QIndir) (predV v) ; - ComplVA v ap = insertObj (\\_ => ap.s ! Bare) (predV v) ; -- check form of adjective - SlashV2V v vp = insertVV (infVV v.isAux vp).s (predV v) **{c2 = {s = v.c1 ; ra = [] ; c = VTransPost}} ; + ComplSlash vp np = insertObjPre np vp ; - SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = v.c2.s ;ra = [] ; c = VTransPost}}) ; - SlashV2Q v q = insertObjc2 ( q.s ! QIndir) (predV v ** {c2 = {s = v.c2.s ; ra = [] ;c = VTransPost}}) ; - SlashV2A v ap = insertObjc3 ( ap.s ! Bare) (predV v ** {c2 = {s = [] ; ra = v.c2.ra ;c = VTransPost}}) ; ---- paint it red , check form of adjective + ComplVV v vp = insertVV (infVV v.isAux vp) (predV v) ; + ComplVS v s = embComp (conjThat ++ s.s) (predV v) ; + ComplVQ v q = embComp (conjThat ++ q.s ! QIndir) (predV v) ; + ComplVA v ap = insertComp (\\_ => ap.s ! Bare) (predV v) ; -- check form of adjective + SlashV2V v vp = insertVV (infVV v.isAux vp) (predV v) **{c2 = {s = v.c1 ; ra = []}} ; - ComplSlash vp np = insertObjPre (\\_ => np.s ! Bare ) vp ; - SlashVV vv vp = - -- insertObj (infVV vv.isAux vp).s (predV vv) ** - insertVV (infVV vv.isAux vp).s (predV vv) ** - {c2 = vp.c2} ; - SlashV2VNP vv np vp = - insertObjPre (\\_ => np.s ! Bare ) --- (insertObjc (infVV vv.isAux vp).s (predVc vv)) ** - (insertVVc (infVV vv.isAux vp).s (predVc vv)) ** - {c2 = vp.c2} ; + SlashV2S v s = v ** embComp (conjThat ++ s.s) (predV v) ; + SlashV2Q v q = v ** embComp (q.s ! QIndir) (predV v) ; + SlashV2A v ap = v ** insertObj (ap.s ! Bare) (predV v) ; ---- paint it red , check form of adjective - UseComp comp = insertObj comp.s (predAux auxBe) ; + SlashVV vv vps = vps ** insertVV (infVV vv.isAux vps) (predV vv) ; + + SlashV2VNP v2v np vps = + let vvVP : VPH = insertVV (infVV v2v.isAux vps) (predV v2v) ; + vvVPS = vvVP ** {c2={s=v2v.c1 ; ra=v2v.c2}} ; + in insertObjPre np vvVPS ** {c2 = vps.c2} ; + + + UseComp comp = insertComp comp.s (predAux auxBe) ; AdvVP vp adv = insertAdV adv.s vp ; AdVVP adv vp = insertAdV adv.s vp ; - ReflVP v = insertObjPre (\\a => reflPron ! a) v ; + ReflVP v = insertCompPre reflPron v ; PassV2 v = predV v ; -- need to be fixed CompAP ap ={s = \\_ => ap.s ! Bare} ; -- check form of adjective CompAdv adv = {s = \\_ => adv.s } ; @@ -49,7 +48,6 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in { ! case cn.hasAdj of { False => Bare ; True => Clitic } - } ; CompNP np = { diff --git a/src/persian/src/IdiomPes.gf b/src/persian/src/IdiomPes.gf index 8464328d4..29c51ce24 100644 --- a/src/persian/src/IdiomPes.gf +++ b/src/persian/src/IdiomPes.gf @@ -17,7 +17,7 @@ concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in { ExistNP np = mkSClause " " (agrPesP3 (fromAgr np.a).n) - (insertObj (\\_ => np.s ! Bare) (predAux auxBe)) ; + (insertComp (\\_ => np.s ! Bare) (predAux auxBe)) ; ExistIP ip = let cl = mkSClause ( ip.s ) (agrPesP3 ip.n) (predAux auxBe); @@ -28,7 +28,7 @@ concrete IdiomPes of Idiom = CatPes ** open Prelude,Predef, ResPes in { } }; --- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; +-- ProgrVP vp = insertComp (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; ProgrVP vp = (predProg vp) ; diff --git a/src/persian/src/ResPes.gf b/src/persian/src/ResPes.gf index 53cf10a76..14ea48075 100644 --- a/src/persian/src/ResPes.gf +++ b/src/persian/src/ResPes.gf @@ -162,7 +162,7 @@ oper } ; -} insertObjc : (AgrPes => Str) -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj obj vp ** {c2 = vp.c2} ; + insertComp obj vp ** {c2 = vp.c2} ; insertVVc : (AgrPes => Str) -> VPHSlash -> VPHSlash = \obj,vp -> insertVV obj vp ** {c2 = vp.c2} ; @@ -170,7 +170,7 @@ oper insertSubj : PPerson -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; -} - insertObj : (AgrPes => Str) -> VPH -> VPH = \obj1,vp -> { + insertComp : (AgrPes => Str) -> VPH -> VPH = \obj1,vp -> { s = vp.s ; obj = vp.obj ; subj = vp.subj ; @@ -195,7 +195,7 @@ oper comp = vp.comp } ; - insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { + embComp : (Str) -> VPH -> VPH = \obj1,vp -> { s = vp.s; obj = vp.obj ; subj = vp.subj ; @@ -221,8 +221,8 @@ oper } ; - insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj2 obj vp ** {c2 = vp.c2} ; + embCompSlash : Str -> VPHSlash -> VPHSlash = \obj,vp -> + embComp obj vp ** {c2 = vp.c2} ; insertObjc3 : Str -> VPHSlash -> VPHSlash = \obj,vp -> insertObj3 obj vp ** {c2 = vp.c2} ; {- diff --git a/src/persian/src/SentencePes.gf b/src/persian/src/SentencePes.gf index bcaafe82d..f3a982016 100644 --- a/src/persian/src/SentencePes.gf +++ b/src/persian/src/SentencePes.gf @@ -32,7 +32,7 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { SlashVS np vs slash = mkClause np - (insertObj2 (conjThat ++ slash.s) (predV vs)) ** + (embComp (conjThat ++ slash.s) (predV vs)) ** {c2 = slash.c2} ; EmbedS s = {s = conjThat ++ s.s} ;