Beta

Word statistics

Description:

Implement function word_stats that would count number of word occurrence in the given text.

  • return hash where every key is a word
  • words are lower case and value is a number
  • hash must be sorted in the lexical order.

Word has the common meaning. In "The cat is hungry!", the last word is "hungry", not "hungry!" .

Example:

text = "Blow my body blow, the 4 wings in the snow."
word_stats(text) # => {"4"=>1, "blow"=>2, "body"=>1, "in"=>1, "my"=>1, "snow"=>1, "the"=>2, "wings"=>1}
Statistics
Fundamentals

Stats:

CreatedSep 6, 2014
PublishedSep 6, 2014
Warriors Trained581
Total Skips81
Total Code Submissions1235
Total Times Completed251
Ruby Completions251
Total Stars6
% of votes with a positive feedback rating87% of 58
Total "Very Satisfied" Votes48
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes5
Total Rank Assessments65
Average Assessed Rank
7 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • greyblake Avatar
  • cliffstamp Avatar
Ad