You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I tried, but It can't seem to handle the number in the text.
thanks. a great library
The text was updated successfully, but these errors were encountered: