mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
(Pes) Remove redundant parameters in V*, VP and Cl
Keep VerbForm at VP level, and rename VPHTense to use Tense and Anteriority instead of custom names that are then mapped to Tense and Anteriority in Use*Cl functions. WIP: Remove Aux type and use beVerb instead of beAux. There were a lot of comments along the lines "check the right form"; will do that with a native speaker.
This commit is contained in:
@@ -9,7 +9,7 @@ lin
|
||||
GenericCl vp = mkSClause "آدم" (agrP3 Sg) vp ;
|
||||
|
||||
CleftNP np rs =
|
||||
let cl = mkSClause (np.s ! Bare) (np.a) (predAux auxBe);
|
||||
let cl = mkSClause (np.s ! Bare) (np.a) (predV beVerb);
|
||||
in
|
||||
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
||||
|
||||
@@ -17,10 +17,10 @@ lin
|
||||
|
||||
ExistNP np =
|
||||
mkSClause " " (agrP3 (fromAgr np.a).n)
|
||||
(insertComp (\\_ => np.s ! Bare) (predAux auxBe)) ;
|
||||
(insertComp (\\_ => np.s ! Bare) (predV beVerb)) ;
|
||||
|
||||
ExistIP ip =
|
||||
let cl = mkSClause ( ip.s ) (agrP3 ip.n) (predAux auxBe);
|
||||
let cl = mkSClause ( ip.s ) (agrP3 ip.n) (predV beVerb);
|
||||
in {s = \\t,p,qf => case qf of {
|
||||
QDir => cl.s ! t ! p ! ODir;
|
||||
QIndir => cl.s ! t! p ! ODir
|
||||
@@ -30,8 +30,8 @@ lin
|
||||
|
||||
ProgrVP vp = predProg vp ;
|
||||
|
||||
ImpPl1 vp = {s = "بیایید" ++ vp.s ! VVForm (agrP1 Pl)} ;
|
||||
ImpP3 np vp = {s = "بگذارید" ++ np.s!Bare ++ vp.s ! VVForm np.a};
|
||||
ImpPl1 vp = {s = "بیایید" ++ vp.s ! Vvform (agrP1 Pl)} ;
|
||||
ImpP3 np vp = {s = "بگذارید" ++ np.s!Bare ++ vp.s ! Vvform np.a};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -142,21 +142,21 @@ Determiner : Type = {s : Str ; n :Number ; isNum : Bool ; mod : Mod} ;
|
||||
-- Verbs
|
||||
------------------------------------------------------------------
|
||||
param
|
||||
VerbForm1 = VF Polarity VTense2 Agr
|
||||
VerbForm = VF Polarity VTense Agr
|
||||
| Vvform Agr
|
||||
| Imp Polarity Number
|
||||
| Inf | Root1 | Root2 ;
|
||||
VTense2 = PPresent2 PrAspect
|
||||
| PPast2 PstAspect
|
||||
| PFut2 FtAspect
|
||||
| Infr_Past2 InfrAspect;
|
||||
VTense = VFPres PrAspect
|
||||
| VFPast PstAspect
|
||||
| VFFut FtAspect
|
||||
| VFInfrPast InfrAspect;
|
||||
PrAspect = PrPerf | PrImperf ;
|
||||
PstAspect = PstPerf | PstImperf | PstAorist ;
|
||||
FtAspect = FtAorist ; -- just keep FtAorist
|
||||
InfrAspect = InfrPerf | InfrImperf ;
|
||||
|
||||
oper
|
||||
Verb = {s : VerbForm1 => Str} ;
|
||||
Verb = {s : VerbForm => Str} ;
|
||||
|
||||
mkVerb : (x1,x2 : Str) -> Verb = \inf,root2 ->
|
||||
let root1 = tk 1 inf ;
|
||||
@@ -180,7 +180,7 @@ oper
|
||||
-- Most verbs that end in C+تن or C+دن
|
||||
mkVerb2 : (_: Str) -> Verb = \inf -> mkVerb inf (tk 2 inf) ;
|
||||
|
||||
mkCmnVF : Str -> Str -> Polarity -> VTense2 -> Agr -> Str = \root1,root2,pol,t,ag ->
|
||||
mkCmnVF : Str -> Str -> Polarity -> VTense -> Agr -> Str = \root1,root2,pol,t,ag ->
|
||||
let khordh = root1 + "ه";
|
||||
nkhordh = addN khordh ;
|
||||
mekhor = zwnj "می" root2 ;
|
||||
@@ -199,33 +199,33 @@ oper
|
||||
perfSuff : Str -> Str = perfectSuffix ag ;
|
||||
pluperfSuff : Str -> Str = pluperfectSuffix ag
|
||||
in case <pol,t> of {
|
||||
<Pos,PPresent2 PrImperf> => impfSuffD mekhor ;
|
||||
<Pos,PPresent2 PrPerf> => perfSuff khordh ;
|
||||
<Pos,VFPres PrImperf> => impfSuffD mekhor ;
|
||||
<Pos,VFPres PrPerf> => perfSuff khordh ;
|
||||
|
||||
<Pos,PPast2 PstPerf> => pluperfSuff khordh ;
|
||||
<Pos,PPast2 PstImperf> => impfSuff mekhord ;
|
||||
<Pos,PPast2 PstAorist> => impfSuff root1 ;
|
||||
<Pos,VFPast PstPerf> => pluperfSuff khordh ;
|
||||
<Pos,VFPast PstImperf> => impfSuff mekhord ;
|
||||
<Pos,VFPast PstAorist> => impfSuff root1 ;
|
||||
|
||||
<Pos,PFut2 FtAorist> => impfSuffD khah ++ root1;
|
||||
<Pos,VFFut FtAorist> => impfSuffD khah ++ root1;
|
||||
|
||||
<Pos,Infr_Past2 InfrPerf> => khordh ++ perfSuff bvdh ;
|
||||
<Pos,Infr_Past2 InfrImperf> => perfSuff khordh ;
|
||||
<Pos,VFInfrPast InfrPerf> => khordh ++ perfSuff bvdh ;
|
||||
<Pos,VFInfrPast InfrImperf> => perfSuff khordh ;
|
||||
|
||||
-- negatives
|
||||
<Meg,PPresent2 PrImperf> => impfSuffD nmekhor ;
|
||||
<Neg,PPresent2 PrPerf> => perfSuff nkhordh ;
|
||||
<Neg,VFPres PrImperf> => impfSuffD nmekhor ;
|
||||
<Neg,VFPres PrPerf> => perfSuff nkhordh ;
|
||||
|
||||
<Neg,PPast2 PstPerf> => pluperfSuff nkhordh ;
|
||||
<Neg,PPast2 PstImperf> => impfSuff nmekhord ;
|
||||
<Neg,PPast2 PstAorist> => impfSuff (addN root1) ;
|
||||
<Neg,VFPast PstPerf> => pluperfSuff nkhordh ;
|
||||
<Neg,VFPast PstImperf> => impfSuff nmekhord ;
|
||||
<Neg,VFPast PstAorist> => impfSuff (addN root1) ;
|
||||
|
||||
<Neg,PFut2 FtAorist> => impfSuffD nkhah ++ root1 ;
|
||||
<Neg,VFFut FtAorist> => impfSuffD nkhah ++ root1 ;
|
||||
|
||||
<Neg,Infr_Past2 InfrPerf> => nkhordh ++ perfSuff bvdh ;
|
||||
<Neg,Infr_Past2 InfrImperf> => perfSuff nmekhordh
|
||||
<Neg,VFInfrPast InfrPerf> => nkhordh ++ perfSuff bvdh ;
|
||||
<Neg,VFInfrPast InfrImperf> => perfSuff nmekhordh
|
||||
|
||||
-- <Pos,PFut2 FtImperf> => perfSuffD mekhah ++ addBh (perfSuffD root2) ;
|
||||
-- <Neg,PFut2 FtImperf> => perfSuffD nmekhah ++ addBh (perfSuffD root2) ;
|
||||
-- <Pos,VFFut FtImperf> => perfSuffD mekhah ++ addBh (perfSuffD root2) ;
|
||||
-- <Neg,VFFut FtImperf> => perfSuffD nmekhah ++ addBh (perfSuffD root2) ;
|
||||
} ;
|
||||
|
||||
mkvVform : Str -> Agr -> Str = \root2,ag ->
|
||||
@@ -315,20 +315,14 @@ oper
|
||||
Imp Neg Sg => "ندار" ;
|
||||
Imp Neg Pl => "ندارید" ;
|
||||
Vvform agr => mkvVform "دار" agr ;
|
||||
VF pol tense agr => toHave pol tense agr
|
||||
VF pol tense agr => case <pol,tense> of {
|
||||
<Pos,VFPres PrImperf> => imperfectSuffixD agr "دار" ;
|
||||
<Neg,VFPres PrImperf> => imperfectSuffixD agr (addN "دار") ;
|
||||
_ => mkCmnVF "داشت" "دار" pol tense agr
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
toHave : Polarity -> VTense2 -> Agr -> Str = \pol,t,ag ->
|
||||
let dar = "دار" ;
|
||||
ndar = addN dar ;
|
||||
dasht = "داشت"
|
||||
in case <pol,t> of {
|
||||
<Pos,PPresent2 PrImperf> => imperfectSuffixD ag dar ;
|
||||
<Neg,PPresent2 PrImperf> => imperfectSuffixD ag ndar ;
|
||||
_ => mkCmnVF dasht dar pol t ag
|
||||
} ;
|
||||
|
||||
-- TODO: merge with auxBe in ResPes
|
||||
beVerb : Verb = { s = table {
|
||||
Vvform agr => imperfectSuffixD agr "باش" ;
|
||||
@@ -343,13 +337,15 @@ oper
|
||||
let impfSuff = imperfectSuffix agr ;
|
||||
perfSuff = perfectSuffix agr
|
||||
in case <pol,tense,agr> of {
|
||||
<Pos,PPresent2 PrImperf,Ag Sg P3> => "است" ;
|
||||
<Pos,PPresent2 PrImperf> => impfSuff "هست" ;
|
||||
<Pos,PPresent2 PrPerf> => perfSuff "بوده" ;
|
||||
<Neg,PPresent2 PrImperf,Ag Sg P3> => "نیست" ;
|
||||
<Neg,PPresent2 PrImperf> => impfSuff "نیست" ;
|
||||
<Neg,PPresent2 PrPerf> => perfSuff "نبوده" ;
|
||||
_ => mkCmnVF "بود" "باش" pol tense agr
|
||||
<Pos,VFPres PrImperf,Ag Sg P3> => "است" ;
|
||||
<Neg,VFPres PrImperf,Ag Sg P3> => "نیست" ;
|
||||
<Pos,VFPres PrImperf> => impfSuff "هست" ;
|
||||
<Neg,VFPres PrImperf> => impfSuff "نیست" ;
|
||||
<Pos,VFPres PrPerf> => perfSuff "بوده" ;
|
||||
<Neg,VFPres PrPerf> => perfSuff "نبوده" ;
|
||||
<Pos,VFPast PstImperf> => impfSuff "بود" ;
|
||||
<Neg,VFPast PstImperf> => impfSuff "نبود" ;
|
||||
_ => mkCmnVF "بود" "باش" pol tense agr
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -17,7 +17,7 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in {
|
||||
UttNP np = {s = np2str np} ;
|
||||
UttCN cn = {s = cn2str cn};
|
||||
UttAP ap = {s = ap.s ! Bare} ;
|
||||
UttVP vp = {s = showVPH VPInf defaultAgr vp} ;
|
||||
UttVP vp = {s = showVPH Inf defaultAgr vp} ;
|
||||
|
||||
PConjConj conj = {s = conj.s2} ;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in {
|
||||
};
|
||||
|
||||
QuestIComp icomp np =
|
||||
let cl = mkSClause (np.s ! Bare ++ icomp.s) np.a (predAux auxBe);
|
||||
let cl = mkSClause (np.s ! Bare ++ icomp.s) np.a (predV beVerb);
|
||||
in {
|
||||
s = \\t,p,qf => case qf of {
|
||||
QDir => cl.s ! t ! p ! ODir;
|
||||
|
||||
@@ -59,7 +59,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
||||
oper
|
||||
|
||||
VPH : Type = {
|
||||
s : VPHForm => Str ;
|
||||
s : VerbForm => Str ;
|
||||
comp : Agr => Str; -- complements of a verb, agr for e.g. CompCN "I am human/we are humans"
|
||||
vComp : Agr => Str; -- when a verb is used as a complement of an auxiliary verb. Unlike ‘comp’ or ‘obj’, this type of complement follows the auxiliary verb.
|
||||
obj : Str ; -- object of a verb; so far only used for A ("paint it black")
|
||||
@@ -69,7 +69,7 @@ oper
|
||||
wish : Bool ; -- whether a VV has been added
|
||||
} ;
|
||||
|
||||
showVPH : VPHForm -> Agr -> VPH -> Str = \vf,agr,vp ->
|
||||
showVPH : VerbForm -> Agr -> VPH -> Str = \vf,agr,vp ->
|
||||
vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.s ! vf ++ vp.vComp ! agr ++ vp.embComp ;
|
||||
|
||||
Compl : Type = {s : Str ; ra : Str} ;
|
||||
@@ -78,63 +78,24 @@ oper
|
||||
|
||||
param
|
||||
|
||||
VPHForm =
|
||||
VPTense Polarity VPPTense Agr -- 9 * 12
|
||||
-- | VPReq
|
||||
| VPImp Polarity Number
|
||||
-- | VPReqFut
|
||||
| VVForm Agr
|
||||
| VPStem1
|
||||
| VPStem2
|
||||
| VPInf
|
||||
;
|
||||
|
||||
VPHTense =
|
||||
VPres -- impf hum nahim "I گْ"
|
||||
| VPast -- impf Ta nahim "I weنت"
|
||||
| VFut -- fut na/nahim "I سهلل گْ"
|
||||
| VPerfPres -- perf hum na/nahim "I هوe گْنe"
|
||||
| VPerfPast -- perf Ta na/nahim "I هد گْنe"
|
||||
| VPerfFut
|
||||
| VCondSimul
|
||||
| VCondAnter -- subj na "I می گْ"
|
||||
TA Tense Anteriority
|
||||
| VVVForm -- AR 21/3/2018 for mustCl after Nasrin
|
||||
| VRoot1 -- AR 22/3/2018 for mustCl past after Nasrin
|
||||
;
|
||||
|
||||
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) agr => verb.s ! VF pol (PPresent2 PrImperf) agr ;
|
||||
VPTense pol (VPPres Anter) agr => verb.s ! VF pol (PPresent2 PrPerf) agr ;
|
||||
VPTense pol (VPPast Simul) agr => verb.s ! VF pol (PPast2 PstAorist) agr ;
|
||||
VPTense pol (VPPast Anter) agr => verb.s ! VF pol (PPast2 PstPerf) agr ;
|
||||
VPTense pol (VPFutr Simul) agr => verb.s ! VF pol (PFut2 FtAorist) agr ;
|
||||
VPTense pol (VPFutr Anter) agr => verb.s ! VF pol (PPresent2 PrPerf) agr ; -- this is to be confirmed
|
||||
VPTense pol (VPCond Simul) agr => verb.s ! VF pol (PPast2 PstImperf) agr ;
|
||||
VPTense pol (VPCond Anter) agr => verb.s ! VF pol (PPast2 PstImperf) agr ;
|
||||
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 };
|
||||
predV : Verb -> VPH = \verb -> verb ** {
|
||||
subj = VIntrans ;
|
||||
ad,
|
||||
obj,
|
||||
embComp = [];
|
||||
wish = False ;
|
||||
comp,
|
||||
vComp = \\_ => [] ;
|
||||
} ;
|
||||
vComp = \\_ => [] } ;
|
||||
|
||||
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
|
||||
predV verb ** {c2 = {s = verb.c1 ; ra = []} } ;
|
||||
@@ -175,7 +136,7 @@ oper
|
||||
---- 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 -> (Agr => Str) = \isAux,vp ->
|
||||
\\agr => if_then_Str isAux conjThat [] ++ showVPH (VVForm agr) agr vp ;
|
||||
\\agr => if_then_Str isAux conjThat [] ++ showVPH (Vvform agr) agr vp ;
|
||||
|
||||
insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** {
|
||||
ad = vp.ad ++ ad ;
|
||||
@@ -192,34 +153,23 @@ oper
|
||||
---- AR 18/9/2017 intermediate SClause to preserve SOV in e.g. QuestionPes.QuestSlash
|
||||
|
||||
clTable : VPH -> (Agr => VPHTense => Polarity => Str) = \vp ->
|
||||
\\agr,vt,b => case <b,vt> of {
|
||||
<Pos,VPres> => vp.s ! VPTense Pos (VPPres Simul) agr ;
|
||||
<Neg,VPres> => vp.s ! VPTense Neg (VPPres Simul) agr ;
|
||||
<Pos,VPerfPres> => vp.s ! VPTense Pos (VPPres Anter) agr ;
|
||||
<Neg,VPerfPres> => vp.s ! VPTense Neg (VPPres Anter) agr ;
|
||||
<Pos,VPast> => vp.s ! VPTense Pos (VPPast Simul) agr ;
|
||||
<Neg,VPast> => vp.s ! VPTense Neg (VPPast Simul) agr ;
|
||||
<Pos,VPerfPast> => vp.s ! VPTense Pos (VPPast Anter) agr ;
|
||||
<Pos,VFut> => case vp.wish of {
|
||||
True => vp.s ! VPTense Pos (VPPres Simul) agr ;
|
||||
False => vp.s ! VPTense Pos (VPFutr Simul) agr };
|
||||
<Pos,VPerfFut> => case vp.wish of {
|
||||
True => vp.s ! VPTense Pos (VPPres Anter) agr ;
|
||||
False => vp.s ! VPTense Pos (VPFutr Anter) agr }; -- verb form need to be confirmed
|
||||
<Neg,VPerfPast> => vp.s ! VPTense Neg (VPPast Anter) agr ;
|
||||
<Neg,VFut> => case vp.wish of {
|
||||
True => vp.s ! VPTense Neg (VPPres Simul) agr ;
|
||||
False => vp.s ! VPTense Neg (VPFutr Simul) agr };
|
||||
<Neg,VPerfFut> => case vp.wish of {
|
||||
True => vp.s ! VPTense Neg (VPPres Anter) agr ;
|
||||
False => vp.s ! VPTense Neg (VPFutr Anter) agr }; -- verb form need to be confirmed
|
||||
<Pos,VCondSimul> => vp.s ! VPTense Pos (VPCond Simul) agr ;
|
||||
<Pos,VCondAnter> => vp.s ! VPTense Pos (VPCond Anter) agr; -- verb form to be confirmed
|
||||
<Neg,VCondSimul> => vp.s ! VPTense Neg (VPCond Simul) agr ;
|
||||
<Neg,VCondAnter> => vp.s ! VPTense Neg (VPCond Anter) agr ; -- verb form to be confirmed
|
||||
<_, VVVForm> => vp.s ! VVForm agr ; -- AR 21/3/2018
|
||||
<_, VRoot1> => vp.s ! VPStem1 {- ++ Predef.Bind ++ "ه" -} -- AR 22/3/2018
|
||||
};
|
||||
\\agr,vt,pol => case vt of {
|
||||
TA Pres Simul => vp.s ! VF pol (VFPres PrImperf) agr ;
|
||||
TA Pres Anter => vp.s ! VF pol (VFPres PrPerf) agr ;
|
||||
TA Past Simul => vp.s ! VF pol (VFPast PstAorist) agr ;
|
||||
TA Past Anter => vp.s ! VF pol (VFPast PstPerf) agr ;
|
||||
TA Fut Simul => case vp.wish of {
|
||||
True => vp.s ! VF pol (VFPres PrImperf) agr ;
|
||||
False => vp.s ! VF pol (VFFut FtAorist) agr } ;
|
||||
TA Fut Anter => case vp.wish of {
|
||||
_True => vp.s ! VF pol (VFPres PrPerf) agr } ;
|
||||
--False => vp.s ! VF pol (VFFut FtAorist) agr } ; -- verb form need to be confirmed
|
||||
TA Cond Simul => vp.s ! VF pol (VFPast PstImperf) agr ;
|
||||
TA Cond Anter => vp.s ! VF pol (VFPast PstImperf) agr ; -- verb form to be confirmed
|
||||
VVVForm => vp.s ! Vvform agr ; -- AR 21/3/2018
|
||||
VRoot1 => vp.s ! Root1 {- ++ Predef.Bind ++ "ه" -} -- AR 22/3/2018
|
||||
|
||||
} ;
|
||||
|
||||
mkClause : NP -> VPH -> Clause = \np,vp ->
|
||||
let cls = mkSlClause np vp
|
||||
@@ -243,110 +193,19 @@ oper
|
||||
in quest ++ subj ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vps ++ vp.vComp ! agr ++ vp.embComp
|
||||
};
|
||||
|
||||
ta2vt : Tense -> Anteriority -> VPHTense = \t,a -> case <t,a> of {
|
||||
<Pres,Simul> => VPres ;
|
||||
<Pres,Anter> => VPerfPres ;
|
||||
<Past,Simul> => VPast ;
|
||||
<Past,Anter> => VPerfPast ;
|
||||
<Fut,Simul> => VFut ;
|
||||
<Fut,Anter> => VPerfFut ;
|
||||
<Cond,Simul> => VCondSimul ;
|
||||
<Cond,Anter> => VCondSimul } ;
|
||||
|
||||
predAux : Aux -> VPH = \verb -> {
|
||||
s = \\vh => case vh of {
|
||||
VPTense pol (VPPres Simul) agr => verb.inf ! AX pol (AuxPresent PrImperf) agr ;
|
||||
VPTense pol (VPPres Anter) agr => verb.inf ! AX pol (AuxPresent PrPerf) agr ;
|
||||
VPTense pol (VPPast Simul) agr => verb.inf ! AX pol (AuxPast PstAorist) agr ;
|
||||
VPTense pol (VPPast Anter) agr => verb.inf ! AX pol (AuxPresent PrPerf) agr ;
|
||||
VPTense pol (VPFutr Simul) agr => verb.inf ! AX pol (AuxFut FtAorist) agr ;
|
||||
VPTense pol (VPFutr Anter) agr => verb.inf ! AX pol (AuxFut FtAorist) agr ; -- this is to be confirmed
|
||||
VPTense pol (VPCond Simul) agr => verb.inf ! AX pol (AuxFut FtAorist) agr ;
|
||||
VPTense pol (VPCond Anter) agr => verb.inf ! AX pol (AuxPast PstImperf) agr ;
|
||||
VVForm agr => []; -- to be checked => verb.s ! Vvform agr ;
|
||||
VPStem1 => [];
|
||||
VPStem2 => "بود" ;
|
||||
VPInf => "بودن";
|
||||
VPImp _ _ => [] -- need to be confirmed
|
||||
};
|
||||
obj = [] ;
|
||||
subj = VIntrans ;
|
||||
ad = [];
|
||||
embComp = [];
|
||||
wish = False ;
|
||||
vComp = \\_ => [] ;
|
||||
comp = \\_ => []
|
||||
} ;
|
||||
|
||||
Aux = {
|
||||
inf : AuxForm => Str ;
|
||||
} ;
|
||||
|
||||
auxBe : Aux = {
|
||||
inf = table {
|
||||
AX pol tense ag => mkAux pol tense ag
|
||||
} ;
|
||||
} ;
|
||||
|
||||
-- TODO: find out how much overlap with beVerb in MorphoPes /IL
|
||||
mkAux : Polarity -> AuxTense -> Agr -> Str = \pol,t,ag ->
|
||||
let bodh = "بوده" ;
|
||||
nbodh = "نبوده" ;
|
||||
hast = "هست" ;
|
||||
nhast = "نیست" ;
|
||||
bod = "بود" ;
|
||||
khah = "خواه" ;
|
||||
nbod = "نبود" ;
|
||||
nkhah = "نخواه" ;
|
||||
impfSuff : Str -> Str = imperfectSuffix ag ;
|
||||
impfSuffD : Str -> Str = imperfectSuffixD ag ;
|
||||
perfSuff : Str -> Str = perfectSuffix ag
|
||||
in case <pol,t,ag> of {
|
||||
<Pos,AuxPresent PrImperf,Ag Sg P3> => "است" ;
|
||||
<Pos,AuxPresent PrImperf> => impfSuff hast ;
|
||||
<Pos,AuxPresent PrPerf> => perfSuff bodh ;
|
||||
|
||||
<Pos,AuxPast PstPerf> => [] ;
|
||||
<Pos,AuxPast PstImperf> => zwnj "می" (impfSuff bod) ;
|
||||
<Pos,AuxPast PstAorist> => impfSuff bod ;
|
||||
|
||||
<Pos,AuxFut FtAorist> => impfSuffD khah ++ bod ;
|
||||
|
||||
-- negatives
|
||||
<Neg,AuxPresent PrImperf> => impfSuff nhast ;
|
||||
<Neg,AuxPresent PrPerf> => perfSuff nbodh ;
|
||||
|
||||
<Neg,AuxPast PstPerf> => [] ;
|
||||
<Neg,AuxPast PstImperf> => zwnj "نمی" (impfSuff bod) ;
|
||||
<Neg,AuxPast PstAorist> => impfSuff nbod ;
|
||||
|
||||
<Neg,AuxFut FtAorist> => impfSuffD nkhah ++ bod
|
||||
} ;
|
||||
|
||||
param
|
||||
AuxTense = AuxPresent PrAspect | AuxPast PstAspect | AuxFut FtAspect ;
|
||||
AuxForm = AX Polarity AuxTense Agr ;
|
||||
|
||||
|
||||
oper
|
||||
|
||||
predProg : VPH -> VPH = \verb -> verb ** {
|
||||
s = \\vh => case vh of {
|
||||
VPTense pol (VPPres Simul) agr => toHave Pos (PPresent2 PrImperf) agr ++ verb.s ! VPTense pol (VPPres Simul) agr ;
|
||||
VPTense pol (VPPast Simul) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Simul) agr ;
|
||||
VPTense pol (VPCond Simul) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Simul) agr ;
|
||||
VPTense pol (VPCond Anter) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Anter) agr ;
|
||||
-- VPTense pol (VPFutr Anter) agr => verb.s ! VPTense pol (VPFutr Anter) agr ; -- this is to be confirmed
|
||||
VF pol (VFPres PrImperf) agr => haveVerb.s ! VF Pos (VFPres PrImperf) agr ++ verb.s ! VF pol (VFPres PrImperf) agr ;
|
||||
VF pol (VFPast PstAorist) agr => haveVerb.s ! VF Pos (VFPast PstAorist) agr ++ verb.s ! VF pol (VFPast PstAorist) agr ;
|
||||
VF pol (VFPast PstImperf) agr => haveVerb.s ! VF Pos (VFPast PstAorist) agr ++ verb.s ! VF pol (VFPast PstImperf) agr ;
|
||||
_ => verb.s ! vh } ;
|
||||
subj = VIntrans
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
IndefArticle : Str ;
|
||||
IndefArticle = "یک";
|
||||
taryn : Str ;
|
||||
taryn = "ترین" ;
|
||||
IndefArticle : Str ;
|
||||
IndefArticle = "یک";
|
||||
taryn : Str ;
|
||||
taryn = "ترین" ;
|
||||
|
||||
-----------------------------
|
||||
-- Noun Phrase
|
||||
|
||||
@@ -13,11 +13,10 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
|
||||
s = \\pol,n =>
|
||||
let agr = Ag (numImp n) P2 ;
|
||||
in case vp.wish of {
|
||||
True => vp.s ! VPImp pol (numImp n) ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ++ vp.embComp;
|
||||
False => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ++ vp.s ! VPImp pol (numImp n) ++ vp.embComp }
|
||||
True => vp.s ! Imp pol (numImp n) ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ++ vp.embComp;
|
||||
False => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ++ vp.s ! Imp pol (numImp n) ++ vp.embComp }
|
||||
} ;
|
||||
|
||||
|
||||
SlashVP np vp =
|
||||
mkSlClause np vp ** {c2 = vp.c2} ;
|
||||
|
||||
@@ -38,22 +37,22 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
|
||||
|
||||
EmbedS s = {s = conjThat ++ s.s} ;
|
||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
EmbedVP vp = {s = showVPH VPInf defaultAgr vp} ; --- agr
|
||||
EmbedVP vp = {s = showVPH Inf defaultAgr vp} ; --- agr
|
||||
|
||||
|
||||
UseCl temp p cl = let vt = ta2vt temp.t temp.a in {
|
||||
UseCl temp p cl = let vt = TA temp.t temp.a in {
|
||||
s = temp.s ++ p.s ++ cl.s ! vt ! p.p ! ODir
|
||||
} ;
|
||||
|
||||
UseQCl temp p qcl = let vt = ta2vt temp.t temp.a in {
|
||||
UseQCl temp p qcl = let vt = TA temp.t temp.a in {
|
||||
s = \\q => temp.s ++ p.s ++ qcl.s ! vt ! p.p ! q;
|
||||
} ;
|
||||
|
||||
UseRCl temp p rcl = let vt = ta2vt temp.t temp.a in rcl ** {
|
||||
UseRCl temp p rcl = let vt = TA temp.t temp.a in rcl ** {
|
||||
s = \\q => temp.s ++ p.s ++ rcl.s ! vt ! p.p ! ODir ! q
|
||||
} ;
|
||||
|
||||
UseSlash temp p cls = let vt = ta2vt temp.t temp.a in cls ** {
|
||||
UseSlash temp p cls = let vt = TA temp.t temp.a in cls ** {
|
||||
s = temp.s ++ p.s ++ cls.subj ++ cls.vp ! vt ! p.p ! ODir
|
||||
} ;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
|
||||
in complSlash vvVPS np ** {c2 = vps.c2} ;
|
||||
|
||||
|
||||
UseComp comp = insertComp comp.s (predAux auxBe) ;
|
||||
UseComp comp = insertComp comp.s (predV beVerb) ;
|
||||
|
||||
AdvVP vp adv = insertAdV adv.s vp ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user