From d80ac2fd2df4e7fb8a28acfa512bb11472b5cc99 Mon Sep 17 00:00:00 2001
From: liugz18 <57401541+liugz18@users.noreply.github.com>
Date: 星期四, 18 七月 2024 21:34:55 +0800
Subject: [PATCH] Rename 'res' in line 514 to avoid with naming conflict with line 365
---
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