Skip to content

Commit

Permalink
transforming text into CV grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizec committed Jun 19, 2011
1 parent d0c3d29 commit 5205379
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions syllabification/run.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

(ns syllabification
(:require [clojure.string :as str]))

(def text "this is a sample text")

(defn transform [text]
(map #(if (= %1 " ") " "
(if (re-matches #"[aeiou]" %1) "V" "C"))
(str/split text #"")))

(println (transform text))

0 comments on commit 5205379

Please sign in to comment.