(require 'clojure.contrib.seq-utils)
(defn word-count [s]
(frequencies (re-seq #"[a-zA-ZöäüÖÄÜß]+" s)))
(word-count "foo bar baz quux quux foo")
; {"quux" 2, "baz" 1, "bar" 1, "foo" 2}
Matt
On Mar 25, 4:09 pm, jfr <[email protected]> wrote:
> Thanks I will take a look at it .Neverless, the idea was to write my
> own code ;-)
>
> > You can also use "frequencies" from c.c.seq-utils (http://
> > richhickey.github.com/clojure-contrib/seq-api.html#clojure.contrib.seq/
> > frequencies)
>
> > HTH,
> > --
> > Miki
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe from this group, send email to
clojure+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.