wordchoice 0.1.2.1 → 0.1.2.2
raw patch · 5 files changed
+24/−27 lines, 5 filesdep ~pandocPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: pandoc
API changes (from Hackage documentation)
Files
- README.md +2/−14
- bench/Bench.hs +9/−8
- src/Data/Text/WordCount.hs +1/−3
- stack.yaml +7/−0
- wordchoice.cabal +5/−2
README.md view
@@ -28,19 +28,7 @@ ## Installation -### Manual+### Binary Release -Download the binaries from the [release-page](https://github.com/vmchale/wordchoice/releases) for 64-bit Linux, ARM-Linux, and 64-bit Windows. -### Stack--Install stack, following instructions -[here](https://docs.haskellstack.org/en/stable/README/). Then:--```bash- $ stack install wordchoice-```--You might need to do a `stack setup` first. +### Cabal
bench/Bench.hs view
@@ -1,16 +1,17 @@ module Main where -import Criterion.Main-import Data.Text.WordCount+import Criterion.Main+import Data.Text.Lazy (fromStrict)+import Data.Text.WordCount+import Text.Pandoc main = do defaultMain [ env ulysses $ \file -> bgroup "ulysses all"- [ bench "226" $ whnf (fun 10000000) file ]+ [ bench "226" $ nf (fun 10000000) file ] , env beowulf $ \file -> bgroup "beowulf all"- [ bench "226" $ whnf (fun 10000000) file ] ]- where fun = topN- ulysses = processFile "test/ulysses.txt"- beowulf = processFile "test/beowulf.txt"-+ [ bench "226" $ nf (fun 10000000) file ] ]+ where fun n = topN n . fromStrict+ ulysses = runIOorExplode $ processFile "test/ulysses.txt"+ beowulf = runIOorExplode $ processFile "test/beowulf.txt"
src/Data/Text/WordCount.hs view
@@ -62,9 +62,7 @@ common = flip elem ["the","and","a","an","or","not","but","on","so","if","in","that","this","for"] displayWords :: [(Int,TL.Text)] -> T.Text-displayWords [] = ""-displayWords (pair:pairs) = display pair <> "\n" <> displayWords pairs- where display (n,str) = (T.pack . show) n <> ": " <> TL.toStrict str+displayWords = mconcat . fmap (\(i, str) -> (T.pack . show) i <> ": " <> TL.toStrict str <> "\n") buildFreq :: TL.Text -> M.Map TL.Text Int buildFreq = count . filter (/=" ") . TL.split (`elem` (" \n;:,./" :: String)) . TL.map toLower
stack.yaml view
@@ -2,7 +2,14 @@ packages: - '.' extra-deps:+- cmark-gfm-0.1.3 - composition-prelude-0.1.1.0+- pandoc-2.0+- hslua-0.9.2+- doctemplates-0.2.1+- check-gfm-0.1.3+- pandoc-types-1.17.2+- skylighting-0.4.2 flags: wordchoice: llvm-fast: true
wordchoice.cabal view
@@ -1,5 +1,5 @@ name: wordchoice-version: 0.1.2.1+version: 0.1.2.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@@ -47,7 +47,8 @@ executable wrd hs-source-dirs: app main-is: Main.hs- ghc-options: -threaded -rtsopts -with-rtsopts=-N+ -- ghc-options: + -- -threaded -rtsopts -with-rtsopts=-N build-depends: base , wordchoice default-language: Haskell2010@@ -67,7 +68,9 @@ main-is: Bench.hs build-depends: base , criterion+ , text , wordchoice+ , pandoc ghc-options: -threaded -rtsopts -with-rtsopts=-N -O3 default-language: Haskell2010