Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A suite should not be treated as a region. #5

Open
markstos opened this issue Apr 24, 2014 · 4 comments
Open

A suite should not be treated as a region. #5

markstos opened this issue Apr 24, 2014 · 4 comments
Assignees

Comments

@markstos
Copy link
Collaborator

Consider:

{ text: '1 17th Street Suite 2, Denver, CO',
  parts: [],
  unit: undefined,
  country: undefined,
  number: 1,
  street: '17th Street',
  regions: [ 'Suite 2', 'Denver', 'CO' ] }

I don't think a "Suite" should be treated as a region.

For example, when parsing US addresses, I'd like to assume that the
only value "regions" I should find should be a city and state code.

Thanks!

Mark

@markstos markstos changed the title A suite should be treated as a region. A suite should not be treated as a region. Apr 24, 2014
@markstos
Copy link
Collaborator Author

I looked at the code and saw that there was some explicitly support for "apt" and "apartment", so I thought perhaps a "suite" should be treated like an apartment, since they seem similar in concept. It looks like the code is trying to extract the apartment number and stick it in the "unit" field.

To my surprise, an "apartment" is also treated as a "region", which is not what I would expect:

{ text: '1 17th Street, Apt 2, Denver, CO',
parts: [],
unit: undefined,
country: undefined,
number: 1,
street: '17th Street',
regions: [ 'Apt 2', 'Denver', 'CO' ] }

I tried this with and without the comma preceding "Apt"

@DamonOehlman DamonOehlman self-assigned this Apr 25, 2014
@DamonOehlman
Copy link
Owner

Thanks for providing those couple of example inputs. I definitely think any of the following should effectively be treated the same:

  • Apartment
  • Apt
  • Suite
  • Unit

Unit seems to be the term used commonly in Australia, but Suite is definitely used for commercial complexes as well. Feel free to throw in any others :)

@lelandcope
Copy link

When will support for this be added because I just grabbed the version off npm and its placing Apt in the region section instead of unit.

Example Address Used: 1230 W 27th St Apt 110, LA, CA, 90007

@markstos
Copy link
Collaborator Author

@lelandcope feel free to speed up the process with a pull request.

You could also try contact-parser. I switched to using that instead a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants