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

文本以'\n'开头会引起高亮错位BUG #34

Closed
AnyListen opened this issue Aug 27, 2018 · 4 comments
Closed

文本以'\n'开头会引起高亮错位BUG #34

AnyListen opened this issue Aug 27, 2018 · 4 comments
Labels

Comments

@AnyListen
Copy link
Contributor

HighLighterTest.java测试文件中,将索引的文本内容最开始加上一个'\n'即可复现BUG。

我的测试文本:

String text2 = "\n朗坤智能云平台—LiCP\nLuculent intelligent/industrial Cloud Platform\n白皮书\n\n——跨行业跨领域工业互联网平台 ";

String keyword = "朗坤智能云平台";
@AnyListen
Copy link
Contributor Author

测试结果

【
】【朗】【坤智】【能】【云平】台—LiCP
Luculent intelligent/industrial Cloud Platform
白皮书

——跨行业跨领域工业互联【网平】台
测试回测换行符 , 0.47491124

@AnyListen
Copy link
Contributor Author

仔细看了一下是 应该是 SegmentWrapperScanner scanner 的问题,在使用scanner.next();时,默认忽略了第一个 \n符号。

@hankcs hankcs closed this as completed in 8d8fe5c Aug 27, 2018
@hankcs
Copy link
Owner

hankcs commented Aug 27, 2018

是的,Java的Scanner和BufferedReader处理换行符时都在做多余的事情,必须自己写个Reader。请测试刚提交的补丁,如果没问题的话就发新版本。

@hankcs hankcs added the bug label Aug 27, 2018
@AnyListen
Copy link
Contributor Author

已集成到ES分词插件测试,没问题啦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants