瀏覽代碼

Update money.py (#971)

Maybe it would be better surrport "thiry one cent"  -> "$0.31" conversion. Some people say this way, and sometimes ASR  make mistakes.
Binbin Gu 2 年之前
父節點
當前提交
c1d01605bf
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fun_text_processing/inverse_text_normalization/en/taggers/money.py

+ 1 - 1
fun_text_processing/inverse_text_normalization/en/taggers/money.py

@@ -53,7 +53,7 @@ class MoneyFst(GraphFst):
             + pynini.union(
                 pynutil.add_weight(((DAMO_SIGMA - "one") @ cardinal_graph), -0.7) @ add_leading_zero_to_double_digit
                 + delete_space
-                + pynutil.delete("cents"),
+                + (pynutil.delete("cents") | pynutil.delete("cent")),
                 pynini.cross("one", "01") + delete_space + pynutil.delete("cent"),
             )
             + pynutil.insert("\"")