Created
September 26, 2020 04:06
-
-
Save nixin72/488cf64969ef7f41f66b79c43ee70e7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Challenge from a friend: | |
; | |
; - Read a file of text | |
; - determine the n most frequently used words | |
; - print out a sorted list of those words along with their frequencies) | |
(-> filename | |
(slurp) | |
(lower-case) | |
(clojure.string/replace #"\d" "") | |
(clojure.string/split #" ") | |
(frequencies) | |
(#(sort-by second > %))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment