"Play Toy Story which was published last year"
Sentence = mkUtt( mkImp (mkVP
(mkV2 "play")
(mkNP (mkCN
(mkCN (mkN "Toy Story"))
(mkS pastTense simultaneousAnt(mkCl (mkVP
(mkV2 "publish")
(mkNP (mkCN (mkN "last yser")))
)))
))
));
When creating a relative clause sentence in GF it always the syntax S for sentence will add that between the two of the sentences is there is any way to replace that with which.
First of all, the structure you made isn't a relative clause, but this structure:
Relative clause has the type
RS
in the RGL.How to construct an actual RS
Here I build the RS gradually. Feel free to put these steps back to a single expression, if you wish so, but I find it clearer to to things like this.
Now when we test it on the GF shell, we see that despite the name,
which_RP
is actually "that".How to change "that" into "which"
The first thing to check when you want to create a new lexical item is Paradigms module. Unfortunately, there is no
mkRP
for English. Things like relative pronouns are usually thought of as closed class: there's only a small, fixed amount of them. Other examples of closed classes are basic numerals (you can't just make up a new integer between 4 and 5!) and determiners. Contrast this to open classes like nouns, verbs and adjectives, those pop up all the time. For open classes, Paradigms modules have many options. But not for closed classes, like relative pronouns.So if Paradigms doesn't help, the next thing to check is the language-specific Extra module.
Check language-specific Extra modules
If you have the RGL source on your own computer, you can just go to the directory
gf-rgl/src/english
and grep forwhich
. Or you can use the RGL browser to search for interesting functions.And there is indeed a relative pronoun in ExtraEng, also called
which_RP
. (There is also one calledwho_which_RP
.) So now you can do these modifications in your grammar:And the rest of the code is like before. This produces the result you want.
Last-resort hack
So you have looked in all possible modules and found nothing. Consider making it into an issue in the gf-rgl repository, if it's something that's clearly wrong or missing.
But in any case, here's a general, unsafe hack to quickly construct what you want.
First, let's look at the lincat of
RP
in CatEng,{s : RCase => Str ; a : RAgr}
. Then let's look at its implementation in RelativeEng. There you see also the explanation why it's always "that": unlike who and which, "that" works for animate and inanimate NPs.So I would do this to force the string "which":
The
**
syntax means record extension. We use all other fields from the originalwhich_RP
, but in thes
field, we put a table whose all branches contain the string "which". (You can read more about this technique in my blog.)Then we use the newly defined
myWhich_RP
in forming the relative clause:This works too, but it's unsafe, because whenever the RGL changes, any code that touches the raw implementation may break.