Created
September 26, 2012 14:59
-
-
Save jrosti/3788541 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
(defn get-val [ex-id term] | |
(if (not (contains? @inverted-index term)) | |
#{ex-id} | |
(clojure.set/union (get @inverted-index term) #{ex-id}))) | |
(defn insert-term [ex-id term] | |
(swap! @inverted-index assoc term (get-val ex-id term))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment