From 4fe2e38e9b1a3d5b4495b616ba08102c11700364 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 1 Mar 2019 07:27:04 +0100 Subject: [PATCH] (Pes) Merge isVV and isDef into one parameter --- src/persian/ResPes.gf | 49 +++++++++++++++++++------------------- src/persian/SentencePes.gf | 6 ++--- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/persian/ResPes.gf b/src/persian/ResPes.gf index a4352fb87..b86977f1e 100644 --- a/src/persian/ResPes.gf +++ b/src/persian/ResPes.gf @@ -56,6 +56,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { --- Verb Phrase ----------------------- param + VVType = NoVV | FullVV | DefVV ; VVForm = Indic | Subj ; VVTense = VVPres | VVPerf | VVPast ; -- VVPast Anteriority ??? TAnt = TA Tense Anteriority ; @@ -80,8 +81,7 @@ oper obj : Str ; -- object of a verb; so far only used for A ("paint it black") ad : Str ; embComp : Str ; -- when a declarative or interrogative sentence is used as a complement of a verb. - vvtype : Bool ; -- whether a VV has been added - isDef : Bool ; -- whether a the VV is defective + vvtype : VVType ; -- no VV, fully inflecting VV or defective VV } ; showVPH = overload { @@ -103,7 +103,7 @@ oper ad, obj, embComp = []; - isDef,isVV = False ; + vvtype = NoVV ; comp = \\_ => [] ; vComp = \\_,_ => [] } ; @@ -126,8 +126,7 @@ oper insertVV : VV -> VPH -> VPH = \vv,vp -> predV vv ** { vComp = \\a,t => vp.vComp ! a ! t ++ complVV vv vp ! a ! t ; - isVV = True ; - isDef = vv.isDef ; + vvType = case vv.isDef of {True => DefVV ; _ => FullVV} ; } ; embComp : Str -> VPH -> VPH = \str,vp -> vp ** { @@ -146,16 +145,16 @@ oper ---- but don't know yet how False should be affect complVV : VV -> VPH -> (Agr => VVTense => Str) = \vv,vp -> \\agr,ant => if_then_Str vv.isAux conjThat [] ++ - case of { - -- Auxiliaries with full inflection: complement in subjunctive - <_,_,False> => showVPH (VSubj Pos agr) agr vp ; -- - + case of { -- Auxiliaries with defective inflection: complement inflects in tense - => showVPH (VSubj Pos agr) agr vp ; - => showVPH (VAor Pos agr) agr vp ; - => showVPH (VPast Pos agr) agr vp ; + => showVPH (VPast Pos agr) agr vp ; -- => showVPH PerfStem agr vp ++ pluperfAux Pos agr ; -- TODO do we need this? - => showVPH PerfStem agr vp ++ subjAux Pos agr ; + => showVPH PerfStem agr vp ++ subjAux Pos agr ; + + -- Auxiliaries that take indicative (full or defective inflection) + => showVPH (VAor Pos agr) agr vp ; + + -- Default: complement in subjunctive _ => showVPH (VSubj Pos agr) agr vp ---- TODO more forms ? } ; @@ -179,24 +178,24 @@ oper TA Pres Anter => vp.s ! VPerf pol agr ; TA Past Simul => vp.s ! VPast pol agr ; TA Past Anter => - case vp.isDef of { - True => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; - False => vp.s ! PerfStem ++ pluperfAux pol agr } ; + case vp.vvtype of { + DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; + _ => vp.s ! PerfStem ++ pluperfAux pol agr } ; TA Fut Simul => - case vp.isDef of { - True => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; - False => futAux pol agr ++ vp.s ! PastStem + case vp.vvtype of { + DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; + _ => futAux pol agr ++ vp.s ! PastStem } ; -- PastStem is, despite the name, used for future too. /IL TA Fut Anter => - case vp.isDef of { - True => vp.s ! VPerf pol agr ; - False => "خواسته" ++ pluperfAux pol agr ++ vp.s ! PastStem + case vp.vvtype of { + DefVV => vp.s ! VPerf pol agr ; + _ => "خواسته" ++ pluperfAux pol agr ++ vp.s ! PastStem } ; -- verb form need to be confirmed TA Cond Simul => vp.s ! VSubj pol agr ; TA Cond Anter => - case vp.isDef of { - True => vp.s ! VSubj pol agr ; - False => vp.s ! PerfStem ++ subjAux pol agr } -- verb form to be confirmed + case vp.vvtype of { + DefVV => vp.s ! VSubj pol agr ; + _ => vp.s ! PerfStem ++ subjAux pol agr } -- verb form to be confirmed } ; mkClause : NP -> VPH -> Clause = \np,vp -> diff --git a/src/persian/SentencePes.gf b/src/persian/SentencePes.gf index c0f91eeac..06d076416 100644 --- a/src/persian/SentencePes.gf +++ b/src/persian/SentencePes.gf @@ -13,9 +13,9 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { s = \\pol,n => let agr = Ag (numImp n) P2 ; vps = vp.prefix ++ vp.s ! VImp pol (numImp n) - in case vp.isVV of { - True => vps ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp ; - False => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vps ++ vp.embComp } + in case vp.vvtype of { + NoVV => vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vps ++ vp.embComp ; + _ => vps ++ vp.ad ++ vp.comp ! agr ++ vp.obj ++ vp.vComp ! agr ! VVPres ++ vp.embComp } } ; SlashVP np vp =