Pluralize.Core 2.0.4

dotnet add package Pluralize.Core --version 2.0.4                
NuGet\Install-Package Pluralize.Core -Version 2.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pluralize.Core" Version="2.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pluralize.Core --version 2.0.4                
#r "nuget: Pluralize.Core, 2.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pluralize.Core as a Cake Addin
#addin nuget:?package=Pluralize.Core&version=2.0.4

// Install Pluralize.Core as a Cake Tool
#tool nuget:?package=Pluralize.Core&version=2.0.4                

Pluralize Core

This is an updated package from Pluralize.NET so it can now be used for Net Core.

What is Pluralize.Core?

(Originally) Pluralize.NET is a small C# library to pluralize and singularize English words.

How to use it?

Package manage console:

PM> Install-Package Pluralize.Core

Dotnet cli:

dotnet add package Pluralize.Core

Include the namespace:

using Pluralize.Core;

write the code:

IPluralize pluralizer = new Pluralizer();

pluralizer.Singularize("Horses");  //=> "Horse"
pluralizer.Pluralize("Horse");  //=> "Horses"

// Example of new plural rule:
pluralizer.Pluralize("regex"); //=> "regexes"
pluralizer.AddPluralRule(new Regex("gex$"), "gexii");
pluralizer.Pluralize("regex"); //=> "regexii"

// Example of new singular rule:
pluralizer.Singularize('singles'); //=> "single"
pluralizer.AddSingularRule(new Regex("singles"), 'singular');
pluralizer.Singularize('singles'); //=> "singular"

// Example of new irregular rule, e.g. "I" -> "we":
pluralizer.Pluralize('irregular'); //=> "irregulars"
pluralizer.AddIrregularRule('irregular', 'regular');
pluralizer.Pluralize('irregular'); //=> "regular"

// Example of uncountable rule (rules without singular/plural in context):
pluralizer.Pluralize('paper'); //=> "papers"
pluralizer.AddUncountableRule('paper');
pluralizer.Pluralize('paper'); //=> "paper"

// Example of asking whether a word looks singular or plural:
pluralizer.IsPlural('test'); //=> false
pluralizer.IsSingular('test'); //=> true

// Example of formatting a word based on count
pluralizer.Format(5, "dog"); // => "dogs"
pluralizer.Format(5, "dog", inclusive: true); // => "5 dogs"

Supported .Net Versions

  • .Net Core 6.0
  • .Net Core 7.0
  • .Net Core 8.0

The library may work for other .Net versions, but as it is not maintained by the original author, I cannot ensure its compatibility with every version. Working with .Net 6, 7, and 8. If you found a compatibility problem, I appreciate creating an issue in this repo.

License

Original license MIT.

Contributors ✨

<img src="https://avatars.githubusercontent.com/u/5386817?v=4" width="150" /> <img src="https://avatars.githubusercontent.com/u/2773690?v=4){width=150px" width="150" /> <img src="https://avatars.githubusercontent.com/u/14143311?v=4){width=150px" width="150" /> <img src="https://avatars.githubusercontent.com/u/6270283?v=4" width="150" />
Ashraf Sada Daniel Destouche Sarath Kumar CM Dennis Pražák
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Pluralize.Core:

Package Downloads
DynaFill.Filler

DynaFill is a dynamic object filler that can be used to fill objects with dynamic data. It can be used to fill objects with random data, for mocking, testing, and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.4 273 3/12/2024

Added word null and empty checks, with extra unit testing