Map of nouns to their irregular plural form
JavaScript
Pull request Compare This branch is even with sindresorhus:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.travis.yml
irregular-plurals.json
license
package.json
readme.md
test.js

readme.md

irregular-plurals Build Status

Map of nouns to their irregular plural form

An irregular plural in this library is defined as a noun that cannot be made plural by applying these rules:

  • If the noun ends in an "s", "x", "z", "ch" or "sh", add "es"
  • If the noun ends in a "y" and is preceded by a consonent, drop the "y" and add "ies"
  • If the noun ends in a "y" and is preceded by a vowel, add "s"

The list is just a JSON file and can be used wherever.

Install

$ npm install --save irregular-plurals

Usage

const irregularPlurals = require('irregular-plurals');

console.log(irregularPlurals['cactus']);
//=> 'cacti'

console.log(irregularPlurals);
/*
    {
        addendum: 'addenda',
        alga: 'algae',
        ...
    }
*/

Related

  • plur - Pluralize a word

License

MIT © Sindre Sorhus