Swiftpack.co -  CrazyFanFan/K3Pinyin as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
CrazyFanFan/K3Pinyin
translate chinese hanzi to pinyin by swift
.package(url: "https://github.com/CrazyFanFan/K3Pinyin.git", from: "2.0.0")

K3Pinyin

translate chinese hanzi to pinyin by swift

Installation

CocoaPods

To integrate K3Pinyin into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'

target 'TargetName' do
use_frameworks!
pod 'K3Pinyin', '~> 0.0.2'
end

Then, run the following command:

$ pod install

Usage

simple way

// code
let string = "中国"
print(string.k3.pinyin)
print(string.k3.pinyin(nil))
string.k3.pinyin(nil) { (pinyin) in
    print(pinyin)
}


// result
zhōngguó
zhōngguó
zhōngguó

option

print(string.k3.pinyin([.stripCombiningMarks,
                        .separator(""),
                        .onlyFirstCharacter,
                        .allFirstLetter,
                        .capitalized]))

Z

Issues

  • Polyphone

Author

Crazy凡, ccrazyfan@gmail.com

License

K3Pinyin is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 6
Last commit: 5 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

K3Pinyin 2.0.0
31 weeks ago

For Xcode 12 / Swift 5.3

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API