Oh, man. Adventuron’s multi-word input is driving me crazy. I couldn’t understand why my on_command routines weren’t working, so I added the following debugging code at the top of the on_command block:
: match "_ _" {
: mask {
: print {("^n^verb = " + original "verb")}
: print {("^n^preposition = " + original "preposition")}
: print {("^n^noun1 = " + original "noun1")}
: print {("^n^noun2 = " + original "noun2")}
: print {("^n^adverb = " + original "adverb" + "^m^")}
}
}
This revealed some very interesting results:
> READ
verb = read
preposition =
noun1 =
noun2 =
adverb =
That’s to be expected.
> READ ABOUT
verb = read
preposition = about
noun1 = about
noun2 =
adverb =
That certainly wasn’t expected. Not only is ‘about’ treated as a preposition, it’s treated as noun1 as well!
> READ ABOUT BILL
verb = read
preposition = about
noun1 =
noun2 =
adverb =
This time, the noun was thrown away! No wonder my routines wouldn’t work as expected.
> READ ABOUT BILL IN
verb = read
preposition = about
noun1 =
noun2 =
adverb =
This time, both the noun and the second preposition were thrown away!
> READ ABOUT BILL IN BOOK
verb = read
preposition = about
noun1 = book
noun2 =
adverb =
This time, both the first noun and the second preposition were thrown away and the second noun was moved into the first noun’s slot. What the?
After further experimenting, it appears that if a word is unknown, it is just ignored and continues on to the next word. This gives some really strange and unpredictable results. I found that if I put the unknown word in the vocabulary table, then all is well and good. So, in the case of my topics, if I put them in the vocabulary table, then they are magically in scope and I don’t need to create objects for them. However, I still have problems with the ambiguity of preposition 1 and preposition 2. I thought I might be able to use adverb in place of one of them, but it appears that adverb is never used.
Mind you, none of this is consistent. Sometimes, an unknown word is accepted, but most of the time it is ignored. For example, I have a jack-in-the-box with an object id of jack_box (just to distinguish it from another box) and a description of ‘a jack-in-the-box’. When I refer to it is as ‘box’ or ‘jack-in-the-box’, it works. I don’t understand why the latter works. Anything else fails.