How many times a user specified word appears in the files

Assignment Help Computer Engineering
Reference no: EM132110188

Project specification: In this project you are going to implement a word search engine using C++. The search engine would help users to count number of occurrence of a word among given set of text files.

Input specification: The program takes as an input a set of files, containing of multiple words. Words can appear multiple times in a single file or in different files. The input files should be stored in a dedicated directory and loaded in memory upon program execution.

Program functionality:Upon execution, the program should load all the words from the input files in the memory. The program should run until the user explicitly specifies "exit". The following functionality should be supported:

1. Count how many times a user specified word appears in the files.

2. Display the name of input files and corresponding number of occurrences of the specified word.

Upon execution of you program, you should specify as input parameter the path to a directory containing the input files. If executed (which somesone enters an input like "cat"), the program should return the name of files that contain the word "cat" and the number of occurrences of the word in each file

First, you need to implement a class for an abstract data type, in which you are going to store files in memory.

You need to declare a class Word that would store a word and a pointer to the beginning of a linked list and another class File that would store a file-name and number of times that the word occurred in this file. The process of "loading files in the memory" consists of

(i) creating an object of type Word for each new word that occurs in the set of input files,

(ii) appending this object to a linked list (e.g. the green linked list from the picture),

(iii) creating an object File for each occurrence of the word in a file and

(iv) updating the corresponding (blue) linked list with the object File.

Once you have the files loaded in such structure, the searching would be as easy as finding the queried word in the "green" linked list and tracing in which files does it occur by going over the corresponding "blue" linked list.

To start gaining experience in how to structure your C++ projects, you are required to split the different aspects of this program and implement them in separate files. Then you will have to put them all back together to achieve the program functionality. You will need to create several .h and .cpp files for this project. We will help guiding you through this process.

First you need to identify the important object-types and methods you will need for your implementation. In this project, your main object types are going to be class Word and class File. Go ahead and create a file called itemtype.h and declare class File in it.

Then create another file called itemtype.cpp and define your class File in it. These two files are going to be related to objects from the "blue" lists on the picture. The next step is to implement the functionality for creating the "blue" lists. For this purpose, you need to create two more files - list.h and list.cpp. In list.h declare all the methods needed for building a "blue" list and in list.cpp define these methods.

Next, you need to implement the functionality related to objects like these in the "green" list. Create two more files - word.h and word.cpp, declare class Word and all methods to this class in word.h and define them in word.cpp. Now what's left is to put it all together by writing a main function that utilizes both file and word. To do so, create wordsearch.h and wordsearch.cpp, declare your main function in wordsearch.h and define it in wordsearch.cpp.

So all in all you will need eight files: wordsearch.h, wordsearch.cpp, itemtype.h, itemtype.cpp, list.h, list.cpp, word.h, word.cpp.

You need to submit 8 files. Eight of these are the implementation of your project assignment, namely wordsearch.h, wordsearch.cpp, itemtype.h, itemtype.cpp, list.h, list.cpp, word.h, word.cpp.

And yeah that's about it.

Reference no: EM132110188

Questions Cloud

Determine sets of prices which meet the objectives : ITECH1100 Understanding the Digital Revolution Assignment - Parchment Basement, Federation University Australia. Determine sets of prices which meet objectives
Create an application for online shopping : When the user selects to purchase an item, the user will be prompted for the quantity to buy. Create an application for online shopping.
Describe in brief the methods used to collect the data : EGH418 Biomechanics - Describe in brief the methods used to collect the data. Consider anthropometry measures, force plate and motion capture data including
Develop a uml class diagram diagram for a classic car : In this project, you have the opportunity to develop a UML class diagram diagram for a classic car museum database system.
How many times a user specified word appears in the files : Display the name of input files and corresponding number of occurrences of the specified word.
Write a program to run a tournament : Write a program to run a tournament. Start with your project 3 program for creatures. If you had issues with project 3 and need to begin fresh.
List all the courses offered for the first time : List the eligible periods/classrooms for an unassigned course. This list should adhere to all the business rules given.
Which of these malicious software has been more devastating : Which of these malicious software has been more devastating recently and how could it be prevented or contained?
Create data objects to store the data to disk : Create data objects to store the data to disk, we chose this method in order to simulate a data access layer in our application.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain how the hadoop system deals with datanode failures

Explain in detail how the Hadoop system deals with DataNode failures. Explain and write the pseudocode for a Mapper/Reducer that takes as input a large file (possibly split into chucks) of integers and outputs.

  What disadvantage of insertion sort does shell sort overcome

What is the advantage of selection sort over all the other methods we studied? What disadvantage of insertion sort does Shell sort overcome?

  How to write a program "oneway"

Write down a program "oneway" which implements a one-way communication between a parent process and it's child using a pipe.

  Develop a gomoku is a game played by two players

Develop a Gomoku is a game played by two players on a 19 by 19 board. One player uses black stones and the other player uses white stones.

  Program simulating the rolling of one dice

Write down a program which simulates rolling one dice utilizing the following steps: Prompt user for the number of sides on the dice.

  Describe the actions of the next reset and prev functions

Explain the actions of the implode and explode functions. Describe the actions of the next, reset, and prev functions.

  Implement a multilayer perceptron classifier

Using this dataset, implement a Multilayer Perceptron Classifier (MLP) to predict whether an article is popular or not

  What value of k minimizes training set error for data set

What value of k minimizes the training set error for this data set? What is the resulting training error? Explain. Why might too small values of k also be bad?

  Determine the temperature drop of water

Hot water is flowing at an average velocity of 4 ft/s through a cast iron pipe (k = 30 Btu/h.ft.°F) whose inner and outer diameters are 1.0 in and 1.2 in.

  Create an array named x that has n elements

Determine the number of values input by the user and store this value in a variable named N. Create an array named X that has N elements.

  Write java code for a bmi class with a default constructor

Write java code for a BMI Class with both a default & non-default constructor, standard accessors, mutators (with valid argument checking), a method to return.

  There are many property crimes but onlynbsp4 property

there are many property crimes but onlynbsp4 property crimesnbspare listed by the ucr asnbspindex crimes.these are the

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