{"repo":"wangfenjin/simple","free":true,"listed":false,"github":"https://github.com/wangfenjin/simple","clone":"git clone https://github.com/wangfenjin/simple.git","description":"支持中文和拼音的 SQLite fts5 全文搜索扩展 ｜ A SQLite3 fts5 tokenizer which supports Chinese and PinYin","language":"C++","stars":858,"topics":["sqlite3","tokenizer","fts5","chinese","pinyin","sqlite","fts","cpp14","sqlite3-fts5"],"license":null,"category":"databases-storage","readme_excerpt":"Simple tokenizer simple 是一个支持中文和拼音的 sqlite3 fts5 拓展。它完整提供了 微信移动端的全文检索多音字问题解决方案 一文中的方案四，非常简单和高效地支持中文及拼音的搜索。 实现相关介绍：https://www.wangfenjin.com/posts/simple-tokenizer/ 在此基础上，我们还支持通过 cppjieba 实现更精准的词组匹配，介绍文章见 https://www.wangfenjin.com/posts/simple-jieba-tokenizer/ 用法 代码使用 下载已经编译好的插件：https://github.com/wangfenjin/simple/releases 参考 examples 目录，目前已经有 c++, python, go 和 node-sqlite3 的例子。 iOS可以参考: - #73 - @hxicoder 提供的 demo - @pipi32167提供的demo 在 Rust 中使用的例子 https://github.com/wangfenjin/simple/issues/89 https://github.com/fundon/tiny-docs-se Java 例子 https://github.com/wangfenjin/sqlite-java-connect C# 例子 https://github.com/dudylan/SqliteCheck/ Rust 例子 https://github.com/xuxiaocheng0201/libsimple/ Android Flutter 的例子 https://github.com/SageMik/sqlite3 simple React Native op-sqlite 例子 examples/react-native-op-sqlite.md 命令行使用 首先需要确认你用到的 sqlite 版本支持 fts5 拓展，确认方法是： 然后就可以使用了，具体的例子可以参考 example.sql 和 cpp 功能 1. simple tokenizer 支持中文和拼音的分词，并且可通过开关控制是否需要支持拼音 2. simple query() 函数实现自动组装 match query 的功能，用户不用学习 fts5 query 的语法 3. simple highlight() 实现连续高亮 match 的词汇，与 sqlite 自带的 highlight 类似，但是 simple highlight 实现了连续 match 的词汇分到同一组的逻辑，理论上用户更需要这样 4. simple highlight pos() 实现返回 match 的词汇位置，用户可以自行决定怎么使用 5. simple snippet() 实现截取 match 片段的功能，与 sqlite 自带的 snippet 功能类似，同样是增强连续 match 的词汇分到同一组的逻辑 6. jieba query() 实现jieba分词的效果，在索引不变的情况下，可以实现更精准的匹配。可以通过 -DSIMPLE WITH JIEBA=OFF 关掉结巴分词的功能 #35 7. jieba dict() 指定 dict 的目录，只需要调用一次，需要在调用 jieba query() 之前指定。 8. pinyin dict() 支持指定自定义的 pinyin.txt 文件路径。调用成功后会立即切换拼音映射；如果文","default_branch":null,"files":null,"tree":[],"storefront":"/r/wangfenjin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wangfenjin/simple/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}