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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started