All Projects → sarathkcm → Pluralize.NET

sarathkcm / Pluralize.NET

Licence: MIT license
📘 Pluralize or singularize any English word.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Pluralize.NET

Pluralize
Pluralize or singularize any word based on a count
Stars: ✭ 1,808 (+3516%)
Mutual labels:  english, pluralize, singular
go-pluralize
Pluralize and singularize any word (golang adaptation of https://www.npmjs.com/package/pluralize)
Stars: ✭ 60 (+20%)
Mutual labels:  english, pluralize, singular
cv4pve-api-dotnet
Proxmox VE Client API .Net C#
Stars: ✭ 25 (-50%)
Mutual labels:  nuget, dotnet-standard
covidtrackerapiwrapper
CovidSharp is a crossplatform C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)
Stars: ✭ 11 (-78%)
Mutual labels:  nuget, dotnet-standard
HardwareInformation
.NET Standard Cross-Platform Hardware Information Gatherer
Stars: ✭ 37 (-26%)
Mutual labels:  nuget, dotnet-standard
pluralize
An R package to "Pluralize and Singularize Any Word"
Stars: ✭ 58 (+16%)
Mutual labels:  singularize, plural
Kcp
KCP C#版。线程安全,运行时无alloc,对gc无压力。
Stars: ✭ 294 (+488%)
Mutual labels:  nuget, dotnet-standard
Vanara
A set of .NET libraries for Windows implementing PInvoke calls to many native Windows APIs with supporting wrappers.
Stars: ✭ 544 (+988%)
Mutual labels:  nuget, dotnet-standard
Tusdotnet
.NET server implementation of the Tus protocol for resumable file uploads. Read more at https://tus.io
Stars: ✭ 298 (+496%)
Mutual labels:  nuget, dotnet-standard
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (+142%)
Mutual labels:  nuget, dotnet-standard
PortaCapena.OdooJsonRpcClient
Odoo Client Json Rpc
Stars: ✭ 39 (-22%)
Mutual labels:  nuget, dotnet-standard
ILRepack.Lib.MSBuild.Task
MSBuild task for ILRepack which is an open-source alternative to ILMerge.
Stars: ✭ 70 (+40%)
Mutual labels:  nuget
docker-introduction
Reproducible Computational Environments using Containers
Stars: ✭ 34 (-32%)
Mutual labels:  english
i-am-root-nuget-package
📦🏴‍☠️ NuGet package that shows we can run arbitrary code from any NuGet package
Stars: ✭ 22 (-56%)
Mutual labels:  nuget
pssa
Singular Spectrum Analysis for time series forecasting in Python
Stars: ✭ 119 (+138%)
Mutual labels:  singular
matlab-novice-inflammation
Programming with MATLAB
Stars: ✭ 26 (-48%)
Mutual labels:  english
English-Persian-Word-Database
English Persian Word Database - Popular database extensions
Stars: ✭ 19 (-62%)
Mutual labels:  english
EntryCustomReturnPlugin
Xamarin.Forms Plugin to customize the Xamarin.Forms.Entry Keyboard Return Button
Stars: ✭ 81 (+62%)
Mutual labels:  nuget
CSJsonDB
A C# package that performs basic CRUD ( Create, Read, Update, Delete ) operations on a Json file, used for sample minimalistic DBs.
Stars: ✭ 75 (+50%)
Mutual labels:  nuget
BilibiliLiveRecordDownLoader
Bilibili 直播录制与回放下载
Stars: ✭ 422 (+744%)
Mutual labels:  nuget

GitHub license Build status Coverage Status NuGet NuGet

What is it?

This is a C# port of Blake Embrey's pluralize library which helps in pluralizing or singularizing any English word.

Changes reflect commits up to https://github.com/blakeembrey/pluralize/commit/0265e4d131ecad8e11c420fa4be98b75dc92c33d from May 25, 2019.

Why

I could not find a good C# alternative for converting words from singular to plural and vice versa. System.Data.Entity.Design.PluralizationServices.PluralizationService and Humanizer library did not meet the expectations (try 'shoes' or 'toes'). However this small but awesome Javascript libray pluralize worked very well for me and I decided to convert the code to C# and use it.

How

Install from NuGet

Using Package manager console

Install-Package Pluralize.NET

Using dotnet CLI

dotnet add package Pluralize.NET

Using paket CLI

paket add Pluralize.NET

Include using directive

using Pluralize.NET

Write 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"

Profit!

Supported .NET Versions

The Nuget package supports the following .NET versions. This pretty much covers versions 4.0 and above. Please open an issue if you want to support any .NET version in particular.

  • .NET 4.0
  • .NET Standard 1.1
  • .NET 4.5.1
  • .NET 4.6
  • .NET Standard 2.0

Licence

MIT - because the original project is MIT

Contributors


Sarath Kumar CM

💻

Daniel Destouche

💻

Dennis Pražák

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].