vietTTS
vietTTS copied to clipboard
the number in the text
I tried, but It can't seem to handle the number in the text.
thanks. a great library
mee too
bạn có thể dùng thư viện để chuyển từ số thành chữ trước khi dùng.
from vietnam_number import n2w def change_vietnamese_number_in_text(intput_text): groups_text = [] for text in intput_text.split(): if text.isdigit(): text = n2w(text)
elif text.replace(".","").isdigit():
text = n2w(text)
elif text.replace(",","").isdigit():
text = n2w(text)
groups_text.append(text)
# Vietnamese words for numbers 0 to 9
result = ' '.join(groups_text)
return result
intput_text = "Lich su vietnam 15 123 31234 1 3, 1. " print(change_vietnamese_number_in_text(intput_text))