                      :description description}))
 
 (defn add-new-word-into-dictionary
+    "Add new word into the dictionary. If the word already exist, it is 
+     simply updated (make sense only for blacklist)."
     ([word user-name dictionary-type]
     (let [datetime (format-date/format-current-date)]
         (println "storing" datetime word)

                        (println e))))))))

(defn set-word-status
    [word dictionary-type status]
    (try
        (jdbc/update! db-spec/zg-db
                      :dictionary {:deleted (status->int status)} ["word = ? and dictionary = ?" word (dictionary-type->char dictionary-type)])
        (catch Exception e
            (println e)
            [])))

(require '[zg.format-date :as format-date])

(defn status->int
    "Convert word status (:deleted, :undeleted) into an integer."
    [status]
    (if (= status :deleted)
        1
        0))

(defn dictionary-type->char
    "Convert dictionary type (:whitelist, :blacklist) into an integer."
    [dictionary-type]
    (condp = dictionary-type
        :whitelist "w"
