Skip to content

Instantly share code, notes, and snippets.

@AnsonSmith
Last active August 29, 2015 14:13
Show Gist options
  • Save AnsonSmith/7e1df984a3ba5b8d6e49 to your computer and use it in GitHub Desktop.
Save AnsonSmith/7e1df984a3ba5b8d6e49 to your computer and use it in GitHub Desktop.
%%didn't put in all the words, but you get the gist
Words = "tools, Automation, Expertise, guidance, solutions, driven, quality, Collaborative, innovation, Passion, Expertise, innovation,collaborative, quality, Guidance, R&D, Scalable solutions, quality".
LoweredWords = [X || X<-[string:to_lower(Y)|| Y <- [Z|| Z <- string:tokens(Words,", \n")]]].
lists:reverse(lists:keysort(2,lists:usort([{A, length(lists:filter(fun(B)->B=:=A end,LoweredWords))}||A<-LoweredWords]))).
==outputs
[{"quality",3},
{"solutions",2},
{"innovation",2},
{"guidance",2},
{"expertise",2},
{"collaborative",2},
{"tools",1},
{"scalable",1},
{"r&d",1},
{"passion",1},
{"driven",1},
{"automation",1}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment