On Sep 2, 7:02 pm, tmountain tinymount...@gmail.com wrote:
(defn generate-chain [source]
(loop [the-list (map #(list (first (split-at 2 %)) (last %))
(partition 3 1 (.split (.replace source \n
) )))
res (hash-map)]
(if (empty? the-list)
res
I had a suspicion that something similar to this might be happening.
As I said in the first message, including a doall on the filters
prevented the issue from happening. I will relay this info back to my
friend. Thanks for the help.
On Sep 3, 12:04 am, John Harrop jharrop...@gmail.com wrote:
On
The function returns a map with the keys being word pairs and the
value being a single word. It is a component of a larger program.
user= (generate-chain a quick brown fox jumps over the lazy dog)
{(the lazy) (dog), (over the) (lazy), (jumps over)
(the), (fox jumps) (over), (brown fox) (jumps),
On Wed, Sep 2, 2009 at 1:02 PM, tmountain tinymount...@gmail.com wrote:
Hi all - I've recently encouraged a friend to start learning Clojure,
and he has written some basic Markov chaining code as a learning
exercise. His code works fine with small sets of input data, but
larger inputs have