Last active
September 6, 2015 06:32
-
-
Save uggds/7bd5ab310ce4eac666ad 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
(defn indexable-word? [word] | |
(> (count word) 2)) | |
(require '[clojure.string :as str]) | |
(filter indexable-word? (str/split "A fine day it is" #"¥W+")) | |
-> ("fine" "day") | |
(filter (fn [w] (> (count w) 2)) (str/split "A fine day is it" #"\W+")) | |
-> ("fine" "day") | |
(filter #(> (count %) 2) (str/split "A fine day is it" #"\W+")) | |
-> ("fine" "day") | |
(defn indexable-words [text] | |
(let [indexable-word? (fn [w] (> (count w) 2))] | |
(filter indexable-word? (str/split text #"¥W+")))) | |
(indexable-words "A fine day it is") | |
-> ("fine" "day") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment