Assignment 9 |
for submission: Thrusday, 17 Oct., 2002, Midnight. |
In this assignment you are asked to design a Spelling Checker and please note that this assignment is only for those students who didn't opt for the term project. The implementation of a very simple spelling checker uses a Table which stores all the words in a dictionary. (in this Table there is no data associated with a key, just the key itself, a string.) Such a dictionary you can form from the words in Paragraph 1. A text (Paragraph 2) is then read and words which are in the text which can not be found in the dictionary are reported to the user in a attractive window format with the following two options.
Enable the I key to Ignore and A key to Add. Tasks for this lab are to implement JAVA data types and functions which provide implementations of the Table data type using Trees. In both cases the Table data type requires the following functions
Paragraph 1 There was a certain island in the sea, the only inhabitants of which were an old man, whose name was Prospero, and his daughter Miranda, a very beautiful young lady. She came to this island so young that she had no memory of having seen any other human face than her father's. They lived in a cave or cell, made out of a rock; it was divided into several apartments, one of which Prospero called his study; there he kept his books, which chiefly treated of magic, a study at that time much affected by all learned men: and the knowledge of this art he found very useful to him; for being thrown by a strange chance upon this island, which had been enchanted by a witch called Sycorax, who died there a short time before his arrival, Prospero, by virtue of his art, released many good spirits that Sycorax had imprisoned in the bodies of large trees, because they had refused to execute her wicked commands. These gentle spirits were ever after obedient to the will of Prospero. Of these Ariel was the chief. The lively little sprite Ariel had nothing mischievous in his nature, except that he took rather too much pleasure in tormenting an ugly monster called Caliban, for be owed him a grudge because he was the son of his old enemy Sycorax. This Caliban, Prospero found in the woods, a strange misshapen thing, far less human in form than an ape: he took him home to his cell, and taught him to speak; and Prospero would have been very kind to him, but the bad nature which Caliban inherited from his mother, Sycorax, would not let him learn anything good or useful: therefore he was employed like a slave, to fetch wood and do the most laborious offices; and Ariel had the charge of compelling him to these services. Paragraph 2 Thus this misfortune happened. Helena, as has been before related, endeavored to keep pace with Demetrius when he ran away so rudely from her; but she could not continue this unequal race long, men being always better runners in a long race than ladies. Helena soon lost sight of Demetrius; and as she was wandering about, dejected and forlorn, she arrived at the place where Lysander was sleeping. "Ah!" said she, "this is Lysander lying on the ground. Is he dead or asleep?" Then, gently touching him, she said, "Good sir, if you are alive, awake." Upon this Lysander opened his eyes, and, the love-charm beginning to work, immediately addressed her in terms of extravagant love and admiration, telling her she as much excelled Hermia in beauty as a dove does a raven, and that be would run through fire for her sweet sake; and many more such lover-like speeches. Helena, knowing Lysander was her friend Hermia's lover, and that he was solemnly engaged to marry her, was in the utmost rage when she heard herself addressed in this manner; for she thought (as well she might) that Lysander was making a jest of her. "Oh!" said she, "why was I born to be mocked and scorned by every one? Is it not enough, is it not enough, young man, that I can never get a sweet look or a kind word from Demetrius; but you, sir, must pretend in this disdainful manner to court me? I thought, Lysander, you were a lord of more true gentleness." Saying these words in great anger, she ran away; and Lysander followed her, quite forgetful of his own Hermia, who was still asleep. When Hermia awoke she was in a sad fright at finding herself alone. She wandered about the wood, not knowing what was become of Lysander, or which way to go to seek for him. In the mean time Demetrius, not being able to find Hermia and his rival Lysander, and fatigued with his fruitless search, was observed by Oberon fast asleep. Oberon had learned by some questions he had asked of Puck that he had applied the lovecharm to the wrong person's eyes; and now, having found the person first intended, he touched the eyelids of the sleeping Demetrius with the love-juice, and he instantly awoke; and the first thing he saw being Helena, he, as Lysander had done before, began to address love-speeches to her; and just at that moment Lysander, followed by Hermia (for through Puck's unlucky mistake it was now become Hermia's turn to run after her lover), made his appearance; and then Lysander and Demetrius, both speaking together, made love to Helena, they being each one under the influence of the same potent charm. How To Submit You have to upload your solution files duly zipped on 202.141.81.74 latest by due date and time,however you are required to approach the TAs personally on 18th october for getting your solutions evaluated. Please follow the instructions for uploading, mentioned on the site, while you are uploading the files. No requests for fixing the uploading errors which caused due to your carelessness will be entertained. |