Skip to content

纯数有问题 #1

@Darius-H

Description

@Darius-H

print(Text(raw_text='纯数:2983.07克或12345.60米。').normalize())
结果是 纯数:二九八三.零七克或一二三四五.六十米。
点没有正确识别

需要把

chn_text_norm/text.py

Lines 114 to 120 in 8210575

# 规范化数字编号
pattern = re.compile(r"(\d{4,32})")
matchers = pattern.findall(text)
if matchers:
# print('digit')
for matcher in matchers:
text = text.replace(matcher, Digit(digit=matcher).digit2chntext(), 1)
规范化数字编号挪到规范化纯数后面

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions