Class Index | File Index

Classes


Class ilib.Address

Create a new Address instance and parse a physical address.

This function parses a physical address written in a free-form string. It returns an object with a number of properties from the list below that it may have extracted from that address.

The following is a list of properties that the algorithm will return:

The above properties will not necessarily appear in the instance. For any individual property, if the free-form address does not contain that property or it cannot be parsed out, the it is left out.

The options parameter may contain any of the following properties:

When an address cannot be parsed properly, the entire address will be placed into the streetAddress property.

When the freeformAddress is another ilib.Address, this will act like a copy constructor.

Depends directive: !depends addressprs.js
Defined in: ilib-dyn-full.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ilib.Address(freeformAddress, options)
Field Summary
Field Attributes Field Name and Description
 
The country of the address.
 
The 2 or 3 letter ISO 3166 region code for the destination country in this address.
 
private
 
The locality of this address (usually a city or town).
 
Country-specific code for expediting mail.
 
Optional city-specific code for a particular post office, used to expidite delivery.
 
The region (province, canton, prefecture, state, etc.
 
The street address, including house numbers and all.
Class Detail
ilib.Address(freeformAddress, options)
Parameters:
{string|ilib.Address} freeformAddress
free-form address to parse, or a javascript object containing the fields
{Object} options
options to the parser
Field Detail
country
The country of the address.

countryCode
The 2 or 3 letter ISO 3166 region code for the destination country in this address.

format
private

locality
The locality of this address (usually a city or town).

postalCode
Country-specific code for expediting mail. In the US, this is the zip code.

postOffice
Optional city-specific code for a particular post office, used to expidite delivery.

region
The region (province, canton, prefecture, state, etc.) where the address is located.

streetAddress
The street address, including house numbers and all.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Feb 02 2016 16:00:48 GMT-0800 (PST)