I need to write a Python programm to convert spanish numbers in string text into digit numbers:
Input:
'Ciento Veinticuatro Mil Ochocientos Treinta y Cinco'
Output desired:
124835
I've wrote some code, but I've realized that I'm reinventing the wheel, just a parser. So, I need to use a lexic/grammar parser module. But I'd never handled before with lexic/grammar parsers and first is needed to write the BNF or PEG notation (I'm not decided yet which parser module I'll use, the simpliest that I can found.)
It's hard for me, the spanish grammar for numerals it's so quite different of the english.
My approach:
<numeral> ::= ([<centenas>][<decenas>][<unidades>])+ [<millares>]
I fear that it's a question for spanish speakers.