作业Algorithm | java代做 | 代写oop | 作业project | 代写assignment | IT – Big Program 2: Eliza

Big Program 2: Eliza

作业Algorithm | java代做 | 代写oop | 作业project | 代写assignment | IT – 这个题目属于一个java的代写任务, 是有一定代表意义的Algorithm/java/oop/IT等代写方向, 这个项目是assignment代写的代写题目

java代写 代写java

In this project you get to write a natural language processing application called Eliza adapted to utilize specific concepts focused on in this course. This project is based off of a computer program written at M IT in the 1960’s by Joseph Weizenbaum. Eliza uses pattern matching to respond to users in a way that displays interest in the users and continues the conversation until instructed otherwise. The program poses as a therapist and asks the user to type in descriptions of their problems. The program will look for keywords and reply with a prepared response based on the matched keywords. Sample Conversation: Hi I’m Eliza, what is your name? Jim Nice to meet you Jim. What is on your mind? I like programming. Do you say like programming for some special reason? yes You seem to be quite positive. I think it is fun to write software. That’s quite interesting. Do you know how to program? Have you asked anyone else? Not today. Please go on. I’m wondering if you are a human. Do you sometimes wish you were a human? I am a human. Do you believe it is normal to be a human? yes You are sure. let me ask you straight. Are you a human? What are your feelings now? Frustration because I don’t know for sure whether I’m talking to a human or not. Does that reason seem to explain anything else? Like wondering if a human is on the other side of a chat? Really, if a human is on the other side of a chat? Yes. Do all chats have humans on the other side? What does that suggest to you? That you are not human. Do you sometimes wish you were not human? No. Are you saying no just to be negative? I really am human Is it because you are human that you came to me? goodbye Goodbye Jim. Last update: 2018-11-

Program Grading

GradingBigPrograms.pdf – Be sure to read this fully.

BP2 Individual Assignment

This is an individual assignment. With others you are encouraged to discuss general algorithms and the behavior or syntax for specific java programming constructs. However, all the code you submit must be from the assignment or conceived of and typed in by you.

Milestone 1: Processing User Input

  1. Create a new Java Project in Eclipse. You can name this project whatever you want, but Eliza is reasonable. Next download Eliza.java, ElizaTests.java, and Config.java files (try right-clicking to “Save Link As…”) and copy them into the src folder within your new Java Project. Download and copy Eliza.rsp into the project folder (not in the src folder). You may need to select Refresh from the File menu (or press F5), if you cannot immediately see these files in Eclipse’s Package Explorer. a. Eliza.java contains the method definitions for you to complete throughout the project. b. ElizaTests.java contains some testing methods with some tests implemented for you and suggestions for other tests. Add additional tests to these methods as you build this project. Also, add comments to the method headers describing what each of the tests does. c. Config.java contains some constants that are used within the program. Refer to these constants by name, for example Config.DEBUG. You won’t turn in Config.java. A separate Config.java will be used for testing and may have different values for the constants. While developing and testing your code, you may find it helpful to change some of the values in this file. d. Eliza.rsp contains key words and associated responses. In milestone 2 you will write a method to read these into your program.
  2. In this milestone, you will be implementing supporting methods used to process user input. In later milestones, you will implement methods that call and consequently rely on these methods being correct. The requirements for each method are written within the method headers.
  3. Implement and thoroughly test these methods: separatePhrases, foundQuitWord, selectPhrase, replaceWord, and assemblePhrase.
  4. When implementing these methods review the corresponding testing methods in ElizaTests.java and add additional test cases. Comment the test cases in the method header comment block. When you are ready for the test cases to run, uncomment the test method call in ElizaTests main method and run ElizaTests.
  5. Submit your Eliza.java and ElizaTests.java files to zyBooks for feedback and grading. Please complete commenting and styling your code for each milestone as described in the Program Grading section of this document. Your highest scoring results prior to 6:00pm or (11:59pm with a 10% deduction) Wednesday, November 21st will be recorded as your grade for this weekly milestone. Last update: 2018-11-

Milestone 2: Complete Input Processing and Load Response

Table

  1. In this milestone, implement swapWords, prepareInput, loadResponseTable and the Milestone 2 parts of the main method in Eliza.java.
  2. Example Dialog Files: M2-1.txt, M2-2.txt with Config.DEBUG set to true.
  3. The DEBUG output is to help reveal internal state for your testing and debugging purposes. We suggest adding your own debug statement to generate similar output. if (Config.DEBUG) { System.out.println(“DEBUG phrases: ” + phrases); } We won’t be testing your DEBUG output.
  4. Review, run and extend the corresponding tests in ElizaTests.java to assure your methods are working to the specification. Add a brief comment of each test to the header of each testing method.
  5. Submit your Eliza.java and ElizaTests.java files to zyBooks for feedback and grading. Please complete commenting and styling your code for each milestone as described in the Program Grading section of this document. Your highest scoring results prior to 6:00pm or (11:59pm with a 10% deduction) Thursday, November 29th will be recorded as your grade for this weekly milestone.

Milestone 3: Respond

  1. In this milestone implement findKeyWordsInPhrase, selectResponse, prepareResponse, saveDialog and complete the Milestone 3 parts of main method in Eliza.java.
  2. Algorithm for findKeyWordsInPhrase pdf, powerpoint.
  3. Review, run and extend the corresponding tests in ElizaTests.java to assure your methods are working to the specification. Add a brief comment of each test to the header of each testing method.
  4. To complete the Milestone 3 parts of the main method you will have to process command-line arguments, record the dialog while it happens and save the dialog if the user requests. When saving the dialog in Eclipse the current working directory is the Eclipse project folder. Remember to refresh the project (F5) for the dialog file to appear in the package explorer in Eclipse.
  5. Example dialog files: M3-1.txt, M3-2.txt, M3-3.txt, M3-4.txt, M3-5.txt with Config.DEBUG set to true.
  6. Consider adapting Eliza.rsp to create your own therapist such as a bartender, crazy uncle, big sister or ?. Some colorful personalities are described here: http://web.stanford.edu/group/SHR/4-2/text/dialogues.html. If you do, and they are appropriate to be shared, please share on Piazza.
  7. We recommend you carefully review the Program Grading section of this document. When you are satisfied that your code meets the various requirements including commenting and styling, submit your Eliza.java and ElizaTests.java files to zyBooks for feedback and grading. We will supply our own versions of Eliza.rsp and Config.java for testing. Your highest scoring results prior to 6:00pm or (11:59pm with a 10% deduction) Thursday, December 6th will be recorded as your grade for this weekly milestone.
  8. Congratulations on completing your second Big Program in CS 200 Programming I! Last update: 2018-11-

References

Some resources that were helpful when designing this project include: https://en.wikipedia.org/wiki/ELIZA http://www.chayden.net/eliza/instructions.txt http://web.stanford.edu/group/SHR/4-2/text/dialogues.html

Acknowledgements

Maggie Marxen contributed substantial work toward BP2.

Change/Clarifications Log

Initial version: 2018-11- 18-11- In separatePhrases, if there is no punctuation at the end of input then still consider all words in the input. For example “hi! there” would separate to “hi”, “there”. In prepareInput, you don’t need to consider the case where selectPhrase returns null. Consider the output examples as part of the requirements in order to determine various prompts, for example the prompts related to saving the dialog file. 18-11- Suggestion: have a single l oop iterating through userInput a character at a time. Make decisions about whether a character should be appended to the current string, start a new string, etc. Methods in the Character class may be helpful. We don’t recommend using String split on this task. 18-11- findKeyWordsInPhrase: as shown in the pdf, unmatched words array should contain at least the empty string and not null values. The tests within testFindKeyWordsInPhrase() also look for “” and not null. Consider this a testable requirement. 18-11- selectPhrase method header changed From: If phrases parameter is null or size 0 then return null . To: If phrases parameter is null or size 0 then return “” (Update 11/15/18) . Last update: 2018-11-