as-ideas / DeepPhonemizer

Grapheme to phoneme conversion with deep learning.
MIT License
352 stars 38 forks source link

Numeric values in sentences not being Phonemized #43

Open SeymourNickelson opened 9 months ago

SeymourNickelson commented 9 months ago

If you run a string through the Phonemizer that has a numeric value it will produce an empty string as the result. For example:

 resultOne = phonemizer('It\'s 1 o\'clock', lang='en_us')
 print(resultOne)

 resultTwo = phonemizer('It\'s one o\'clock', lang='en_us')
 print(resultTwo)

Produces:

Result One: ɪts ɑklɑk

Result Two: ɪts wʌn ɑklɑk

Perhaps when the input text is split a raw numeric value could be converted to a spelled out string before being fed to the Phonemizer. I'm not sure if Python provides a built in way to do this (newbie @ Python) but if not a library like Inflect perhaps could be used.

Thanks a lot for this cool repository.