Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.85 KB

README.md

File metadata and controls

62 lines (44 loc) · 1.85 KB

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 11 or above.
  • macOS 10.13 or above.
  • tvOS 11 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.