Question: Question You are required to write a C++ program that would serve as a word count. Word count is used quite a lot in Natural

Question You are required to write a C++ program that would serve as a word count. Word count is used quite a lot in Natural Language Processing (NLP) and is pretty interesting concept that is used in various applications today like spam detection, sentiment analysis and etc. You are provided a text file (data.txt) with this lab which is an excerpt from Ontario Tech University's history. All the punctuations except the apostrophe are intentionally removed from the text. You are required to perform the following tasks: Read the text file word by word. Create a class called WordCounter that o Has 2 data members, e.g., string word, int count. o Has appropriate getters and setters At least one constructor o Uses this keyword to help distinguish between data members and local variables Create a collection of words in such a way that your program can distinguish between different words, e.g., store each different word in an object of WordCounter class. Every time a word appears your program is required to count the occurrence of that word in the file. Finally print a report with each word and number of times it occurred in the text file provided. You can only use #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
