The goal of this assignment is to revisit some of the programming and data structure concepts learned in CSC241.
Earth has just established contact with the intelligent civilization of planet RASHT. The critical problem facing the team of scientists, engineers, and sociologists is establishing a basis for communication. The RASHTYs have their own language and symbols. Fortunately, their reprsentation system is not too different from our own. The RASHTYs have 20 basic symbols which have a natural ordering like our own alphabet. There have also been series of matches between English and RASHTY words identified. The linguists have encoded the RASHTY symbols as letters of our alphabet (a-t) to facilitate computer analysis of the RASHTY's messages.
What we need immediately is a program that could produce a RASHTY-English dictionary, the ability to update the dictionary, and the ability to translate the messages from RASHTY. We would also like to have an English-RASHTY dictionary as well; but this is not as critical (EXTRA CREDIT).
You are being hired to write the program in Java for this noble task. But, you are not without guidance on this, I happen to have written an Employee Application that you should use as a model. This Employee application initially loads employee records into a Set object from employee file; it then provides the user with a menu of options that let him perform add/update/remove operations on individual employees or perform wholesale operations on them like give pay raises to all of them. This program also regenerates the employee file before exiting; these are all the kinds of things that you need to do in your assignment.
Your program begins by loading data from an input file with the following format:
are llaassfo did goto we eq you too baby jikerit the eht is li one oen well dotoo last pnqoo not ton exactly kokocat
Your program will then provide our scientists with the following menu:
Sample output when choice 1 is selected. Note that it is in RASHTY alpha order:
RASHTY ENGLISH ------- -------- bjikerit baby dotoo well eht the eq we goto did il is kokocat exactly llaassfo are oen one pnqoo last ton not too you
Sample output when choice 2 is selected. Note that it is in English alpha order and the option is only provided if you are doing the extra credit:
ENGLISH RASHTY ------- -------- are llaassfo baby jikerit did goto exactly kokocat is li last pnqoo not ton one oen the eht we eq well dotoo you too
When choice 3 is selected, we prompt for and store a RASHTY/English pair. Both words must be validated for correctness, a-z for English and a-t for RASHTY. Also, we have been assured by the scientists that RASHTY words would only have one translation; thus, if a RASHTY word is entered here that already exists amongst our stored words, we replace its English translation with the new one entered; otherwise, we add the pair to our dictionary. Here is a sample interaction:
Enter RASHTY Word: appo Enter English Word: hello ....appo/hello has been added to the dictionary
When choice 4 is selected, we prompt for a RASHTY messages that we need to decoded. RASHTY words are seperated by characters that are not in their alphabet (other than a-t). Each RASHTY word that has a translation is replaced by its equivalant English word. There may be RASHTY words that can not be translated, such words shall remain unchanged. All non-RASHTY-alpha characters remain in the translation as well. Here is a sample message getting translated:
Enter Rashty Message: too goto batta jikerit dotoo, ton kokocat. ha ha English Translation: you did batta baby well, not exactly. ha ha
Lastly, when choice 5 is selected, we write all our English/RASHTY pairs back into our dictionary file. and exit the program.