-
Notifications
You must be signed in to change notification settings - Fork 80
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
中文数字补位‘零’识别错误 #78
Comments
遇到了同样的问题“十万零五千”无法转化为105000,smart和strict模式都无法解决,请问有什么好办法么? |
get_pattern的时候没有穷举到这个样式,大概可以加上去试试,应该可以正常反解。 |
好的,谢谢! |
可以用正则识别万零X千然后去掉零 转换为中文数字cn_str = cn2an.transform(original_str, 'an2cn') 修复万零X千(cn2an 包自带问题)pattern = r'万零([一二三四五六七八九十百千]+千)' |
‘十万零一千‘ 无法识别
万位为零千位不为零时,按一般中文数字规则,可以补零也可以不补零。如‘十万一千’和‘十万零一千’,应该都是正确写法。
‘十万一千’正确识别,‘十万零一千’无法识别
输入:
cn2an.cn2an("十万零一千","smart")
报错:
The text was updated successfully, but these errors were encountered: