plurals / pluralize

Pluralize or singularize any word based on a count
MIT License
2.15k stars 184 forks source link

Singular of Hypnosis is Hypnosis #172

Open kobaj opened 3 years ago

kobaj commented 3 years ago
const pluralize = require('pluralize');
console.log(pluralize.singular("hypnosis")); // hypnosi
cirosantilli commented 2 years ago

Yes, everything that ends in -osis, -esis, -ose is broken. These are important greek suffixes, and appear widely in scientific nomemclature. Tuberculosis, basis, endosymbiose, electrophorese, apoptosis, etc.

One thing that is particularly bad is that in those cases, pluralize 1 vs 2 does not do the reverse operation:

> pluralize('tuberculosis', 1)
'tuberculosi'
> pluralize('tuberculosis', 2)
'tuberculoses'
> pluralize('tuberculoses', 2)
'tuberculoses'
> pluralize('tuberculoses', 1)
'tuberculose'
>

so we have tuberculosis 2 -> tuberculoses and tuberculoses 1 -> tuberculose.

"pluralize": "8.0.0".