Anda di halaman 1dari 8

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham

English Spanish Translator


06/03/12 Student Names: Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham

Design
Statement of Requirements The problem involves designing and coding a program in Java which performs Spanish-to-English translation and vice versa. The following requirements need to be met by the program: Requirements System Requirements OS capable of running Java, with Java installed Mouse Keyboard Monitor Graphics Card Minimum 128 Mb RAM 1024kb free Backing Storage Inputs to the Program User shall control basic aspects of the program via mouse click and keyboard. User can also input a text file. Outputs from the Program The translated words will be outputted to the screen. The translation can also be outputted to a text file. Functional Requirements 1. Program shall create dictionaries to translate Spanish to English and English to Spanish 2. Program shall be able to translate phrases and individual words 3. Program shall be able to translate a text file from one language into another, and output the time taken to complete the translation 4. Program shall provide an option to enable users to add new words to the translation dictionary when your translator cannot find the word in the dictionary 5. Program shall provide an option to enable users to remove a word from the dictionary 6. Program shall provide an option to display the dictionaries 7. User shall be able to stop and start the program 8. Program should be able to run outside the IDE 9. Program may be text based 10. Program may use a GUI 11. Program may translate groups of words, not just individual words 12. Program may include other languages for translation 13. Program may use balanced binary trees

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham Non-functional Requirements 1. The program shall be able to run on a basic, low end single core processor 2. The published program should work on the following operating: Windows XP and over, Mac OS X, Linux. 3. At the time of publishing, the program shall be entirely error free.

User Interface

1. 2. 3. 4. 5. 6. 7. 8.

Translate a text file Translate a single word Translate Phrase Add Word Delete Word Print Word List Help! Exit

Enter an option from the Menu:

Use Cases
System: User: System: User: System: System: User: System: Display menu to user Select option from menu Prompt user for input (options 1-5) Inputs text / text file Executes appropriate action Displays menu Selects Exit Exits program

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham

Candidate Classes Candidate Classes


English Spanish BinaryTree TreeNode Dictionary Word Translator User Program

Accept / Reject
Reject Reject Reject Reject Accept Accept Accept Reject Reject

Reason for Rejection


Field in another class Field in another class Renamed to Dictionary Renamed to Word

Irrelevant Irrelevant

Class Descriptions including Responsibilities, Fields and Methods


Dictionary: Purpose & Responsibilities: Sets up two binary trees Performs functions on trees Class Fields Root Methods Dictionary() getRoot() setRoot() englishAdd() spanishAdd() printTree() writeTree() traverseTree() englishFind() spanishFind() englishDelete() spanishDelete() removeNode() isTreeEmpty() traverseWrite()

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham

Word: Purpose & Responsibilities: Store data for each word Class Fields String English String Spanish Word left Word right Word parent Methods Word() getEnglish() setEnglish() getSpanish() setSpanish() getRight() setRight() getLeft() setLeft() printInfo() getParent() setParent() Translator: Purpose & Responsibilities: Display Menu Control Program Class Fields Dictionary dictEng Dictionary dictSpa Date timeStarted Date timeFinished Long elapsed String [] englishWords String [] spanishWords

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham

Methods Translator() Main() Menu() addInitial() addWord() delete() print() find() engTranslate() spaTranslate() engRead() spaRead() splitEnglish() splitSpanish()

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham

Class Diagram
Translator Dictionary english, spanish Translator() Main() Menu() addInitial() addWord() delete() print() find() engTranslate() spaTranslate() engRead() spaRead() splitEnglish() splitSpanish()

Word String english, Spanish Word left, right, parent Word() getEnglish() setEnglish() getSpanish() setSpanish() getLeft() setLeft() getRight() setRight() getParent() setParent() printInfo()

Dictionary Word root Dictionary() getRoot() setRoot() englishAdd() spanishAdd() printTree() writeTree() tranverseTree() englishFind() spanishFind() englishDelete() spanishDelete() removeNode() isTreeEmpty() traverseWrite()

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham Pseudocode: translate() Ask user if they want to read text in from file or enter word(s) if read text in readFileToTranslate() else get word(s) from user split string into individual words ask user if they want to translate from English to Spanish or vice versa for each word if English to Spainsh findEnglishWord() add Spanish word to String else findSpanishWord() add English word to String print/write final string

Team 7 Calum Duncan, Kevin McKenzie, Rory Duthie, Hussain Al-Nadaf, Alastair Letham AC12001 Group Project Meeting List 6/3/2012 14.08 Calum Duncan Kevin McKenzie Rory Duthie 14.32 Hussain Al-Nadaf Started work on design and requirements. Finished Design document. Started Coding. Group Allocations: Calum - Group Management / Code Kevin - Modify Binary Tree Code Rory Find / Compile Word List Hussain Find / Compile Word List Alastair ?? 7/3/2012 10.00 Calum Duncan Kevin McKenzie Rory Duthie Hussain Al-Nadaf Kevin worked on code at home, translate function working (no word list). Rory worked on loading word list. Calum worked on time elapsed code Hussain will work on design doc Group Allocations: Calum - Continue with time code Rory Continue with word list Kevin - Continue with translator class Hussain Update Design Doc Alastair ?? Calum to update Design Doc and Submit on Friday

Anda mungkin juga menyukai