From e24dbdc496debec225414d4d2c760f5775e64f2a Mon Sep 17 00:00:00 2001
From: 天地 <tiandiweizun@gmail.com>
Date: 星期三, 26 三月 2025 13:44:41 +0800
Subject: [PATCH] 感觉应该从文件读取更合适,因为上面判断了文件存在,且可以读取,如果本身是文本的话,下面也会有逻辑进行处理 (#2452)

---
 fun_text_processing/text_normalization/ru/utils.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fun_text_processing/text_normalization/ru/utils.py b/fun_text_processing/text_normalization/ru/utils.py
index 861f75b..1a1f30f 100644
--- a/fun_text_processing/text_normalization/ru/utils.py
+++ b/fun_text_processing/text_normalization/ru/utils.py
@@ -1,5 +1,3 @@
-
-
 import csv
 import os
 
@@ -12,13 +10,13 @@
 
     Args:
         rel_path: relative path to this file
-        
+
     Returns absolute path
     """
     abs_path = os.path.dirname(os.path.abspath(__file__)) + os.sep + rel_path
 
     if not os.path.exists(abs_path):
-        logging.warning(f'{abs_path} does not exist')
+        logging.warning(f"{abs_path} does not exist")
     return abs_path
 
 
@@ -31,6 +29,6 @@
 
     Returns dictionary of mappings
     """
-    label_tsv = open(abs_path, encoding='utf-8')
+    label_tsv = open(abs_path, encoding="utf-8")
     labels = list(csv.reader(label_tsv, delimiter="\t"))
     return labels

--
Gitblit v1.9.1