OpenCC 0.1.5

OpenCC 0.1.5

Maintained by Weizhong Yang.



OpenCC 0.1.5

OpenCC Pod Spec

Actions Status Version License Platform

The project wraps SwiftyOpenCC by ddddxxx into a CocoaPods spec. You can use Swift Package Manager or Carthage to install SwiftyOpenCC, however, it does not provide a CocoaPods spec, and I want to make my own life easier.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

A quick example:

import OpenCC

var bundle: Bundle? = {
    let openCCBundle = Bundle(for: ChineseConverter.self)
    guard let resourceUrl = openCCBundle.url(forResource: "OpenCCDictionary", withExtension: "bundle") else {
        return nil
    }
    return Bundle(url: resourceUrl)
}()

let str = "鼠标里面的硅二极管坏了,导致光标分辨率降低。"
let converter = try! ChineseConverter(bundle: bundle!, option: [.traditionalize, .TWStandard, .TWIdiom])
converter.convert(str)
// 滑鼠裡面的矽二極體壞了,導致游標解析度降低。

Requirements

  • Latest Xcode
  • iOS 8 or above.
  • macOS 10.10 or above.
  • tvOS 9 or above.

Installation

OpenCC is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'OpenCC'

Author

zonble, [email protected]

License

OpenCC is available under the MIT license. See the LICENSE file for more info.