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

“连衣裙”,要求搜索前缀“连衣”也能得到结果,我的解决方法是否可行? #20

Open
med opened this issue Oct 21, 2015 · 0 comments

Comments

@med
Copy link

med commented Oct 21, 2015

要求用户搜素某个词的前几个字也可以得到结果。以“连衣裙”为例,maxword分词结果为“连 | 衣裙”。要求用户搜索“连”或“连衣”都要有结果。我看了下淘宝和京东目前能做到这一点。
这一点现在可以通过模糊查询实现,但担心对较短的中文字词进行频繁模糊查询会影响性能(这个究竟影响多少尚未实测),我希望用空间换时间。
我的解决方案如下:
1、先用mmsege4j进行正常分词
2、将上面正常分词中长度大于等于3的词的前缀也分出来,不管它是不是一个正常的词,比如是“连衣裙”就把“连衣”也分出来。
3、将整个句子分成单字
最后的结果是上面3个集合的和。

这种方案是否能解决我提到的问题?

@med med changed the title “正常分词+词的前缀+单字”这样是否有意义? “连衣裙”,要求搜索前缀“连衣”也能得到结果,我的解决方法是否可行? Oct 21, 2015
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

1 participant