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

Create xml document to save calendar information, Prepare an XML document t...

Prepare an XML document that contains calendar information such as the following text describes: The calendar is owned by a person (e.g. John Smith) and has a few paragraphs tha

Linux assignment , Hi how can I upload my hw to you experts?

Hi how can I upload my hw to you experts?

C program with creation of child process using fork system, Problem 6. ...

Problem 6. Demonstrate how and when can you use the commands- vi, cat, chmod, grep, man, pwd, ps, kill, mkdir, rm demonstrating how and when the above 10 commands can be

Develop an application for spacerocks game, Extend the SpaceRocks game and ...

Extend the SpaceRocks game and provide a warp feature which allows the ship to jump to a random location to escape a rock. The warp feature is only activated once the shields have

Simulation algorithm, Please remember to read and follow all of the assignm...

Please remember to read and follow all of the assignment guidelines. This assignment will expand upon the simulation algorithm given in class to produce a program which may be u

Java input stream, Expertsmind brings you unique solution in java assignme...

Expertsmind brings you unique solution in java assignments I.O streams The Java.io packages contains nearly every category you might ever need to execute feedback and resu

Software architecture, Select two different architecture styles to design a...

Select two different architecture styles to design and implement a software system and provide its Architecture Diagrams (implement the software with java)

Jsp, how can we get the data from data base to combo box in jsp page dynami...

how can we get the data from data base to combo box in jsp page dynamically

Write a program to draw the fish, Write a program to draw the figure shown ...

Write a program to draw the figure shown below. the program must provide: a. Close the fish's mouth slowly (at least 5 moves from the original position to close the mouth) b.

Network security, Term project (you should code a function), demonstrate it...

Term project (you should code a function), demonstrate it to the class and a very breief report (one or two pages) describing what you did. You determine your project (could be imp

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