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

use obj for cmrc so no need to copy PINYIN_TEXT #98

Merged
merged 3 commits into from
Aug 18, 2022
Merged

Conversation

wangfenjin
Copy link
Owner

@hxicoder 注意到 iOS 需要libPINYIN_TEXT 这个文件,我做了点更新可以修复这个问题,这样所有东西都打包到 libsimple 里面去了。麻烦帮忙测试下这个分支

另外你也可以加一点代码展示下怎么用 jieba_query 。需要把 dict 目录也 copy 到你的库里面去。

@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #98 (75b5908) into master (4b73ed1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #98   +/-   ##
=======================================
  Coverage   95.77%   95.77%           
=======================================
  Files           3        3           
  Lines         213      213           
=======================================
  Hits          204      204           
  Misses          9        9           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wangfenjin wangfenjin added the fix Used for auto generate changelog label Aug 17, 2022
@hxicoder
Copy link

@hxicoder 注意到 iOS 需要libPINYIN_TEXT 这个文件,我做了点更新可以修复这个问题,这样所有东西都打包到 libsimple 里面去了。麻烦帮忙测试下这个分支

另外你也可以加一点代码展示下怎么用 jieba_query 。需要把 dict 目录也 copy 到你的库里面去。

我把dict目录拖到工程中,并移动到可访问的沙盒目录下,然后指定路径 BOOL bR = [db executeQuery:[NSString stringWithFormat:@"select jieba_dict('%@')", kJiebaPath]];,然后查询的时候报错:
/Users/daw/Documents/GitHub/simple/build-ios/cppjieba/src/cppjieba/include/cppjieba/DictTrie.hpp:203 FATAL exp: [ifs.is_open()] false. open ./dict/jieba.dict.utf8 failed.

@wangfenjin
Copy link
Owner Author

@hxicoder 你用 ./dict 这样的路径可能不行,要用绝对路径。

例子

string dict_path = get_current_dir() + "/dict";

@hxicoder
Copy link

hxicoder commented Aug 18, 2022

@hxicoder 你用 ./dict 这样的路径可能不行,要用绝对路径。

例子

string dict_path = get_current_dir() + "/dict";

kJiebaPath是绝对路径,路径为/var/mobile/Containers/Data/Application/7908A269-92B9-449D-992A-FD12EA9D31BC/Documents/dict/,报错日志上的路径为啥是libsimple生成的路径

@wangfenjin
Copy link
Owner Author

https://github.com/hxicoder/DBDemo/blob/main/DBDemo/DBDemo/ViewController.m#L151-L158

@hxicoder 你要先调用 jieba_dict 才能调用 jieba_query 这样的函数;不然第一次调用 jieba_query 的路径就不对了

@hxicoder
Copy link

https://github.com/hxicoder/DBDemo/blob/main/DBDemo/DBDemo/ViewController.m#L151-L158

@hxicoder 你要先调用 jieba_dict 才能调用 jieba_query 这样的函数;不然第一次调用 jieba_query 的路径就不对了

我调用 jieba_dict 了,我再看看吧

@wangfenjin
Copy link
Owner Author

wangfenjin commented Aug 18, 2022

@hxicoder 调 jieba_query 前要先 jieba_dict ,并且 jieba_dict 只用调一次就够了

@wangfenjin wangfenjin merged commit c750862 into master Aug 18, 2022
@wangfenjin wangfenjin deleted the ios-obj branch August 18, 2022 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Used for auto generate changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants