Question: Ruby Programming - Finding unique words in two separate files+ program #6: Go to http://www.textfiles.com/stories/ and check that this site 1 hosts multiple stories while
Ruby Programming - Finding unique words in two separate files+
program #6: Go to http://www.textfiles.com/stories/ and check that this site 1 hosts
multiple stories while each story is in a textfile. Download two textfiles of your choice, which have atleast
400 words, and save the files as storyA.txt and storyB.txt. Your program needs to read these files and
processes them to collect some statistics. In particular, for each story x report the the number of unique
words in x, the third-most frequent word in x and its frequency. Also, your program needs to report the number of unique words that are present in both the files. Hints: A template code is given to you. We use
Array and Hash data structures as they are available in Ruby. You may design a regular expression to define
a word.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
