From 23e7ddebccd3b05cf7ef89809bcfe565ad6dfa1f Mon Sep 17 00:00:00 2001
From: majic31 <majic31@163.com>
Date: 星期二, 24 十二月 2024 10:00:14 +0800
Subject: [PATCH] Fix the variable name (#2328)
---
fun_text_processing/inverse_text_normalization/vi/graph_utils.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/fun_text_processing/inverse_text_normalization/vi/graph_utils.py b/fun_text_processing/inverse_text_normalization/vi/graph_utils.py
index aac8289..644a0ae 100644
--- a/fun_text_processing/inverse_text_normalization/vi/graph_utils.py
+++ b/fun_text_processing/inverse_text_normalization/vi/graph_utils.py
@@ -1,4 +1,3 @@
-
import os
import string
from pathlib import Path
@@ -36,7 +35,9 @@
delete_hyphen = pynutil.delete(pynini.closure("-", 0, 1))
insert_hyphen = pynutil.insert("-")
-TO_LOWER = pynini.union(*[pynini.cross(x, y) for x, y in zip(string.ascii_uppercase, string.ascii_lowercase)])
+TO_LOWER = pynini.union(
+ *[pynini.cross(x, y) for x, y in zip(string.ascii_uppercase, string.ascii_lowercase)]
+)
TO_UPPER = pynini.invert(TO_LOWER)
@@ -66,7 +67,9 @@
Returns output fst where breaking spaces are converted to non breaking spaces
"""
- return fst @ pynini.cdrewrite(pynini.cross(DAMO_SPACE, DAMO_NON_BREAKING_SPACE), "", "", DAMO_SIGMA)
+ return fst @ pynini.cdrewrite(
+ pynini.cross(DAMO_SPACE, DAMO_NON_BREAKING_SPACE), "", "", DAMO_SIGMA
+ )
class GraphFst:
@@ -88,7 +91,9 @@
self.far_path = Path(os.path.dirname(__file__) + "/grammars/" + kind + "/" + name + ".far")
if self.far_exist():
- self._fst = Far(self.far_path, mode="r", arc_type="standard", far_type="default").get_fst()
+ self._fst = Far(
+ self.far_path, mode="r", arc_type="standard", far_type="default"
+ ).get_fst()
def far_exist(self) -> bool:
"""
--
Gitblit v1.9.1