TinyPinyin 1.1.0

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

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

TinyPinyin.Net

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

特性

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

如何使用

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

安装

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

使用

/// <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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.8

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on TinyPinyin:

Package Downloads
NRB.Infrastructure

NRB.Infrastructure 基础工具

USAlgo.ClassBalance

学生均衡分班算法库 Algorithm library for balanced class allocation for students

ZhuoPu_SModel

Package Description

Platter.ApplicationCore

ApplicationCore

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on TinyPinyin:

Repository Stars
GoldenPotato137/PotatoVN
一款Visual Novel管理软件
Version Downloads Last updated
1.1.0 25,262 3/20/2022
1.0.1 235 3/20/2022
1.0.0 251 3/20/2022