Created
November 23, 2012 07:47
-
-
Save yedi/4134413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rhyme-finder.core> (def poem-line (nth (get-poem "poems/test.txt") 2)) | |
#'rhyme-finder.core/poem-line | |
rhyme-finder.core> (clojure.string/split poem-line #"\s") | |
["It" "is" "not" "quite" "the" "best"] | |
rhyme-finder.core> (map test-prons (clojure.string/split poem-line #"\s")) | |
(nil ["" "ih" "z"] ["" "n" "aa" "t"] ["" "k" "w" "ay" "t"] ["" "dh" "ah"] ["" "b" "eh" "s" "t"]) | |
rhyme-finder.core> poem-line | |
"It is not quite the best" | |
rhyme-finder.core> (test-prons "it") | |
["" "ih" "t"] | |
rhyme-finder.core> (concat (map test-prons (clojure.string/split poem-line #"\s"))) | |
(nil ["" "ih" "z"] ["" "n" "aa" "t"] ["" "k" "w" "ay" "t"] ["" "dh" "ah"] ["" "b" "eh" "s" "t"]) | |
rhyme-finder.core> test-prons | |
{"outperforms" ["" "aw" "t" "p" "er" "f" "ao" "r" "m" "z"], "fest" ["" "f" "eh" "s" "t"], "a" ["" "ah"], "but" ["" "b" "ah" "t"], "behest" ["" "b" "ih" "hh" "eh" "s" "t"], "best" ["" "b" "eh" "s" "t"], "for" ["" "f" "ao" "r"], "is" ["" "ih" "z"], "it" ["" "ih" "t"], "my" ["" "m" "ay"], "enough" ["" "ih" "n" "ah" "f"], "the" ["" "dh" "ah"], "test" ["" "t" "eh" "s" "t"], "at" ["" "ae" "t"], "not" ["" "n" "aa" "t"], "rest" ["" "r" "eh" "s" "t"], "quite" ["" "k" "w" "ay" "t"], "this" ["" "dh" "ih" "s"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment