You are on page 1of 2

How a Computer Responds to Your Words

Michael Berlyn and Marc Blank 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 RETURN 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.

" 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. 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. The programming involved in the first few steps (this act of uncovering the structure of a sentence is called parsing) is difficult enough." The parser is merely a tool in the hands of the creative human author. Before we can teach the computer to answer the important question about "Take the house. though. but one capable of imagining and planning responses to the innumerable entries only humans are capable of. What is important. the author must create not only things." it must be taught something about the concept of "take. but also the rules that act upon them-the laws of nature for the world he has created. Besides. we can tell that "Take with house" is not reasonable and that "Take the house" is. talking about one's parser is actually beside the point. Writing sophisticated interactive fiction is an act of creation. Playing House Now we come to the question we started with. and managing to tell a story. Only an author's imagination can do that. and how many of them? All of this must be taught to the computer. Real intelligence on the computer's part-understanding what you mean-requires knowledge of how the created world works." Can everything be taken? If not. On the other hand. Many writers claim their parser understands full sentences. what are the properties of things that can be taken? Who (or what) can take things. 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 simplest approach would be to make a list of forms that are appropriate for a given verb. sentences beginning with the verb "Take" might include "Take something" and "Take something out of something. A good parser won't guarantee a first-rate piece of interactive fiction. The ability to "get what you mean. Understanding." Assuming we have compiled the comprehensive list.But is the sentence reasonable? Using our list of possible sentence structures. we would find that "Take with house" is legal. we will have to be more specific. it leaves something to be desired semantically. Then we must teach the concept of "house. Therefore. The parser is not the be-all and end-all of interactive fiction. but most parsers understand little more than verb/noun pairing. They look for a few key words and ignore everything else in the sentence. To be successful. we need some rules for indicating which sentences are legal from the standpoint of surface meaning. Everyone writing interactive fiction talks about his parser. These laws need not be the laws of our world-the story may take place in another galaxy or alternate reality. In our example. No ordinary author. is the sense of completeness and consistency found in this world. but the real stumbling block is extracting the meaning of the sentence. .