Copyright | © 2016 Brady Ouren |
---|---|
License | MIT |
Maintainer | Brady Ouren <brady@andand.co> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
pluralization and singularization transformations
- pluralize :: Text -> Text
- pluralizeWith :: [Inflection] -> Text -> Text
- singularize :: Text -> Text
- singularizeWith :: [Inflection] -> Text -> Text
- makeMatchMapping :: [(RegexPattern, RegexReplace)] -> [Inflection]
- makeIrregularMapping :: [(Singular, Plural)] -> [Inflection]
- makeUncountableMapping :: [Text] -> [Inflection]
Documentation
pluralizeWith :: [Inflection] -> Text -> Text Source #
pluralize a word given a custom mapping.
Build the [Inflection] with a combination of
makeUncountableMapping
makeIrregularMapping
makeMatchMapping
singularize :: Text -> Text Source #
singularize a word given a default mapping
singularizeWith :: [Inflection] -> Text -> Text Source #
singularize a word given a custom mapping.
Build the [Inflection] with a combination of
makeUncountableMapping
makeIrregularMapping
makeMatchMapping
makeMatchMapping :: [(RegexPattern, RegexReplace)] -> [Inflection] Source #
Makes a simple list of mappings from singular to plural, e.g [("person", "people")]
the output of [Inflection] should be consumed by singularizeWith
or pluralizeWith
makeIrregularMapping :: [(Singular, Plural)] -> [Inflection] Source #
Makes a simple list of mappings from singular to plural, e.g [("person", "people")]
the output of [Inflection] should be consumed by singularizeWith
or pluralizeWith
makeUncountableMapping :: [Text] -> [Inflection] Source #
Makes a simple list of uncountables which don't have
singular plural versions, e.g ["fish", "money"]
the output of [Inflection] should be consumed by singularizeWith
or pluralizeWith