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

使用工具加载dll时,提示错误 #92

Closed
meskgron opened this issue Jun 8, 2022 · 8 comments
Closed

使用工具加载dll时,提示错误 #92

meskgron opened this issue Jun 8, 2022 · 8 comments

Comments

@meskgron
Copy link

meskgron commented Jun 8, 2022

image

@meskgron
Copy link
Author

meskgron commented Jun 8, 2022

@wangfenjin
Copy link
Owner

你的路径不对吧,没用过这个软件

@meskgron
Copy link
Author

meskgron commented Jun 8, 2022

这个我i理解和代码中 loadextension是一个功能,i对比了文档上要求,没有找到原因,大佬有空可以看下
而且我加载其他的extension没有问题

@wangfenjin
Copy link
Owner

注意你的系统是 x86 还是 x64,如果不确定就都试一下

751657351307_ pic

@l1t1
Copy link

l1t1 commented Jun 3, 2023

dll放在sqlite目录下没问题,其他目录调用结巴有问题

sqlite> .load d:/sqlite/libsimple-windows-x86/simple.dll

sqlite> CREATE VIRTUAL TABLE t1 USING fts5(text, tokenize = 'simple');

sqlite> INSERT INTO t1 VALUES ('中华人民共和国国歌');

sqlite> select simple_highlight(t1, 0, '[', ']') as text from t1 where text match simple_query('中华国歌');
[中华]人民共和[国国歌]

sqlite>  select simple_highlight(t1, 0, '[', ']') as text from t1 where text match jieba_query('中华国歌');
2023-06-03 17:49:32 D:\a\_temp\windows\cppjieba\src\cppjieba\include\cppjieba\DictTrie.hpp:203 FATAL exp: [ifs.is_open()] false. open ./dict/jieba.dict.utf8 failed.

把dll和dict目录移动到d:/sqlite

sqlite> .load ./simple.dll
sqlite>  select simple_highlight(t1, 0, '[', ']') as text from t1 where text match jieba_query('中华国歌');
Parse error: no such table: t1
sqlite> CREATE VIRTUAL TABLE t1 USING fts5(text, tokenize = 'simple');
sqlite> INSERT INTO t1 VALUES ('中华人民共和国国歌');
sqlite>  select simple_highlight(t1, 0, '[', ']') as text from t1 where text match jieba_query('中华国歌');
[中华]人民共和国[国歌]
``

@wangfenjin
Copy link
Owner

jieba_dict() 指定 dict 的目录,只需要调用一次,需要在调用 jieba_query() 之前指定。

@wangfenjin
Copy link
Owner

sql = "select jieba_dict('" + dict_path + "')";

@l1t1
Copy link

l1t1 commented Jun 4, 2023

谢谢

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