english-plurals
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

English plurals

Features

Agreement of English words (singular / plural), based on a few rules and on linguistic resources.

You have to import and provide independently linguistic resources: use english-plurals-list. If you do not provide linguistic resources, very basic rules will be used: adding s or es mainly.

Also see pluralize-me that does the same thing with another approach (almost no resources, more rules, and allows plural to singular transformation).

Usage

getPlural returns the plural of a singular word, based on:

  • a list of exception elements where singular is the key and having a plural property: in general leave null
  • a list of irregular plurals: use english-plurals-list
  • the singular word

Installation

npm install english-plurals

Usage

const EnglishPlurals = require('english-plurals');
const Irregular = require('english-plurals-list/dist/plurals.json');

// women
console.log(EnglishPlurals.getPlural(Irregular, 'woman'));

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i english-plurals

    Weekly Downloads

    203

    Version

    3.3.0

    License

    Apache-2.0

    Unpacked Size

    17.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • ludan.stoeckle