;; Create a word frequency map out of a large string s.
;; `s` is a long string containing a lot of words :)
(reduce #(assoc %1 %2 (inc (%1 %2 0)))
{}
(re-seq #"\w+" s))
; (This can also be done using the `frequencies` function.)
;; Create a word frequency map out of a large string s.
;; `s` is a long string containing a lot of words :)
(reduce #(assoc %1 %2 (inc (%1 %2 0)))
{}
(re-seq #"\w+" s))
; (This can also be done using the `frequencies` function.)
;; Create a word frequency map out of a large string s
;; `s` is a long string containing a lot of words :)
(reduce #(assoc %1 %2 (inc (%1 %2 0)))
{}
(re-seq #"\w+" s))
; (This can also be done using the `frequencies` function.)
;; Create a word frequency map out of a large string s
;; s is set to a large string with a lot of words
(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} (re-seq #"\w+" s))
;this can also be done using the (frequencies) function
;; Create a word frequency map out of a large string s
;; s is set to a large string with a lot of words
(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} (re-seq #"\w+" s))
Create a word frequency map out of a large string s
;;; s is set to a large string with a lot of words
(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} (re-seq #"\w+" s))