-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
There are few issues in documentation (https://github.com/andychase/reparse/blob/master/doc/source/howto.rst):
- Incorrect regex for area code
[+]([0-9] \d{2}) - (\d{3}) - (\d{4})=>[+]([0-9] \d{3}) - (\d{3}) - (\d{4}) - Misleading examples of outputs in section 5: description indicates direct output but implementation suggests output of first function being an array
def senthill((AreaCode, Prefix, Body):
return Phone(area_code=AreaCode, prefix=Prefix, body=Body, fax=False)
def phone(p):
return p[0]- "basic phone" returns a list and "fax phone" returns the first element: this does not match with section 6
def basic_phone(p):
return p
def fax_phone(p):
return p[0]._replace(fax=True)
...
print(phone_parser('+974-584-5656'))
# => [phone(area_code='974', prefix='584', body='5656', fax=False)]
print(phone_parser('Fax: +974-584-5656'))
# => [phone(area_code='974', prefix='584', body='5656', fax=True)]Metadata
Metadata
Assignees
Labels
No labels