📦 快速转化「中文数字」和「阿拉伯数字」~ (最新特性:分数,日期、温度等转化)
Home Page:https://www.dovolopor.com/cn2an
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool
bobkentt opened this issue 4 years ago · comments
RT 比如 “用户增长最快的三个城市” 转换为 “用户增长最快的3个城市”
你可以用「正则」把中文数字匹配出来,使用 cn2an 转化后再还原回去。
方法参考这里。
我打算近期在 v0.4 中加入这个功能。
@bobkentt 请更新到最新的 0.4.0 版本,这个功能的基本版本已经上线。
0.4.0
import cn2an output = cn2an.transform("我捡了一百块钱", "cn2an") # or output = cn2an.transform("我捡了一百块钱") print(output) # 我捡了100块钱 output = cn2an.transform("我捡了100块钱", "an2cn") print(output) # 我捡了一百块钱