Itzalive.NameParserSharp
2.0.0
dotnet add package Itzalive.NameParserSharp --version 2.0.0
NuGet\Install-Package Itzalive.NameParserSharp -Version 2.0.0
<PackageReference Include="Itzalive.NameParserSharp" Version="2.0.0" />
paket add Itzalive.NameParserSharp --version 2.0.0
#r "nuget: Itzalive.NameParserSharp, 2.0.0"
// Install Itzalive.NameParserSharp as a Cake Addin #addin nuget:?package=Itzalive.NameParserSharp&version=2.0.0 // Install Itzalive.NameParserSharp as a Cake Tool #tool nuget:?package=Itzalive.NameParserSharp&version=2.0.0
NameParserSharp
Based upon nameparser 1.1.3, NameParserSharp is a C# library that parses a human name into constituent fields Title
, First
, Middle
, Last
, Suffix
, and Nickname
from the HumanName
class. For example:
var jfk = new HumanName("president john 'jack' f kennedy");
// person.Title == "president"
// person.First == "john"
// person.Middle == "f"
// person.Last == "kennedy"
// person.Nickname == "jack"
var jfk_alt = new HumanName("kennedy, president john (jack) f");
Assert.IsTrue(jfk == jfk_alt);
NameParserSharp implements the functionality of the Python project on which it is based in a C# idiomatic way.
The same extensive suite of tests as python-nameparser is used to confirm it meets the same specification.
Performance
There have been performance improvements to the library over the Python implementation to take advantage of some of the latest .NET features.
Method | Runtime | Mean | Ratio | Allocated | Alloc Ratio |
---|---|---|---|---|---|
NameParserSharp (Based on python-nameparser V0.3.6) | .NET 6.0 | 4.980 us | 0.69 | 9.3 KB | 1.78 |
python-nameparser V1.1.3 direct port | .NET 6.0 | 7.171 us | 1.00 | 5.21 KB | 1.00 |
Itzalive.NameParserSharp | .NET 6.0 | 2.834 us | 0.39 | 4.83 KB | 0.93 |
NameParserSharp (Based on python-nameparser V0.3.6) | .NET 8.0 | 4.446 us | 0.61 | 9.01 KB | 1.73 |
python-nameparser V1.1.3 direct port | .NET 8.0 | 4.404 us | 0.61 | 5.21 KB | 1.00 |
Itzalive.NameParserSharp | .NET 8.0 | 1.999 us | 0.28 | 4.54 KB | 0.87 |
Using NameParserSharp
NameParserSharp is available as a NuGet package: Install-Package Itzalive.NameParserSharp
Still to port
- Emoji character support
- Extracting initials
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. 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. |
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 1,346 | 3/13/2024 |
v.2.0.0
- Initial Release
- Implements python nameparser 1.1.3