zhifu gao
2024-04-24 861147c7308b91068ffa02724fdf74ee623a909e
fun_text_processing/inverse_text_normalization/zh/utils.py
@@ -1,14 +1,12 @@
import csv
import os
from typing import Union
import inflect
UNIT_1e01 = '十'
UNIT_1e02 = '百'
UNIT_1e03 = '千'
UNIT_1e04 = '万'
UNIT_1e01 = "十"
UNIT_1e02 = "百"
UNIT_1e03 = "千"
UNIT_1e04 = "万"
_inflect = inflect.engine()
@@ -25,6 +23,7 @@
        x = _inflect.number_to_words(str(x)).replace("-", " ").replace(",", "")
    return x
def get_abs_path(rel_path):
    """
    Get absolute path
@@ -34,7 +33,7 @@
        
    Returns absolute path
    """
    return os.path.dirname(os.path.abspath(__file__)) + '/' + rel_path
    return os.path.dirname(os.path.abspath(__file__)) + "/" + rel_path
def load_labels(abs_path):