From ab2148ec182db2b5d18d38f2dd690922d2cf56b8 Mon Sep 17 00:00:00 2001
From: Logan <52682203+ding-ding666@users.noreply.github.com>
Date: 星期一, 26 五月 2025 14:34:47 +0800
Subject: [PATCH] 更新go client 的原生实现 (#2532)
---
fun_text_processing/inverse_text_normalization/ja/verbalizers/ordinal.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/fun_text_processing/inverse_text_normalization/ja/verbalizers/ordinal.py b/fun_text_processing/inverse_text_normalization/ja/verbalizers/ordinal.py
index 6d665c7..0458859 100644
--- a/fun_text_processing/inverse_text_normalization/ja/verbalizers/ordinal.py
+++ b/fun_text_processing/inverse_text_normalization/ja/verbalizers/ordinal.py
@@ -1,6 +1,10 @@
-
import pynini
-from fun_text_processing.inverse_text_normalization.ja.graph_utils import DAMO_NOT_QUOTE, DAMO_SIGMA, GraphFst, delete_space
+from fun_text_processing.inverse_text_normalization.ja.graph_utils import (
+ DAMO_NOT_QUOTE,
+ DAMO_SIGMA,
+ GraphFst,
+ delete_space,
+)
from pynini.lib import pynutil
@@ -16,11 +20,11 @@
graph = (
pynutil.delete("integer:")
+ delete_space
- + pynutil.delete("\"")
+ + pynutil.delete('"')
+ pynutil.insert("绗�", weight=0.01)
# + DAMO_NOT_QUOTE
+ pynini.closure(DAMO_NOT_QUOTE, 1)
- + pynutil.delete("\"")
+ + pynutil.delete('"')
)
# convert_hundred = pynini.cross("绗櫨", "绗�100")
# convert_eleven = pynini.cross("11", "鍗佷竴")
@@ -29,7 +33,6 @@
# convert_one = pynini.cross("1", "绗竴")
# convert_two = pynini.cross("2", "绗簩")
# convert_three = pynini.cross("3", "绗笁")
-
# suffix = pynini.cdrewrite(
# convert_hundred
--
Gitblit v1.9.1