Thanks to everyone who has contributed information to this thread. It’s been really interesting.
I’ve been investigating the Inform parser and there is definitely a weakness here. Of course, as pointed out by several people, this can be remedied with various “fix ups”. But really this should not be necessary.
The two things that appear weak are:
adjective noun confusion
“some orange juice” and “an orange” is conflated by the word “orange”.
allowing noun phrase words in any order leads to confusion.
So, “the old fat man” is the same as “the fat old man”, which is fine but also the same is identified by “the old man fat” and “the man fat old”
Now you might say, what is wrong with “the fat man old” identifying “the old fat man” as it is a nonsense that serves no other purpose.
Yes indeed, but there are some cases when this reversal can mean something else.
“the killer whale” and “the whale killer”
These can be different objects which, without remedy, the Inform parser does not correctly distinguish.
Saying don’t do it like that in your story, just choose other words, is a bit like the joke about the man who goes to the doctor and complains his arm hurts when he moves it in such-and-such a manner. Whereupon the doctor replies, well just don’t do that then!
How to fix?
When you have a noun-phrase of the form,
you can allow the list of adjectives in any order, but you must discriminate on the noun which must be the end of the parse phrase.
so “orange” never matches “orange juice” by default, the word “juice” must be present and last.
“fresh orange juice” is matched by “juice”, “fresh juice”, “orange juice”, “fresh orange juice” and “orange fresh juice” but not by “fresh” or “orange” alone (or even together).
“killer whale” is never matched by “killer” or “whale killer” only “whale” or “killer whale”.
So insisting on the terminal noun is fix for all these problems.
Earlier, @Draconis suggested;
Infocom had a distinction between adjectives and nouns, and if you typed a word like “orange” alone, it would prefer an orange-noun over an orange-adjective. Inform dispensed with this and relegated these things to “does the player mean” rules.
That the old Infocom parser did this appears to be lost in the Inform parser.
Notwithstanding that these problems can be fixed up by a number of somewhat ugly bodges, I feel the Inform parser way is a better one.
And instead of the non-terminal adjectives alone being an accepted match for an object, those are the cases that should be relegated to “understand” or “does the player mean” rules where deemed important.
Your views most welcome.