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

Class Percentage

utils/text_norm.py:584–597  ·  view source on GitHub ↗

PERCENTAGE类

Source from the content-addressed store, hash-verified

582
583
584class Percentage:
585 """
586 PERCENTAGE类
587 """
588
589 def __init__(self, percentage=None, chntext=None):
590 self.percentage = percentage
591 self.chntext = chntext
592
593 def chntext2percentage(self):
594 return chn2num(self.chntext.strip().strip('百分之')) + '%'
595
596 def percentage2chntext(self):
597 return '百分之' + num2chn(self.percentage.strip().strip('%'))
598
599
600# ================================================================================ #

Callers 1

normalizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected