Latest 0.0.4
Homepage https://github.com/CrazyFanFan/K3Pinyin/
License MIT
Platforms ios 8.0, requires ARC
Dependencies K3Base
Authors

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凡, [email protected]

License

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

Latest podspec

{
    "name": "K3Pinyin",
    "version": "0.0.4",
    "summary": "a simple wap to use pinyin with swift.",
    "description": "a simple wap to use pinyin with swift. nsupport strip combining marksu3001strip whitespace... with option",
    "homepage": "https://github.com/CrazyFanFan/K3Pinyin/",
    "license": "MIT",
    "authors": {
        "Crazyu51e1": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/CrazyFanFan/K3Pinyin.git",
        "tag": "0.0.4"
    },
    "source_files": "K3Pinyin/**/*.{h,swift}",
    "requires_arc": true,
    "swift_version": "5.0",
    "dependencies": {
        "K3Base": []
    }
}

Pin It on Pinterest

Share This