Is there any algorithm in c# to singularize - pluralize a word?


Question

Is there any algorithm in c# to singularize - pluralize a word (in english) or does exist a .net library to do this (may be also in different languages)?

1
102
1/31/2018 4:52:39 PM

Accepted Answer

You also have the System.Data.Entity.Design.PluralizationServices.PluralizationService.

UPDATE: Old answer deserves update. There's now also Humanizer: https://github.com/MehdiK/Humanizer

178
11/8/2014 5:09:29 AM

I can do it for Esperanto, with no special cases!

string plural(string noun) { return noun + "j"; }

For English, it would be useful to become familiar with the rules for Regular Plurals of Nouns, as well as Irregular Plurals of Nouns. There is a whole Wikipedia article on the English plural, which may have some helpful information too.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon