Merge pull request #230 from inariksit/persian

Persian: imperatives, word order
This commit is contained in:
Inari Listenmaa
2019-04-27 17:12:02 +02:00
committed by GitHub
3 changed files with 25 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ lin
AdvIsNP adv np = mkClause (indeclNP adv.s ** {a = np.a}) (UseComp (CompNP np)) ; AdvIsNP adv np = mkClause (indeclNP adv.s ** {a = np.a}) (UseComp (CompNP np)) ;
-- : VP -> Adv ; -- by publishing the document -- : VP -> Adv ; -- by publishing the document
ByVP vp = lin Adv {s = with_Prep.s ++ showVPH Inf defaultAgr vp} ; ByVP vp = lin Adv {s = with_Prep.s ++ showVPH' VO False VVPres Inf defaultAgr vp } ;
-- : VP -> Adv ; -- (in order) to publish the document -- : VP -> Adv ; -- (in order) to publish the document
InOrderToVP vp = lin Adv {s = for_Prep.s ++ showVPH PerfStem defaultAgr vp} ; InOrderToVP vp = lin Adv {s = for_Prep.s ++ showVPH PerfStem defaultAgr vp} ;

View File

@@ -207,9 +207,9 @@ oper
VSubj Pos agr => addBh (imperfectSuffixD agr kon) ; VSubj Pos agr => addBh (imperfectSuffixD agr kon) ;
VSubj Neg agr => addN (imperfectSuffixD agr kon) ; VSubj Neg agr => addN (imperfectSuffixD agr kon) ;
VImp Pos Sg => addBh imp ; VImp Pos Sg => addBh imp ;
VImp Pos Pl => addBh imp + "ید" ; VImp Pos Pl => addBh kon + "ید" ;
VImp Neg Sg => addN imp ; VImp Neg Sg => addN imp ;
VImp Neg Pl => addN imp + "ید" } ; VImp Neg Pl => addN kon + "ید" } ;
prefix = [] ;-- For compound verbs prefix = [] ;-- For compound verbs
passive = Add ; passive = Add ;
} where { } where {
@@ -338,7 +338,15 @@ oper
vf => beRegV.s ! vf } vf => beRegV.s ! vf }
} where { beRegV = mkVerb "بودن" "باش" } ; } where { beRegV = mkVerb "بودن" "باش" } ;
doVerb = mkVerb "کردن" "کن" ** {passive=Replace} ; doVerb : Verb = doRegV ** {s = table {
VSubj pol agr => addN pol (imperfectSuffixD agr "کن") ;
VImp Pos Sg => "کن" ;
VImp Pos Pl => "کنید" ;
VImp Neg Sg => "نکن" ;
VImp Neg Pl => "نکنید" ;
vf => doRegV.s ! vf } ;
passive = Replace
} where { doRegV = mkVerb "کردن" "کن" } ;
becomeVerb : Verb = mkVerb "شدن" "شو" ; becomeVerb : Verb = mkVerb "شدن" "شو" ;

View File

@@ -15,6 +15,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in {
CardOrd = NCard | NOrd ; CardOrd = NCard | NOrd ;
RAgr = RNoAg | RAg Agr ; RAgr = RNoAg | RAg Agr ;
RelPron = Ance | Ke ; -- https://en.wiktionary.org/wiki/%D8%A2%D9%86%DA%86%D9%87 RelPron = Ance | Ke ; -- https://en.wiktionary.org/wiki/%D8%A2%D9%86%DA%86%D9%87
WordOrder = OV | VO ; -- for showVPH
oper oper
CN : Type = Noun ** { CN : Type = Noun ** {
@@ -102,18 +103,22 @@ oper
} ; } ;
showVPH = overload { showVPH = overload {
showVPH : VerbForm -> Agr -> VPH -> Str = showVPH' False VVPres ; showVPH : VerbForm -> Agr -> VPH -> Str = showVPH' OV False VVPres ;
showVPH : VVTense -> VerbForm -> Agr -> VPH -> Str = showVPH' False showVPH : VVTense -> VerbForm -> Agr -> VPH -> Str = showVPH' OV False
} ; } ;
showVPH' : Bool -> VVTense -> VerbForm -> Agr -> VPH -> Str = showVPH' : WordOrder -> Bool -> VVTense -> VerbForm -> Agr -> VPH -> Str =
\showImpPref,ant,vf,agr,vp -> \wo,showImpPref,ant,vf,agr,vp ->
let impPref = case showImpPref of { let impPref = case showImpPref of {
True => vp.s ! ImpPrefix Pos ; True => vp.s ! ImpPrefix Pos ;
False => [] } False => [] }
in vp.ad ++ vp.comp ! agr ++ vp.obj in case wo of {
OV => vp.ad ++ vp.comp ! agr ++ vp.obj
++ vp.prefix ++ impPref ++ vp.s ! vf ++ vp.prefix ++ impPref ++ vp.s ! vf
++ vp.vComp ! agr ! ant ++ vp.embComp ; ++ vp.vComp ! agr ! ant ++ vp.embComp ;
VO => vp.prefix ++ vp.s ! vf ++ vp.ad
++ vp.comp ! agr ++ vp.obj ++ impPref
++ vp.vComp ! agr ! ant ++ vp.embComp } ;
Compl : Type = {s : Str ; ra : Str ; mod : Mod} ; Compl : Type = {s : Str ; ra : Str ; mod : Mod} ;
@@ -189,7 +194,7 @@ oper
\\agr,ant => if_then_Str vv.isAux conjThat [] ++ \\agr,ant => if_then_Str vv.isAux conjThat [] ++
case <ant,vv.isDef,vv.compl> of { case <ant,vv.isDef,vv.compl> of {
-- Auxiliaries with defective inflection: complement inflects in tense -- Auxiliaries with defective inflection: complement inflects in tense
<VVPast Indic,True,> => showVPH' True VVPres (VPast Pos agr) agr vp ; <VVPast Indic,True,> => showVPH' OV True VVPres (VPast Pos agr) agr vp ;
<VVPast Indic,_,_> => showVPH (VPast Pos agr) agr vp ; <VVPast Indic,_,_> => showVPH (VPast Pos agr) agr vp ;
<VVPast Subj> => showVPH PerfStem agr vp ++ subjAux Pos agr ; <VVPast Subj> => showVPH PerfStem agr vp ++ subjAux Pos agr ;