|
пре 5 година | |
---|---|---|
.. | ||
index.js | пре 5 година | |
irregular-plurals.json | пре 5 година | |
license | пре 5 година | |
package.json | пре 5 година | |
readme.md | пре 5 година |
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.
$ npm install irregular-plurals
const irregularPlurals = require('irregular-plurals');
console.log(irregularPlurals.get('cactus'));
//=> 'cacti'
console.log(irregularPlurals);
/*
Map {
[addendum, 'addenda'],
[alga, 'algae'],
…
}
*/
MIT © Sindre Sorhus