vladimarius / pyap

Python address detector and parser
MIT License
200 stars 60 forks source link

Is there a way to return the raw, unformatted addresses #22

Open mrxiaohe opened 3 years ago

mrxiaohe commented 3 years ago

When I use pyap.parse() on the address below, the full address is formatted where the newline character \n is replaced by a comma and a space. I wonder if there is a way to also get the extracted but unformatted address. This might be useful if, say, a user would like to get the span of an address in the original text where the address is extracted from. Thanks!

address = """14234 Wilshire Blvd
Los Angeles, CA 90011"""

pyap.parse(address, country='US')[0].full_address
#14234 Wilshire Blvd, Los Angeles, CA 90011