irregular-plurals

WebJar for irregular-plurals

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

irregular-plurals
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

irregular-plurals
WebJar for irregular-plurals
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/irregular-plurals

Download irregular-plurals

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/irregular-plurals/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>irregular-plurals</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/irregular-plurals/
implementation 'org.webjars.npm:irregular-plurals:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/irregular-plurals/
implementation ("org.webjars.npm:irregular-plurals:2.0.0")
'org.webjars.npm:irregular-plurals:jar:2.0.0'
<dependency org="org.webjars.npm" name="irregular-plurals" rev="2.0.0">
  <artifact name="irregular-plurals" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='irregular-plurals', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "irregular-plurals" % "2.0.0"
[org.webjars.npm/irregular-plurals "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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'],

}
*/

Related

  • plur - Pluralize a word

Versions

Version
2.0.0
1.4.0