From 05c8eba11c51ca928eee9c041de1a4192e590aec Mon Sep 17 00:00:00 2001
From: nianjiuhuiyi <64776403+nianjiuhuiyi@users.noreply.github.com>
Date: 星期五, 27 六月 2025 09:57:45 +0800
Subject: [PATCH] Fix: 修复c++后端服务因为空数组的异常退出,以及c++的http服务在收到Ctrl+C信号后无法正常退出 (#2571)

---
 fun_text_processing/inverse_text_normalization/pt/verbalizers/telephone.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fun_text_processing/inverse_text_normalization/pt/verbalizers/telephone.py b/fun_text_processing/inverse_text_normalization/pt/verbalizers/telephone.py
index ef2ba51..8c30c08 100644
--- a/fun_text_processing/inverse_text_normalization/pt/verbalizers/telephone.py
+++ b/fun_text_processing/inverse_text_normalization/pt/verbalizers/telephone.py
@@ -1,6 +1,3 @@
-
-
-
 import pynini
 from fun_text_processing.text_normalization.en.graph_utils import DAMO_NOT_QUOTE, GraphFst
 from pynini.lib import pynutil
@@ -16,6 +13,10 @@
     def __init__(self):
         super().__init__(name="telephone", kind="verbalize")
 
-        number_part = pynutil.delete("number_part: \"") + pynini.closure(DAMO_NOT_QUOTE, 1) + pynutil.delete("\"")
+        number_part = (
+            pynutil.delete('number_part: "')
+            + pynini.closure(DAMO_NOT_QUOTE, 1)
+            + pynutil.delete('"')
+        )
         delete_tokens = self.delete_tokens(number_part)
         self.fst = delete_tokens.optimize()

--
Gitblit v1.9.1