From 04cc05c20fb8584f9285af1eed2062097d8f52fb Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 7 Feb 2017 16:11:51 -0500 Subject: [PATCH] Erase the feature vector from equal terms. --- src/Data/RandomWalkSimilarity.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/RandomWalkSimilarity.hs b/src/Data/RandomWalkSimilarity.hs index ec85e9128..60cef35f4 100644 --- a/src/Data/RandomWalkSimilarity.hs +++ b/src/Data/RandomWalkSimilarity.hs @@ -149,7 +149,7 @@ rws compare as bs -- Possibly replace terms in a diff. replaceIfEqual :: Term f (Record fields) -> Term f (Record fields) -> Maybe (Diff f (Record fields)) replaceIfEqual a b - | (category <$> a) == (category <$> b) = hylo wrap runCofree <$> zipTerms a b + | (category <$> a) == (category <$> b) = hylo wrap runCofree <$> zipTerms (eraseFeatureVector a) (eraseFeatureVector b) | otherwise = Nothing cost = iter (const 0) . (1 <$)