Prepositions are things one should not end a sentence with

Winston Churchill once supposedly said that the rule against ending a sentence with a preposition was “the sort of pedantry up with which I shall not put”, but in most of the other languages of the world it is bad grammar to end a sentence with a preposition. That includes questions.

I’m working on an Esperanto extension for Inform, and I would really like to find a way to change output that is structured like this…

…to the equivalent of this…

This message is number 49 in the Miscellany section of “Long Texts” in Language.i6t, but my I6 kung-fu is not strong enough to figure out how to reword the output message appropriately. The basic problem seems to be that Inform handles prepositions as if they are inseparable parts of the verb.

Here is the code in question:

48: print "Whom do you want"; if (actor ~= player) print " ", (the) actor; print " to "; PrintCommand(); print "?^"; 49: print "What do you want"; if (actor ~= player) print " ", (the) actor; print " to "; PrintCommand(); print "?^";

Looks like you need the library code to check and find out exactly what the command is – get in, sit on, stand on, etc. Once you know that, customizing the code for #49 becomes trivial.

If you’re writing a translation of Inform (I7, I presume), I fear it is less than trivial, since you’d like the solution to be general and apply to future authors’ newly defined command verbs (with prepositions) as well as to the standard ones.

But isn’t word order in Esperanto flexible enough to let you put the whole noun phrase last in the sentence?

print "Vi volas "; PrintCommand(); print " kion?^";

(I don’t really know Esperanto …)

One more thing: presumably, you want the command verb repeated in the infinitive (that is probably true for all the messages where PrintCommand() is used); but PrintCommand gives you the player’s command (from the verb on) as the player actually entered it, and I suppose the verb will then be in the volitive/imperative rather than the infinitive. Translators are supposed to use the I6 LanguageVerb() routine (in the Language Template) to change that. (In English the imperative and the infinitive read identically of course—it’s quite a simplistic language in some respects—, but even in English LanguageVerb() is used to expand the abbreviated verbs “i”, “x”, “z” etc., before PrintCommand() returns them.)

Although it is preferable to move the noun phrase to the front of the question, that way might actually work better (minus the unnecessary “volas”). At least it would be grammatically acceptable, unlike Kion vi sidu sur?

The imperative mode in Esperanto works fine 99% of the time for printing the verb in the context of interactive fiction. The imperative is understood as expressing the speaker’s desire that the verb should be done, and is the same for first/second/third person in any number.

49: print "Kion vi "; if (actor ~= player) print "volas, ke tiu "; PrintCommand(); print "?^";

For single-word verbs, that works perfectly. It will produce output like…

Kion vi malfermu literally means, “What should you open?” And the other one means, “What do you want, that that (person) should open?” which is kind of awkward translated word-for-word in English, but is clear in Esperanto.

Think this is more or less solved. Thanks, Felix! Here’s the code that I ended up using, in case anyone cares…

if (actor ~= player) print "Tiu "; else print "Vi "; PrintCommand(); print " kion?^";

Great!
(Will the presence of a preposition affect the case of the pronoun? I mean, is it “Vi foobaru kion?” but “Vi foobaru je kio?”?)

We use the accusative together with a preposition when indicating direction with some prepositions that don’t normally indicate direction, e.g. Vi metu la libron en la keston (“You should put the book into the box”) or Vi metu la libron sur la tablon (“You should put the book onto the table”), and nominative otherwise: Vi vidas libron en la kesto (“You see a book in the box”). In other words, en+accusative means “into” and en+nominative means “in”.

So, the accusative will work right probably at least 90% of the time with that library message, even with prepositions, given the most common commands in a typical IF. But it will be wrong sometimes, e.g. if a game has defined a custom verb skribu sur [something] (“should write on [something]”), the message Vi skribu sur kion? would be wrong. But I don’t really think it would be possible to write general code that will be able to tell the difference between what should be nominative and what should be accusative since either can be used with most prepositions.