-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yaofei.sun
committed
Jan 12, 2016
1 parent
5c325d5
commit d7ebfbe
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d7ebfbe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原有的判断交叉的方式不全面,新加的代码的思路是:两个线段交叉时其总长度小于等于两个线段的和,结果会景点smart模式分词结果。
测试case如下 :
输入:孙要求是正确
自定义词库:
孙要
孙要求
要求
求是
正确
———————————————————————not smart before bug fix
0 - 3 : 孙要求 | CN_WORD
0 - 2 : 孙要 | CN_WORD
0 - 1 : 孙 | CN_WORD
1 - 3 : 要求 | CN_WORD
2 - 4 : 求是 | CN_WORD
4 - 6 : 正确 | CN_WORD
————————————————————————smart before bug fix
0 - 2 : 孙要 | CN_WORD
2 - 4 : 求是 | CN_WORD
4 - 6 : 正确 | CN_WORD
———————————————————————not smart after bug fix
0 - 3 : 孙要求 | CN_WORD
0 - 2 : 孙要 | CN_WORD
0 - 1 : 孙 | CN_WORD
1 - 3 : 要求 | CN_WORD
2 - 4 : 求是 | CN_WORD
4 - 6 : 正确 | CN_WORD
————————————————————————smart after bug fix
0 - 3 : 孙要求 | CN_WORD
4 - 6 : 正确 | CN_WORD