COMS E6111 Project 2 Jahyun Kim (jk3111) [ README ] a) Jahyun Kim, jk3111 - ALONE b) Makefile Project2.java InfoboxCreator.java AnswerMachine.java transcript.txt README.txt c) How to run the program: After running a Makefile with "make" command, in order to execute the program, write java -cp ./commons-codec-1.9.jar:./json-simple-1.1.1.jar:./google-api-client-1.18.0-rc.jar:./google- http-client-1.18.0-rc.jar:./httpcore-4.0.1.jar:. Project2 in the command line. are: 1. -key -q -t 2.-key -f -t 3.-key d) Description of the design: [ Project2.java ] Project2 class is the main frame of the program. This analyzes the command line argument inputs and decides which action to do. If the user decides to do an interactive infobox creation, which is the third option out of all input options, the program keeps running until the user enters "done" or "exit" or "quit" or CTRL+C out. The program first generates a timestamp for displaying every time the user types a query to create an infobox. Once the query is read by the program (Project2.java), it is passed to the InfoboxCreator. If either the first or second option is chosen, the program decides whether to process the input string (-q) or input file (-f) based on the third command line argument. Then the last command line argument decides whether to create an infobox or an answer machine. [ InfoboxCreator.java ] InfoboxCreator first generates the JSONArray of the Freebase Search results using the query passed from the Project2 class. Using this search result, when print() is called, InfoboxCreator passes the mid of each JSONObject of the search results array to Freebase Topic. Then using the Freebase Topic result, the program decides which types out of 6 (Person, Author, Actor, Business Person, League, Sports Team) satisfy the result. If the current result meets with any of the 6 types, the program further analyzes the result to produce the infobox. However, if none of 6 types are found in the current result, the next mid from the search results is passed on to Freebase topic. In terms of accessing information from the Freebase Topic results, "text", "value", "values", "results", "property", and "count" fields are used. "count" field is used to check if the values inside the object is empty or not. "text" and "value" are used to extract the information. "values', "results", and "property" are used for getting accessed to "text' and "value" fields. [ AnswerMachine.java ] AnswerMachine creates MQLRead queries for both the "Author" and "Founder" options. Then the program connects to Freebase MQLRead with each query and retrieve two result arrays. Then the program prints the result according to the format given by the assignment. The program first prints all elements of "Author" results and then "Founder" results. e) Freebase API Key: AIzaSyCrJCY9Elvg0cIxd0EI5atARzbCjiYL0IY