We saw how Eliza works as a simple production system. There is a genre of games known as interactive fiction (text adventures) and it is a genre that is alive and well on the internet. For a sample of how they work, please see:
Beginner Resources for Interactive Fiction
How to play interactive fiction
The goals of this homework are the following:
Please read Chapter 20 on "Understanding Language" from your book. It may give you ideas on how to implement language parsing.
You may write your program in any higher level language that works on the Suns and has a regular expression library. Flex/Bison, Perl and Java are examples of appropriate languages. It is highly suggested that you use regular expressions to help with word/grammar matching in your program. If you are unsure of what regular expressions are or don't remember them, please see my PLC web page for assistance. All code MUST work on the Sun machines. I will not grade work that doesn't compile/run on the target machines.
For your natural language processing system, you should separate the data (storyline, commands that can be typed) from the actual implementation of the interactive story. As an example, you could have a text file that has key words and links them with associated commands. Methods in your program would then deal with this mapping appropriately. This allows for future expansion and the possibility for different stories. The format you use for your data may be in any format you wish, but it should be in ASCII text so that I can look at it easily.
The story itself should be playable in a 15-minute time period (it should be short) and should use a variety of commands typed in simple natural language. Examples of natural language include "I hate you.", "Go left.", and "Turn the dial right.". The case of letters should not matter in your program and you may use one word responses, but please keep this to a minimum. Remember that you will be graded on the AI in your program, so don't take a lot of short cuts in conversational responses. Straight text input/output is just fine. Try to think of multiple ways a person can say things so that people going through your story to not easily become frustrated and give up. You may take material from existing stories and books (fairy tales and children's books are good resources), but make sure you do not take from copyrighted materials if you wish to publish your work on a web site.
In addition to your program, you will submit files that describe the architecture of your program, the story it tells, and that answer the following questions:
For your particular homework there are several submissions:
try jdb-grd register /dev/null
try jdb-grd hmwk1-1 *.*
The *.* above represents any files (such as the required data files) as well as program files.
try jdb-grd hmwk1-2 description.txt *.*
The *.* allows you to have pictures or pdf submissions. Please do not submit MS Word docs for this part of your submission.
try jdb-grd hmwk1-3 answers.txt
try jdb-grd hmwk1-4 problems.txt
You can resubmit
as often as you like before the deadline. try will be open for the
1-day grace period after the deadline.
If you work as a pair, you should submit all program files
from one account and
both partner's names should appear on all submitted files.