Program for searching by indexing text files, Programming Languages

Write a program that can facilitate searching by indexing text files according to words. In this task, you are given a large text file, sample.txt, which you will need to index the words stored in them.

To do this, you will separate out the words in the text file and index them according to their frequencies.  Your program shall count the number of unique words and store them in an appropriate Standard Template Library container.  The words are to be normalized to lower-case so that we do not have to deal with case-sensitivity. Your program will ignore the following:

  • Punctuations
  • Numerical numbers (1, 2, etc., but 'one', 'two' are to be treated as words)

Next, your program shall generate two output files, index.txt, and common.txt. At the start of the program, you shall prompt user to enter the threshold number. This number determines if the unique words are to be stored in index.txt or common.txt.

Unique words with frequency greater or equal than the threshold are to be stored in common.txt. Likewise, unique words with frequency less than the threshold are to be stored in index.txt.

As an illustration, suppose a text file, sample.txt, contains the following:

Give us a break!  It is a beautiful day.  We do not want to do programming today.  Do you want to go to the beach with us?

At program starts:

Enter threshold number: 2

The above indicates that user enters 2 for threshold number. Your program shall generate the two output files with following content (words sorted in ascending order):

index.txt

Total words: 15

beach              1

beautiful          1

break               1

day                  1         

give                 1

go                    1

is                      1

it                      1

not                   1

programming  1

the                   1

today               1

we                   1

with                  1

you                  1

common.txt

Total words: 5

a                      2

do                    3

to                     3

us                    2

want                2

Posted Date: 2/27/2013 2:47:16 AM | Location : United States







Related Discussions:- Program for searching by indexing text files, Assignment Help, Ask Question on Program for searching by indexing text files, Get Answer, Expert's Help, Program for searching by indexing text files Discussions

Write discussion on Program for searching by indexing text files
Your posts are moderated
Related Questions
'This program compares interest rates between two banks and determines the best bank 'Eric Weber, Adam Litchfield, Eric Romero, Sarah, Alex, Amy '10/5/12 'Lab #4 Problem 42 'CSC

Most popular news websites publish their RSS ( Really Simple Syndication ) feeds. If you haven 't heard of RSS, you may have a look at this article on Wikipedia. In this assignm

Write a function called triple (in a file called 'triple.m'). That takes a single variable x and returns a single variable in which every element of x is multiplied by 3. Make sure

#questCustomers of a particular restaurant are described with some categories. If the categories indicate the customer is a senior citizen, or the customer works for the restaurant

This assignment begins software tools and techniques for structuring complex programs. Use it to become familiar with these facilities, and ensure you use the speci?ed concepts in

develop a pseudocode algorithm to determine the total amount of extra cost changed to the organizers for expenses accurednduring the workshop. the code is to be written for an unde

You must use the keyword ''var'' to create and initialize a variable. The placement of the variable creation in your code is very important. Examples: var first = 21; var secon

Advantages of java stored procedures Transactions Although a saved process contains SQL orders, once collected it will socialize with SQL Hosting server very diversely from

The languages used in the module are of a type known as high-level languages. There is another set of languages known as low-level languages. (a) Differentiate between high-leve

i doing a project about depth estimation, i have done some research, and i used the block matching algorithm to get the motion vectors from the image sequences, i now have the prob