473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Project help count total number of words " Data Structure "

Hi
I need help please
This is my project and i need a help to solve it with you

A page of text is to be read and analyzed to determine number of occurrences and locations of different words. The results of the analysis are to be stored in a suitable data structure. The main task in this project is to design a suitable ADT (call it WAnalysis) to store the results and enable the following operations to be performed as fast as possible:
(i) An operation to determine the total number of words of a particular length occurring in the page.
(ii) An operation to determine the total number of occurrences of a particular word.
(iii) An operation to display the locations of the occurrences of a word starting from the top of the page as a list of line and word numbers. Note that every new-line character indicates end of a line.

Phase I
In the first phase of the project you will describe the design of the ADT you suggest for the problem, as follows:
(a) Give the graphical representation of the ADT to show its structure. Label the diagram clearly.
(b) Give a specification of the operations (i), (ii) and (iii), and other supporting operations you may need to read the text from a text file and store the results in the ADT (e.g. insert).

Phase II
In the second phase of the project you will implement the ADT and the operations you specified in the first phase as a single Java class WAnalysis. You may use the ADTs you have studied in the course.
You must also give the time complexity of the algorithms you used to implement the above operations.

Example Input and Output Data:
Assume that words are separated by at least one space. Single letter words e.g. ‘a’, ‘I’, are counted as words. Punctuation (e.g. commas, periods, etc.) is to be ignored. Hyphenated words (e.g. ‘decision-makers’) or apostrophized words (e.g. ‘customer’s’) are to be read as single words. See the following example of a piece of text in the font Times New Roman, and size 12pts:

In these ways, the testing methodology provides a window into the total Web Experience from the customer’s point of view, providing insight and direction for business decision- makers. Marketing executives discover how they should allocate resources for maximal impact, while designers obtain insight into why particular features and functions are not working as planned and how to best modify them.

The output of the operation (i) for word length 3 would be 14.
The output of the operation (ii) for the word ‘and’ would be 3.
The output of the operation (iii) for the word ‘and’ would be (2, 9) (4, 10) (5, 4). Note that (2, 9) indicates that word ‘and’ is occurring on line 2 as the ninth word.

Thank you
Nov 8 '09 #1
2 3395
Dököll
2,364 Expert 2GB
Hey there!

If you could post a bit of your code, it would be great. Might get better hits on your question that way...

In a bit!
Nov 9 '09 #2
Frinavale
9,735 Expert Mod 8TB
Please take the time to research the problem before you post your question. The experts here are more than willing to help you with a specific problem but you have to do your part to learn the basics and also formulate a specific question we can help with. Please take the time to read over the Posting Guidelines, specifically the section on Before you Post your Question.

Before posting any question you are expected to attempt to find and work on a solution. When you find a specific problem with your attempt, that is the time to post here requesting assistance with any difficulties you have or about a particular function of the code that you don't know how to achieve. When posting your problem, details of the problem itself and where it's found are the bare minimum information required. The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you.

Code may be posted for reference purposes, but please don't expect us to work out the meaning of your problem by reverse-engineering your code. The question you post must make sense in its own right.
Nov 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: dan | last post by:
this is a program to count average letters per word. i am able to count the total number of letters, but not words. How do you count the total number of words in a text file, so i am able to divide...
6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
2
by: Alexandre MELARD | last post by:
Hi, My name is alexandre, I am 4th year student at the Napier university of edinburgh. I am finishing my year and do a presentation of my honours project next wednesday (the 5th of May). I am...
5
by: Yellowbird | last post by:
Hi all, I'm new to JavaScript, but am pretty sure what I want to accomplish is not that difficult. I just need an example or suggestion to help clarify it for me - I haven't had much time to...
3
by: Rabun | last post by:
Heres one that is giving me fits ( = = Access newbie), more than likely something simple that I blew right over . . . any help is appreciated - I have a report based on a query, with several...
0
by: chris.bender | last post by:
1. My problem: I am using a query to populate a Chart in MS Access 2k. 2. My query: SELECT .Status, ., Sum(.Amount) AS SumOfAmount, Sum(IIf(!="Debit",!,!*-1)) AS realAmount, Count(.Status) AS...
8
by: DQ dont quit | last post by:
I'm currently working on a ASP.Net / C# / SQL 2000 project that involves the entering of keywords, that a web user enters, and then searching MSWord documents for those words. This information...
4
by: naknak4 | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.