Program for searching by indexing text files, Programming Languages

Assignment Help:

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


Related Discussions:- Program for searching by indexing text files

Explain how web designers can deal with css , Explain, in your own words, ...

Explain, in your own words, how web designers can deal with CSS conflict resolution. What is the order of precedence between the different types of CSS (inline, embedded and extern

Class registration, using UML 1- Identify primary classes 2- Scenario d...

using UML 1- Identify primary classes 2- Scenario description 3- Class diagrams 4- Sequence diagrams

What are the characteristics of a good algorithm, What is an algorithm? Wha...

What is an algorithm? What are the characteristics of a good algorithm? An algorithm is defined as “a step-by-step procedure of accomplishing some task'''' An algorithm may be sh

#Linux, Hi Dehren, Below is the assessment question for the linux:  Task Y...

Hi Dehren, Below is the assessment question for the linux:  Task Your job in this assignment is to create two Virtual machines each running a different but the latest distribution

Python, Software and sales assingment I keep get a syntax error

Software and sales assingment I keep get a syntax error

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)) ==> (

Computer programming on human algorithm, 1.   You have been asked to write ...

1.   You have been asked to write a computer program that will figure out the total of an order when given the amount of the order ($200) and a sales tax rate of five percent.  I w

Application for a mid , The assignment has two parts: first you generate a ...

The assignment has two parts: first you generate a simple application for a MID that operates independently of other MIDs. As a second part, the application is extended to keep so

C language code, Go to the following link and please do Problem 6. This is ...

Go to the following link and please do Problem 6. This is in C language. http://wikisend.com/download/304748/hw%206.pdf The code I need must be in C language and not C++ . Thank

Triple eigenvalue with 2 linearly independent eigenvectors, 1 Triple Eigenv...

1 Triple Eigenvalue with 2 Linearly Independent Eigenvectors       In this case we will have the eigen-value l with the two linearly independent eigenvectors  ?h 1 and  ?h 2

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