Untested fix of incExcSpeGen_sorted'

parent e5419936
......@@ -92,12 +92,14 @@ data Scored t = Scored { _scored_terms :: t
, _scored_speGen :: SpecificityGenericity
} deriving (Show)
incExcSpeGen_sorted' :: Ord t => Map (t,t) Int -> [Scored t]
incExcSpeGen_sorted' m = zipWith (\(i,t) (inc,spe) -> Scored t inc spe) (M.toList fi) scores
incExcSpeGen_sorted' :: (DAA.Elt t, Ord t) => Map (t,t) Int -> [Scored t]
incExcSpeGen_sorted' m = map (\(t,inc,spe) -> Scored t inc spe) scores
where
(ti,fi) = createIndices m
(is, ss) = incExcSpeGen $ cooc2mat ti m
scores = DAA.toList $ DAA.run $ DAA.zip (DAA.use is) (DAA.use ss)
scores = DAA.toList $ DAA.run $ DAA.zip3 (DAA.use ts) (DAA.use is) (DAA.use ss)
ts = DAA.fromList (DAA.arrayShape is) (snd <$> M.toAscList fi)
-- TODO fi should already be a Vector
incExcSpeGen_sorted :: Ord t => Map (t,t) Int -> ([(t,Double)],[(t,Double)])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment