Safe Haskell | None |
---|---|
Language | Haskell2010 |
- topN :: Int -> Text -> [(Int, Text)]
- displayWords :: [(Int, Text)] -> Text
- filterTop :: Int -> (Text -> Bool) -> Text -> [(Int, Text)]
- small :: Text -> Bool
- common :: Text -> Bool
- makeFile :: [(Int, Text)] -> FilePath -> IO ()
- makeDistribution :: BarsPlotValue a => [(a, Text)] -> StateT (Layout PlotIndex a) (State CState) ()
- processFile :: String -> IO Text
- globFile :: String -> IO Text
- buildFreq :: Text -> Map Text Int
- indexed :: Text -> IntMap [Text]
Documentation
topN :: Int -> Text -> [(Int, Text)] Source #
Return top n words and their frequencies
>>> topN 2 "hello hello goodbye it is time is it why why why it it" [(4,"it"),(3,"why")]
filterTop :: Int -> (Text -> Bool) -> Text -> [(Int, Text)] Source #
Return the top n words, with some filter applied.
Filters
For making graphs
makeFile :: [(Int, Text)] -> FilePath -> IO () Source #
Make a bar graph from the word frequencies
makeFile :: IO () makeFile [(4,"it"),(3,"why")] "out.html"
makeDistribution :: BarsPlotValue a => [(a, Text)] -> StateT (Layout PlotIndex a) (State CState) () Source #
File processing with pandoc
processFile :: String -> IO Text Source #
Process a file given a filename. Return text only, discarding superflouous material.