TinyPinyin.NetFramework 1.0.2.2

dotnet add package TinyPinyin.NetFramework --version 1.0.2.2
NuGet\Install-Package TinyPinyin.NetFramework -Version 1.0.2.2
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="TinyPinyin.NetFramework" Version="1.0.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TinyPinyin.NetFramework --version 1.0.2.2
#r "nuget: TinyPinyin.NetFramework, 1.0.2.2"
#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 TinyPinyin.NetFramework as a Cake Addin
#addin nuget:?package=TinyPinyin.NetFramework&version=1.0.2.2

// Install TinyPinyin.NetFramework as a Cake Tool
#tool nuget:?package=TinyPinyin.NetFramework&version=1.0.2.2

TinyPinyin.Net

适用于.Net平台的快速、低内存占用的汉字转拼音库。核心算法来自TinyPinyin(https://github.com/promeG/TinyPinyin)

特性

  1. 生成的拼音不包含声调,均为大写
  2. 执行效率高
  3. 低内存占用
  4. 支持获取简码(拼音首字母)

如何使用

只提供足够简洁的API,简单易用。

安装

使用 NuGet 搜索 TinyPinyin 进行安装,也可直接执行命令: Install-Package TinyPinyin

使用

/// <summary>
/// 获取单个字符的拼音
/// </summary>
/// <param name="c"></param>
/// <returns></returns>
string PinyinHelper.GetPinyin(char c)

/// <summary>
/// 获取文本字符串的拼音,允许设定拼音分割符
/// </summary>
/// <param name="text">要获取拼音的文本</param>
/// <param name="separator">拼音分割符,默认空格</param>
/// <returns></returns>
string PinyinHelper.GetPinyin(string text, string separator = " ")

/// <summary>
/// 获取拼音首字母
/// </summary>
/// <param name="str"></param>
/// <param name="separator">拼音分割符,默认空字符串(不分割)</param>
/// <returns></returns>
string GetPinyinInitials(string str, string separator = "")

/// <summary>
/// 判断单个字符是否是中文
/// </summary>
/// <param name="c"></param>
/// <returns></returns>
bool IsChinese(char c)

感谢

感谢 @promeG 提供的 Java版本

Product 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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.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
1.0.2.2 84 5/8/2024
1.0.2.1 72 5/8/2024