Magpie Chatbot Project

It is highly recommended (though not required) by College Board that we study its Magpie Chatbot Lab during the school year. The guide and source code that go with this lab are not publically available to students. You may access it here though. You will be submitting an essay as well as several modified programs by following the instructions below.

Activity 1 (15 - 45 mins) - Go to chatbots.org and try several of the chatbots that you find there. Submit a paragraph essay labelled "Activity 1" that fully explains your analysis of at least two chatbots. Be sure to include the web page addresses, a list of specific keywords and phrases to which they respond.

Activity 2 (1 - 2 hrs) - Watch this video to learn how to download, extract, and open this Magpie2 Runner project. Execute the MagpieRunner source file. Write an essay labelled "Activity 2" that fully explains in its first paragraph how the program responds to "My mother and I talked last night.", "I said no!", "The weather is nice.", and "Do you know my brother?" In another paragraph of your essay, explain how an if statement is used to control the responses that the chatbot provides to the user.

Modify the source code of the Magpie class so that it

  • responds with "Tell me more about your pets" when the statement contains the word "dog" or "cat".
  • responds with "He sounds like a good teacher." when the statement "Mr. Minich is telling us about robotics." or any statement that contains his last name is inputted.
  • uses the trim method to detect if an empty string was provided as the input and responds with the phrase "Say something, please."
  • has two more concommittal responses to the possible random responses.
  • responds with interesting, relevant statements to at least three more keywords such as "no" or "brother".

Add another paragraph to your Activity 2 essay that explains what happens when more than one keyword appears in an inputted statement such as "My mother has a dog but no cat." Explain how to prioritize responses in the reply method.

Add another paragraph to your Activity 2 essay that explains what happens when a keyword is embedded inside another word.

Compress and submit the source code for your Magpie2 project with the modifications outlined above.

Activity 3 (1 - 2 hrs) -

Download, extract, and open this Magpie3 Runner project????????. Open the StringExplorer program as well as the API for the String class. In the first paragraph of an essay labelled "Activity 3" explain what value is returned by the indexOf method if the substring does not occur in the string? Add the following lines of code to the program to see for yourself:

??????

Add lines of code to StringExplorer that illustgrate how the version of indexOf that accepts two parameters differs from the one with one parameter.

Run the Magpie class that is included in this project. As a Microsoft Word table, recreate the chart given on the Activity 3 page in the Magpie Student Guide to show the value of each of the variables psn, before, and after each time the program control reaches the point in the findKeyword method indicated by the comment.

Repeat the changes you made to this Activity 3 version of Magpie that you made in Activity 2 using this new method to detect keywords.

Compress and submit the source code for your Magpie3 project with the modifications outlined above.

Activity 4 (1 - 2 hrs) -

Download, extract, and open this Magpie4 Runner project????????. In the first paragraph of an essay labelled "Activity 4" explain how this version of the Magpie class responds to "I want to build a robot.", "I want to understand French.", "Do you like me?", and "You confuse me." Alter the code so that it responds to statements like "I want something" with "Would you really be happy if you had something?" Also alter the code so that it responds to statements of the form "I something you" with "Why do you something me?"

Compress and submit the source code for your Magpie4 project with the modifications outlined above.

Activity 5 (30 mins) -

Download, extract, and open this Magpie5 Runner project????????. As you can see this project works similarly to the others however the internal code has been written differently which is called "code refactoring." Notice the use of an array in the getRandomResponse method. Alter the array to add four additional random responses.

Compress and submit the source code for your Magpie5 project with the modifications outlined above.

All programs must follow the class Coding Standards.