1
0
forked from GitHub/gf-rgl

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 } ; 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
++ 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 ; VVType = NoVV | FullVV | DefVV ;
VVForm = Indic | Subj ; ---| SubjPast ; -- TODO extend this to VV, VS and Subj VVForm = Indic | Subj ; ---| SubjPast ; -- TODO extend this to VV, VS and Subj
VVTense = VVPres | VVPast VVForm ; VVTense = VVPres | VVPast VVForm ;
TAnt = TA Tense Anteriority ; TAnt = Ind Tense Anteriority | Sub Anteriority ;
oper oper
@@ -78,10 +78,10 @@ oper
-- قاتل نمی توانسته آنجا بوده باشد، چون او آن زمان در پاریس بوده -- قاتل نمی توانسته آنجا بوده باشد، چون او آن زمان در پاریس بوده
-- The form is created in complVV, but not currently used in other functions. /IL -- The form is created in complVV, but not currently used in other functions. /IL
ta2vvt : TAnt -> VVType -> VVTense = \ta,vvtype -> case ta of { ta2vvt : TAnt -> VVType -> VVTense = \ta,vvtype -> case ta of {
TA Pres Anter | Ind Pres Anter |
TA Past _ => VVPast Indic ; Ind Past _ => VVPast Indic ;
TA Cond Simul => VVPres ; Ind Cond Simul => VVPres ;
TA Cond Anter => Ind Cond Anter =>
case vvtype of { case vvtype of {
DefVV => VVPast Indic ; DefVV => VVPast Indic ;
_ => VVPres } ; _ => VVPres } ;
@@ -205,10 +205,14 @@ oper
_ => showVPH (VSubj Pos agr) agr vp _ => showVPH (VSubj Pos 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 ;
} ; } ;
insertAdV : Str -> VPH -> VPH = \ad,vp -> vp ** {
ad = ad ++ vp.ad ;
} ;
conjThat : Str = "که" ; conjThat : Str = "که" ;
--------------------------- ---------------------------
@@ -220,23 +224,23 @@ oper
clTable : VPH -> (Agr => TAnt => Polarity => Str) = \vp -> clTable : VPH -> (Agr => TAnt => Polarity => Str) = \vp ->
\\agr,vt,pol => vp.prefix ++ case vt of { \\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. Ind 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 ; Ind Pres Anter => vp.s ! VPerf pol agr ;
TA Past Simul => vp.s ! VPast pol agr ; -- Past Simul: simple past Ind Past Simul => vp.s ! VPast pol agr ; -- Past Simul: simple past
TA Past Anter | TA Cond _ => -- Past Anter & Cond _: continuous past Ind Past Anter | Ind Cond _ => -- Past Anter & Cond _: continuous past
case vp.vvtype of { case vp.vvtype of {
DefVV => vp.s ! VPast pol agr ; DefVV => vp.s ! VPast pol agr ;
_ => vp.s ! ImpPrefix pol ++ vp.s ! VPast Pos agr } ; _ => vp.s ! ImpPrefix pol ++ vp.s ! VPast Pos agr } ;
TA Fut Simul => Ind Fut Simul =>
case vp.vvtype of { case vp.vvtype of {
DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ; DefVV => vp.s ! ImpPrefix pol ++ vp.s ! VAor pol agr ;
_ => futAux pol agr ++ vp.s ! PastStem _ => futAux pol agr ++ vp.s ! PastStem
} ; -- PastStem is, despite the name, used for future too. /IL } ; -- PastStem is, despite the name, used for future too. /IL
TA Fut Anter => Ind Fut Anter =>
case vp.vvtype of { case vp.vvtype of {
DefVV => vp.s ! VPerf pol agr ; 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 -> 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 = { UseCl temp p cl = {
s = \\vvf => temp.s ++ p.s ++ case vvf of { s = \\vvf => temp.s ++ p.s ++ case vvf of {
Indic => cl.s ! TA temp.t temp.a ! p.p ! ODir ; Indic => cl.s ! Ind temp.t temp.a ! p.p ! ODir ;
Subj => cl.s ! TA Cond 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 ; 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 s = \\a => temp.s ++ p.s ++ rcl.s ! vt ! p.p ! a
} ; } ;
UseSlash temp p cls = cls ** { UseSlash temp p cls = cls ** {
s = \\vvf => temp.s ++ p.s ++ cls.subj ++ case vvf of { s = \\vvf => temp.s ++ p.s ++ cls.subj ++ case vvf of {
Indic => cls.vp ! TA temp.t temp.a ! p.p ! ODir ; Indic => cls.vp ! Ind temp.t temp.a ! p.p ! ODir ;
Subj => cls.vp ! TA Cond temp.a ! p.p ! ODir } Subj => cls.vp ! Sub temp.a ! p.p ! ODir }
} ; } ;
AdvS a s = {s = \\vvf => a.s ++ s.s ! vvf} ; 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 ; youSg_Pron = R.agr2pron ! Ag Sg P2 ;
youPl_Pron = R.agr2pron ! Ag Pl P2 ; youPl_Pron = R.agr2pron ! Ag Pl P2 ;
youPol_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="نه"} ; not_Predet = {s="نه"} ;
if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ; if_then_Conj = sd2 "اگر" "آنگاه" ** {n = Sg} ;
at_least_AdN = ss "حداقل" ; 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 ; 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 ; AdVVP adv vp = insertAdV adv.s vp ;
ReflVP = insertCompPre reflPron ; ReflVP = insertCompPre reflPron ;
PassV2 = passV ; PassV2 = passV ;
@@ -64,6 +64,7 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in {
CompAdv adv = {s = \\_ => adv.s} ; CompAdv adv = {s = \\_ => adv.s} ;
-- see https://sites.la.utexas.edu/persian_online_resources/nouns/noun-in-a-predicative-position/ -- 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 = { CompCN cn = {
s = \\a => cn.s ! giveNumber a s = \\a => cn.s ! giveNumber a
! case cn.hasAdj of { ! case cn.hasAdj of {