 
       (/ inner-prod (* mod1 mod2)))))
 
+(defn signature-similarity-weighted-cosine
+  "Expected signature:
+   XPath: frequency
+   weights-table:
+   [Xpath -> #of items globally, df globally]"
+  [sign1 sign2 weights-table]
+  (let [weighted-sign  (fn [sgn]
+                         (map
+                          (fn [[xpath count] sign1]
+                            [xpath (* count (weights-table xpath))])
+                          sgn))
+
+        weight-sign-1  (weighted-sign sign1)
+
+        weight-sign-2  (weighted-sign sign2)]
+    (signature-similarity-cosine weight-sign-1 weight-sign-2)))
+
 (defn page-signature
   [xpaths xpath-hrefs]
   (map

        (clojure.set/intersection set-sign1 set-sign2))
       (* (Math/sqrt (count set-sign1)) (Math/sqrt (count set-sign2))))))

(defn signature-similarity2
  [sign1 sign2]
  (let [sign1-map (into {} sign1)
        sign2-map (into {} sign2)]

    xpath-hrefs)))

(defn signature-similarity
  "Return cardinality of intersection"
  [sign1 sign2]
  (let [set-sign1 (set sign1)
        set-sign2 (set sign2)]
