Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Inform in other langÿÿÿÿÿ

230 views
Skip to first unread message

NEIL SLATER

unread,
May 21, 1996, 3:00:00 AM5/21/96
to

JW> > 1. Identify all words in the sentence from a dictionary. The diction
JW> > also assigns them a _type_ eg Article, Noun, Verb, Preposition. (Thi
JW> > already failing as a natural language interpreter, but should be ade
JW> > for an adventure)

JW> > eg "use the key to unl the red doo" becomes
JW> > "use" "the" "key" "to" "unlock" "the" "red" "door", stored in an
JW> > and ^V ^R ^N ^P ^V ^R ^A ^N for types in an
JW> > array. (R stands for "aRticle")

JW> This stage is actually more of a problem than you might think,
JW> because many words cannot be unambiguously identified in this way.

Yes, you're right. The original post was from off the top of my head. I
have written a parser with a first stage much like this. I think you can
get away with with it by choosing your words carefully, but I suppose
that's not much consolation if you've bought a pre-written parser.

This is not a trivial problem. Even the best minds in AI cannot solve this
problem for natural language. The main hurdle is that language _is_
ambiguous, and we understand it with large amounts context and common
sense.

One solution (again, off the top of my head) is to generate several
versions of this ^V^R^Netc. array, and use the Pattern Matching I
described in my last post to weed out the most likely one. This may just be
good enough for a text adventure (though again, it falls miles short of
natural language comprehension).

JW> One silly example that Magnetic Scrolls used to advertise their parser
JW> was the player input
JW> >PLANT THE POT PLANT IN THE PLANT POT.

I would use "PLANT THE SMALL SHRUB IN THE ORANAMENTAL POT"

But then I'm sure someone would try "POT THE PLANT"!

The following was made famous through AI language attempts:

"Time flies like an arrow."
"Fruit flies like a banana."

JW> What can you do with this? You may say it's an unrealistic example,
JW> but this sort of problem crops up in smaller ways all over the place:

JW> I guess I'm just saying you shouldn't gloss over this stage as it's
JW> vital to the way your parser works - I for one would be interested in
JW> solution to this problem that doesn't force an author to avoid nouns
JW> which are also verbs or adjectives.

It can probably be done. Because my own parser is for a Play By Email
game, I can pretty much define the command structure to be VERB NOUN, but
I'm still interested in any other algorithms that people have used/
thought of.

Neil
---
* RM 1.3 U0448 * Neil....@Almac.co.uk


NEIL SLATER

unread,
May 22, 1996, 3:00:00 AM5/22/96
to

