Структура моего хэша
(def *document-hash* {"documentid" {:term-detail {"term1" tf1 ,"term2" tf2}})
Я хочу найти тф. Прямо сейчас у меня есть это. Есть ли лучший способ сделать это в ближайшем будущем?
;; Find tf
(defn find-tf [documentid term-number]
(if (nil? *document-hash* documentid)
0
(if (nil? (((*document-hash* documentid) :term-detail) term-number))
0
(((*document-hash* documentid) :term-detail) term-number))))