Skip to content

Instantly share code, notes, and snippets.

View ereteog's full-sized avatar

Guillaume Erétéo ereteog

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ereteog on github.
  • I am guigui (https://keybase.io/guigui) on keybase.
  • I have a public key ASCWwiBhYfOID1as0GQZl2Iq6EsSQVd_cugrCaJxBEWt3go

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ereteog on github.
  • I am guigui (https://keybase.io/guigui) on keybase.
  • I have a public key whose fingerprint is F32C D1EC 5AC1 E76E A9F5 E19D 2AB4 EFEB C763 89B9

To claim this, I am signing this object:

(ns markov.core)
(defn transform
[words]
(->> words
(partition 2 1)
(reduce (fn [acc [w next-w]]
(update-in acc
[w next-w]
(fnil inc 0)))