Advertisement
Guest User

Untitled

a guest
Mar 18th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (def sentences  
  2.   (->>  (-> (slurp "http://www.news.com")                         ; open url
  3.             (strip-html)                                          ; remove html
  4.             (str/split #"[.!?]"))                                 ; split by sentence
  5.        ; feed through LC, trim and split by word, resulting a vector
  6.        (map (comp #(str/split % #"\s+") str/trim str/lower-case))
  7.        (into #{})                                                 ; pack to hashmap
  8.        ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement