From 0eb77f5291061af4cb0b17d3798e97ef19734572 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 20 Oct 2021 18:56:21 +0800 Subject: [PATCH] (Eng) Use "whose" in FunRP instead of "of which" --- src/english/CatEng.gf | 7 ++++++- src/english/ParadigmsEng.gf | 15 +++++++++++++-- src/english/RelativeEng.gf | 10 +++++++++- src/english/StructuralEng.gf | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/english/CatEng.gf b/src/english/CatEng.gf index cf50524db..09e96fc62 100644 --- a/src/english/CatEng.gf +++ b/src/english/CatEng.gf @@ -86,7 +86,12 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in { Conj = {s1,s2 : Str ; n : Number} ; Subj = {s : Str} ; - Prep = {s : Str; isPre : Bool} ; + Prep = { + s : Str ; -- "with", "ago" + isPre : Bool ; -- whether it's pre- or postposition: "with"=True, "ago"=False + isPoss : Bool ; -- whether it becomes "whose" in FunRP: "John, whose mother is wise" + empty : Str ; -- dummy empty string to avoid issues with parsing, if s field is replaced by "whose" in FunRP + } ; CAdv = {s : Polarity => Str; p : Str} ; -- Open lexical classes, e.g. Lexicon diff --git a/src/english/ParadigmsEng.gf b/src/english/ParadigmsEng.gf index e02c68971..121a77588 100644 --- a/src/english/ParadigmsEng.gf +++ b/src/english/ParadigmsEng.gf @@ -534,10 +534,21 @@ mkVoc s = lin Voc (ss s) ; mkCAdv sp sn p = lin CAdv {s = table Polarity [sp;sn]; p = p} ; - mkPrep p = lin Prep {s=p; isPre=True} ; - mkPost p = lin Prep {s=p; isPre=False} ; + mkPrep p = lin Prep { + s = p ; -- the string: "with", "in front of" + isPre = True ; -- default case: it is a preposition, not postposition + isPoss = False ; -- default case: not possessive (i.e. no change in FunRP) + empty = [] -- dummy field to prevent an issue with parsing. only relevant when isPoss=True, and FunRP overrides the s field with "whose". for explanation of the issue, see https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#metavariables-or-those-question-marks-that-appear-when-parsing + } ; + mkPost p = mkPrep p ** { + isPre = False -- postposition: e.g. "ago" + } ; noPrep = mkPrep [] ; + possPrep : Str -> Prep = \p -> mkPrep p ** { + isPoss = True -- for possessive, FunRP overrides the Prep's string with "whose": + } ; -- e.g. "whose mother" instead of "mother of which" + mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ; regV cry = diff --git a/src/english/RelativeEng.gf b/src/english/RelativeEng.gf index 5a0888e44..3a37a57ba 100644 --- a/src/english/RelativeEng.gf +++ b/src/english/RelativeEng.gf @@ -32,8 +32,16 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in { c = NPAcc } ; + -- John , whose every friend is right FunRP p np rp = { - s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; + s = \\c => + let npGender : Gender = (fromAgr np.a).g in + case p.isPoss of { + True => rp.s ! RC npGender NPNomPoss ++ -- whose + p.empty ++ -- empty string to avoid metavariables + np.s ! NCase Nom ; -- NP in nom: "whose every friend" + False => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep npGender + } ; a = RAg np.a } ; diff --git a/src/english/StructuralEng.gf b/src/english/StructuralEng.gf index c77a90cfc..d21413b39 100644 --- a/src/english/StructuralEng.gf +++ b/src/english/StructuralEng.gf @@ -99,7 +99,7 @@ concrete StructuralEng of Structural = CatEng ** otherwise_PConj = ss "otherwise" ; part_Prep = mkPrep "of" ; please_Voc = ss "please" ; - possess_Prep = mkPrep "of" ; + possess_Prep = possPrep "of" ; quite_Adv = mkAdv "quite" ; she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ; so_AdA = mkAdA "so" ;