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

多音字拼音提取出错 #131

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Conversation

vdbrcxby
Copy link
Contributor

@vdbrcxby vdbrcxby commented Sep 7, 2023

U+7F57: luó,luō # 罗
类似这种多音字,第一个拼音的最后一个字母带音调会导致后一个拼音提取出错

U+7F57: luó,luō  # 罗
类似这种多音字,第一个拼音的最后一个字母带音调会导致后一个拼音提取出错
@wangfenjin
Copy link
Owner

请问有复现的例子吗

@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #131 (7e35f2c) into master (5083845) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   96.01%   96.03%   +0.01%     
==========================================
  Files           3        3              
  Lines         226      227       +1     
==========================================
+ Hits          217      218       +1     
  Misses          9        9              
Files Changed Coverage Δ
src/pinyin.cc 91.96% <100.00%> (+0.07%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@vdbrcxby
Copy link
Contributor Author

vdbrcxby commented Sep 7, 2023

请问有复现的例子吗

这个是必现的
当input = "luó,luō" 时
std::setstd::string PinYin::to_plain(const std::string &input) 返回的结果是(”l“,"luo","u","uo"), 预期结果应该是 (”l“,"luo")

@vdbrcxby
Copy link
Contributor Author

vdbrcxby commented Sep 7, 2023

请问有复现的例子吗

这个是必现的 当input = "luó,luō" 时 std::setstd::string PinYin::to_plain(const std::string &input) 返回的结果是(”l“,"luo","u","uo"), 预期结果应该是 (”l“,"luo")
问题的原因是 PinYin::to_plain 方法在处理 逗号 时没有将 len 变量的值重新赋值,当逗号前的字母时长度>1,会导致 步进长度出错

@wangfenjin wangfenjin merged commit 67f6d79 into wangfenjin:master Sep 7, 2023
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants