Last active
September 18, 2018 11:22
-
-
Save dodadoa/0450a0a62e3ce64da8f58ab95b10f036 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (defn build-new-ds [result ds] | |
| (if (empty? ds) | |
| result | |
| (let [province (get (first ds) :province) | |
| amphoe (get (first ds) :amphoe) | |
| district (get (first ds) :district)] | |
| (if (contains? result province) | |
| (recur | |
| (assoc result province | |
| (assoc (province result) amphoe | |
| (vec (conj (amphoe (province result)) district)))) | |
| (next ds)) | |
| (recur | |
| (assoc result province { amphoe [district]}) | |
| (next ds)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment