mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -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 ;
|
GenericCl vp = mkSClause "آدم" (agrP3 Sg) vp ;
|
||||||
|
|
||||||
CleftNP np rs =
|
CleftNP np rs =
|
||||||
let cl = mkSClause (np.s ! Bare) (np.a) (predAux auxBe);
|
let cl = mkSClause (np.s ! Bare) (np.a) (predV beVerb);
|
||||||
in
|
in
|
||||||
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
{s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a };
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@ lin
|
|||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkSClause " " (agrP3 (fromAgr np.a).n)
|
mkSClause " " (agrP3 (fromAgr np.a).n)
|
||||||
(insertComp (\\_ => np.s ! Bare) (predAux auxBe)) ;
|
(insertComp (\\_ => np.s ! Bare) (predV beVerb)) ;
|
||||||
|
|
||||||
ExistIP ip =
|
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 {
|
in {s = \\t,p,qf => case qf of {
|
||||||
QDir => cl.s ! t ! p ! ODir;
|
QDir => cl.s ! t ! p ! ODir;
|
||||||
QIndir => cl.s ! t! p ! ODir
|
QIndir => cl.s ! t! p ! ODir
|
||||||
@@ -30,8 +30,8 @@ lin
|
|||||||
|
|
||||||
ProgrVP vp = predProg vp ;
|
ProgrVP vp = predProg vp ;
|
||||||
|
|
||||||
ImpPl1 vp = {s = "بیایید" ++ vp.s ! VVForm (agrP1 Pl)} ;
|
ImpPl1 vp = {s = "بیایید" ++ vp.s ! Vvform (agrP1 Pl)} ;
|
||||||
ImpP3 np vp = {s = "بگذارید" ++ np.s!Bare ++ vp.s ! VVForm np.a};
|
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
|
-- Verbs
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
param
|
param
|
||||||
VerbForm1 = VF Polarity VTense2 Agr
|
VerbForm = VF Polarity VTense Agr
|
||||||
| Vvform Agr
|
| Vvform Agr
|
||||||
| Imp Polarity Number
|
| Imp Polarity Number
|
||||||
| Inf | Root1 | Root2 ;
|
| Inf | Root1 | Root2 ;
|
||||||
VTense2 = PPresent2 PrAspect
|
VTense = VFPres PrAspect
|
||||||
| PPast2 PstAspect
|
| VFPast PstAspect
|
||||||
| PFut2 FtAspect
|
| VFFut FtAspect
|
||||||
| Infr_Past2 InfrAspect;
|
| VFInfrPast InfrAspect;
|
||||||
PrAspect = PrPerf | PrImperf ;
|
PrAspect = PrPerf | PrImperf ;
|
||||||
PstAspect = PstPerf | PstImperf | PstAorist ;
|
PstAspect = PstPerf | PstImperf | PstAorist ;
|
||||||
FtAspect = FtAorist ; -- just keep FtAorist
|
FtAspect = FtAorist ; -- just keep FtAorist
|
||||||
InfrAspect = InfrPerf | InfrImperf ;
|
InfrAspect = InfrPerf | InfrImperf ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Verb = {s : VerbForm1 => Str} ;
|
Verb = {s : VerbForm => Str} ;
|
||||||
|
|
||||||
mkVerb : (x1,x2 : Str) -> Verb = \inf,root2 ->
|
mkVerb : (x1,x2 : Str) -> Verb = \inf,root2 ->
|
||||||
let root1 = tk 1 inf ;
|
let root1 = tk 1 inf ;
|
||||||
@@ -180,7 +180,7 @@ oper
|
|||||||
-- Most verbs that end in C+تن or C+دن
|
-- Most verbs that end in C+تن or C+دن
|
||||||
mkVerb2 : (_: Str) -> Verb = \inf -> mkVerb inf (tk 2 inf) ;
|
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 + "ه";
|
let khordh = root1 + "ه";
|
||||||
nkhordh = addN khordh ;
|
nkhordh = addN khordh ;
|
||||||
mekhor = zwnj "می" root2 ;
|
mekhor = zwnj "می" root2 ;
|
||||||
@@ -199,33 +199,33 @@ oper
|
|||||||
perfSuff : Str -> Str = perfectSuffix ag ;
|
perfSuff : Str -> Str = perfectSuffix ag ;
|
||||||
pluperfSuff : Str -> Str = pluperfectSuffix ag
|
pluperfSuff : Str -> Str = pluperfectSuffix ag
|
||||||
in case <pol,t> of {
|
in case <pol,t> of {
|
||||||
<Pos,PPresent2 PrImperf> => impfSuffD mekhor ;
|
<Pos,VFPres PrImperf> => impfSuffD mekhor ;
|
||||||
<Pos,PPresent2 PrPerf> => perfSuff khordh ;
|
<Pos,VFPres PrPerf> => perfSuff khordh ;
|
||||||
|
|
||||||
<Pos,PPast2 PstPerf> => pluperfSuff khordh ;
|
<Pos,VFPast PstPerf> => pluperfSuff khordh ;
|
||||||
<Pos,PPast2 PstImperf> => impfSuff mekhord ;
|
<Pos,VFPast PstImperf> => impfSuff mekhord ;
|
||||||
<Pos,PPast2 PstAorist> => impfSuff root1 ;
|
<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,VFInfrPast InfrPerf> => khordh ++ perfSuff bvdh ;
|
||||||
<Pos,Infr_Past2 InfrImperf> => perfSuff khordh ;
|
<Pos,VFInfrPast InfrImperf> => perfSuff khordh ;
|
||||||
|
|
||||||
-- negatives
|
-- negatives
|
||||||
<Meg,PPresent2 PrImperf> => impfSuffD nmekhor ;
|
<Neg,VFPres PrImperf> => impfSuffD nmekhor ;
|
||||||
<Neg,PPresent2 PrPerf> => perfSuff nkhordh ;
|
<Neg,VFPres PrPerf> => perfSuff nkhordh ;
|
||||||
|
|
||||||
<Neg,PPast2 PstPerf> => pluperfSuff nkhordh ;
|
<Neg,VFPast PstPerf> => pluperfSuff nkhordh ;
|
||||||
<Neg,PPast2 PstImperf> => impfSuff nmekhord ;
|
<Neg,VFPast PstImperf> => impfSuff nmekhord ;
|
||||||
<Neg,PPast2 PstAorist> => impfSuff (addN root1) ;
|
<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,VFInfrPast InfrPerf> => nkhordh ++ perfSuff bvdh ;
|
||||||
<Neg,Infr_Past2 InfrImperf> => perfSuff nmekhordh
|
<Neg,VFInfrPast InfrImperf> => perfSuff nmekhordh
|
||||||
|
|
||||||
-- <Pos,PFut2 FtImperf> => perfSuffD mekhah ++ addBh (perfSuffD root2) ;
|
-- <Pos,VFFut FtImperf> => perfSuffD mekhah ++ addBh (perfSuffD root2) ;
|
||||||
-- <Neg,PFut2 FtImperf> => perfSuffD nmekhah ++ addBh (perfSuffD root2) ;
|
-- <Neg,VFFut FtImperf> => perfSuffD nmekhah ++ addBh (perfSuffD root2) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkvVform : Str -> Agr -> Str = \root2,ag ->
|
mkvVform : Str -> Agr -> Str = \root2,ag ->
|
||||||
@@ -315,20 +315,14 @@ oper
|
|||||||
Imp Neg Sg => "ندار" ;
|
Imp Neg Sg => "ندار" ;
|
||||||
Imp Neg Pl => "ندارید" ;
|
Imp Neg Pl => "ندارید" ;
|
||||||
Vvform agr => mkvVform "دار" agr ;
|
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
|
-- TODO: merge with auxBe in ResPes
|
||||||
beVerb : Verb = { s = table {
|
beVerb : Verb = { s = table {
|
||||||
Vvform agr => imperfectSuffixD agr "باش" ;
|
Vvform agr => imperfectSuffixD agr "باش" ;
|
||||||
@@ -343,13 +337,15 @@ oper
|
|||||||
let impfSuff = imperfectSuffix agr ;
|
let impfSuff = imperfectSuffix agr ;
|
||||||
perfSuff = perfectSuffix agr
|
perfSuff = perfectSuffix agr
|
||||||
in case <pol,tense,agr> of {
|
in case <pol,tense,agr> of {
|
||||||
<Pos,PPresent2 PrImperf,Ag Sg P3> => "است" ;
|
<Pos,VFPres PrImperf,Ag Sg P3> => "است" ;
|
||||||
<Pos,PPresent2 PrImperf> => impfSuff "هست" ;
|
<Neg,VFPres PrImperf,Ag Sg P3> => "نیست" ;
|
||||||
<Pos,PPresent2 PrPerf> => perfSuff "بوده" ;
|
<Pos,VFPres PrImperf> => impfSuff "هست" ;
|
||||||
<Neg,PPresent2 PrImperf,Ag Sg P3> => "نیست" ;
|
<Neg,VFPres PrImperf> => impfSuff "نیست" ;
|
||||||
<Neg,PPresent2 PrImperf> => impfSuff "نیست" ;
|
<Pos,VFPres PrPerf> => perfSuff "بوده" ;
|
||||||
<Neg,PPresent2 PrPerf> => perfSuff "نبوده" ;
|
<Neg,VFPres PrPerf> => perfSuff "نبوده" ;
|
||||||
_ => mkCmnVF "بود" "باش" pol tense agr
|
<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} ;
|
UttNP np = {s = np2str np} ;
|
||||||
UttCN cn = {s = cn2str cn};
|
UttCN cn = {s = cn2str cn};
|
||||||
UttAP ap = {s = ap.s ! Bare} ;
|
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} ;
|
PConjConj conj = {s = conj.s2} ;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ concrete QuestionPes of Question = CatPes ** open ResPes, Prelude in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
QuestIComp icomp np =
|
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 {
|
in {
|
||||||
s = \\t,p,qf => case qf of {
|
s = \\t,p,qf => case qf of {
|
||||||
QDir => cl.s ! t ! p ! ODir;
|
QDir => cl.s ! t ! p ! ODir;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
|
|||||||
oper
|
oper
|
||||||
|
|
||||||
VPH : Type = {
|
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"
|
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.
|
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")
|
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
|
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 ;
|
vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.s ! vf ++ vp.vComp ! agr ++ vp.embComp ;
|
||||||
|
|
||||||
Compl : Type = {s : Str ; ra : Str} ;
|
Compl : Type = {s : Str ; ra : Str} ;
|
||||||
@@ -78,63 +78,24 @@ oper
|
|||||||
|
|
||||||
param
|
param
|
||||||
|
|
||||||
VPHForm =
|
|
||||||
VPTense Polarity VPPTense Agr -- 9 * 12
|
|
||||||
-- | VPReq
|
|
||||||
| VPImp Polarity Number
|
|
||||||
-- | VPReqFut
|
|
||||||
| VVForm Agr
|
|
||||||
| VPStem1
|
|
||||||
| VPStem2
|
|
||||||
| VPInf
|
|
||||||
;
|
|
||||||
|
|
||||||
VPHTense =
|
VPHTense =
|
||||||
VPres -- impf hum nahim "I گْ"
|
TA Tense Anteriority
|
||||||
| 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 می گْ"
|
|
||||||
| VVVForm -- AR 21/3/2018 for mustCl after Nasrin
|
| VVVForm -- AR 21/3/2018 for mustCl after Nasrin
|
||||||
| VRoot1 -- AR 22/3/2018 for mustCl past after Nasrin
|
| VRoot1 -- AR 22/3/2018 for mustCl past after Nasrin
|
||||||
;
|
;
|
||||||
|
|
||||||
VType = VIntrans | VTrans | VTransPost ;
|
VType = VIntrans | VTrans | VTransPost ;
|
||||||
|
|
||||||
VPPTense =
|
|
||||||
VPPres Anteriority
|
|
||||||
|VPPast Anteriority
|
|
||||||
|VPFutr Anteriority
|
|
||||||
|VPCond Anteriority ;
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
predV : Verb -> VPH = \verb -> {
|
predV : Verb -> VPH = \verb -> 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 };
|
|
||||||
subj = VIntrans ;
|
subj = VIntrans ;
|
||||||
ad,
|
ad,
|
||||||
obj,
|
obj,
|
||||||
embComp = [];
|
embComp = [];
|
||||||
wish = False ;
|
wish = False ;
|
||||||
comp,
|
comp,
|
||||||
vComp = \\_ => [] ;
|
vComp = \\_ => [] } ;
|
||||||
} ;
|
|
||||||
|
|
||||||
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
|
predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb ->
|
||||||
predV verb ** {c2 = {s = verb.c1 ; ra = []} } ;
|
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
|
---- AR 14/9/2017 trying to fix isAux = True case by inserting conjThat
|
||||||
---- but don't know yet how False should be affect
|
---- but don't know yet how False should be affect
|
||||||
infVV : Bool -> VPH -> (Agr => Str) = \isAux,vp ->
|
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 ** {
|
insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** {
|
||||||
ad = vp.ad ++ ad ;
|
ad = vp.ad ++ ad ;
|
||||||
@@ -192,34 +153,23 @@ oper
|
|||||||
---- AR 18/9/2017 intermediate SClause to preserve SOV in e.g. QuestionPes.QuestSlash
|
---- AR 18/9/2017 intermediate SClause to preserve SOV in e.g. QuestionPes.QuestSlash
|
||||||
|
|
||||||
clTable : VPH -> (Agr => VPHTense => Polarity => Str) = \vp ->
|
clTable : VPH -> (Agr => VPHTense => Polarity => Str) = \vp ->
|
||||||
\\agr,vt,b => case <b,vt> of {
|
\\agr,vt,pol => case vt of {
|
||||||
<Pos,VPres> => vp.s ! VPTense Pos (VPPres Simul) agr ;
|
TA Pres Simul => vp.s ! VF pol (VFPres PrImperf) agr ;
|
||||||
<Neg,VPres> => vp.s ! VPTense Neg (VPPres Simul) agr ;
|
TA Pres Anter => vp.s ! VF pol (VFPres PrPerf) agr ;
|
||||||
<Pos,VPerfPres> => vp.s ! VPTense Pos (VPPres Anter) agr ;
|
TA Past Simul => vp.s ! VF pol (VFPast PstAorist) agr ;
|
||||||
<Neg,VPerfPres> => vp.s ! VPTense Neg (VPPres Anter) agr ;
|
TA Past Anter => vp.s ! VF pol (VFPast PstPerf) agr ;
|
||||||
<Pos,VPast> => vp.s ! VPTense Pos (VPPast Simul) agr ;
|
TA Fut Simul => case vp.wish of {
|
||||||
<Neg,VPast> => vp.s ! VPTense Neg (VPPast Simul) agr ;
|
True => vp.s ! VF pol (VFPres PrImperf) agr ;
|
||||||
<Pos,VPerfPast> => vp.s ! VPTense Pos (VPPast Anter) agr ;
|
False => vp.s ! VF pol (VFFut FtAorist) agr } ;
|
||||||
<Pos,VFut> => case vp.wish of {
|
TA Fut Anter => case vp.wish of {
|
||||||
True => vp.s ! VPTense Pos (VPPres Simul) agr ;
|
_True => vp.s ! VF pol (VFPres PrPerf) agr } ;
|
||||||
False => vp.s ! VPTense Pos (VPFutr Simul) agr };
|
--False => vp.s ! VF pol (VFFut FtAorist) agr } ; -- verb form need to be confirmed
|
||||||
<Pos,VPerfFut> => case vp.wish of {
|
TA Cond Simul => vp.s ! VF pol (VFPast PstImperf) agr ;
|
||||||
True => vp.s ! VPTense Pos (VPPres Anter) agr ;
|
TA Cond Anter => vp.s ! VF pol (VFPast PstImperf) agr ; -- verb form to be confirmed
|
||||||
False => vp.s ! VPTense Pos (VPFutr Anter) agr }; -- verb form need to be confirmed
|
VVVForm => vp.s ! Vvform agr ; -- AR 21/3/2018
|
||||||
<Neg,VPerfPast> => vp.s ! VPTense Neg (VPPast Anter) agr ;
|
VRoot1 => vp.s ! Root1 {- ++ Predef.Bind ++ "ه" -} -- AR 22/3/2018
|
||||||
<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
|
|
||||||
};
|
|
||||||
|
|
||||||
mkClause : NP -> VPH -> Clause = \np,vp ->
|
mkClause : NP -> VPH -> Clause = \np,vp ->
|
||||||
let cls = mkSlClause 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
|
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 ** {
|
predProg : VPH -> VPH = \verb -> verb ** {
|
||||||
s = \\vh => case vh of {
|
s = \\vh => case vh of {
|
||||||
VPTense pol (VPPres Simul) agr => toHave Pos (PPresent2 PrImperf) agr ++ verb.s ! VPTense pol (VPPres Simul) agr ;
|
VF pol (VFPres PrImperf) agr => haveVerb.s ! VF Pos (VFPres PrImperf) agr ++ verb.s ! VF pol (VFPres PrImperf) agr ;
|
||||||
VPTense pol (VPPast Simul) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Simul) agr ;
|
VF pol (VFPast PstAorist) agr => haveVerb.s ! VF Pos (VFPast PstAorist) agr ++ verb.s ! VF pol (VFPast PstAorist) agr ;
|
||||||
VPTense pol (VPCond Simul) agr => toHave Pos (PPast2 PstAorist) agr ++ verb.s ! VPTense pol (VPCond Simul) agr ;
|
VF pol (VFPast PstImperf) agr => haveVerb.s ! VF Pos (VFPast PstAorist) agr ++ verb.s ! VF pol (VFPast PstImperf) 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
|
|
||||||
_ => verb.s ! vh } ;
|
_ => verb.s ! vh } ;
|
||||||
subj = VIntrans
|
subj = VIntrans
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
IndefArticle : Str ;
|
||||||
|
IndefArticle = "یک";
|
||||||
IndefArticle : Str ;
|
taryn : Str ;
|
||||||
IndefArticle = "یک";
|
taryn = "ترین" ;
|
||||||
taryn : Str ;
|
|
||||||
taryn = "ترین" ;
|
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
-- Noun Phrase
|
-- Noun Phrase
|
||||||
|
|||||||
@@ -13,11 +13,10 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
|
|||||||
s = \\pol,n =>
|
s = \\pol,n =>
|
||||||
let agr = Ag (numImp n) P2 ;
|
let agr = Ag (numImp n) P2 ;
|
||||||
in case vp.wish of {
|
in case vp.wish of {
|
||||||
True => vp.s ! VPImp pol (numImp n) ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ++ 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 ! VPImp pol (numImp n) ++ vp.embComp }
|
False => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ++ vp.s ! Imp pol (numImp n) ++ vp.embComp }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
mkSlClause np vp ** {c2 = vp.c2} ;
|
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} ;
|
EmbedS s = {s = conjThat ++ s.s} ;
|
||||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
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
|
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;
|
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
|
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
|
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} ;
|
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 ;
|
AdvVP vp adv = insertAdV adv.s vp ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user