1
0
mirror of https://github.com/thangisme/notes.git synced 2024-10-31 20:17:30 -04:00
notes/node_modules/irregular-plurals
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
irregular-plurals.json Initial commit 2017-03-09 13:16:08 -05:00
license Initial commit 2017-03-09 13:16:08 -05:00
package.json Initial commit 2017-03-09 13:16:08 -05:00
readme.md Initial commit 2017-03-09 13:16:08 -05:00

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',
        ...
    }
*/
  • plur - Pluralize a word

License

MIT © Sindre Sorhus