Binbin Gu
2023-04-27 d6e8c17ba6eef78ddae75edd8b3dd8f69b3f0bf4
Update cardinal.py

it will make numbers like "three thousand and one" convert into "30001" not "3001".
1个文件已修改
2 ■■■ 已修改文件
fun_text_processing/inverse_text_normalization/id/taggers/cardinal.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fun_text_processing/inverse_text_normalization/id/taggers/cardinal.py
@@ -27,7 +27,7 @@
        graph_hundreds = pynini.string_file(get_abs_path("data/numbers/hundreds.tsv"))
        graph_thousand = pynini.string_file(get_abs_path("data/numbers/thousand.tsv"))
        graph_cents = pynini.cross("seratus", "100") | pynini.cross("ratus", "100") | pynini.union(graph_hundreds, pynutil.insert("00"))
        graph_cents = pynini.cross("seratus", "100") | pynini.cross("ratus", "100") | pynini.union(graph_hundreds, pynutil.insert("0"))
        graph_hundred = pynini.cross("ratus", "") | pynini.cross("seratus", "")
        graph_hundred_component = pynini.union(graph_digit + delete_space + graph_hundred, pynutil.insert("00"))