--# -path=.:../abstract:../common:../../prelude -- --1 Pnbu auxiliary operations. -- -- This module contains operations that are needed to make the -- resource syntax work. resource ResPes = ParamX ** open Prelude,Predef in { flags optimize=all ; coding = utf8; param Order = ODir | OQuest ; Animacy = Animate | Inanimate ; PMood = Del | Imper | PCond ; PPerson = PPers1 | PPers2 | PPers3; VerbForm1 = VF Polarity VTense2 PPerson Number | Vvform AgrPes | Imp Polarity Number | Inf | Root1 | Root2 ; VTense2 = PPresent2 PrAspect | PPast2 PstAspect | PFut2 FtAspect| Infr_Past2 InfrAspect; PrAspect = PrPerf | PrImperf ; PstAspect = PstPerf | PstImperf | PstAorist ; FtAspect = FtAorist ; -- just keep FtAorist InfrAspect = InfrPerf | InfrImperf ; AgrPes = AgPes Number PPerson; Ezafa = bEzafa | aEzafa | enClic; NPCase = NPC Ezafa ; CardOrd = NCard | NOrd ; RAgr = RNoAg | RAg AgrPes ; -- RCase = RC Number Case ; param CPolarity = CPos |CNeg Bool; -- contracted or not oper Noun = {s : Ezafa => Number => Str ; animacy : Animacy ; definitness : Bool } ; Verb = {s : VerbForm1 => Str} ; Compl : Type = {s : Str ; ra : Str ; c : VType} ; Adjective = {s:Ezafa => Str ; adv : Str} ; NP : Type = {s : NPCase => Str ; a : AgrPes ; animacy : Animacy } ; Determiner = {s : Str ; n :Number ; isNum : Bool ; fromPron : Bool} ; VPHSlash = VPH ** {c2 : Compl} ; oper contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { Pos => CPos ; Neg => CNeg b } ; ----------------------- --- Verb Phrase ----------------------- oper VPH : Type = { s : VPHForm => {inf : Str} ; obj : {s : Str ; a : AgrPes} ; subj : VType ; comp : AgrPes => Str; vComp : AgrPes => Str; inf : Str; ad : Str; embComp : Str ; wish : Bool ; } ; param VPHForm = VPTense Polarity VPPTense AgrPes -- 9 * 12 -- | VPReq | VPImp Polarity Number -- | VPReqFut | VVForm AgrPes | VPStem1 | VPStem2 ; VPHTense = VPres -- impf hum nahim "I go" | VPast -- impf Ta nahim "I went" | VFut -- fut na/nahim "I shall go" | VPerfPres -- perf hum na/nahim "I have gone" | VPerfPast -- perf Ta na/nahim "I had gone" | VPerfFut | VCondSimul | VCondAnter -- subj na "I may go" ; VType = VIntrans | VTrans | VTransPost ; VPPTense = VPPres Anteriority |VPPast Anteriority |VPFutr Anteriority |VPCond Anteriority ; oper predV : Verb -> VPH = \verb -> { s = \\vh => case vh of { VPTense pol (VPPres Simul) (AgPes n p) => { inf = verb.s ! VF pol (PPresent2 PrImperf) p n } ; VPTense pol (VPPres Anter) (AgPes n p) => { inf = verb.s ! VF pol (PPresent2 PrPerf) p n } ; VPTense pol (VPPast Simul) (AgPes n p) => { inf =verb.s ! VF pol (PPast2 PstAorist) p n } ; VPTense pol (VPPast Anter) (AgPes n p) => { inf =verb.s ! VF pol (PPast2 PstPerf) p n } ; VPTense pol (VPFutr Simul) (AgPes n p) => { inf = verb.s ! VF pol (PFut2 FtAorist) p n } ; VPTense pol (VPFutr Anter) (AgPes n p) => { inf = verb.s ! VF pol (PPresent2 PrPerf) p n } ; -- this is to be confirmed VPTense pol (VPCond Simul) (AgPes n p) => { inf = verb.s ! VF pol (PPast2 PstImperf) p n } ; VPTense pol (VPCond Anter) (AgPes n p) => { inf = verb.s ! VF pol (PPast2 PstImperf) p n } ; VVForm (AgPes n p) => {inf = verb.s ! Vvform (AgPes n p)} ; VPStem1 => { inf = verb.s ! Root1}; VPStem2 => { inf = verb.s ! Root2} ; VPImp pol n => { inf = verb.s ! Imp pol n} }; obj = {s = [] ; a = defaultAgrPes} ; subj = VIntrans ; inf = verb.s ! Inf; ad = []; embComp = []; wish = False ; vComp = \\_ => [] ; comp = \\_ => [] } ; 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 -> { s = vps.s ; -- 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 { "rA" => np.s ++ vps.c2.s ++ vps.obj.s; _ => vps.c2.s ++ np.s ++ vps.obj.s }; a = np.a} ; subj = vps.c2.c ; inf = vps.inf; ad = vps.ad; embComp = vps.embComp; -- wish = vps.wish ; comp = vps.comp } ; -} insertObjc : (AgrPes => Str) -> VPHSlash -> VPHSlash = \obj,vp -> insertObj obj vp ** {c2 = vp.c2} ; insertVVc : (AgrPes => Str) -> VPHSlash -> VPHSlash = \obj,vp -> insertVV obj vp ** {c2 = vp.c2} ; {- insertSubj : PPerson -> Str -> Str = \p,s -> case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; -} insertObj : (AgrPes => Str) -> VPH -> VPH = \obj1,vp -> { s = vp.s ; obj = vp.obj ; subj = vp.subj ; inf = vp.inf; ad = vp.ad; embComp = vp.embComp; wish = vp.wish ; vComp = vp.vComp ; comp = \\a => vp.comp ! a ++ obj1 ! a } ; insertVV : (AgrPes => Str) -> VPH -> VPH = \obj1,vp -> { s = vp.s ; -- obj = vp.obj ; obj = vp.obj ; subj = vp.subj ; inf = vp.inf; ad = vp.ad; embComp = vp.embComp; wish = True ; vComp = \\a => vp.comp ! a ++ obj1 ! a ; comp = vp.comp } ; insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { s = vp.s; obj = vp.obj ; subj = vp.subj ; inf = vp.inf; ad = vp.ad; embComp = vp.embComp ++ obj1; wish = vp.wish ; vComp = vp.vComp ; comp = \\a => vp.comp ! a -- ++ obj1 } ; insertObj3 : (Str) -> VPH -> VPH = \obj1,vp -> { s = vp.s; obj = {s = obj1 ++ vp.obj.s ; a = vp.obj.a }; subj = vp.subj ; inf = vp.inf; ad = vp.ad; embComp = vp.embComp; wish = vp.wish ; vComp = vp.vComp ; comp = vp.comp } ; 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 ; -} infVV : Bool -> VPH -> {s : AgrPes => Str} = \isAux,vp -> {s = \\agr => case agr of { AgPes n p => (vp.comp ! (toAgr n p)) ++ (vp.s ! VVForm (AgPes n p)).inf }}; insertObjPre : (AgrPes => Str) -> VPHSlash -> VPH = \obj,vp -> { s = vp.s ; obj = vp.obj ; inf = vp.inf ; subj = vp.subj ; ad = vp.ad ; embComp = vp.embComp; wish = vp.wish ; vComp = vp.vComp ; -- comp = \\a => case vp.c2.s of {"rA" => 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 -> { s = vp.s ; obj = vp.obj ; inf = vp.inf ; subj = vp.subj; ad = vp.ad ++ ad ; embComp = vp.embComp; wish = vp.wish ; vComp = vp.vComp ; comp = vp.comp } ; conjThat : Str = "kh" ; {- checkPron : NP -> Str -> Str = \np,str -> case (np.isPron) of { True => np.s ! NPC Obl; False => np.s ! NPC Obl ++ str} ; insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> { s = vp.s ; obj = vp.obj ; inf = vp.inf ; subj = vp.subj; ad = vp.ad; embComp = vp.embComp ++ emb; wish = vp.wish ; comp = vp.comp } ; insertTrans : VPH -> VType -> VPH = \vp,vtype -> { s = vp.s ; obj = vp.obj ; inf = vp.inf ; subj = case vtype of {VIntrans => VTransPost ; VTrans => VTrans ; _ => vtype} ; -- still some problem not working properly ad = vp.ad; embComp = vp.embComp ; wish = vp.wish ; comp = vp.comp } ; -} --------------------------- --- Clauses --------------------------- Clause : Type = {s : VPHTense => Polarity => Order => Str} ; mkClause : NP -> VPH -> Clause = \np,vp -> { s = \\vt,b,ord => let subj = np.s ! NPC bEzafa; agr = np.a ; n = (fromAgr agr).n; p = (fromAgr agr).p; vps = case of { => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; => vp.s ! VPTense Pos (VPPast Simul) (AgPes n p) ; => vp.s ! VPTense Neg (VPPast Simul) (AgPes n p) ; => vp.s ! VPTense Pos (VPPast Anter) (AgPes n p) ; => case vp.wish of {True => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; False => vp.s ! VPTense Pos (VPFutr Simul) (AgPes n p) }; => case vp.wish of {True => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; False => vp.s ! VPTense Pos (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed => vp.s ! VPTense Pos (VPCond Simul) (AgPes n p) ; => vp.s ! VPTense Pos (VPCond Anter) (AgPes n p); -- verb form to be confirmed => vp.s ! VPTense Neg (VPPast Anter) (AgPes n p) ; => case vp.wish of {True => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; False => vp.s ! VPTense Neg (VPFutr Simul) (AgPes n p) }; => case vp.wish of {True => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; False => vp.s ! VPTense Neg (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed => vp.s ! VPTense Neg (VPCond Simul) (AgPes n p) ; => vp.s ! VPTense Neg (VPCond Anter) (AgPes n p) -- verb form to be confirmed }; quest = case ord of { ODir => []; OQuest => "A:yA" }; in quest ++ subj ++ vp.ad ++ vp.comp ! np.a ++ vp.obj.s ++ vps.inf ++ vp.vComp ! np.a ++ vp.embComp }; --Clause : Type = {s : VPHTense => Polarity => Order => Str} ; mkSClause : Str -> AgrPes -> VPH -> Clause = \subj,agr,vp -> { s = \\vt,b,ord => let n = (fromAgr agr).n; p = (fromAgr agr).p; vps = case of { => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; => vp.s ! VPTense Pos (VPPast Simul) (AgPes n p) ; => vp.s ! VPTense Neg (VPPast Simul) (AgPes n p) ; => vp.s ! VPTense Pos (VPPast Anter) (AgPes n p) ; => case vp.wish of {True => vp.s ! VPTense Pos (VPPres Simul) (AgPes n p) ; False => vp.s ! VPTense Pos (VPFutr Simul) (AgPes n p) }; => case vp.wish of {True => vp.s ! VPTense Pos (VPPres Anter) (AgPes n p) ; False => vp.s ! VPTense Pos (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed => vp.s ! VPTense Pos (VPCond Simul) (AgPes n p) ; => vp.s ! VPTense Pos (VPCond Anter) (AgPes n p); -- verb form to be confirmed => vp.s ! VPTense Neg (VPPast Anter) (AgPes n p) ; => case vp.wish of {True => vp.s ! VPTense Neg (VPPres Simul) (AgPes n p) ; False => vp.s ! VPTense Neg (VPFutr Simul) (AgPes n p) }; => case vp.wish of {True => vp.s ! VPTense Neg (VPPres Anter) (AgPes n p) ; False => vp.s ! VPTense Neg (VPFutr Anter) (AgPes n p) }; -- verb form need to be confirmed => vp.s ! VPTense Neg (VPCond Simul) (AgPes n p) ; => vp.s ! VPTense Neg (VPCond Anter) (AgPes n p) -- verb form to be confirmed }; quest = case ord of { ODir => []; OQuest => "A:yA" }; in quest ++ subj ++ vp.ad ++ vp.comp ! agr ++ vp.obj.s ++ vps.inf ++ vp.vComp ! agr ++ vp.embComp }; predAux : Aux -> VPH = \verb -> { s = \\vh => case vh of { VPTense pol (VPPres Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPresent PrImperf) p n } ; VPTense pol (VPPres Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPresent PrPerf) p n } ; VPTense pol (VPPast Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPast PstAorist) p n } ; VPTense pol (VPPast Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPresent PrPerf) p n } ; VPTense pol (VPFutr Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxFut FtAorist) p n } ; VPTense pol (VPFutr Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxFut FtAorist) p n } ; -- this is to be confirmed VPTense pol (VPCond Simul) (AgPes n p) => { inf = verb.inf ! AX pol (AuxFut FtAorist) p n } ; VPTense pol (VPCond Anter) (AgPes n p) => { inf = verb.inf ! AX pol (AuxPast PstImperf) p n } ; VVForm (AgPes n p) => {inf = ""} ; -- to be checked VPStem1 => { inf = ""}; VPStem2 => { inf = "bvd"} ; VPImp _ _ => { inf = ""} -- need to be confirmed -- _ => { inf = ""} }; obj = {s = [] ; a = defaultAgrPes} ; subj = VIntrans ; inf = "bvdn"; ad = []; embComp = []; wish = False ; vComp = \\_ => [] ; comp = \\_ => [] } ; Aux = { inf : AuxForm => Str ; } ; auxBe : Aux = { inf = table { AX pol tense person number => (mkAux pol tense person number).s } ; } ; mkAux : Polarity -> AuxTense -> PPerson -> Number -> {s:Str}= \pol,t,p,n -> {s = let bodh = "bvdh" ; nbodh = "nbvdh" ; hast = "hst" ; nhast = "nyst" ; bod = "bvd" ; khah = "KvAh" ; mekhah = "my" ++ khah ; bash = "bAC" ; nbod = "nbvd" ; nkhah = "nKvAh" ; nmekhah = "nmy" ++ khah ; nbash = "nbAC" in case of { => bodh ++ "Am" ; => bodh ++ "Aym" ; => bodh ++ "Ay" ; => bodh ++ "Ayd" ; => bodh ++ "Ast" ; => bodh ++ "And" ; => hast + "m" ; => hast + "ym" ; => hast + "y" ; => hast + "yd" ; => "Ast" ; => hast + "nd" ; => ""; => "" ; => "" ; => "" ; => "" ; => "" ; => "my" ++ bod + "m" ; => "my" ++ bod + "ym" ; => "my" ++ bod + "y"; => "my" ++ bod + "yd" ; => "my" ++ bod ; => "my" ++ bod + "nd" ; => bod + "m" ; => bod + "ym" ; => bod + "y"; => bod + "yd" ; => bod ; => bod + "nd" ; {- => mekhah + "m" ++ bash + "m" ; => mekhah + "ym" ++ bash + "ym" ; => mekhah + "y" ++ bash + "y" ; => mekhah + "yd" ++ bash + "yd" ; => mekhah + "d" ++ bash + "d" ; => mekhah + "nd" ++ bash + "nd" ; -} => khah + "m" ++ bod ; => khah + "ym" ++ bod ; => khah + "y" ++ bod ; => khah + "yd" ++ bod ; => khah + "d" ++ bod ; => khah + "nd" ++ bod ; -- nagatives => nbodh ++ "Am" ; => nbodh ++ "Aym" ; => nbodh ++ "Ay" ; => nbodh ++ "Ayd" ; => nbodh ++ "Ast" ; => nbodh ++ "And" ; => nhast + "m" ; => nhast + "ym" ; => nhast + "y" ; => nhast + "yd" ; => "nyst" ; => nhast + "nd" ; => ""; => "" ; => "" ; => "" ; => "" ; => "" ; => "nmy" ++ bod + "m" ; => "nmy" ++ bod + "ym" ; => "nmy" ++ bod + "y"; => "nmy" ++ bod + "yd" ; => "nmy" ++ bod ; => "nmy" ++ bod + "nd" ; => nbod + "m" ; => nbod + "ym" ; => nbod + "y"; => nbod + "yd" ; => nbod ; => nbod + "nd" ; {- => nmekhah + "m" ++ bash + "m" ; => nmekhah + "ym" ++ bash + "ym" ; => nmekhah + "y" ++ bash + "y" ; => nmekhah + "yd" ++ bash + "yd" ; => nmekhah + "d" ++ bash + "d" ; => nmekhah + "nd" ++ bash + "nd" ; -} => nkhah + "m" ++ bod ; => nkhah + "ym" ++ bod ; => nkhah + "y" ++ bod ; => nkhah + "yd" ++ bod ; => nkhah + "d" ++ bod ; => nkhah + "nd" ++ bod {- => khordh ++ bvdh ++ "Am" ; => khordh ++ bvdh ++ "Aym" ; => khordh ++ bvdh ++ "Ay" ; => khordh ++ bvdh ++ "Ayd" ; => khordh ++ bvdh ++ "Ast" ; => khordh ++ bvdh ++ "And" ; => mekhordh ++ "Am" ; => mekhordh ++ "Aym" ; => mekhordh ++ "Ay" ; => mekhordh ++ "Ayd" ; => mekhordh ++ "Ast" ; => mekhordh ++ "And" -} } } ; param AuxTense = AuxPresent PrAspect | AuxPast PstAspect | AuxFut FtAspect ; AuxForm = AX Polarity AuxTense PPerson Number ; oper toHave : Polarity -> VTense2 -> Number -> PPerson -> {s:Str} = \pol,t,n,p -> { s = let dasht = "dACt"; ndasht = "ndACt" ; dashteh = "dACth"; ndashteh = "ndACth" ; dar = "dAr" ; ndar = "ndAr" ; khah = "KvAh" ; nkhah = "nKvAh" ; bvdh = "bvdh" ; in case of { => dashteh ++ "Am" ; => dashteh ++ "Aym" ; => dashteh ++ "Ay" ; => dashteh ++ "Ayd" ; => dashteh ++ "Ast" ; => dashteh ++ "And" ; => dar + "m" ; => dar + "ym" ; => dar + "y" ; => dar + "yd" ; => dar + "d" ; => dar + "nd" ; => dashteh ++ "bvdm" ; => dashteh ++ "bvdym" ; => dashteh ++ "bvdy" ; => dashteh ++ "bvdyd" ; => dashteh ++ "bvd" ; => dashteh ++ "bvdnd" ; => dasht + "m" ; => dasht + "ym" ; => dasht + "y"; => dasht + "yd" ; => dasht ; => dasht + "nd" ; => dasht + "m" ; => dasht + "ym" ; => dasht + "y"; => dasht + "yd" ; => dasht ; => dasht + "nd" ; => khah + "m" ++ dasht ; => khah + "ym" ++ dasht ; => khah + "y" ++ dasht ; => khah + "yd" ++ dasht ; => khah + "d" ++ dasht ; => khah + "nd" ++ dasht ; => dashteh ++ bvdh ++ "Am" ; => dashteh ++ bvdh ++ "Aym" ; => dashteh ++ bvdh ++ "Ay" ; => dashteh ++ bvdh ++ "Ayd" ; => dashteh ++ bvdh ++ "Ast" ; => dashteh ++ bvdh ++ "And" ; => dashteh ++ "Am" ; => dashteh ++ "Aym" ; => dashteh ++ "Ay" ; => dashteh ++ "Ayd" ; => dashteh ++ "Ast" ; => dashteh ++ "And" ; -- negatives => ndashteh ++ "Am" ; => ndashteh ++ "Aym" ; => ndashteh ++ "Ay" ; => ndashteh ++ "Ayd" ; => ndashteh ++ "Ast" ; => ndashteh ++ "And" ; => ndar + "m" ; => ndar + "ym" ; => ndar + "y" ; => ndar + "yd" ; => ndar + "d" ; => ndar + "nd" ; => ndashteh ++ "bvdm" ; => ndashteh ++ "bvdym" ; => ndashteh ++ "bvdy" ; => ndashteh ++ "bvdyd" ; => ndashteh ++ "bvd" ; => ndashteh ++ "bvdnd" ; => ndasht + "m" ; => ndasht + "ym" ; => ndasht + "y"; => ndasht + "yd" ; => ndasht ; => ndasht + "nd" ; => ndasht + "m" ; => ndasht + "ym" ; => ndasht + "y"; => ndasht + "yd" ; => ndasht ; => ndasht + "nd" ; => nkhah + "m" ++ dasht ; => nkhah + "ym" ++ dasht ; => nkhah + "y" ++ dasht ; => nkhah + "yd" ++ dasht ; => nkhah + "d" ++ dasht ; => nkhah + "nd" ++ dasht ; => ndashteh ++ bvdh ++ "Am" ; => ndashteh ++ bvdh ++ "Aym" ; => ndashteh ++ bvdh ++ "Ay" ; => ndashteh ++ bvdh ++ "Ayd" ; => ndashteh ++ bvdh ++ "Ast" ; => ndashteh ++ bvdh ++ "And" ; => ndashteh ++ "Am" ; => ndashteh ++ "Aym" ; => ndashteh ++ "Ay" ; => ndashteh ++ "Ayd" ; => ndashteh ++ "Ast" ; => ndashteh ++ "And" }; } ; predProg : VPH -> VPH = \verb -> { s = \\vh => case vh of { VPTense pol (VPPres Simul) (AgPes n p) => { inf = (toHave Pos (PPresent2 PrImperf) n p).s ++ (verb.s ! VPTense pol (VPPres Simul) (AgPes n p)).inf } ; VPTense pol (VPPres Anter) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPPres Anter) (AgPes n p)).inf } ; VPTense pol (VPPast Simul) (AgPes n p) => { inf = (toHave Pos (PPast2 PstAorist) n p).s ++ (verb.s ! VPTense pol (VPCond Simul) (AgPes n p)).inf } ; VPTense pol (VPPast Anter) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPPast Anter) (AgPes n p)).inf } ; VPTense pol (VPFutr Simul) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPFutr Simul) (AgPes n p)).inf } ; VPTense pol (VPFutr Anter) (AgPes n p) => { inf = (verb.s ! VPTense pol (VPFutr Anter) (AgPes n p)).inf } ; -- this is to be confirmed VPTense pol (VPCond Simul) (AgPes n p) => { inf = (toHave Pos (PPast2 PstAorist) n p).s ++ (verb.s ! VPTense pol (VPCond Simul) (AgPes n p)).inf } ; VPTense pol (VPCond Anter) (AgPes n p) => { inf = (toHave Pos (PPast2 PstAorist) n p).s ++ (verb.s ! VPTense pol (VPCond Anter) (AgPes n p)).inf } ; VVForm (AgPes n p) => {inf = (verb.s ! VVForm (AgPes n p)).inf} ; VPStem1 => { inf = (verb.s ! VPStem1).inf}; VPStem2 => { inf = (verb.s ! VPStem2).inf} ; VPImp pol n => { inf = (verb.s ! VPImp pol n).inf} -- need to be confirmed -- _ => { inf = (verb.s ! VPStem1).inf} }; obj = verb.obj ; subj = VIntrans ; inf = verb.inf; ad = verb.ad; wish = verb.wish; vComp = verb.vComp ; embComp = verb.embComp ; comp = verb.comp } ; ------------------------- -- Ezafa construction ------------------------ oper mkEzafa : Str -> Str ; mkEzafa str = case str of { st + "Ah" => str ; st + "vh" => str ; st + "h" => str ++ "y" ; st + "Av" => str ; st + "vv" => str ; st + "v" => str + "y" ; st + "A" => str + "y" ; _ => str }; mkEnclic : Str -> Str ; mkEnclic str = case str of { st + "A" => str ++ "yy" ; st + "v" => str ++ "yy" ; st + "y" => str ++ "yy" ; st + "h" => str ++ "yy" ; _ => str + "y" }; IndefArticle : Str ; IndefArticle = "yk"; taryn : Str ; taryn = "tryn" ; --------------- -- making negatives --------------- addN : Str -> Str ; addN str = case str of { "A" + st => "ny" + str ; "A:" + st => "nyA" + st ; _ => "n" + str }; addBh2 : Str -> Str ; -- should use drop instead but it gives linking error addBh2 str1 = case str1 of { "my" + str => case str of { "A" + st => Prelude.glue "by" str ; -- need to use '+' but it gives linking error "A:" + st => Prelude.glue "byA" st ; _ => Prelude.glue "b" str }; _ => "" }; ----------------------------- -- Noun Phrase ----------------------------- {-toNP : Str -> Str = \pn, npc -> case npc of { NPC c => pn ! c ; NPObj => pn ! Dir ; NPErg => pn ! Obl } ; -} partNP : Str -> Str = \str -> (Prelude.glue str "h") ++ "Cdh" ; -- partNP : Str -> Str = \str -> str + "h" ++ "Cdh" ; ------------------------------------------ -- Agreement transformations ----------------------------------------- toAgr : Number -> PPerson -> AgrPes = \n,p -> AgPes n p; fromAgr : AgrPes -> {n : Number ; p : PPerson } = \agr -> case agr of { AgPes n p => {n = n ; p = p } } ; conjAgrPes : AgrPes -> AgrPes -> AgrPes = \a0,b0 -> let a = fromAgr a0 ; b = fromAgr b0 in toAgr (conjNumber a.n b.n) b.p; giveNumber : AgrPes -> Number =\a -> case a of { AgPes n _ => n }; -- defaultAgr : Agr = agrP3 Sg Inanimate ; -- agrP3 : Number -> Animacy -> Agr = \n,a -> Ag n PPers3 a ; defaultAgrPes : AgrPes = agrPesP3 Sg ; agrPesP3 : Number -> AgrPes = \n -> AgPes n PPers3 ; -- personalAgr : Agr = agrP1 Sg ; agrPesP1 : Number -> AgrPes = \n -> AgPes n PPers1 ; -------------------------------------------------------- -- Reflexive Pronouns ----------------------------------- reflPron : AgrPes => Str = table { AgPes Sg PPers1 => "Kvdm" ; AgPes Sg PPers2 => "Kvdt" ; AgPes Sg PPers3 => "KvdC" ; AgPes Pl PPers1 => "KvdmAn" ; AgPes Pl PPers2 => "KvdtAn" ; AgPes Pl PPers3 => "KvdCAn" } ; getPron : Animacy -> Number -> Str = \ani,number -> case of { => "Av" ; => ["A:n hA"] ; => "A:n" ; => ["A:n hA"] }; }