Here’s an example of how to use the .NET PluralizationServices library. I usually work with numbers but sometimes I have to work on natural language processing (NLP) projects. A basic NLP task is converting a plural form of a word (such as “processes” or “mice”) to the singular form (“process”, “mouse”), or vice versa.
It’s a surprisingly difficult task if you try to code from scratch. But the .NET Framework 4.5 introduced a PluralizationServices library that’s very handy. The demo code:
using System;
// add reference to System.Data.Entity.Design
using System.Data.Entity.Design.PluralizationServices;
// visible by default
using System.Globalization;
namespace SingularAndPlural
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("\nBegin singular and plural words demo");
Console.WriteLine("Example of .NET PluralizationServices\n");
CultureInfo ci = new CultureInfo("en-us");
PluralizationService ps =
PluralizationService.CreateService(ci);
string word = "die";
if (ps.IsSingular(word) == true)
{
Console.WriteLine("The word " + word + " is singluar");
string plural = ps.Pluralize(word);
Console.WriteLine("The plural form is " + plural);
}
Console.WriteLine("\nModifying the service");
((ICustomPluralizationMapping)ps).AddWord("die", "dice");
string pluralAlt = ps.Pluralize(word);
Console.WriteLine("\nNow the plural form is " + pluralAlt);
Console.WriteLine("\nEnd demo\n");
Console.ReadLine();
} // Main
} // Program
} // ns
The code should be pretty self-explanatory. The demo converts the singular word “die” to its two plural forms, the default “dies” and an alternative “dice” using methods IsSingular and Pluralize. The service also has methods IsPlural and Singularize.

.NET Test Automation Recipes
Software Testing
SciPy Programming Succinctly
Keras Succinctly
R Programming
2026 Visual Studio Live
2025 Summer MLADS Conference
2026 DevIntersection Conference
2025 Machine Learning Week
2025 Ai4 Conference
2026 G2E Conference
2026 iSC West Conference
You must be logged in to post a comment.