#Word count problem in Ruby
Sort and print occurrence of words from a text file in descending order
Input from : Read from wordfile.txt file
Output at : Store in output.txt file
- read_each_line_from :- to read the input from a file
- take_words_from_line :- take each line from input file and remove punctuations
- update_hash_with_words :- update hash with key as word and value as it count
- remove_common_words :- remove all the words in common-words.txt file
- Read from input text file line by line
- remove all the punctuations from the line and split each words to form an array
- iterate through this array and check if the hash table have the key with words in array
- if word is present in hash table, then increment the count of it by 1
- If word is not present in hash table, then add the word to hash and assign its count = 1
- read from the common_words.txt file and check if those words are present as key of the hash
- If common_words is present in hash, then remove it
- Sort the hash based on the occurance of the word
- Store the filtered hash to output.txt file