packages feed

countable-inflections 0.3.0 → 0.3.2

raw patch · 5 files changed

+16/−3 lines, 5 filesnew-uploaderPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+## 0.3.2++* Fix double pluralization (e.g. `pluralize "people"` now returns `"people"` instead of `"peoples"`)+* Widen base upper bound to < 5+ ## 0.3.0  * Bumped lts from 8.0 to 10.8
README.md view
@@ -3,7 +3,7 @@ [![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) [![Hackage](https://img.shields.io/hackage/v/countable-inflections.svg)](http://hackage.haskell.org/package/countable-inflections) [![Stackage LTS](http://stackage.org/package/countable-inflections/badge/lts)](http://stackage.org/lts/package/countable-inflections)-[![Build Status](https://circleci.com/gh/tippenein/countable-inflections.svg?style=shield&circle-token=whatever)](https://circleci.com/gh/tippenein/countable-inflections)+  This library implements pluralization and singularization in a similar way to the [rails inflectors](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html) 
Text/Countable.hs view
@@ -49,7 +49,7 @@ pluralize :: Text -> Text pluralize = pluralizeWith mapping   where-    mapping = defaultIrregulars ++ defaultUncountables ++ defaultPlurals+    mapping = defaultUncountables ++ defaultPlurals ++ irregularPluralsAsUncountables ++ defaultIrregulars  -- | singularize a word given a default mapping singularize :: Text -> Text@@ -149,3 +149,8 @@ headMaybe :: [a] -> Maybe a headMaybe [] = Nothing headMaybe (x:_) = Just x++-- Treat irregular plurals as uncountables to avoid double pluralization+irregularPluralsAsUncountables :: [Inflection]+irregularPluralsAsUncountables =+  makeUncountableMapping (map snd defaultIrregulars')
countable-inflections.cabal view
@@ -1,5 +1,5 @@ name:                countable-inflections-version:             0.3.0+version:             0.3.2 synopsis:            Countable Text Inflections description:   Provides methods for singularizing and pluralizing text.
test/Text/CountableSpec.hs view
@@ -46,6 +46,9 @@       pluralize "ox" `shouldBe` "oxen"       pluralize "vertex" `shouldBe` "vertices" +    it "can doesn't pluralize plurals a second time" $+      pluralize "people" `shouldBe` "people"+   describe "singularize" $ do     it "singularizes regex cases" $ do       singularize "mice" `shouldBe` "mouse"