From ec4dac68d05e78a64412f895bc2b5859a2a6670b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 23 May 2019 14:07:34 +0200 Subject: [PATCH] (Pes) WIP: more fine-grained rules about definiteness in NPs --- src/persian/MorphoPes.gf | 9 +++++---- src/persian/NounPes.gf | 2 ++ src/persian/ResPes.gf | 9 ++++++--- src/persian/VerbPes.gf | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/persian/MorphoPes.gf b/src/persian/MorphoPes.gf index 714a825f..538fe56c 100644 --- a/src/persian/MorphoPes.gf +++ b/src/persian/MorphoPes.gf @@ -135,7 +135,8 @@ oper -------------------- BaseQuant : Type = { mod : Mod ; - isNeg : Bool + isNeg : Bool ; + isDef : Bool } ; Determiner : Type = BaseQuant ** { @@ -146,13 +147,13 @@ oper } ; Quant : Type = BaseQuant ** { - s : Number => CmpdStatus => Str ; - isDef : Bool } ; + s : Number => CmpdStatus => Str} ; makeDet : Str -> Number -> (isNum, isNeg : Bool) -> Determiner = \str,n,isNum,isNeg -> { s,sp = str; - isNum = isNum; + isNum = isNum ; isNeg = isNeg ; + isDef = True ; mod = Bare ; n = n }; diff --git a/src/persian/NounPes.gf b/src/persian/NounPes.gf index 195bf69d..c76776b8 100644 --- a/src/persian/NounPes.gf +++ b/src/persian/NounPes.gf @@ -19,6 +19,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { Clitic => detStr ++ cn.s ! num ! Clitic ++ cn.compl ! det.n ; -- In RGL this is only for no_Quant. If other determiners with different word order take Clitic, will change. /IL x => cn.s ! num ! x ++ detStr ++ cn.compl ! det.n } ; -- Ezafe or Poss: comes after noun, Mod table is overwritten to the given form a = agrP3 det.n ; + takesYeAsComp = False ; -- TODO: some rule with det.isDef and cn.hasAdj isNeg = det.isNeg ; -- affects polarity in Cl: "*nothing is real" -> "nothing isn't real" } ; @@ -111,6 +112,7 @@ concrete NounPes of Noun = CatPes ** open ResPes, Prelude in { MassNP cn = emptyNP ** cn ** { s = \\m => cn.s ! Sg ! m ++ cn.compl ! Sg ; a = agrP3 Sg ; + takesYeAsComp = cn.hasAdj ; } ; UseN, diff --git a/src/persian/ResPes.gf b/src/persian/ResPes.gf index e0453bdd..1c5b780e 100644 --- a/src/persian/ResPes.gf +++ b/src/persian/ResPes.gf @@ -31,7 +31,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { BaseNP : Type = { a : Agr ; isNeg : Bool ; -- negative determiner forces negation in Cl and S - hasAdj : Bool ; -- to get the right form when NP is a predicate + takesYeAsComp : Bool ; -- to get the right form when NP is a predicate animacy : Animacy ; -- to get the right pronoun in FunRP isClitic : Bool ; -- if isPron, becomes clitic as a direct object clitic : Str ; @@ -44,7 +44,7 @@ resource ResPes = MorphoPes ** open Prelude,Predef in { s = \\_ => [] ; a = defaultAgr ; isNeg = False ; - hasAdj = False ; + takesYeAsComp = False ; animacy = Inanimate ; isClitic = False ; clitic = [] ; @@ -207,7 +207,10 @@ oper case of { => [] ; -- clitic is attached to the verb or prefix => appCompVP vp.c2 (\\_ => BIND ++ np.clitic) ! wo ++ vp.comp ! a ! wo ; - _ => appCompVP vp.c2 np.s ! wo ++ vp.comp ! a ! wo + _ => let nps : Mod=>Str = np.s ; + -- case np.takesYeAsComp of { True => replaceBare Clitic np.s ; -- TODO: later make a better rule, related to definiteness, when NP takes a clitic. + -- _ => np.s } ; + in appCompVP vp.c2 nps ! wo ++ vp.comp ! a ! wo } ; s = case of { diff --git a/src/persian/VerbPes.gf b/src/persian/VerbPes.gf index 42fb770e..1dda7b8b 100644 --- a/src/persian/VerbPes.gf +++ b/src/persian/VerbPes.gf @@ -73,7 +73,7 @@ concrete VerbPes of Verb = CatPes ** open ResPes,Prelude in { } ; CompNP np = { - s = \\a => np.s ! case np.hasAdj of { + s = \\a => np.s ! case np.takesYeAsComp of { False => Bare ; True => Clitic } } ;