Skip to content

Instantly share code, notes, and snippets.

@rsuniev
Created May 9, 2010 12:26
Show Gist options
  • Save rsuniev/395126 to your computer and use it in GitHub Desktop.
Save rsuniev/395126 to your computer and use it in GitHub Desktop.
(ns test.dialect
(:require [clojure.contrib.string :as st]))
(defn pig-latinize [word]
(let [fs (str (first word))]
(str
(if (re-seq #"(?i)[aeiou]" fs)
word
(str (subs word 1) fs))
"ay")))
(defn pls [sentence]
(st/join " " (map pig-latinize (re-seq #"\w+" sentence))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment