<!--
	Book Title: Digital Deli
	Book Subtitle: The comprehensive, user-lovable menu of computer lore, culture, lifestyles and fancy.
	Book Editor: Steve Ditlea
	Publisher: Workman Publishing Company, Inc., New York
	Date: 1984
	Transcription by Steve Derby
	Excerpt: (Word Salad) How a Computer Responds to Your Words, p. 177
	Article Authors: Michael Berlyn and Marc Blank
-->

---

This is an excerpt from:

Berlyn, Michael and Marc Blank. "How a Computer Responds to Your Words."
	<em>Digital Deli: The comprehensive, user-lovable menu of computer lore,
	culture, lifestyles and fancy</em>, edited by Steve Ditlea, Workman Publishing Company, Inc.,
	1984, p. 177.

---

One of the strongest experiences of a good adventure game or interactive fiction
is the feeling you get when the computer answers your words. You could swear you're
not just typing commands at your keyboard — that in fact you're talking to someone
inside your computer.

Your first experience with even the most sophisticated piece of interactive fiction
will also make you aware of its limitations. Many people are amazed that a sentence
of any sort can be understood; others are appalled that a sentence like "Where were
you after you left the drugstore the other night?" could cause a problem. After all,
it is a simple question.

Consider the problem from the computer's point of view. As you type, the keystrokes
are recognized and remembered. When you hit the <span style="font-variant-caps: small-caps;">return</span>
key, the program receives a sequence of characters that correspond to the keys
you've typed. But there is no meaning in the characters themselves. Meaning has to
reside in the way they are combined to form words and sentences.

The extraction of meaning from written language requires intelligence. Unfortunately,
the computer has none. The best we can do is teach it some rules to make it seem
intelligent.

## Teaching Grammar

We can start by teaching the computer that words are usually separated by the
"space" character. Using this rule, the sentence "Take the house" can be broken
into three words. This may seem simplistic, but it's not. When you look at the
sentence, you instinctively see three words. The computer has no such instinct
and "sees" only apparently arbitrary patterns.

Breaking the sentence into words is simple. Knowing that "Take the house" consists
of three words is useful, but it says nothing about what the sentence means unless
you already know English. The computer doesn't. Let's try to teach the computer
English by thinking through some questions about the words we've found.

Are the words English words? We can solve this problem the way Noah Webster did,
by creating a dictionary in which we list all the words in the language and some
information about each. We might, for example, list in the dictionary that "take"
is a verb form, "the" is an article and "house" is a noun. But this isn't enough
to understand language.

Do the words form a sentence? Here we come to the next problem: grammar. Do the words
"Take the house" make a legal (i.e., grammatical) sentence? We might list all the
legal sentence forms: For example, verb/noun, verb/article/noun and verb/preposition/noun
are each legal structures for a sentence. Assuming we have created such a list,
we can tell that our example is legal in structure.

But is the sentence reasonable? Using our list of possible sentence structures,
we would find that "Take with house" is legal. On the other hand, it leaves
something to be desired semantically. Therefore, we need some rules for indicating
which sentences are legal from the standpoint of surface meaning. The simplest
approach would be to make a list of forms that are appropriate for a given verb.
In our example, sentences beginning with the verb "Take" might include "Take
something" and "Take something out of something." Assuming we have compiled the
comprehensive list, we can tell that "Take with house" is not reasonable and that
"Take the house" is.

## Playing House

Now we come to the question we started with. How does the computer understand what
we mean when we type something? The answer is much more complicated than merely
recognizing that the words form a reasonable sentence. Before we can teach the
computer to answer the important question about "Take the house," it must be taught
something about the concept of "take." Can everything be taken? If not, what are the
properties of things that can be taken? Who (or what) can take things, and how many
of them? All of this must be taught to the computer.

Then we must teach the concept of "house." What constitutes a house? What properties
do houses have in common? Can they be taken? Can they be used as wood for bonfires?
In the context of a particular piece of interactive fiction, we will have to be more
specific. Are we referring to a particular house? Is this particular house different
from houses in general?

Look how far we've come just to understand one short sentence.

The programming involved in the first few steps (this act of uncovering the structure
of a sentence is called parsing) is difficult enough, but the real stumbling block is
extracting the meaning of the sentence. Writing sophisticated interactive fiction is
an act of creation. To be successful, the author must create not only things, but also
the rules that act upon them — the laws of nature for the world he has created. These
laws need not be the laws of our world — the story may take place in another galaxy or
alternate reality. What is important, though, is the sense of completeness and
consistency found in this world.

Everyone writing interactive fiction talks about his parser. Many writers claim their
parser understands full sentences, but most parsers understand little more than
verb/noun pairing. They look for a few key words and ignore everything else in the
sentence. Besides, talking about one's parser is actually beside the point. Real
intelligence on the computer’s part — understanding what you mean — requires knowledge
of how the created world works. The parser is not the be-all and end-all of interactive
fiction.

Understanding. The ability to "get what you mean." The parser is merely a tool in the
hands of the creative human author. No ordinary author, but one capable of imagining
and planning responses to the innumerable entries only humans are capable of, and
managing to tell a story. A good parser won’t guarantee a first-rate piece of
interactive fiction. Only an author's imagination can do that.
