Created
March 27, 2011 05:13
-
-
Save brehaut/888932 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
(->> (re-seq #"(?i)(\d+)\.|(yes|no)" "no1. asdf\n\nasdf foo yes2.\n\nfsdf\nno yes no") | |
(map rest) | |
(partition-by first) | |
(drop-while (comp nil? ffirst)) | |
(partition 2) | |
(map (fn [s] (let [[i & r] (keep identity (flatten s))] | |
[(Integer/parseInt i) | |
(-> (last r) .toLowerCase first (= \y))]))) | |
(into {})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment