Question: Now extend the code you wrote in Part 3 to look for commonly paired words. You should create a new, seperate file for this task.

 

Now extend the code you wrote in Part 3 to look for commonly paired words. You should create a new, seperate file for this task. Create a list of all word pairs, and count the number of times each pair occurs. You will need a new struct definition to store both words, and you will need to keep track of two words at once while moving through the text. You will not need to worry about word order for this task; that is, you should interpret [eat fish] and [fish eat] as separate entities.

Sort the array in ascending order. Display to the console the number of unique word pairs, the 10 most frequently occurring, and 10 least frequently occurring. Run this on both the cleaned text and the original text. How different are they?

Hints:This task is much more similar to task 3 than it may appear. Depending on your implementation and how much of the code is split into independent functions, some parts may work with very little (if any) modification. Remember to check your edge cases!




Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!