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
Shemrock Inc. is a brake pad manufacturing company. This company uses raw materials, such as carbon powder, iron, ash, and resin. It wants to develop an inventory management system

I am trying to get right side triangle in visual logic using for loop

Type of Linear Programming - DEA The Express Dry Cleaners currently has four locations in the Chicago area and willing be opening the fifth in the very near future.  Mr. James,

I need an application that will gather data from one SQL Database and update another. Data is contained in dbo.CallList with following fields: Customer_ID, AlreadyPickedUp, Phone_N

Object-oriented languages Languages that support OOP features can be classified into the following two categories: 1.    Object-based programming languages, and 2.      O

1- If the order of a (mod P) is 3, prove that the order of a+1 is 6. 2- Explain why the "simplifiled knapsack" code is not secure.

The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of t

I''m studying electrical engineering, and this semester im taking course that called Computer Design. in this course they need me to a final project about any thing we took during

I am working on a matlab project and need help debugging one question i have written and need help working through another problem.

Problem: (i) Define Remote Procedure Call (RPC). (ii) Explain with diagram how RPC works? (iii) A remote procedure is uniquely defined by (a) Program number. (b)