Design and implement a character analyser, Programming Languages

Assignment Help:

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).


Related Discussions:- Design and implement a character analyser

Java.., create a program that can determine the number of students that are...

create a program that can determine the number of students that are doing their final year for a particular program (e.g. BCOM Information Systems), calculate the required credits

Write a perl script that accepts two integer arguments, 1. Write a Perl scr...

1. Write a Perl script that accepts exactly 2 integer arguments where the first argument must be less than the second argument. The script will print a comma separated list of inte

Learning when and how to use a while loop, 1.  A function that produces the...

1.  A function that produces the Collatz sequence and counts the number of terms. 2.  A main function that calculates interesting values about the Collatz sequence. 1.The Col

Draw the sequence diagram for the scenario, Draw the sequence diagram for t...

Draw the sequence diagram for the following scenario of eBroker. Sell Stock The user enters the username and password The system checks that the user is a valid user

Jsp help, what is the code to copy code on 1 jsp page to others

what is the code to copy code on 1 jsp page to others

Use an insertion sort to sort an array, Use an insertion sort to sort an ar...

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE

Write a program that draws the initials j, Write a program that draws the i...

Write a program that draws the initials J G P on the form similar to that shown in Fig J 1 (using straight lines and curve semicircles). The figure can not have corners. All ends a

Define a procedure that takes a list as a single argument, (a) Define a pro...

(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list; e.g. (subsets '(a b c)) ==> (

Use a procedure to integrate cube, Simpson's Rule is a more accurate method...

Simpson's Rule is a more accurate method of numerical integration than the method described in class. Using Simpson's Rule, the integral of a function f between a and b is approxim

Design entry using the graphical editor, In this activity, you are going to...

In this activity, you are going to place components on a sheet and connect them with virtual wires to create a simple digital circuit. You will simulate the circuit to verify the c

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd