-
Notifications
You must be signed in to change notification settings - Fork 79
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
有 BUG🐛,戳这里👇 #26
Comments
安装PyYAML5.3版本的时候 提示ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. 导致cn2an 安装不成功 |
@xiaoludian 你可以尝试先手动更新 PyYAML 到最新版本,再安装 cn2an 。 pip install PyYAML -U --ignore-installed |
1、 |
@mengxifeng 我理解你所说的意思,但目前本库所使用的技术仅限于规则匹配。在下个0.x版本中,我考虑加入一些机器学习的内容来改善它。 |
赞,期待新版本~ |
input: cn2an.transform(创业板指九月九日早盘低开百分之一点五七) |
@yilei0620 收到,我会在下个小版本修复它。 |
在 |
input: cn2an.cn2an('百万', 'smart') |
input: cn2an.cn2an('10000000000000', 'smart') |
input: cn2an.cn2an('4万一', 'smart')可以 |
@hurricanedjp 感谢反馈~
|
|
cn2an.cn2an('104207', 'smart') 有问题 |
多谢,辛苦
cn2an.an2cn("10000000000000")是可以的。但我的需求是,无论中文还是阿拉伯数字都转成阿拉伯数字,所以直接用smart的 |
你可以试试,先用 int(input) 强行转化,捕获异常后再做 cn2an 转化。 |
我自己程序肯定打了补丁了,单纯反馈个bug |
@hurricanedjp 嗯嗯,感谢反馈~ |
输入:
输出:
都差了10 if index == len(integer_data) - 1: # 215行
output_integer += unit 改成 if index == len(integer_data) - 1 or integer_data[index + 1] in self.conf["unit_cn2an"]:
output_integer += unit 但是没有考虑其他情况,不知道有没有更好的办法🤣 |
@invobzvr 感谢反馈,我会尽快检查问题~ |
引发这个问题的主要原因是单位 import cn2an
text = "一百十"
# 用正则写可能更简单,这里仅做示意
if "百十" in text:
text = text.replace("百十", "百一十")
result = cn2an.cn2an(text)
print(result)
# 110 非规范描述特别多,规则很难完全覆盖。 |
@chbambooshoot 会在下个小版本支持这个功能 |
句子转化中“一点九亿”显示“WARN: 不符合格式的数据” |
@Hotinosin 收到,稍晚一点进行确认。 |
还有在句子转化中“一直”“一般”“一天”“一样”等等,带“一”的词语有转化的错误 |
有 BUG 直接提新的 Issue。 |
写下你的问题,尽可能的详细描述~
The text was updated successfully, but these errors were encountered: