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

Class Fraction

utils/text_norm.py:485–500  ·  view source on GitHub ↗

FRACTION类

Source from the content-addressed store, hash-verified

483
484
485class Fraction:
486 """
487 FRACTION类
488 """
489
490 def __init__(self, fraction=None, chntext=None):
491 self.fraction = fraction
492 self.chntext = chntext
493
494 def chntext2fraction(self):
495 denominator, numerator = self.chntext.split('分之')
496 return chn2num(numerator) + '/' + chn2num(denominator)
497
498 def fraction2chntext(self):
499 numerator, denominator = self.fraction.split('/')
500 return num2chn(denominator) + '分之' + num2chn(numerator)
501
502
503class Date:

Callers 1

normalizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected