Safe Haskell | None |
---|---|
Language | Haskell2010 |
- topN :: Int -> Text -> [(Int, Text)]
- displayWords :: [(Int, Text)] -> Text
- makeFile :: BarsPlotValue a => [(a, Text)] -> FilePath -> IO ()
- makeDistribution :: BarsPlotValue a => [(a, Text)] -> EC (Layout PlotIndex a) ()
- processFile :: String -> IO Text
- globFile :: [String] -> IO Text
- buildFreq :: Text -> Map Text Int
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")]
For making graphs
makeFile :: BarsPlotValue a => [(a, 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)] -> EC (Layout PlotIndex a) () Source #
Make a plot from values
File processing with pandoc
processFile :: String -> IO Text Source #
Process a file given a filename. Return text only, discarding superflouous material.