codeql-action/node_modules/irregular-plurals
github-actions[bot] 0da815296a Update checked-in dependencies 2022-02-24 17:03:29 +00:00
..
index.d.ts replace jest with ava 2020-05-13 11:13:27 +01:00
index.js replace jest with ava 2020-05-13 11:13:27 +01:00
irregular-plurals.json Upgrade Ava to v4 2022-02-01 18:56:42 +00:00
license replace jest with ava 2020-05-13 11:13:27 +01:00
package.json Update checked-in dependencies 2022-02-24 17:03:29 +00:00
readme.md Upgrade Ava to v4 2022-02-01 18:56:42 +00:00

readme.md

irregular-plurals

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 consonant, 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 anywhere.

Install

$ npm install irregular-plurals

Usage

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

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

console.log(irregularPlurals);
/*
Map {
	[addendum, 'addenda'],
	[alga, 'algae'],
}
*/
  • plur - Pluralize a word