yanyiwu / cppjieba

"结巴"中文分词的C++版本
MIT License
2.58k stars 691 forks source link

jieba分词分出来的词比之前的字多 #148

Closed congjiye closed 3 years ago

congjiye commented 3 years ago

代码:

s = "改善程序与设计的55个具体做法";
jieba.CutAll(s, words);
std::cout << limonp::Join(words.begin(), words.end(), " ") << std::endl;

输出结果:

改善 程序 与 设计 的 5 5 个 具体 具体做法 做法
yanyiwu commented 3 years ago

cutAll 就是这么设计的,主要为了建索引,如果你要精确的直接使用cut即可,不要使用cutAll

发自我的iPhone

在 2020年10月26日,20:37,Jyc notifications@github.com 写道:

 代码:

s = "改善程序与设计的55个具体做法"; jieba.CutAll(s, words); std::cout << limonp::Join(words.begin(), words.end(), " ") << std::endl; 输出结果:

改善 程序 与 设计 的 5 5 个 具体 具体做法 做法 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

congjiye commented 3 years ago

好的,谢谢啦~