Learn R Programming

SemNetCleaner (version 1.1.1)

pluralize: Converts Words to their Plural Form

Description

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 does not handle special cases, so particular care is necessary.

Usage

pluralize(word)

Arguments

word

A word

Value

Returns the word in singular form

Examples

Run this code
# NOT RUN {
# 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")

# }

Run the code above in your browser using DataLab