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 ;