https://github.com/zonble/opencc
OpenCC Pod Spec
https://github.com/zonble/opencc
Last synced: 11 months ago
JSON representation
OpenCC Pod Spec
- Host: GitHub
- URL: https://github.com/zonble/opencc
- Owner: zonble
- License: mit
- Created: 2019-10-21T16:13:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-13T14:51:01.000Z (almost 2 years ago)
- Last Synced: 2024-11-18T04:52:01.398Z (over 1 year ago)
- Language: Swift
- Homepage:
- Size: 134 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenCC Pod Spec
[](https://github.com/zonble/OpenCC/actions)
[](https://cocoapods.org/pods/OpenCC)
[](https://cocoapods.org/pods/OpenCC)
[](https://cocoapods.org/pods/OpenCC)
The project wraps [SwiftyOpenCC](https://github.com/ddddxxx/SwiftyOpenCC) by
[ddddxxx](https://github.com/ddddxxx) into a [CocoaPods](https://cocoapods.org)
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:
```swift
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](https://developer.apple.com/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:
```ruby
pod 'OpenCC'
```
## Author
zonble, zonble@gmail.com
## License
OpenCC is available under the MIT license. See the LICENSE file for more info.