MCPcopy Index your code
hub / github.com/MoonInTheRiver/DiffSinger / Money

Class Money

utils/text_norm.py:561–581  ·  view source on GitHub ↗

MONEY类

Source from the content-addressed store, hash-verified

559
560
561class Money:
562 """
563 MONEY类
564 """
565
566 def __init__(self, money=None, chntext=None):
567 self.money = money
568 self.chntext = chntext
569
570 # def chntext2money(self):
571 # return self.money
572
573 def money2chntext(self):
574 money = self.money
575 pattern = re.compile(r'(\d+(\.\d+)?)')
576 matchers = pattern.findall(money)
577 if matchers:
578 for matcher in matchers:
579 money = money.replace(matcher[0], Cardinal(cardinal=matcher[0]).cardinal2chntext())
580 self.chntext = money
581 return self.chntext
582
583
584class Percentage:

Callers 1

normalizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected