countable-inflections alternatives and similar packages
Based on the "Text" category.
Alternatively, view countable-inflections alternatives based on common mentions on social networks and blogs.
-
pandoc-citeproc
Library and executable for using citeproc with pandoc -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
texmath
A Haskell library for converting LaTeX math to MathML. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
prettyprinter
A modern, extensible and well-documented prettyprinter. -
pandoc-types
types for representing structured documents -
arx
Bundles code and a job to run for local or remote execution. -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
text-offset
Emits code crossreference data for Haskell sources. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
pretty-show
Tools for working with derived Show instances in Haskell. -
servant-checked-exceptions
type-level errors for Servant APIs. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
hyphenation
Knuth-Liang Hyphenation for Haskell based on TeX hyphenation files
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of countable-inflections or a related project?
README
Countable Inflections
This library implements pluralization and singularization in a similar way to the rails inflectors
It uses regexes to define the non-standard transformations and therefore doesn't provide much safety. If you need to provide the same pluralization and singularization which rails does out of the box, this will work the same. If you want more you should be using inflections-hs which uses megaparsec to give you more guarantees
Usage
λ: pluralize "person"
"people"
λ: singularize "branches"
"branch"
These can also be given custom inflection matchers
λ: :t singularizeWith
[Inflection] -> Text -> Text
There are 3 different types of transformations:
Match
Takes a PCRE regex and a replacement string.
λ: :t makeMatchMapping
[(RegexPattern, RegexReplace)] -> [Inflection]
λ: let mapping = makeMatchMapping [("(octop)us", "\\1i")]
λ: pluralizeWith mapping "octopus"
"octopi"
Irregular
From singular to plural with no greater pattern.
λ: :t makeIrregularMapping
[(Singular, Plural)] -> [Inflection]
λ: let mapping = makeIrregularMapping [("zombie","zombies")]
λ: pluralizeWith mapping "zombie"
"zombies"
Uncountable
Doesn't have a mapping, word stays the same) so it has the type:
[Text] -> [Inflection]
Inflect
In general you can input a number and singularize or pluralize based on the count, for example:
setReport = do
sets <- getSets
n <- length sets
print $ show n ++ " " ++ inflect "sets" n
This way it'll list as "1 set" or "5 sets" based on the input.
License
MIT - see [the LICENSE file](LICENSE.md).
*Note that all licence references and agreements mentioned in the countable-inflections README section above
are relevant to that project's source code only.