(Eng) Undo the change in FunRP from #381

This commit is contained in:
Inari Listenmaa
2022-01-19 14:51:49 +08:00
parent eb7b74578f
commit 5a5adef0db
4 changed files with 6 additions and 21 deletions

View File

@@ -89,8 +89,6 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
Prep = { Prep = {
s : Str ; -- "with", "ago" s : Str ; -- "with", "ago"
isPre : Bool ; -- whether it's pre- or postposition: "with"=True, "ago"=False 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} ; CAdv = {s : Polarity => Str; p : Str} ;

View File

@@ -537,18 +537,12 @@ mkVoc s = lin Voc (ss s) ;
mkPrep p = lin Prep { mkPrep p = lin Prep {
s = p ; -- the string: "with", "in front of" s = p ; -- the string: "with", "in front of"
isPre = True ; -- default case: it is a preposition, not postposition 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 ** { mkPost p = mkPrep p ** {
isPre = False -- postposition: e.g. "ago" isPre = False -- postposition: e.g. "ago"
} ; } ;
noPrep = mkPrep [] ; 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 = []}) ; mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
regV cry = regV cry =
@@ -622,7 +616,7 @@ mkVoc s = lin Voc (ss s) ;
auxVV, infVV = \v -> lin VV { auxVV, infVV = \v -> lin VV {
s = table { s = table {
VVF vf => v.s ! vf ; VVF vf => v.s ! vf ;
VVPresNeg => v.s ! VPres ++ "not" VVPresNeg => v.s ! VPres ++ "not"
; VVPastNeg => v.s ! VPast ++ "not" --# notpresent ; VVPastNeg => v.s ! VPast ++ "not" --# notpresent
} ; } ;
p = v.p ; p = v.p ;
@@ -701,7 +695,7 @@ mkVoc s = lin Voc (ss s) ;
mkA : (fat,fatter : Str) -> A = \fat,fatter -> mkA : (fat,fatter : Str) -> A = \fat,fatter ->
lin A (mkAdjective fat fatter (init fatter + "st") (adj2adv fat)) ; lin A (mkAdjective fat fatter (init fatter + "st") (adj2adv fat)) ;
mkA : (good,better,best,well : Str) -> A = \a,b,c,d -> mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
lin A (mkAdjective a b c d) lin A (mkAdjective a b c d)
} ; } ;
invarA s = lin A { invarA s = lin A {

View File

@@ -32,16 +32,10 @@ concrete RelativeEng of Relative = CatEng ** open ResEng, Prelude in {
c = NPAcc c = NPAcc
} ; } ;
-- John , whose every friend is right -- a number, [the square of which] is 4
-- For a construction like "John , [whose every friend] is right", use Extend.GenRP
FunRP p np rp = { FunRP p np rp = {
s = \\c => s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ;
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 a = RAg np.a
} ; } ;

View File

@@ -99,7 +99,7 @@ concrete StructuralEng of Structural = CatEng **
otherwise_PConj = ss "otherwise" ; otherwise_PConj = ss "otherwise" ;
part_Prep = mkPrep "of" ; part_Prep = mkPrep "of" ;
please_Voc = ss "please" ; please_Voc = ss "please" ;
possess_Prep = possPrep "of" ; possess_Prep = mkPrep "of" ;
quite_Adv = mkAdv "quite" ; quite_Adv = mkAdv "quite" ;
she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ; she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ;
so_AdA = mkAdA "so" ; so_AdA = mkAdA "so" ;
@@ -159,4 +159,3 @@ concrete StructuralEng of Structural = CatEng **
lin language_title_Utt = ss "English" ; lin language_title_Utt = ss "English" ;
} }