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.
Overview:
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.
Consider:
â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, <list-of-adjectives> <noun>
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.