MCPcopy Create free account
hub / github.com/FunAudioLLM/Fun-ASR / get_symbol

Function get_symbol

tools/cn_tn.py:613–629  ·  view source on GitHub ↗
(char, system)

Source from the content-addressed store, hash-verified

611
612def chn2num(chinese_string, numbering_type=NUMBERING_TYPES[1]):
613 def get_symbol(char, system):
614 for u in system.units:
615 if char in [u.traditional, u.simplified, u.big_s, u.big_t]:
616 return u
617 for d in system.digits:
618 if char in [
619 d.traditional,
620 d.simplified,
621 d.big_s,
622 d.big_t,
623 d.alt_s,
624 d.alt_t,
625 ]:
626 return d
627 for m in system.math:
628 if char in [m.traditional, m.simplified]:
629 return m
630
631 def string2symbols(chinese_string, system):
632 int_string, dec_string = chinese_string, ""

Callers 1

string2symbolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected