wordchoice-0.1.0.4: Get word counts and distributions

Safe HaskellNone
LanguageHaskell2010

Data.Text.WordCount

Contents

Synopsis

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.

globFile :: [String] -> IO Text Source #

Process files given a filename glob

Low level-ish