MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / ChineseChar

Class ChineseChar

utils/text_norm.py:57–74  ·  view source on GitHub ↗

中文字符 每个字符对应简体和繁体, e.g. 简体 = '负', 繁体 = '負' 转换时可转换为简体或繁体

Source from the content-addressed store, hash-verified

55# basic class
56# ================================================================================ #
57class ChineseChar(object):
58 """
59 中文字符
60 每个字符对应简体和繁体,
61 e.g. 简体 = '负', 繁体 = '負'
62 转换时可转换为简体或繁体
63 """
64
65 def __init__(self, simplified, traditional):
66 self.simplified = simplified
67 self.traditional = traditional
68 # self.__repr__ = self.__str__
69
70 def __str__(self):
71 return self.simplified or self.traditional or None
72
73 def __repr__(self):
74 return self.__str__()
75
76
77class ChineseNumberUnit(ChineseChar):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected