From 718d0f91403627e3a5ef6bba3f4aaad128802b63 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 13 Mar 2019 13:37:32 +0100 Subject: [PATCH 1/4] (Pes) Fix a few bugs in standalone forms of Dets --- src/persian/NounPes.gf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index 35d70ba65..c517e246d 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -12,8 +12,8 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { => Ezafe ; -- If CN is compound and Det is poss.pron, don't use poss.suff but Ezafe and full form of pronoun _ => det.mod } ; detStr : Str = case cn.isCmpd of { - IsCmpd => det.sp ; - NotCmpd => det.sp } ; + NotCmpd => det.s ; -- possessive suffix + IsCmpd => det.sp } ; -- full form in case mod of { Bare => detStr ++ cn.s ! num ! m ; -- det doesn't require a special form, keep the Mod=>Str table x => cn.s ! num ! x ++ detStr } ; -- det requires a special form @@ -42,7 +42,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { DetQuantOrd quant num ord = { s = quant.s ! num.n ! NotCmpd ++ num.s ++ ord.s ; - sp = quant.s ! num.n ! IsCmpd ; -- only matters for PossPron + sp = quant.s ! num.n ! IsCmpd ++ num.s ++ ord.s ; -- only matters for PossPron isNum = orB num.isNum ord.isNum ; mod = quant.mod ; n = num.n @@ -50,7 +50,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { DetQuant quant num = { s = quant.s ! num.n ! NotCmpd ++ num.s ; - sp = quant.s ! num.n ! IsCmpd ; -- only matters for PossPron + sp = quant.s ! num.n ! IsCmpd ++ num.s ; -- only matters for PossPron isNum = num.isNum; mod = quant.mod ; n = num.n From edf9aa40db782904bf1a7ba43a7786af63dc9e2b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 13 Mar 2019 15:47:29 +0100 Subject: [PATCH 2/4] (Pes) Add Gerund{NP,CN,Adv} to Extend --- src/persian/ExtendPes.gf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/persian/ExtendPes.gf b/src/persian/ExtendPes.gf index 5b4441d76..77b8c986f 100644 --- a/src/persian/ExtendPes.gf +++ b/src/persian/ExtendPes.gf @@ -3,6 +3,7 @@ concrete ExtendPes of Extend = CatPes ** ExtendFunctor - [ GenNP, ApposNP, ICompAP + ,GerundNP,GerundCN,GerundAdv ] with (Grammar=GrammarPes) ** open Prelude, ResPes in { @@ -20,4 +21,13 @@ lin } ; ICompAP ap = {s = "چقدر" ++ ap.s ! Bare} ; + -- : VP -> CN ; -- publishing of the document (can get a determiner) + GerundCN vp = useN (indeclN (showVPH Inf defaultAgr vp)) ; + + -- : VP -> NP ; -- publishing the document (by nature definite) + GerundNP vp = indeclNP (showVPH Inf defaultAgr vp) ; + + -- : VP -> Adv ; -- publishing the document (prepositionless adverb) + GerundAdv vp = lin Adv {s = showVPH Inf defaultAgr vp} ; + } From 0c91baf08d61d4118f8c3bc8c369e04e07d484c8 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 13 Mar 2019 15:47:49 +0100 Subject: [PATCH 3/4] (Pes) Remove redundant exclusion of lincat of Adv --- src/persian/CatPes.gf | 5 +---- src/persian/GrammarPes.gf | 16 +++++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/persian/CatPes.gf b/src/persian/CatPes.gf index 0cfd20e4f..fe5d2cab9 100644 --- a/src/persian/CatPes.gf +++ b/src/persian/CatPes.gf @@ -1,4 +1,4 @@ -concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { +concrete CatPes of Cat = CommonX ** open ResPes, Prelude in { flags optimize=all_subs ; @@ -44,9 +44,6 @@ concrete CatPes of Cat = CommonX - [Adv] ** open ResPes, Prelude in { VPSlash = ResPes.VPHSlash ; Comp = {s : Agr => Str} ; ----- Adv - Adv = {s : Str} ; - ---- Adjective AP = ResPes.Adjective ; diff --git a/src/persian/GrammarPes.gf b/src/persian/GrammarPes.gf index 0749eb17f..42603e115 100644 --- a/src/persian/GrammarPes.gf +++ b/src/persian/GrammarPes.gf @@ -1,8 +1,8 @@ --# -path=.:../abstract:../common:../prelude - concrete GrammarPes of Grammar = - NounPes, - VerbPes, + concrete GrammarPes of Grammar = + NounPes, + VerbPes, AdjectivePes, AdverbPes, NumeralPes, @@ -10,16 +10,14 @@ QuestionPes, RelativePes, ConjunctionPes, - + PhrasePes, - TextPes - [Adv], + TextPes, StructuralPes, - TenseX - [Adv], - IdiomPes + TenseX, + IdiomPes ** { flags startcat = Phr ; unlexer = text ; lexer = text ; } - - From 9b9ef182429776faf1e18cda271187593ba9197f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 13 Mar 2019 15:48:11 +0100 Subject: [PATCH 4/4] (Pes) Add a constructor for N that doesn't pattern match --- src/persian/MorphoPes.gf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index c42aafe42..ab02b8719 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -97,7 +97,7 @@ oper isCmpd : CmpdStatus -- Affects possession: awkward to use poss. suff. with compound nouns } ; - mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> { + mkN : (x1,x2 : Str) -> Animacy -> Noun = \sg,pl,ani -> indeclN sg ** { s = table { Sg => table {Bare => sg ; Ezafe => mkEzafe sg ; @@ -106,10 +106,13 @@ oper Pl => table {Bare => pl ; Ezafe => mkEzafe pl ; Clitic => mkEnclic pl ; - Poss => mkPossStem pl } - } ; - animacy = ani ; isCmpd = NotCmpd - } ; + Poss => mkPossStem pl }} + } ; + + indeclN : Str -> Noun = \s -> { + s = \\_,_ => s ; + animacy = Inanimate ; isCmpd = NotCmpd + } ; -- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e) -- Arabic nouns ends with h. also taken as Masc