parse.clj 558 Bytes
Newer Older
1 2 3 4 5 6 7

(def male "Man, Boy, Father, Male, Grandpa, Husband, Son, Uncle")
(def female "Girl, Female, Aunt, Daughter, Wife, Woman, Mother, Grandma")
(def art "Philosophy, Humanities, Arts, Literature, English, Music, History")
(def science "Science, Physics, Chemistry, Math, Geology, Astronomy, Engineering")

(defn parse 
Xiaoying Pu's avatar
Xiaoying Pu committed
8
  [s]
9
  (let 
Xiaoying Pu's avatar
Xiaoying Pu committed
10
      [splited (clojure.string/split s #", ")]
11 12 13 14
    (apply str (interpose 
                "|" 
                (for [token splited]
                  (str "2*" token))))))
Xiaoying Pu's avatar
Xiaoying Pu committed
15 16 17 18

(defn get-list
  [s]
  (clojure.string/split s #", "))