Closed Kuaranir closed 1 year ago
In that case I would suggest to split up at blanks and convert each "word" itself and join it to one string after that. Would that be a solution?
text2num
it for converting an expression into an integer. The expression "eight nine two" is not a valid integer.
If you you want to transform the input into the string "8 9 2", you should use the alpha2digit
function instead.
alpha2digit
thanks, it works
Doesn't work with separate digits like:
from text_to_num import text2num
print(text2num("eight nine two", "en"))
Output:ValueError: invalid literal for text2num: 'eight nine two'
Desired: 892 or 8 9 2 maybe