lda-0.0.1: NLP/LDA/Utils.hs
module NLP.LDA.Utils
( count
)
where
import qualified Data.IntMap as IntMap
count :: Int -> IntMap.IntMap Double -> Double
count z t = case IntMap.findWithDefault 0 z t of
n | n < 0 -> error "NLP.LDA.Utils.count: negative count"
n -> n
{-# INLINE count #-}