Merge pull request #232 from inariksit/persian

Persian
This commit is contained in:
Inari Listenmaa
2019-04-30 18:47:04 +02:00
committed by GitHub
5 changed files with 32 additions and 27 deletions

View File

@@ -43,9 +43,9 @@ lin
ByVP vp = lin Adv {s = with_Prep.s ++ showVPH' VO False VVPres Inf defaultAgr vp } ;
-- : 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
++ case vp.passive of {
Replace => showVPH PerfStem defaultAgr <vp ** {s = \\vf => []} : VP> ; -- only show prefix
_ => showVPH PerfStem defaultAgr vp}
} ;
}

View File

@@ -70,7 +70,7 @@ param
VVType = NoVV | FullVV | DefVV ;
VVForm = Indic | Subj ; ---| SubjPast ; -- TODO extend this to VV, VS and Subj
VVTense = VVPres | VVPast VVForm ;
TAnt = TA Tense Anteriority ;
TAnt = Ind Tense Anteriority | Sub Anteriority ;
oper
@@ -78,10 +78,10 @@ oper
-- قاتل نمی توانسته آنجا بوده باشد، چون او آن زمان در پاریس بوده
-- The form is created in complVV, but not currently used in other functions. /IL
ta2vvt : TAnt -> VVType -> VVTense = \ta,vvtype -> case ta of {
TA Pres Anter |
TA Past _ => VVPast Indic ;
TA Cond Simul => VVPres ;
TA Cond Anter =>
Ind Pres Anter |
Ind Past _ => VVPast Indic ;
Ind Cond Simul => VVPres ;
Ind Cond Anter =>
case vvtype of {
DefVV => VVPast Indic ;
_ => VVPres } ;
@@ -205,10 +205,14 @@ oper
_ => showVPH (VSubj Pos agr) agr vp
} ;
insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** {
insertAdv : Str -> VPH -> VPH = \ad,vp -> vp ** {
ad = vp.ad ++ ad ;
} ;
insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** {
ad = ad ++ vp.ad ;
} ;
conjThat : Str = "که" ;
---------------------------
@@ -220,23 +224,23 @@ oper
clTable : VPH -> (Agr => TAnt => Polarity => Str) = \vp ->
\\agr,vt,pol => vp.prefix ++ case vt of {
TA Pres Simul => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; -- for reg. verbs, VAor pol is invariant and negation comes in ImpPrefix.
TA Pres Anter => vp.s ! VPerf pol agr ;
TA Past Simul => vp.s ! VPast pol agr ; -- Past Simul: simple past
TA Past Anter | TA Cond _ => -- Past Anter & Cond _: continuous past
Ind Pres Simul => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; -- for reg. verbs, VAor pol is invariant and negation comes in ImpPrefix.
Ind Pres Anter => vp.s ! VPerf pol agr ;
Ind Past Simul => vp.s ! VPast pol agr ; -- Past Simul: simple past
Ind Past Anter | Ind Cond _ => -- Past Anter & Cond _: continuous past
case vp.vvtype of {
DefVV => vp.s ! VPast pol agr ;
_ => vp.s ! ImpPrefix pol ++ vp.s ! VPast Pos agr } ;
TA Fut Simul =>
Ind Fut Simul =>
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 =>
Ind Fut Anter =>
case vp.vvtype of {
DefVV => vp.s ! VPerf pol agr ;
_ => futAux pol agr ++ vp.s ! PastStem
}
_ => futAux pol agr ++ vp.s ! PastStem } ;
Sub _ => vp.s ! VSubj pol agr -- TODO: anterior subjunctive ?
} ;
mkClause : NP -> VPH -> Clause = \np,vp ->

View File

@@ -43,22 +43,22 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in {
UseCl temp p cl = {
s = \\vvf => temp.s ++ p.s ++ case vvf of {
Indic => cl.s ! TA temp.t temp.a ! p.p ! ODir ;
Subj => cl.s ! TA Cond temp.a ! p.p ! ODir }
Indic => cl.s ! Ind temp.t temp.a ! p.p ! ODir ;
Subj => cl.s ! Sub temp.a ! p.p ! ODir }
} ;
UseQCl temp p qcl = let vt = TA temp.t temp.a in {
UseQCl temp p qcl = let vt = Ind temp.t temp.a in {
s = temp.s ++ p.s ++ qcl.s ! vt ! p.p ;
} ;
UseRCl temp p rcl = let vt = TA temp.t temp.a in rcl ** {
UseRCl temp p rcl = let vt = Ind temp.t temp.a in rcl ** {
s = \\a => temp.s ++ p.s ++ rcl.s ! vt ! p.p ! a
} ;
UseSlash temp p cls = cls ** {
s = \\vvf => temp.s ++ p.s ++ cls.subj ++ case vvf of {
Indic => cls.vp ! TA temp.t temp.a ! p.p ! ODir ;
Subj => cls.vp ! TA Cond temp.a ! p.p ! ODir }
Indic => cls.vp ! Ind temp.t temp.a ! p.p ! ODir ;
Subj => cls.vp ! Sub temp.a ! p.p ! ODir }
} ;
AdvS a s = {s = \\vvf => a.s ++ s.s ! vvf} ;

View File

@@ -101,7 +101,7 @@ concrete StructuralPes of Structural = CatPes **
youSg_Pron = R.agr2pron ! Ag Sg P2 ;
youPl_Pron = R.agr2pron ! Ag Pl P2 ;
youPol_Pron = R.agr2pron ! Ag Pl P2 ;
no_Quant = mkQuant "هیچ" "هیچ" ;
no_Quant = mkQuant "هیچ" "هیچ" ; -- TODO: takes object in clitic form + is always singular
not_Predet = {s="نه"} ;
if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ;
at_least_AdN = ss "حداقل" ;

View File

@@ -54,7 +54,7 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
VPSlashPrep vp prep = vp ** vs prep ;
AdvVP vp adv = insertAdV adv.s vp ;
AdvVP vp adv = insertAdv adv.s vp ;
AdVVP adv vp = insertAdV adv.s vp ;
ReflVP = insertCompPre reflPron ;
PassV2 = passV ;
@@ -64,6 +64,7 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
CompAdv adv = {s = \\_ => adv.s} ;
-- see https://sites.la.utexas.edu/persian_online_resources/nouns/noun-in-a-predicative-position/
-- TODO: extend this to all verbs, when NP is indefinite
CompCN cn = {
s = \\a => cn.s ! giveNumber a
! case cn.hasAdj of {