changed indent method according to ghc standard
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module CSVParser (
|
||||
parseCSV
|
||||
)where
|
||||
)where
|
||||
|
||||
import Text.ParserCombinators.Parsec
|
||||
|
||||
|
||||
10
DataModel.hs
10
DataModel.hs
@@ -17,14 +17,18 @@ instance Show Item where
|
||||
data ItemSet = ItemSet (Set Item) deriving (Eq, Ord)
|
||||
|
||||
instance Show ItemSet where
|
||||
show (ItemSet x) = foldr ((\y old -> y ++ " " ++ old).show) "" (Set.toList x)
|
||||
show (ItemSet x) =
|
||||
foldr ((\y old -> y ++ " " ++ old).show) "" (Set.toList x)
|
||||
|
||||
instance Freq ItemSet where
|
||||
frequency table (ItemSet set) = setCount / fromIntegral (length table) where
|
||||
frequency table (ItemSet set) =
|
||||
setCount / fromIntegral (length table) where
|
||||
setCount = fromIntegral $ count table (ItemSet set)
|
||||
|
||||
count :: [ItemSet] -> ItemSet -> Count
|
||||
count table (ItemSet set) = length (filter (\(ItemSet row) -> set `Set.isSubsetOf` row) table)
|
||||
count table (ItemSet set) =
|
||||
length (filter isSuperSet table) where
|
||||
isSuperset (ItemSet row) = set `Set.isSubsetOf` row
|
||||
|
||||
data Rule = Rule ItemSet ItemSet deriving (Eq)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module FrequentPatterns (
|
||||
frequentPatterns
|
||||
) where
|
||||
) where
|
||||
import DataModel
|
||||
import qualified Data.Set as Set
|
||||
import Debug.Trace (traceShow)
|
||||
|
||||
Reference in New Issue
Block a user