AP> This is already weaker than the Inform parser, in both stages. For
AP> example, consider "Show audience show". (Which is a perfectly
AP> legitimate command in a game I'm working on. :-) "Show" is both a noun
AP> and a verb, and the two objects are adjacent in the sentence with no

Yes, you're right. Serves me right for trying to teach people to suck
eggs. See my more recent post for my thoughts on bringing my algorithm
more into the nineties (1890's, that is :-).

But the original thread is about Inform in other
languages. If Inform is already quite good, then how easy would it be to
modify the code to handle different grammar (such as Dutch?)

If the basics of Inform are easy to change, then maybe I can help? I'm an
OK programmer (BASIC and C++), and I am living with a Dutch girl, Yvonne,
who is keen to teach me the language. Only problem is I don't know Inform
:(, but I hear it is quite similar to C++?

Apologies to those of you trying to follow the thread when my BBS account
seems intent on changing the subject (at least the last few letters,
anyhow)!

Michael Blaheta

unread,
May 23, 1996, 3:00:00 AM5/23/96
to

Quoth NEIL SLATER:

> JW> One silly example that Magnetic Scrolls used to advertise their parser
> JW> was the player input
> JW> >PLANT THE POT PLANT IN THE PLANT POT.

> I would use "PLANT THE SMALL SHRUB IN THE ORANAMENTAL POT"

> But then I'm sure someone would try "POT THE PLANT"!

Hmm... because of the nature of IF, though, it always uses the
imperative; in English at least (most languages I've seen, too), such a
sentence will always start with a verb, and will contain no other verbs
(except in clauses, more on that in a minute). So a parser reading the
above could think "Ok, POT, that's the verb" just based on position. If
the first word isn't a verb, spew a nasty message. The next thing to
expect is an object of some sort. If it's a non-Indirect-Object verb,
the next thing will definitely be a direct object. Thus, get the next
word (ignore article): "PLANT". We are at the end of the sentence, so
that is the noun we need.

If you wanted to, you could try and implement clauses, to allow stuff
like "KILL THE TROLL WHICH HAS THE AXE", without any heavy difficulty:
merely have the parser take the part after "WHICH" (or "THAT") and
convert it to an adjective, e.g. has_axe, so that the above would be
equiv. to "KILL THE HAS_AXE TROLL". "PULL THE KNOB THAT WAS PUSHED",
"PULL THE WAS_PUSHED KNOB". I can't offhand think how to integrate
cluases that don't end the sentence, though; "TURN THE BOLT WHICH WAS
MELTED WITH THE WRENCH"--hard to tell where "with the wrench" should go.
In any case, though, you could also watch for "special" verbs in
clauses, and just remove them, so that you wouldn't have to define
"was_melted" and "has_been_melted" in addition to "melted". Of course,
the value of all this is questionable.

In the case of the "tough" sentence above:
"PLANT: first word, so it's the verb. Next thing will be direct object,
adverb, or prepositional phrase. "THE" is an article, ignore. "POT"
can be an adjective or noun--lookahead at the next word. A noun, so
"POT PLANT" is a noun phrase [reverse order for some languages where adj
follows noun]. It's the direct object. Ok, we have all our objects;
only thing we can have now are adverbs and prep. phrases. "IN" is a
preposition, so expect another noun phrase. "ORNAMENTAL" is an
adjective, so expect noun. "POT" can be a noun or adjective--lookahead.
End of sentence, so "POT" must be a noun here."

So you see, as long as you carefully mix "expected word type" and "word
type lookup" you wouldn't have too much difficulty, even with tough
sentences, and even with other languages. It doesn't really help with
Inform though...

> The following was made famous through AI language attempts:

> "Time flies like an arrow."
> "Fruit flies like a banana."

Well, IF only has to deal with imperative form, but my method would work
perfectly with the first sentence and definitely show an ambiguity in
the second (rather than just coming up with a wrong answer). Of course,
I could hardly expect a work of IF to properly distinguish that when huge
AI engines had a hard time with it. :)

> JW> I guess I'm just saying you shouldn't gloss over this stage as it's
> JW> vital to the way your parser works - I for one would be interested in
> JW> solution to this problem that doesn't force an author to avoid nouns
> JW> which are also verbs or adjectives.
>
> It can probably be done. Because my own parser is for a Play By Email
> game, I can pretty much define the command structure to be VERB NOUN, but
> I'm still interested in any other algorithms that people have used/
> thought of.

A lot of it depends on whether you distinguish adjectives from nouns,
and how. Esp. with the "POT PLANT" vs. "PLANT POT" example....

> Neil

Don

-=-=-=-Don Blaheta-=-=-=-bla...@quincy.edu-=-=-=-dbl...@aol.com-=-=-=-

In Pocataligo, Georgia, it is a violation for a woman over 200 pounds
and attired in shorts to pilot or ride in an airplane.

PAZ SALGADO

unread,
May 23, 1996, 3:00:00 AM5/23/96
to

Michael Blaheta (mbla...@flood.xnet.com) wrote:
: Hmm... because of the nature of IF, though, it always uses the

: imperative; in English at least (most languages I've seen, too), such a
: sentence will always start with a verb, and will contain no other verbs
: (except in clauses, more on that in a minute). So a parser reading the
: above could think "Ok, POT, that's the verb" just based on position. If
: the first word isn't a verb, spew a nasty message. The next thing to
: expect is an object of some sort. If it's a non-Indirect-Object verb,
: the next thing will definitely be a direct object. Thus, get the next
: word (ignore article): "PLANT". We are at the end of the sentence, so
: that is the noun we need.

It can be for traditional player input, but absolute not for talking with
NPCs!

Every time I probe a new parser I have the same problem: sometimes there are only
awful ways to make NPCs talking, and in the few case in which you can create
an NPC that talk to you, it can only acept orders (in imperative form,
because imperative is the way you type player input). But I want my
NPCs answer question!

> Say to Ms. Little "Where were you yesterday morning?"

Ms. Little answer: "Shopping, Mr. Holmes, shopping"


Please,I think parsing are important think!

Meliton Rodriguez, from 117 room

John Wood

unread,
May 23, 1996, 3:00:00 AM5/23/96
to

neil....@almac.co.uk (NEIL SLATER) writes (much snipped):

>
> JW> This stage is actually more of a problem than you might think,
> JW> because many words cannot be unambiguously identified in this way.
>
> Yes, you're right. The original post was from off the top of my head. I
> have written a parser with a first stage much like this. I think you can
> get away with with it by choosing your words carefully, but I suppose
> that's not much consolation if you've bought a pre-written parser.

I started writing a parser "way back when" using this method (in Z80
assembler, which was the only language I knew at the time 8-). I gave up
when I hit this problem, because I wanted to parse more than verb-noun, and
couldn't see how to cope with words like PLANT. There were a gazillion
other things I wanted to try coding anyway.

> One solution (again, off the top of my head) is to generate several
> versions of this ^V^R^Netc. array, and use the Pattern Matching I
> described in my last post to weed out the most likely one. This may just be
> good enough for a text adventure (though again, it falls miles short of
> natural language comprehension).

Possibly this would work - but I would worry that the combinations would
generate too many likely candidates. I'm generally overly-pessemistic
about such things, though.

> JW> One silly example that Magnetic Scrolls used to advertise their parser
> JW> was the player input
> JW> >PLANT THE POT PLANT IN THE PLANT POT.
>
> I would use "PLANT THE SMALL SHRUB IN THE ORANAMENTAL POT"
>
> But then I'm sure someone would try "POT THE PLANT"!

And if you're writing an authoring tool, that person may very well be the
adventure's author... 8-)

> JW> I guess I'm just saying you shouldn't gloss over this stage as it's
> JW> vital to the way your parser works - I for one would be interested in
> JW> solution to this problem that doesn't force an author to avoid nouns
> JW> which are also verbs or adjectives.
>
> It can probably be done. Because my own parser is for a Play By Email
> game, I can pretty much define the command structure to be VERB NOUN, but
> I'm still interested in any other algorithms that people have used/
> thought of.

Ah. In this sort of controlled environment, where you can avoid the
problems, things are certainly simpler than in IF.

Thanks for the ideas - the thread seems to be flourishing, so we'll see
what everyone else has to offer too.

John


John J Lee

unread,
May 23, 1996, 3:00:00 AM5/23/96
to

On 23 May 1996, Michael Blaheta wrote:

> Quoth NEIL SLATER:


> > JW> One silly example that Magnetic Scrolls used to advertise their parser

[...]


> > The following was made famous through AI language attempts:
>
> > "Time flies like an arrow."
> > "Fruit flies like a banana."
>
> Well, IF only has to deal with imperative form, but my method would work
> perfectly with the first sentence and definitely show an ambiguity in
> the second (rather than just coming up with a wrong answer). Of course,
> I could hardly expect a work of IF to properly distinguish that when huge
> AI engines had a hard time with it. :)

[...]
Of course, the problem was that they didn't have a hard time with it in a
sense - they found that their program could extract about 20 or 30 (i can't
remember, it was a lot) different meanings from something like "Time flies
like an arrow". This is definitely not an advantage in a parser when
playing an adventure game.

eg
(The third one is the one used in the joke pointing out the problem):

time metaphorically flies past us very fast, like an arrow does
time literally flies like an arrow does
the insects known as "time flies" enjoy an arrow from time to time
the insects known as "time flies" like a particular arrow
instruction: measure the time taken by the flies to perform some
activity, in the same manner that arrows would time them.
instruction: time those flies which fly like an arrow
it is time that flies started liking an arrow occasionally
it is time that flies started liking a particular arrow

Well, the last two are a bit of a squeeze, but I know there are more, I
just can't think of any at the moment. I suppose there are different
ways in which time could be (literally or metaphorically) 'like' an
arrow, but I don't know if this is the sort of thing the AI programs spotted.

John

Yes, I know it's a simile, not a metaphor really.
:o)
Ooo, look!
||
\||/
\/
--
Time flies like an arrow, fruit flies like a banana.


John Wood

unread,
May 23, 1996, 3:00:00 AM5/23/96
to

mbla...@flood.xnet.com (Michael Blaheta) writes:
> In the case of the "tough" sentence above:
> "PLANT: first word, so it's the verb. Next thing will be direct object,
> adverb, or prepositional phrase. "THE" is an article, ignore. "POT"
> can be an adjective or noun--lookahead at the next word. A noun, so
> "POT PLANT" is a noun phrase [reverse order for some languages where adj
> follows noun]. It's the direct object. Ok, we have all our objects;
> only thing we can have now are adverbs and prep. phrases. "IN" is a
> preposition, so expect another noun phrase. "ORNAMENTAL" is an
> adjective, so expect noun. "POT" can be a noun or adjective--lookahead.
> End of sentence, so "POT" must be a noun here."

Yup, that works...

> So you see, as long as you carefully mix "expected word type" and "word
> type lookup" you wouldn't have too much difficulty, even with tough
> sentences, and even with other languages. It doesn't really help with
> Inform though...

Just to clarify: I understood the original post to be proposing an
*alternative* to this way of identifying meaning, by delaying the
analysis of sentence structure to a later point in the proceedings
(i.e., once parts of speech were identified).

John


0 new messages