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

convertToPinyinList方法,返回了所有同音字的拼音。 #1634

Closed
1 task done
liuyan731 opened this issue Mar 19, 2021 · 1 comment
Closed
1 task done

convertToPinyinList方法,返回了所有同音字的拼音。 #1634

liuyan731 opened this issue Mar 19, 2021 · 1 comment
Assignees
Labels

Comments

@liuyan731
Copy link

Describe the bug
convertToPinyinList方法,返回了所有同音字的拼音。

Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

System.out.println(HanLP.convertToPinyinString("你好", " ", false));
// ni hao hao

Describe the current behavior
convertToPinyinList方法返回了多音字所有的拼音,导致返回的拼音字符串有多余的多音字,同时当需要转拼音字符串有中英混杂时,会出现报错IndexOutOfBoundaryException。1.7.8无此问题。

Expected behavior
“你好”返回“ni hao”而不是“ni hao hao”。

System information

  • Linux、Windows
  • Python version:
  • HanLP version:1.8.0

Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

  • I've completed this form and searched the web for solutions.
@hankcs
Copy link
Owner

hankcs commented Mar 19, 2021

感谢反馈,已经修复,请参考上面的commit。
如果还有问题,欢迎重开issue。

@hankcs hankcs closed this as completed Mar 19, 2021
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