Next level parser

92 views
Skip to first unread message

David Fisher

unread,
May 3, 2005, 6:15:51 AM5/3/05
to
Does anyone know of any research being done to do with IF & natural language
processing ?

Something I am interested in is the "next level" of grammatical structures
beyond [ACTOR, ] VERB [ { ADJ } NOUN [ PREP { ADJ } NOUN ] ] ... this being
higher level than the original VERB [ NOUN ] sentences.

This next level would need to be constrained (eg. it is not just "the
English language"), but it must be in an intuitive way so that players will
easily get a feel for what is acceptable to the parser. Here are some
thoughts (if some of these seem less than useful, think of using them in a
conversation with an NPC):

* Relative pronouns (who, which, that) and prepositional phrases ("the dwarf
with the axe", as discussed in the recent thread "Futzing with continuous
substances")
* Past and future tenses ("ate" and "will eat"), as well as the continuous
present tense ("eating")
* Questions (who, what, where, when, why, how + can/could/would/should)
* (Dare I say it ?) - adverbs ! (which does not necessarily imply "guess the
adverb" puzzles)
* Conditionals & subordinate clauses (if ... then, when ..., because ...)
* Multiple "it"s (not restricting "it" to a single object, but resolving by
context / logic)
* Idioms like "there are" / "it is"

If players could use all of the above, what else should they be allowed to
say ?

(By the way, I am thinking about all of the above being understandable by
the parser - but not replacing what already exists. It would still accept
simple commands like "x table" and "look").

How does this sound to everybody ? (Apart from ambitious :-P)

David Fisher


Boluc Papuccuoglu

unread,
May 3, 2005, 6:43:17 AM5/3/05
to
On Tue, 3 May 2005 20:15:51 +1000, "David Fisher" <da...@hsa.com.au>
wrote:

I strongly suggest that you look into the Magnetic scrolls parser for
the features you mentioned. I remember first hand that it understood
prepositional phrases and relative pronouns, as well as adverbs (in
Guild of Thieves you can "carefully go north" to prevent the PC from
tripping and breaking the lute when exiting the mill - or, you can but
it in a sack. Ironically, the second solution awarded points while the
first one did not) Questions were understood even by the Zork I parser
(try typing "what is a grue") But I havent seen any parser that
understood past/future tense. As for condiitionals, the Magnetic
Scrolls parser could understand a phrase like "take all the keys on
the table but not the blue one", but not "take all the keys on the
table if they are red".

Dan Shiovitz

unread,
May 3, 2005, 4:56:51 PM5/3/05
to
In article <GgIde.9745$Le2....@nasal.pacific.net.au>,

David Fisher <da...@hsa.com.au> wrote:
>Does anyone know of any research being done to do with IF & natural language
>processing ?
>
>Something I am interested in is the "next level" of grammatical structures
>beyond [ACTOR, ] VERB [ { ADJ } NOUN [ PREP { ADJ } NOUN ] ] ... this being
>higher level than the original VERB [ NOUN ] sentences.

I would suggest you check out
http://groups-beta.google.com/group/rec.arts.int-fiction/browse_frm/thread/e540fb8b118a5be5
or one of the other adverb threads if you're wondering about past
discussion of more complicated grammatical structures.

Not all the stuff you mention is exactly a grammatical-structure
thing, but I think >ASK NPC ABOUT FISH vs >NPC, WHO IS THE FISH still
falls under the two-axis theory. The improved it-handling might be
nice but there's no real way to tell if it's worth it unless it shows
up in a game. I dunno, which is the real answer you're going to get
about most of these; we can give you as many opinions as you want to
listen to but nobody is going to know for sure until somebody writes a
game with the feature and we see if it works in practice or not.

>David Fisher
--
Dan Shiovitz :: d...@cs.wisc.edu :: http://www.drizzle.com/~dans
"He settled down to dictate a letter to the Consolidated Nailfile and
Eyebrow Tweezer Corporation of Scranton, Pa., which would make them
realize that life is stern and earnest and Nailfile and Eyebrow Tweezer
Corporations are not put in this world for pleasure alone." -PGW

David Fisher

unread,
May 3, 2005, 11:27:52 PM5/3/05
to
"Dan Shiovitz" <d...@cs.wisc.edu> wrote in message
news:d58oij$g9u$1...@drizzle.com...

> David Fisher <da...@hsa.com.au> wrote:
>
>>Does anyone know of any research being done to do with IF & natural
>>language
>>processing ?
>
> I would suggest you check out
>
> http://groups-beta.google.com/group/rec.arts.int-fiction/browse_frm/thread/e540fb8b118a5be5
> or one of the other adverb threads if you're wondering about past
> discussion of more complicated grammatical structures.

Yes, I had discovered that one.

> The improved it-handling might be nice but there's no real way
> to tell if it's worth it unless it shows up in a game. I dunno,
> which is the real answer you're going to get about most of these;
> we can give you as many opinions as you want to listen to but
> nobody is going to know for sure until somebody writes a game
> with the feature and we see if it works in practice or not.

I agree ... but what I am mainly asking is something like this: If players
are able to enter such-and-such (as in the first post), what else would they
intuitively expect ? I am trying to limit the number of possible sentences
accepted by the parser, without seeming unreasonable to the players.

David Fisher

~~ More IF stuff than you can poke a stick at -
http://www.ifwiki.org/index.php/Past_raif_topics ~~


Kevin Forchione

unread,
May 3, 2005, 11:44:33 PM5/3/05
to
"David Fisher" <da...@hsa.com.au> wrote in message
news:9oXde.9814$Le2....@nasal.pacific.net.au...

> I agree ... but what I am mainly asking is something like this: If players
> are able to enter such-and-such (as in the first post), what else would
> they intuitively expect ? I am trying to limit the number of possible
> sentences accepted by the parser, without seeming unreasonable to the
> players.

Some of that would be dependent on the kind of story you're telling and the
nature of the puzzles you create.

--Kevin


Daryl McCullough

unread,
May 5, 2005, 4:07:18 PM5/5/05
to
David Fisher says...

>Does anyone know of any research being done to do with IF & natural language
>processing?

I'm all in favor of improving the ability of the parser, but I
have one caution to make: Increasing the sophistication of the
parser without a corresponding increase in the sophistication
of the world model might be misleading to the player.

Here is one example: adverbs. It isn't that hard to get
the parser to be able to accept inputs like

Go slowly north

or

Carefully pick up snake

However, unless the game is *incredibly* detailed, the adverb isn't
usually going to make any difference in the gameplay.

--
Daryl McCullough
Ithaca, NY

David Fisher

unread,
May 5, 2005, 11:25:40 PM5/5/05
to
"Daryl McCullough" <stevend...@yahoo.com> wrote in message
news:d5dud...@drn.newsguy.com...

Definitely ... in general, I would think that adverbs would just add
"flavour" to the game - possibly changing the description text (which
players enjoy), but not actually making a difference to the game. They
should never be required for solving puzzles - unless you want to get
lynched by a mob of angry players some dark night ...

I also agree that the world model needs to keep in step with the parser for
this kind of thing to work properly. One potential difficulty I have is
keeping things general enough for other people to use - it is hard to avoid
"tying down" the world model when you start adding implicit actions,
detailed object interactions, etc. If you create a realistic world and
someone wants to write a cartoon-based game, they might have to undo or
disable a lot of the rules you have so carefully crafted. (What are the
rules of Bugs Bunny physics, anyway ?)

David Fisher


steve....@gmail.com

unread,
May 7, 2005, 12:09:19 AM5/7/05
to
David Fisher wrote:
> Does anyone know of any research being done to do with IF & natural
language
> processing ?

My research has found the following: The purpose of natural-language
processor differs from the purpose of the IF command interface: a
natural language processor is required when the language was initially
for human consumption; the language has come first, and the machine
comes later to manage, organize, or otherwise make some sense of it. In
the case of the IF command interface, the machine itself is the
addressee. Until we have NLP-complete machines, some codification of
commands is both obviously practical and necessary.

> * Relative pronouns (who, which, that) and prepositional phrases
("the dwarf
> with the axe", as discussed in the recent thread "Futzing with
continuous
> substances")

I was suprised nobody mentioned on that thread that Tads-3 already has
this capability. Then again, it hasn't yet been fully explored.

> * Past and future tenses ("ate" and "will eat"), as well as the
continuous
> present tense ("eating")

Forchione's Tads-3 continuous-action is interesting here. There are
past-tense extensions for both Tads-3 (by Nizette) and Inform.

> * Questions (who, what, where, when, why, how +
can/could/would/should)

Yes.

> * (Dare I say it ?) - adverbs ! (which does not necessarily imply
"guess the
> adverb" puzzles)

It does not imply this? Could you explain?

> * Conditionals & subordinate clauses (if ... then, when ..., because
...)

I find it difficult to imagine the utility of this, from a player's
perspective. Perhaps some examples?

> * Multiple "it"s (not restricting "it" to a single object, but
resolving by
> context / logic)

Yes.

> * Idioms like "there are" / "it is"

Again I'm not sure what you imagine. Perhaps examples?

> If players could use all of the above, what else should they be
allowed to
> say ?

Strong ideas so far, but be careful not to put parser-sophistication
ahead of purpose. The player doesn't care what the parser is capable
of: the player only cares to have a mechanism to interact with the
underlying simulation. So, the clearer the mechanism, the better.
"Guess the sophistication of the parser" is probably one worse than
"guess the adverb."

> How does this sound to everybody ? (Apart from ambitious :-P)

Sounds like you should sink your teeth into Tads-3.

David Fisher

unread,
May 7, 2005, 3:21:31 AM5/7/05
to
<steve....@gmail.com> wrote in message
news:1115438959.1...@g14g2000cwa.googlegroups.com...

> David Fisher wrote:
>> Does anyone know of any research being done to do with IF &
>> natural language processing ?

[ reponding to Steve's comments in (roughly) reverse order ... ]

> Sounds like you should sink your teeth into Tads-3.

That's been "pending" while I have been learning TADS 2 and reading through
old posts ... sounds like a good idea, though.

> Strong ideas so far, but be careful not to put parser-sophistication
> ahead of purpose. The player doesn't care what the parser is capable
> of: the player only cares to have a mechanism to interact with the
> underlying simulation. So, the clearer the mechanism, the better.
> "Guess the sophistication of the parser" is probably one worse than
> "guess the adverb."

Once the players get used to the parser, they will know what kinds of thing
they can do ... what I really want to know is, if you start adding some of
these features, which of them form a "complete set" which will be
intuitively obvious to the player ? What we have so far is:

(1) One or two word parsers ("north", "get key"). No need to explain this to
the player - once they know that the limit is two words, they won't try "get
the brass key and put it on the table".

(2) Verbs (with prepositions allowed) + nouns (with adjectives allowed) +
ordering NPCs ("Fred, "). The set of available commands is pretty clear once
you know the basic format.

TADS2 and Inform seem to be up to this point now. Continuing into the future
/ TADS3:

(3) Prepositional phrases seem like the next logical thing ("hit the dwarf
with the red shoes" - meaning, "who has the red shoes", not "hit him with
the red shoes").

If you can use prepositional phrases, I *think* players wouldn't
automatically assume you can use relative pronouns - even though they might
mean the same thing. That is, even though you can say "with the red shoes",
they won't assume you can say "who has the red shoes".

(4) Comparitive adjectives ("get the smallest apple"; "x the yellowest
clay"). Andrew Plotkin had a go at this in the "Futzing with continuous
substances" thread. This seems like a pretty advanced feature to me; if a
player can do this, I think they would expect to be able to do a lot of
other things, too - possibly including:

(5) Questions to do with features of objects / the environment ("which clay
is the yellowest ?", "can I make it across the pit ?"). Presumably "examine"
would tell you whatever you really need to know, but I am just thinking of
what a (newish) player would expect to be able to enter in a game.

(6) Possessives ("take the goblin's sword" - which is then no longer "the
goblin's sword", but the PC's).

(7) Adverbs ("slowly lift the torch"; "lift the torch very slowly").

[Steve asked what I meant when I said, "This does not necessarily imply
'guess the adverb' puzzles" ... what I meant was, including the ability for
the parser to handle adverbs does not *necessarily* mean that game authors
will (mis)use them to make impossibly difficult puzzles. See the respose to
Daryl McCullough's post in this thread for more on this thought.]

More advanced stuff:

(8) Interrogatives (who/what/when/where/how) in direct and indirect speech
("Fred, where is the jewel ?"; "Ask Fred where jewel is")

(9) Past and future tense in conversations with NPCs + infinitives ("Where
did Harold put the banana ?"; "I will slay the dragon"; "I am going to eat
the apple"; "I want to buy a boat").

(10) Relative clauses & continuous present tense ("Hit the dwarf who is
eating an apple")

(11) Parser memory ("Hit the dwarf who gave me the axe"; "pick a different
one").

(12) Generalisations & "logical" sentences using and/or/no/not ("Do people
ever go there ?"; "Are there any elves or dwarves in this town ?", "I don't
have any food")

(13) Conditional sentences ("if anyone comes, call me"; "when I wave, cut
the rope").

(14) Reported speech ("He said that he was leaving"; "He told me he was
leaving")

(15) Idioms like "there is", "it is" ("say, 'There is an ogre at the gate'";
"it is on the table" (in answer to a question from an NPC)). There are lots
of other idioms like this one which would need custom parsing rules as well.

---------------------------

So ... my basic question is, what are the logical chunks to group the above
things into ? Are they all separate, or do some of them inevitably go
together ?

Thanks for past and future (and present !) thoughts about these things,

David Fisher


Damian Dollahite

unread,
May 7, 2005, 5:13:11 AM5/7/05
to
David Fisher wrote:
> (6) Possessives ("take the goblin's sword" - which is then no longer "the
> goblin's sword", but the PC's).
>

TADS 3 already does that, too. By default, objects are possessed by
whoever happens to be holding them at the moment, but you can also
assign permanent ownership for personal property.

--
Ryukage

David Fisher

unread,
May 7, 2005, 5:21:46 AM5/7/05
to
"Damian Dollahite" <ryu...@aol.com> wrote in message
news:d5i0q3$os0$1...@domitilla.aioe.org...

Cool !

Anything TADS3 *doesn't* do (yet) ? ;-)

David Fisher


Andrew Plotkin

unread,
May 7, 2005, 10:07:57 AM5/7/05
to
Here, David Fisher <da...@hsa.com.au> wrote:
>
> Once the players get used to the parser, they will know what kinds of thing
> they can do ... what I really want to know is, if you start adding some of
> these features, which of them form a "complete set" which will be
> intuitively obvious to the player ? What we have so far is:
>
> (1) One or two word parsers ("north", "get key"). No need to explain this to
> the player - once they know that the limit is two words, they won't try "get
> the brass key and put it on the table".
>
> (2) Verbs (with prepositions allowed) + nouns (with adjectives allowed) +
> ordering NPCs ("Fred, "). The set of available commands is pretty clear once
> you know the basic format.
>
> TADS2 and Inform seem to be up to this point now. Continuing into the future
> / TADS3:
>
> (3) Prepositional phrases
> (4) Comparitive adjectives

> (6) Possessives ("take the goblin's sword" - which is then no longer "the
> goblin's sword", but the PC's).
>
> (5) Questions to do with features of objects / the environment ("which clay
> is the yellowest ?", "can I make it across the pit ?").
> (7) Adverbs ("slowly lift the torch"; "lift the torch very slowly").

I count questions and adverbs as a separate category (thus rearranged
above). Of the above list, (5) and (7) are new capabilities for the
*protagonist*. (3), (4), and (6) are ways for the *player* to more
effectively specify what the protagonist should do.

The difference is that adding new capabilities for the protagonist can
make a game less fun by default -- either by adding meaningless
options, or by adding insufficiently-clued options that the player
decides (wrongly) are meaningless. See other posts in thread, but I am
generally not sanguine about this kind of thing.

Better descriptors (adjectives, etc) can only make games easier to
write -- you can add that sort of thing to the default parser without
worrying. (Of course you can invent pathological cases, but in general
I'm fine with it.)

--Z

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
I'm still thinking about what to put in this space.

Damian Dollahite

unread,
May 7, 2005, 7:59:36 PM5/7/05
to

Can't get it to make me breakfast...


But seriously, TADS 3 is way ahead of the other languages right now.
Last few months I've seen a number of discussions of how to do things
that TADS 3 already does. And it's only going to get better. I believe
the first official release is coming out as soon as Mike finishes the
manual, and after that I think he's gonna start working on rope and
liquids, as well as improving the multimedia layer and interpeter UI.
Glulx/Inform and Hugo will be hard-pressed to keep up.


--
Ryukage

David Fisher

unread,
May 7, 2005, 9:49:25 PM5/7/05
to
"Damian Dollahite" <ryu...@aol.com> wrote in message
news:d5jko1$i2b$1...@domitilla.aioe.org...

> David Fisher wrote:
>>
>> Anything TADS3 *doesn't* do (yet) ? ;-)
>>
> Can't get it to make me breakfast...

D'oh !

> But seriously, TADS 3 is way ahead of the other languages right now.
> Last few months I've seen a number of discussions of how to do things
> that TADS 3 already does. And it's only going to get better. I believe
> the first official release is coming out as soon as Mike finishes the
> manual, and after that I think he's gonna start working on rope and
> liquids, as well as improving the multimedia layer and interpeter UI.
> Glulx/Inform and Hugo will be hard-pressed to keep up.

What is the best source of information about TADS 3 right now ? Here is what
Google turns up ... are there any others ?

"TADS 3 Beta" site:
http://www.tads.org/t3dl.htm#docs

Proto documentation:
http://www.stauffconsulting.com/tads3doc/

TADS3 mailing list archives:
http://lists.v-space.org/archive/tads3/

David Fisher

PS. Who is writing the TADS 3 manual ? I would be very happy to proof read
anything to see if it makes sense to someone who doesn't know the language
yet ...


David Fisher

unread,
May 8, 2005, 12:59:54 AM5/8/05
to

<steve....@gmail.com> wrote in message
news:1115438959.1...@g14g2000cwa.googlegroups.com...
> David Fisher wrote:
>> Does anyone know of any research being done to do with IF &
>> natural language processing ?

[snip TADS 3 references]

>> * Multiple "it"s (not restricting "it" to a single object,
>> but resolving by context / logic)
>
> Yes.

Just to clarify ... if I say:

:> Pick up bottle
:> x painting
:> Fill it with water

... will the TADS 3 parser realise that bottles are "fillable" but paintings
are not, and resolve the "it" reference to be the bottle ? What are the TADS
3 rules for resolving it/them/other pronouns ?

Other examples:

:> Get potato
:> again
:> Get knife
:> Drop them

... does the parser realise that "potato" is the most recently mentioned
plural object ?

:> x potato
:> x table
:> x wall
:> pick it up

... will this say that the wall is not portable ? Or the table ? Or the
potato be picked up, because it is the most recent object which "it" can
reasonably be applied to ?

What about:

:> x rock

It is an ordinary looking rock

:> look

There is a rock, a frog and a peanut here. Suddenly, the frog jumps into the
air !

:> Pick it up

... is "it" ambiguous (requiring clarification from the player), the frog
(the last mentioned object in the game) or the rock (the last object
mentioned by the player) ?

Thanks,

David Fisher


Damian Dollahite

unread,
May 8, 2005, 1:32:09 AM5/8/05
to
David Fisher wrote:
> What is the best source of information about TADS 3 right now ? Here is what
> Google turns up ... are there any others ?
>
> "TADS 3 Beta" site:
> http://www.tads.org/t3dl.htm#docs
>
> Proto documentation:
> http://www.stauffconsulting.com/tads3doc/
>
> TADS3 mailing list archives:
> http://lists.v-space.org/archive/tads3/
>

That last URL is probably the best source of info, that's the archive
for the development discussion list. That's where to get inside info on
future features and suggest new features. (The feature set is currently
semi-frozen pending the official release.)

There's also Eric Eve's tutorials found at

http://users.ox.ac.uk/~manc0049/TADSGuide/intro.htm

and the technical articles at tads.org.


> PS. Who is writing the TADS 3 manual ? I would be very happy to proof read
> anything to see if it makes sense to someone who doesn't know the language
> yet ...
>


Michael J. Roberts is writing it himself. He's the only one who
actually understands a lot of the more advanced features of the library.


--
Ryukage

David Fisher

unread,
May 8, 2005, 1:47:29 AM5/8/05
to
"David Fisher" <da...@hsa.com.au> wrote in message
news:%xBee.10759$Le2....@nasal.pacific.net.au...

> "Daryl McCullough" <stevend...@yahoo.com> wrote in message
> news:d5dud...@drn.newsguy.com...
>> David Fisher says...
>>
>>>Does anyone know of any research being done to do with IF & natural
>>>language
>>>processing?
>>
>> I'm all in favor of improving the ability of the parser, but I
>> have one caution to make: Increasing the sophistication of the
>> parser without a corresponding increase in the sophistication
>> of the world model might be misleading to the player.
>>
>> Here is one example: adverbs. It isn't that hard to get
>> the parser to be able to accept inputs like
>>
>> Go slowly north
>>
>> or
>>
>> Carefully pick up snake
>>
>> However, unless the game is *incredibly* detailed, the adverb isn't
>> usually going to make any difference in the gameplay.
>
> Definitely ... in general, I would think that adverbs would just add
> "flavour" to the game - possibly changing the description text (which
> players enjoy), but not actually making a difference to the game. They
> should never be required for solving puzzles - unless you want to get
> lynched by a mob of angry players some dark night ...

I found an interesting thread on adverbs on my way back through the RAIF
archives ...

http://groups-beta.google.com/group/rec.arts.int-fiction/browse_frm/thread/889e36f69699e00f/0229e8efb8dffd58

The thread says "Games in development", but since when do RAIF threads keep
to their topic (a tradition I have often noticed and swear to uphold to the
best of my ability ;-)

Damian Dollahite

unread,
May 8, 2005, 1:58:04 AM5/8/05
to
David Fisher wrote:
> <steve....@gmail.com> wrote in message
> news:1115438959.1...@g14g2000cwa.googlegroups.com...
>>>* Multiple "it"s (not restricting "it" to a single object,
>>>but resolving by context / logic)
>>
>>Yes.
>
>
> Just to clarify ... if I say:
>
> :> Pick up bottle
> :> x painting
> :> Fill it with water
>
> ... will the TADS 3 parser realise that bottles are "fillable" but paintings
> are not, and resolve the "it" reference to be the bottle ? What are the TADS
> 3 rules for resolving it/them/other pronouns ?
>

No, it doesn't go that far. Once you use a command that doesn't contain
a pronoun, the antecedant list is reset. I think that's probably a good
idea, letting pronouns go too far back would create confusion for the
player.

TADS 3 stores a list of objects recently used in commands. Arbitrary
objects can also be added to the list manually. When a pronoun is used,
it treats it as an ambiguous command with the antecedant list as the set
of possible matches. Then the regular object-guessing rules come into
play, except I believe disambig requests are disabled and the most
recent Direct Object is the default if it can't decide.

The matching rules first check for gender and number agreement, then
apply the standard verification ranking (see the tech articles on "Good
usage of check() and verify()" and "TADS 3 action results"). The
antecedant list is reset when a command is entered that doesn't contain
a pronoun.

In principle you could modify the system to remember objects several
commands back regardless of pronoun usage, but as I said I think that
would be more confusing than helpful.

> Other examples:
>
> :> Get potato
> :> again
> :> Get knife
> :> Drop them
>
> ... does the parser realise that "potato" is the most recently mentioned
> plural object ?
>

Now, "them" is different from "it". "Them" is a collective pronoun, so
it normally matches groups of objects, not single plural objects. So in
this case only the knife will be dropped, as it's the only object
currently in the antecedant list. However...

>Get two potatoes and the knife
>Drop them

...will pick up and drop all three objects.

> :> x potato
> :> x table
> :> x wall
> :> pick it up
>
> ... will this say that the wall is not portable ? Or the table ? Or the
> potato be picked up, because it is the most recent object which "it" can
> reasonably be applied to ?
>

By now I've probably answered this, but... it will say that the wall is
not portable. It could, however, be easily modified to remember farther
back, as I mentioned above.

> What about:
>
> :> x rock
>
> It is an ordinary looking rock
>
> :> look
>
> There is a rock, a frog and a peanut here. Suddenly, the frog jumps into the
> air !
>
> :> Pick it up
>
> ... is "it" ambiguous (requiring clarification from the player), the frog
> (the last mentioned object in the game) or the rock (the last object
> mentioned by the player) ?
>

If the code that displayed the message about the frog jumping also added
the frog to the antecedant list, then it will probably choose the frog.
Otherwise, I believe it will choose the rock, though it might just say
that "'it' doesn't refer to anything right now" because of the
intervening look. I'm not sure if intransitive commands reset the
antecedant list or not.


--
Ryukage

Gu

unread,
May 8, 2005, 2:45:51 AM5/8/05
to
On Tue, 3 May 2005 20:15:51 +1000, "David Fisher" <da...@hsa.com.au>
wrote:

[snip]
my 2 (euro)cents:
when playing if the player is aware he's not talking to a human being
but to a machine. indeed, he's not "talking", but giving command. as
long as you're able to do what you want, it does not matter, to me, if
you have to write a complex or a simple sentence, if you have to split
a concept in parts. if the description of the room says that on the
northern wall there's a oak door, it would be great to have a parser
that understands "ok, now move to that wall where, somewhere on it,
there's an entrance namely called door not made of ash, but equally
made of a type of wood", but it would be completely useless as "n"
would result in the same "understanding" from the parser and the same
output frrom it.

implementing a different response if the player goes there "carefully"
"normally" or "running" in a single location where it is needed is
simple with any parser, i think (there are actually "guess the adverb"
puzzles). harder it is to make it work for any verb. but again, do you
really need it? when playing an adventure you often come across
actions you'd like to perform but the developer didn't have time /
didn't thought about / didn't thought it would be useful to implement.
so if the description says there's a wooden floor and i want to pick
up a single bar of wood from the floor, probably the author didn't
think anyone would ever try it and didn't make it possible. how can i
pretend he also had time to write a "pick _carefully_ a bar of wood
from the floor"? there's plenty of commands out there that are not
*always* used for *every* objects, do we need to implement adverbs no
one will ever use except when they're important for the purpose of the
game?

again. some parsers still do it. i can "x the apple" and then "get
it". the difference between the two commands is:
1. i can say "oh, wow the parser understands it" (quite useless)
2. save three letters from "get apple" to "get it". probably, thou,
"get ap" would have worked.
it may be faster, but if i want to play a fast peaced game i'd
definitely go for doom 3, not for an if.

to finish off: if there are seven apples on a table, the author knows
how to differ them one from the other if they're different in order to
let the player get the one he wants, without the need for the parser
to understand "pick the apple next to be second biggest one but not
the one on the right, the one on the left".
gustavo

Kevin Forchione

unread,
May 8, 2005, 2:53:49 AM5/8/05
to
"David Fisher" <da...@hsa.com.au> wrote in message
news:F4hfe.10945$Le2....@nasal.pacific.net.au...
>
<snip>

> Just to clarify ... if I say:
>
> :> Pick up bottle
> :> x painting
> :> Fill it with water
>
> ... will the TADS 3 parser realise that bottles are "fillable" but
> paintings are not, and resolve the "it" reference to be the bottle ? What
> are the TADS 3 rules for resolving it/them/other pronouns ?

No. It would assume you were referring to the painting. English convention
is that "it" refers to the most recent direct or indirect object. As in all
the examples posited in your post, a human would begin to assume that the
person issuing such commands were a little ... scatter-brained.

The fallacy of this parser "enhancement" is masked by its command list
brevity. Suppose we have a list of commands N, and the N+1 command refers to
one of the objects in the N commands by "it". It becomes evident that if our
list passes a certain threshold (5? 10? 20? 40?) that the human parser
begins to roll its eyes at the patent "puzzle-like" nature of this approach.

The second problematic aspect of resolving "it" to the "most logical" object
based on the action is that it begins to encroach upon the player's
exploration of the game world. This is masked by the use of commonly
understood verbs and objects, but would be much more evident if we had
something like:

>froople the vorm
>kvortz the splunker with the shavitz
>throm the sploon in the blunkin
>glam it.

Here it's not obvious which object "glam" is logical for, but a human player
would tend to assume that "it" referred to the sploon, since it is the last
direct object referenced in a player command. If the parser resolved "it"
to, say, the vorm, then we might miss out on an informative response on the
nature of sploon and the results of attempting to glam it.

> Other examples:
>
> :> Get potato
> :> again
> :> Get knife
> :> Drop them
>
> ... does the parser realise that "potato" is the most recently mentioned
> plural object ?

If I had received a command such as:
>get the marbles
>get the knife
>drop them

I wouldn't assume that them referred to the marbles. If "them" didn't refer
to the knife then I would probably have to assume that "them" referred to
the marbles and the knife. Though again, in a list of commands of N length,
are we to assume that "it" referred to all of the objects mentioned?

But another difficulty here is that we're dealing with multiple player
commands, which are distinct from a single player command. How much time has
elapsed between the player commands?

Also, should I assume that the actions have occurred one right after
another, or that they're separated by hours or days? A command such as <<get
the marbles and the knife>> is easily referenced as a single unit of player
action, consuming a single "turn", while <<get marbles. get knife>> are
multiple player actions and the time taken by these actions consumes two
"turns".

> :> x potato
> :> x table
> :> x wall
> :> pick it up
>
> ... will this say that the wall is not portable ? Or the table ? Or the
> potato be picked up, because it is the most recent object which "it" can
> reasonably be applied to ?

Again, this example, for reasons stated above, is vunerable to the
vunerability of the "puzzle-like" solution resolved by the parser for a list
of N such commands, and also for *assuming player intent*, perhaps leaving
the player wondering why the table cannot be picked up, or why it was picked
over the potato. Even worse, what is the player to assume if the parser
assumes player intent and picks up the potato when the player thought that
the table was something s/he could pick up, only to find to his dismay that
the potato was booby-trapped and explodes in his face?

Such implied selections aleady exist in the case of <<take all>> which
usually precludes fixed items, and in the case of object selection for
commands such as <<close door>> where door choice is eleminated due to
object state. But in the case of pronouns such as it/them the conventional
reference is always to the previously executed command. Otherwise we are
making a puzzle out of pronoun selection, and must resolve an arbitrary list
of N commands, as well as decide at what point this list is to be cleared.

> What about:
>
> :> x rock
>
> It is an ordinary looking rock
>
> :> look
>
> There is a rock, a frog and a peanut here. Suddenly, the frog jumps into
> the air !
>
> :> Pick it up
>
> ... is "it" ambiguous (requiring clarification from the player), the frog
> (the last mentioned object in the game) or the rock (the last object
> mentioned by the player) ?

The parser by default would have set "it" to the rock, since it is the last
mentioned direct object of a player command. However, since your game code
has produced a frog response it would probably be best practice to treat
this response as though it were generated by an implicit <<look frog>>
command, and have the code generating the response set "it" to the frog.

This is logical as well, from the standpoint of the psychological impact on
the player. The "focus" has shifted for the player to the object that has
produced an action response. However, again, if all three objects were to
produce some kind of response in addition to the <<look>> command we would
have an arbitrary situation. At any rate, this probably isn't a decision
that a parser can make, but one that playtesters must help iron out in terms
of comfort and naturalness of play.

--Kevin


REH

unread,
May 9, 2005, 9:50:30 AM5/9/05
to

"David Fisher" <da...@hsa.com.au> wrote in message
news:gNhfe.10946$Le2....@nasal.pacific.net.au...
I have been working on my own system for the past several years. The parse
allows the use of every part-of-speech in the English language. Adverbs,
for example, may modify verb and adjectives. My reasoning for allowing them
(besides completeness), is because I thought I may want to allow the user to
enter such commands as, "drop the vase carefully" or "quickly take the book
from the fire" or "drop the very thick book." The parser can handle entire
paragraphs. It is actually "built" at game startup from a set of strings
defined by the programmer (they are kind of like a mix between BNF and
regular expressions). There are rules and priorities to help resolve the
language ambiguities. A very, very, very early version is available in the
IF archive. Newer versions, which I have not made available yet, are much
easier to use and understand.

REH


David Fisher

unread,
May 10, 2005, 3:04:47 AM5/10/05
to
"Kevin Forchione" <ke...@lysseus.com> wrote in message
news:1Iife.11727$5o2....@newssvr13.news.prodigy.com...

> "David Fisher" <da...@hsa.com.au> wrote in message
> news:F4hfe.10945$Le2....@nasal.pacific.net.au...
>>
> <snip>
>> Just to clarify ... if I say:
>>
>> :> Pick up bottle
>> :> x painting
>> :> Fill it with water
>>
>> ... will the TADS 3 parser realise that bottles are "fillable" but
>> paintings are not, and resolve the "it" reference to be the bottle ? What
>> are the TADS 3 rules for resolving it/them/other pronouns ?
>
> No. It would assume you were referring to the painting. English convention
> is that "it" refers to the most recent direct or indirect object. As in
> all the examples posited in your post, a human would begin to assume that
> the person issuing such commands were a little ... scatter-brained.
>
> The fallacy of this parser "enhancement" is masked by its command list
> brevity. Suppose we have a list of commands N, and the N+1 command refers
> to one of the objects in the N commands by "it". It becomes evident that
> if our list passes a certain threshold (5? 10? 20? 40?) that the human
> parser begins to roll its eyes at the patent "puzzle-like" nature of this
> approach.

On reflection I think I agree ...

> The second problematic aspect of resolving "it" to the "most logical"
> object based on the action is that it begins to encroach upon the player's
> exploration of the game world. This is masked by the use of commonly
> understood verbs and objects, but would be much more evident if we had
> something like:
>
>>froople the vorm
>>kvortz the splunker with the shavitz
>>throm the sploon in the blunkin
>>glam it.
>
> Here it's not obvious which object "glam" is logical for, but a human
> player would tend to assume that "it" referred to the sploon, since it is
> the last direct object referenced in a player command.

Not necessarily ...

:> Pour the water into the balloon
:> Pop it with the needle

vs

:> Tie the balloon with the string
:> Pop it with the needle

[snip lots of other good points]

I think I generally agree with the idea that "it" should be kept pretty
simple - just exploring the landscape ...

David Fisher


David Fisher

unread,
May 10, 2005, 2:54:40 AM5/10/05
to
"REH" <bo...@nowhere.net> wrote in message
news:d5npr7$8s...@cui1.lmms.lmco.com...

>>>> David Fisher says...
>>>>
>>>>> Does anyone know of any research being done to do with IF &
>>>>> natural language processing?

> I have been working on my own system for the past several years. The

> parse
> allows the use of every part-of-speech in the English language. Adverbs,
> for example, may modify verb and adjectives. My reasoning for allowing
> them
> (besides completeness), is because I thought I may want to allow the user
> to
> enter such commands as, "drop the vase carefully" or "quickly take the
> book
> from the fire" or "drop the very thick book." The parser can handle
> entire
> paragraphs. It is actually "built" at game startup from a set of strings
> defined by the programmer (they are kind of like a mix between BNF and
> regular expressions). There are rules and priorities to help resolve the
> language ambiguities. A very, very, very early version is available in
> the
> IF archive. Newer versions, which I have not made available yet, are much
> easier to use and understand.

Sounds great ! I'm looking forward to finding out more ...

Where are you up to with a world model ?

David Fisher


REH

unread,
May 10, 2005, 9:23:17 AM5/10/05
to

"David Fisher" <da...@hsa.com.au> wrote in message
news:9YYfe.11146$Le2....@nasal.pacific.net.au...

Pretty far. I'm trying to make everything as generic as possible, as to not
need a lot of special condition handling. Objects in the world model exist
not only in a hierarchy of ownership, but with positional information (on
top, beneath, behind, inside, etc.). An object can be a supporter and a
container (i.e., an oven) without an special coding except to set both
flags.

The parser took up most of the time (I work on the project on and off). It
is every sophisticated, but I'm trying to make it easier to handle all that
information. The parser is setup so it can handle all parts-of-speech
(English), plus user defined ones and allows flags in the parser strings for
fine-tuning (i.e., allow only nouns accepting adjectives here). I currently
have it configured something like (not exact as this is off the top of my
head):

Assume:
S = subject noun
N = noun
V = verb
A = adverb
J = adjective
P = preposition
T = article
C = conjunction

* = zero or more
+ = one or more
() = grouping
{} = same as *()
[] = same as +()

Also assume we are ignoring punctuation (we don't have to).
With the above I define one parser string (there can be many, with an
earlier one taking precedence):

Substrings (to help with verbosity of definition):
ADVS = A { {C} A}
ADJ = {ADVS} J
ADJS = ADJ { {C} ADJ}
N_PHRASE = {P} {T} {ADJS} N
V_PHRASE = {ADVS} V {ADVS}

SENTENCE = { {T} {ADJS} S } V_PHRASE {N_PHRASE} {ADVS}
SENTENCES = SENTENCE { {C} SENTENCE}

So, SENTENCES is close to how I have it defined currently. It is not exact
as there are other things present to resolve all the ambiguities that arise
from the above. I parser can even be given a regular expression to handle
things like phone numbers.


I've taken a break from it for awhile and am studing how other systems
handle things (and taking a lot of notes!). I'm not planning on it being a
polished system or to be used by others as there are already a lot of great
ones out there. I'm doing it mostly for enjoyment as I do not usually get
to do the kind of programming I like or with the languages I like at work.
I'm also not planning on defining an IF language. It is a library (C++).
This (possibly) makes it harder to use, but is (I think) more versatile.
Though languages like Inform and TADS are (most likely) Turning Complete, it
still can be difficult to accomplish things outside of their scope.

REH


Reply all
Reply to author
Forward
0 new messages