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

Function get_symbol

utils/text_norm.py:234–243  ·  view source on GitHub ↗
(char, system)

Source from the content-addressed store, hash-verified

232
233def chn2num(chinese_string, numbering_type=NUMBERING_TYPES[1]):
234 def get_symbol(char, system):
235 for u in system.units:
236 if char in [u.traditional, u.simplified, u.big_s, u.big_t]:
237 return u
238 for d in system.digits:
239 if char in [d.traditional, d.simplified, d.big_s, d.big_t, d.alt_s, d.alt_t]:
240 return d
241 for m in system.math:
242 if char in [m.traditional, m.simplified]:
243 return m
244
245 def string2symbols(chinese_string, system):
246 int_string, dec_string = chinese_string, ''

Callers 1

string2symbolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected