Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File STPhrases not found #6

Closed
hustlzp opened this issue Mar 31, 2019 · 5 comments
Closed

File STPhrases not found #6

hustlzp opened this issue Mar 31, 2019 · 5 comments

Comments

@hustlzp
Copy link

hustlzp commented Mar 31, 2019

Carthage version: 0.32.0
Xcode version: 10.2
Swift version: 5.0

Test codes:

let converter = try? ChineseConverter(option: [.traditionalize])
print(converter?.convert("诗词"))

Error:

屏幕快照 2019-03-31 下午4 26 58

I install SwiftyOpenCC via Carthage instructions:

https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos

Did I miss something?

@hustlzp
Copy link
Author

hustlzp commented Mar 31, 2019

Seems that the Dictionary directory does't exist in OpenCC.framework:

屏幕快照 2019-03-31 下午4 35 45

@ddddxxx
Copy link
Owner

ddddxxx commented Mar 31, 2019

Yes, The dictionary is not shipped with the framework. You need to pass it manually.

/// Returns an initialized `ChineseConverter` instance with the specified
/// conversion option.
///
/// - Parameter bundle: The bundle used to store the dictionary file. Pass
///   nil for the main bundle.
/// - Parameter option: The convert’s option.
public convenience init(bundle: Bundle? = nil, option: Options) throws

You can find the precompiled bundle here.

@hustlzp
Copy link
Author

hustlzp commented Mar 31, 2019

Solved, thanks!

@hustlzp hustlzp closed this as completed Mar 31, 2019
@jerryeechan
Copy link

I Suggest that note this in README, thanks!

@ddddxxx
Copy link
Owner

ddddxxx commented Apr 2, 2019

@jerrypupu111 Done, thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants