This is an enhancement, not a defect. Nothing is broken that needs this. The
reason to write it down is that the reasoning took a while to arrive at and is
easy to lose.
The observation
In push button on hopper, the player does not mean "push the button onto the
hopper." They mean the button which is on the hopper — the prepositional
phrase postmodifies the noun, and identifies which button is meant. It is a
relative clause with the pronoun and copula dropped.
Archetype's convention makes every preposition part of the verb message
(verbmsg := verb & "..." & prep, intrptr.arch), which flattens two different
grammatical roles into one shape:
| utterance |
"on"/"at" is |
flattened to |
push button on hopper |
postmodifier on button |
push...on |
throw rock at guard |
argument of throw |
throw...at |
Only the second is really a verb-and-preposition. The first is a noun phrase
that happens to contain a preposition.
Why it cannot be expressed today
The natural author-side answer would be to declare the phrase as a name:
object button
desc : "big red button"
syn : "button on hopper|button"
That does not work, and cannot. 'ASSEMBLE VOCABULARY' registers every lex —
all the prepositions — in verb mode (intrptr.arch:356-357), and
SystemParser::parse runs matchVerbs_ before matchNouns_. By the time noun
matching runs, the word list is:
[ Verb(push), "button", lex(on), "hopper" ]
The declared three-word phrase is compared against a list in which on is no
longer the string "on" but an object reference, so it can never match. The
name is unreachable however it is declared. Verified empirically.
What a fix would look like
Give the noun matcher a shot at the raw words before verb matching claims the
prepositions: a pre-pass over nounMatches_ restricted to declared phrases of
two or more words, run ahead of matchVerbs_, leaving single-word nouns where
they are. nounMatches_ is already sorted longest-phrase-first, so the ordering
machinery exists.
The risk is a declared noun phrase swallowing a word a verb needed. bare.arch
declares syn : 'push down|push on' as verb phrases, so the cases that would
want tests are the verb phrases that contain prepositions: jump over,
put...in, push on.
The payoff is that an author could deliberately say "button on hopper" and be
understood, rather than relying on recovery after the fact.
Relationship to the fallback already in place
PR for push button on hopper adds a rung to the dispatch ladder: when the game
declares no Verb for the verb-and-preposition pair, the subject is asked about
the bare verb before any generic default. That is a recovery heuristic and it is
deliberately not this. It makes push...on fall back to push, which is
defensible on its own terms — if the game has no notion of the pair, the
preposition was probably never the verb's business. But it does not teach the
parser anything, and it cannot distinguish the two rows of the table above.
The two are complements, not alternatives. The ladder is a reasonable floor even
if this never gets built.
This is an enhancement, not a defect. Nothing is broken that needs this. The
reason to write it down is that the reasoning took a while to arrive at and is
easy to lose.
The observation
In
push button on hopper, the player does not mean "push the button onto thehopper." They mean the button which is on the hopper — the prepositional
phrase postmodifies the noun, and identifies which button is meant. It is a
relative clause with the pronoun and copula dropped.
Archetype's convention makes every preposition part of the verb message
(
verbmsg := verb & "..." & prep,intrptr.arch), which flattens two differentgrammatical roles into one shape:
push button on hopperpush...onthrow rock at guardthrow...atOnly the second is really a verb-and-preposition. The first is a noun phrase
that happens to contain a preposition.
Why it cannot be expressed today
The natural author-side answer would be to declare the phrase as a name:
That does not work, and cannot.
'ASSEMBLE VOCABULARY'registers everylex—all the prepositions — in verb mode (
intrptr.arch:356-357), andSystemParser::parserunsmatchVerbs_beforematchNouns_. By the time nounmatching runs, the word list is:
The declared three-word phrase is compared against a list in which
onis nolonger the string
"on"but an object reference, so it can never match. Thename is unreachable however it is declared. Verified empirically.
What a fix would look like
Give the noun matcher a shot at the raw words before verb matching claims the
prepositions: a pre-pass over
nounMatches_restricted to declared phrases oftwo or more words, run ahead of
matchVerbs_, leaving single-word nouns wherethey are.
nounMatches_is already sorted longest-phrase-first, so the orderingmachinery exists.
The risk is a declared noun phrase swallowing a word a verb needed.
bare.archdeclares
syn : 'push down|push on'as verb phrases, so the cases that wouldwant tests are the verb phrases that contain prepositions:
jump over,put...in,push on.The payoff is that an author could deliberately say "button on hopper" and be
understood, rather than relying on recovery after the fact.
Relationship to the fallback already in place
PR for
push button on hopperadds a rung to the dispatch ladder: when the gamedeclares no Verb for the verb-and-preposition pair, the subject is asked about
the bare verb before any generic default. That is a recovery heuristic and it is
deliberately not this. It makes
push...onfall back topush, which isdefensible on its own terms — if the game has no notion of the pair, the
preposition was probably never the verb's business. But it does not teach the
parser anything, and it cannot distinguish the two rows of the table above.
The two are complements, not alternatives. The ladder is a reasonable floor even
if this never gets built.