Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9521876

Have any Question?


Related Questions in Programming Language

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As