packages feed

wordchoice 0.1.0.1 → 0.1.0.2

raw patch · 3 files changed

+11/−3 lines, 3 filesdep +Glob

Dependencies added: Glob

Files

README.md view
@@ -6,7 +6,7 @@ The following will print the 10 most used words.  ```bash- $ wordchoice test/ulysses.txt -n10 -o distribution.html+ $ wordchoice test/ulysses.txt -n10  13609: the  8134: of  6550: and
src/Data/Text/WordCount/FileRead.hs view
@@ -6,10 +6,17 @@ import qualified Data.Text as T import qualified Data.Text.IO as TIO import qualified Data.ByteString.Lazy as BSL+import System.FilePath.Glob  eitherError = either (error . show) id --- | Process a file given its filename. Return text only, discarding superflouous material.+-- | Process files given a filename glob+globFile :: String -> IO T.Text+globFile str = do+    files <- glob str+    fmap T.concat . sequence $ fmap processFile files++-- | Process a file given a filename. Return text only, discarding superflouous material. processFile :: String -> IO T.Text processFile filepath = T.filter goodChar <$> case (extension . decodeString $ filepath) of     (Just "md") -> T.pack . writePlain def . filterCode . eitherError . readMarkdown def . T.unpack <$> TIO.readFile filepath
wordchoice.cabal view
@@ -1,5 +1,5 @@ name:                wordchoice-version:             0.1.0.1+version:             0.1.0.2 synopsis:            Get word counts and distributions description:         A command line tool to compute the word distribution from various types of document, converting to text with pandoc. homepage:            https://github.com/githubuser/wordchoice#readme@@ -25,6 +25,7 @@   build-depends:       base >= 4.7 && < 5                      , pandoc                      , containers+                     , Glob                      , text                      , optparse-applicative                      , Chart