Last active
December 20, 2015 07:49
-
-
Save fbernier/6095820 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
(ns phrase | |
(:require [clojure.string :as str])) | |
(defn- strip-punctuation [phrase] | |
(str/replace phrase #"[^\w\s]" "") | |
) | |
(defn word-count [phrase] | |
(frequencies (str/split(str/lower-case (strip-punctuation phrase)) #"\s+")) | |
) |
Author
fbernier
commented
Jul 27, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment