From 25a151c2d299ea371aea9249927daa9246ca38cf Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 19 Mar 2019 16:56:10 +0100 Subject: [PATCH 1/6] (Pes) Add mkInterj + minor fixes in some prepositions --- src/persian/ParadigmsPes.gf | 3 +++ src/persian/StructuralPes.gf | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/persian/ParadigmsPes.gf b/src/persian/ParadigmsPes.gf index 1531bd07..ee7a8df0 100644 --- a/src/persian/ParadigmsPes.gf +++ b/src/persian/ParadigmsPes.gf @@ -214,6 +214,9 @@ oper = \vvf,s -> lin Subj {s=s ; compl=vvf} } ; + mkInterj : Str -> Interj + = \s -> lin Interj {s=s} ; + --. --2 Definitions of paradigms diff --git a/src/persian/StructuralPes.gf b/src/persian/StructuralPes.gf index e8f110ed..ee3cd127 100644 --- a/src/persian/StructuralPes.gf +++ b/src/persian/StructuralPes.gf @@ -57,9 +57,9 @@ concrete StructuralPes of Structural = CatPes ** only_Predet = ss "فقط" ; or_Conj = sd2 [] "یا" ** {n = Sg} ; otherwise_PConj = ss ["درغیراین صورت"] ; - part_Prep = mkPrep "از" ; -- TODO: the object following it should be in Ezafa form + part_Prep = mkPrep "از" Ezafe ; please_Voc = ss "لطفاً" ; - possess_Prep = mkPrep "" ; -- will be handeled in Ezafeh + possess_Prep = mkPrep [] Ezafe ; quite_Adv = ss "کاملاً" ; she_Pron = R.agr2pron ! Ag Sg P3 ; so_AdA = ss "بسیار" ; From 8438e8841075b48d7c4523ea537ca251e159f1f6 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 20 Mar 2019 10:23:34 +0100 Subject: [PATCH 2/6] (Pes) Fix bug in PrepNP --- src/persian/AdverbPes.gf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/persian/AdverbPes.gf b/src/persian/AdverbPes.gf index 2fe6cacc..026d2dd1 100644 --- a/src/persian/AdverbPes.gf +++ b/src/persian/AdverbPes.gf @@ -11,12 +11,12 @@ concrete AdverbPes of Adverb = CatPes ** open ResPes, Prelude in { s = a.adv ++ cadv.p ++ cadv.s ++ s.s ! Indic; } ; - PrepNP prep np = {s = prep.s ++ np.s ! Bare } ; + PrepNP prep np = {s = appComp prep np.s} ; AdAdv ada adv = { s = ada.s ++ adv.s} ; -- SubjS = cc2 ; - SubjS sub snt = {s = sub.s ++ "که" ++ snt.s ! sub.compl} ; + SubjS sub snt = {s = sub.s ++ conjThat ++ snt.s ! sub.compl} ; AdnCAdv cadv = {s = cadv.s ++ "از"} ; } From 3c301efd0523171ffcd95f9472cd8d9370be05c1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 20 Mar 2019 13:41:07 +0100 Subject: [PATCH 3/6] (Pes) Add InOrderToVP and ByVP to ExtendPes --- src/persian/ExtendPes.gf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/persian/ExtendPes.gf b/src/persian/ExtendPes.gf index 8bf3aeef..967248ae 100644 --- a/src/persian/ExtendPes.gf +++ b/src/persian/ExtendPes.gf @@ -2,7 +2,7 @@ concrete ExtendPes of Extend = CatPes ** ExtendFunctor - [ - GenNP, ApposNP, ICompAP, AdvIsNP + GenNP, ApposNP, ICompAP, AdvIsNP, InOrderToVP, ByVP ,GerundNP,GerundCN,GerundAdv,EmbedPresPart ] with (Grammar=GrammarPes) @@ -35,4 +35,14 @@ lin -- : Adv -> NP -> Cl -- here is the car / here are the cars AdvIsNP adv np = mkClause (indeclNP adv.s ** {a = np.a}) (UseComp (CompNP np)) ; + + -- : VP -> Adv ; -- by publishing the document + ByVP vp = lin Adv {s = with_Prep.s ++ showVPH Inf defaultAgr vp} ; + + -- : VP -> Adv ; -- (in order) to publish the document + InOrderToVP vp = lin Adv {s = for_Prep.s ++ showVPH PerfStem defaultAgr vp} ; + + + + } From 79ceab1ec12eae78152f21f46f67b96a20451743 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 20 Mar 2019 13:41:27 +0100 Subject: [PATCH 4/6] (Pes) fix typo in insertVV --- src/persian/ResPes.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/persian/ResPes.gf b/src/persian/ResPes.gf index b97bd1ee..f88cc2d1 100644 --- a/src/persian/ResPes.gf +++ b/src/persian/ResPes.gf @@ -151,7 +151,7 @@ oper insertVV : VV -> VPH -> VPH = \vv,vp -> predV vv ** { vComp = \\a,t => vp.vComp ! a ! t ++ complVV vv vp ! a ! t ; - vvType = case vv.isDef of {True => DefVV ; _ => FullVV} ; + vvtype = case vv.isDef of {True => DefVV ; _ => FullVV} ; ad = vp.ad -- because complVV doesn't include ad! for word order. } ; From 84520766367aa25bd9b1b039ffe745ad1d0394be Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 20 Mar 2019 15:32:43 +0100 Subject: [PATCH 5/6] (Pes) Remove unnecessary parameters from Imp --- src/persian/CatPes.gf | 2 +- src/persian/PhrasePes.gf | 6 +++--- src/persian/SentencePes.gf | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/persian/CatPes.gf b/src/persian/CatPes.gf index b2f926a0..cfcce220 100644 --- a/src/persian/CatPes.gf +++ b/src/persian/CatPes.gf @@ -18,7 +18,7 @@ concrete CatPes of Cat = CommonX ** open ResPes, Prelude in { vp : ResPes.TAnt => Polarity => Order => Str ; c2 : ResPes.Compl } ; - Imp = {s : Polarity => ImpForm => Str} ; + Imp = {s : Polarity => Number => Str} ; ---- Question QCl = {s : ResPes.TAnt => Polarity => Str} ; diff --git a/src/persian/PhrasePes.gf b/src/persian/PhrasePes.gf index 419e6a48..89a3549a 100644 --- a/src/persian/PhrasePes.gf +++ b/src/persian/PhrasePes.gf @@ -3,9 +3,9 @@ concrete PhrasePes of Phrase = CatPes ** open Prelude, ResPes in { lin PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; UttS s = {s = s.s ! Indic} ; - UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ; - UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ; - UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; UttIP, --- Acc also UttQS, diff --git a/src/persian/SentencePes.gf b/src/persian/SentencePes.gf index 6c6b40fe..7d667886 100644 --- a/src/persian/SentencePes.gf +++ b/src/persian/SentencePes.gf @@ -11,8 +11,8 @@ concrete SentencePes of Sentence = CatPes ** open Prelude, ResPes,Predef in { ImpVP vp = { s = \\pol,n => - let agr = Ag (numImp n) P2 ; - vps = vp.prefix ++ vp.s ! VImp pol (numImp n) + let agr = Ag n P2 ; + vps = vp.prefix ++ vp.s ! VImp pol n 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 } From 24ff11c63d6cd364c36e7ca8a0c0630027eda46f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 20 Mar 2019 16:01:55 +0100 Subject: [PATCH 6/6] (Pes) Fix bug in DetQuant: "a one N" --- src/persian/ExtendPes.gf | 2 +- src/persian/MorphoPes.gf | 6 ++++-- src/persian/NounPes.gf | 28 +++++++++++++++++++--------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/persian/ExtendPes.gf b/src/persian/ExtendPes.gf index 967248ae..91ccc932 100644 --- a/src/persian/ExtendPes.gf +++ b/src/persian/ExtendPes.gf @@ -10,7 +10,7 @@ concrete ExtendPes of Extend = lin -- NP -> Quant ; -- this man's - GenNP np = np ** { + GenNP np = makeQuant [] [] ** np ** { mod = Ezafe ; -- the possessed will get Ezafe s = \\num,cmpd => np2str np -- possesser is unmarked; https://sites.la.utexas.edu/persian_online_resources/language-specific-grammar/ezfe/ } ; diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index 0e2eb679..7afe58ee 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -119,7 +119,7 @@ oper --Determiners -------------------- BaseQuant : Type = { - mod : Mod } ; + mod : Mod} ; Determiner : Type = BaseQuant ** { s : Str ; @@ -129,7 +129,8 @@ oper } ; Quant : Type = BaseQuant ** { - s : Number => CmpdStatus => Str} ; + s : Number => CmpdStatus => Str ; + isDef : Bool } ; makeDet : Str -> Number -> Bool -> Determiner = \str,n,b -> { s,sp = str; @@ -141,6 +142,7 @@ oper makeQuant : Str -> Str -> Quant = \sg,pl -> { s = table {Sg => \\_ => sg ; Pl => \\_ => pl} ; mod = Bare ; + isDef = True }; --------------------------- -- Adjectives diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index 56c19b03..428ab04c 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -41,17 +41,27 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { s = \\ez => np.s ! Ezafe ++ adv.s } ; - DetQuantOrd quant num ord = { - s = quant.s ! num.n ! NotCmpd ++ num.s ++ ord.s ; - sp = quant.s ! num.n ! IsCmpd ++ num.s ++ ord.s ; -- only matters for PossPron + DetQuantOrd quant num ord = + let cs : CmpdStatus => Str = case of { + => \\_ => num.s ++ ord.s ; + _ => \\c => quant.s ! num.n ! c ++ num.s ++ ord.s} ; + + in { + s = cs ! NotCmpd ; + sp = cs ! IsCmpd ; -- only matters for PossPron isNum = orB num.isNum ord.isNum ; mod = quant.mod ; n = num.n } ; - DetQuant quant num = { - s = quant.s ! num.n ! NotCmpd ++ num.s ; - sp = quant.s ! num.n ! IsCmpd ++ num.s ; -- only matters for PossPron + DetQuant quant num = + let cs : CmpdStatus => Str = case of { + => \\_ => num.s ; + _ => \\c => quant.s ! num.n ! c ++ num.s } ; + + in { + s = cs ! NotCmpd ; + sp = cs ! IsCmpd ; -- only matters for PossPron isNum = num.isNum; mod = quant.mod ; n = num.n @@ -65,7 +75,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { relpron = Ance -- TODO check if this works for all Dets } ; - PossPron p = { + PossPron p = DefArt ** { s = \\_ => table { NotCmpd => BIND ++ p.ps ; IsCmpd => p.s } ; -- is a compound @@ -87,8 +97,8 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { OrdSuperl a = {s = a.s ! Bare ++ taryn; n = Sg ; isNum=False ; isPre = True} ; -- check the form of adjective - DefArt = {s = \\_,_ => [] ; mod = Bare} ; - IndefArt = {s = table {Sg => \\_ => IndefArticle ; Pl => \\_ => []} ; mod = Bare} ; + DefArt = makeQuant [] [] ; + IndefArt = makeQuant IndefArticle [] ** {isDef = False} ; MassNP cn = emptyNP ** cn ** { s = \\m => cn.s ! Sg ! m ++ cn.compl ! Sg ;