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
So one of the use cases I think could be parsing phone numbers or zip codes. These might be written in the form of two three zero two five eight etc with each of the digit spelled out. Using parse would return space separated string 2 3 0 2 5 8 while parse_number would give None. Neither gives the wanted output 230258 (number). (Of-course the user can do some additional processing on parse output which will work but having a feature it in the library itself might be better)
We can have a parameter in parse_number say relaxed which when set to true will build this number up as one large number.
The text was updated successfully, but these errors were encountered:
We could also use a parameter like join_delimiter or something like that to choose how to join the followed numbers (that are followed omitting spaces, commas, etc).
Examples:
>>>parse('I have three numbers: one, two, three', join_delimiter='-')
'I have 3 numbers: 1-2-3'>>>parse('I have three numbers: one, two, three', join_delimiter='')
'I have 3 numbers: 123'>>>parse('I have three numbers: one, two, three', join_delimiter='/')
'I have 3 numbers: 1/2/3'>>>parse('two three zero two five eight', join_delimiter='.')
2.3.0.2.5.8
So one of the use cases I think could be parsing phone numbers or zip codes. These might be written in the form of
two three zero two five eight
etc with each of the digit spelled out. Usingparse
would return space separated string2 3 0 2 5 8
whileparse_number
would giveNone
. Neither gives the wanted output230258 (number)
. (Of-course the user can do some additional processing onparse
output which will work but having a feature it in the library itself might be better)We can have a parameter in
parse_number
sayrelaxed
which when set to true will build this number up as one large number.The text was updated successfully, but these errors were encountered: