Word count engine

Implement a document scanning engine that receives a text document doc and returns a list of all unique words in it and their number of occurrences, sorted by the number of occurrences in descending order.

The engine should ignore punctuation and white-spaces.

example:

wordCountEngine('practice makes perfect. get perfect by practice. just practice!');
// [[practice, 3], [perfect, 2], [make, 1], [get, 1], [by, 1], [just, 1]]


Share Comments