1
0
forked from GitHub/gf-rgl

(Eng) Use "whose" in FunRP instead of "of which"

This commit is contained in:
Inari Listenmaa
2021-10-20 18:56:21 +08:00
parent 32ac7b5fe3
commit 0eb77f5291
4 changed files with 29 additions and 5 deletions

View File

@@ -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

View File

@@ -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 =

View File

@@ -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
} ;

View File

@@ -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" ;