Design and implement a character analyser, Programming Languages

Your task is to write an application to analyse texts in a file.  Your application will employ  several kinds of text-analyser objects (which you also have to implement)  as described below. Your application will prompt the user for a filename, ask the user to select one of the text analysers and then will use the selected analyser on the given filename  (each analyser will have a public method "analyse(String filename)"). After analysis a summary report (as outlined in the analyser descriptions - each analyser will have a method "getSummary()" that returns a String that contains the summary) is printed to the screen and the user is offered to query the analyser for more detailed information (as outlined in the analyser description) until the option "done with analysis" is chosen. At the end the user is given the choice to start over again or to terminate the application.

You need to design and implement the following types of analysers:

1.  Character analyser, which establishes:
-  Number of characters in the text (including letters, digits, spaces, symbols, etc.).
-  Number of letters in the text.
-  Number of digits in the text.
-  Number of whitespaces (spaces, tabs, line breaks etc.).
-  Number of other characters (symbols etc.)
-  Frequency distribution of each letter (i.e. the amount of relative occurrence of each letter in the text as percentage, i.e. as a figure between 0.0%-100.0%).

-  Frequency distribution of each digit (i.e. the amount of relative occurrence of each digit in the text as percentage, i.e. as a figure between 0.0%-100.0%).

The summary report includes the number of characters, letters, digits, whitespaces and symbols. The user can query the analyser for  each value individually and also for  the frequency distribution of a single letter or digit  (chosen by the user) or for an overview that displays the frequency distribution of all letters and digits. The way in which you store the information is not important.

2.  Simple word analyser, which establishes:

-  Number of words in the text.
-  Number of different words (not case sensitive, i.e. the words "card" and "Card" are counted as the same word).
-  A list of words occurring in the text (words are kept in order of appearance).
-  Number of occurrences of each word.

The summary report includes the number words and the number of different words. After   the analysis the user can query the analyser for the number of words, number of different words, a list of occurring words (in order of first appearance - each word should be listed only once) and the amount of occurrences of individual words (the user can select the word by index and also by entering the word directly -  you need two separate methods for this).

The simple word analyser stores  the list of words in an  indexed dynamic data structure  (you must be able to get the first, second, third word etc. - it cannot use a hash-based storage).

3.  Sorted word analyser, which establishes the same as the simple word analyser. However, the list of occurring words is sorted in alphabetical order. The overview report and the possible queries are identical to the word analyser.  
 
The sorted word analyser stores the list of words in an  indexed dynamic data structure. Use any sorting algorithm to sort the list of words. The sorted word analyser must use Binary Search to find words in the stored data structure.
 
4.  Hashed word analyser, which establishes the same as the simple word analyser. However, this analyser uses a hash table to store the information. As a consequence,  when querying the occurrences of individual words the index cannot be used  -  the user must enter the words directly.

The hashed word analyser stores the list of words in a  dynamic hash table  (a hash table that adjusts to the required size automatically).

Posted Date: 2/14/2013 4:09:44 AM | Location : United States







Related Discussions:- Design and implement a character analyser, Assignment Help, Ask Question on Design and implement a character analyser, Get Answer, Expert's Help, Design and implement a character analyser Discussions

Write discussion on Design and implement a character analyser
Your posts are moderated
Related Questions
Often, DNA sequences are represented as a sequence of characters (String) and each character in the sequence corresponds with one of four nucleotides. A = adenine, C = cytosine,

#1. Every mathematics student likes primes numbers. Every mathematics student like parabolas. Let''s put them together to have some fun: Consider two natural numbers a and b. Of co

Create the class Robot described in the Karel++ book. Description: The Robot class described in the Karel++ text is a derived class of ur_Robot. Create class Robot as a d

would you like to see some of my code. I am trying to do an add friend request. when I view my friends page I click on the add button. with ajax I want the script to send over the

A manager at the local Walmart needs to determine how many workers to hire to cover a 24-hour period. Each worker must work 9 consecutive hours but may only start work at the begin

1. Write a function that converts a character array to a signed decimal integer. Function prototype must be as follows: int asciiToInt( char *str, unsigned char* eflag) YOU MAY NO

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

What are the main pros and cons of assembly programming language?

Calculate the total price based on several key parts required to build a state-of-the-art gaming computer. The user will have the option of selecting different parts.

The following are required for this lesson: Complete the Project "Adding New Payments," which is the Karate Payments that includes the Adding New Payments, Deleting Payments,