Description Usage Arguments Value Author(s) Examples
A function to change words to their plural form. The rules for converting words to their plural forms are based on the grammar rules found here: https://www.grammarly.com/blog/plural-nouns/. This function handles most special cases and some irregular cases (see examples) but caution is necessary. If no plural form is identified, then the original word is returned.
1 | pluralize(word)
|
word |
A word |
Returns the word in singular form, unless a plural form could not be found (then the original word is returned)
Alexander Christensen <alexpaulchristensen@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Handles any prototypical cases
"dogs"
pluralize("dog")
"foxes"
pluralize("fox")
"wolves"
pluralize("wolf")
"octopi"
pluralize("octopus")
"taxa"
pluralize("taxon")
# And most special cases:
"wives"
pluralize("wife")
"roofs"
pluralize("roof")
"photos"
pluralize("photo")
# And some irregular cases:
"children"
pluralize("child")
"teeth"
pluralize("tooth")
"mice"
pluralize("mouse")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.