Skip to the content

address-plus documentation

address-plus API: every export

Every export of every entry point, each with its own page. This page keeps the addresses the old one-page reference had.

@johnmorrisdotca/address-plus/jp

findMunicipalitiesByNamefunction

The municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima).

findMunicipalitiesByRomajifunction

The municipalities a romaji name could mean, written with or without macrons and designators (Chiyoda-ku, Chiyoda City, Sapporo-shi Chuo-ku, Chuo-ku, Sapporo).

findMunicipalityByCodefunction

The municipality with a JIS X 0402 code, a designated city's own code included.

findPrefecturefunction

The prefecture a name, reading, romaji spelling or JIS code refers to: 東京都, 東京, トウキョウト, Tokyo, Osaka Prefecture, 13.

formatJapanesefunction

Writes a Japanese address in Japanese order, as an envelope is addressed: 〒100-0005, then 東京都千代田区丸の内1-2-3, then サンプルビル5階501号室.

formatJapaneseEnglishfunction

Writes a Japanese address in English order, as a form from abroad expects: building, room, block, town, municipality, prefecture, postal code, Japan.

getPostalPrefixesForPrefecturefunction

The three-digit postal prefixes a prefecture's codes begin with, the reverse of getPrefectureFromJapanesePostalCode.

getPrefectureFromJapanesePostalCodefunction

The prefecture a Japanese postal code delivers to, from Japan Post's data: by its first three digits, and for the codes on the far side of a prefix that straddles a border, by the whole code.

JapaneseMunicipalitytype

A municipality (市区町村) in the tables: its JIS code, its prefecture's code, its official name with the district for a town or village in one, its reading and its romaji.

JapanesePrefecturetype

A prefecture (都道府県) in the tables: its JIS code, official name, katakana reading and romaji.

JapaneseValidationtype

What validateJapaneseAddress returns: the errors and the warnings found.

JP_DESIGNATED_CITIESconstant

The twenty designated cities (政令指定都市) as municipalities of their own.

JP_MUNICIPALITIESconstant

Every municipality (市区町村) by JIS X 0402 code, with its prefecture, official name, reading and romaji; a designated city's wards are listed, and the city itself is in JP_DESIGNATED_CITIES.

JP_POSTAL_EXCEPTIONSconstant

The postal codes that deliver to another prefecture than the rest of their three-digit prefix, each to that prefecture's JIS code.

JP_POSTAL_PREFIXESconstant

Each three-digit postal prefix, to the JIS code of the prefecture most of its codes deliver to.

JP_PREFECTURESconstant

The 47 prefectures in JIS X 0401 order, each with its code, official name, katakana reading and romaji.

kanjiNumeralsToDigitsfunction

Turns the kanji numerals that stand for block, floor or room numbers into digits: 一丁目二番三号 becomes 1丁目2番3号.

looksJapanesefunction

Whether a text is a Japanese address: in Japanese script, ending with Japan, or naming a prefecture beside a Japanese postal code, a romaji designator (-ku, -shi) or a municipality written with an English word (Chiyoda City).

municipalitiesOffunction

Every municipality of a prefecture, the designated cities included.

normalizeJapaneseAddressTextfunction

Makes the text of a Japanese address uniform, as the parser reads it: widths folded, spaces tidied, numerals as digits, and 1の2の3, 1-2-3 or any other dash written 1-2-3.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseJapaneseAddressfunction

Parses a Japanese address, in Japanese script or in romaji, into the Japanese fields and the shared ones.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

validateJapaneseAddressfunction

Checks a parsed Japanese address against the tables: the postal code's shape, whether any code begins with its first three digits, whether it delivers to the prefecture named, and whether the municipality is a real one in that prefecture.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/au

AU_CROSS_BORDER_POSTCODESconstant

The postcodes whose area lies in more than one state or territory, each with the states it lies in, the one with most of it first.

AU_EXTERNAL_TERRITORY_POSTCODESconstant

The postcodes the Australian Bureau of Statistics places, wholly or partly, in the Other Territories: Jervis Bay, Norfolk Island, Christmas Island and the Cocos (Keeling) Islands.

AU_POSTCODE_RANGESconstant

The blocks of postcodes Australia Post allocates to each state and territory.

AU_STATESconstant

The six states and two territories of Australia, in order of their codes, each with Australia Post's code, the ISO 3166-2 code and its name in English and in Japanese.

AU_STREET_TYPESconstant

Australia's street types: each AS4590 abbreviation, in proper case as the parser reports it, with the word it stands for.

australiaconstant

Australia's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with a state and its postcode (or Australia) is read as Australian; country: "AU" reads any address as one.

AustralianPostcodeRangetype

One block of postcodes Australia Post allocates to a state or territory: every postcode from from to to, inclusive, written as four digits.

AustralianStatetype

An Australian state or territory in the tables: Australia Post's code, the ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

AustralianStateCodetype

The code of an Australian state or territory, as Australia Post writes it on the last line of an address.

compareAustralianAddressesfunction

Compares two Australian addresses field by field: the unit, level, lot, number, street, suburb, state and postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findAustralianStatefunction

Finds an Australian state or territory by its code (VIC, AU-VIC, Vic.) or its name in English or Japanese (Victoria, ビクトリア州), in any letter case.

formatAustraliaPostfunction

Writes an Australian address as Australia Post asks: the building's name, then the delivery line (unit and level before the number, the street type abbreviated), then the suburb, state and postcode, both in capitals with no punctuation.

getStatesForAustralianPostcodefunction

Every state or territory a postcode serves: its block's state, and for a postcode that crosses a border, the states across it too, the one with most of the postcode's area first.

looksAustralianfunction

Whether an address is surely Australian, with no hint: it ends with Australia, or with a state and an Australian postcode (NSW 2150, Victoria 3000, VIC 2000, whose postcode is Sydney's).

parseAustralianAddressfunction

Parses an Australian address into its parts, as Australia Post lays one out: the delivery line, then the suburb or town, the state and the postcode.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

validateAustralianAddressfunction

Checks an Australian address against Australia Post's blocks of postcodes: the postcode is four digits, some state's block holds it, and it is the state named, or one it serves across a border (from the ABS's Postal Areas).

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/gb

compareUKAddressesfunction

Compares two addresses in the United Kingdom field by field: the flat, the building, the number, the thoroughfare, the post town and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findUKNationfunction

Finds a nation of the United Kingdom by its code (SCT, GB-SCT) or its name in English or Japanese.

formatRoyalMailfunction

Writes an address in the United Kingdom as Royal Mail asks: the flat or part of the building, the floor, the building's name, the number with the dependent thoroughfare or the thoroughfare, the localities, then the post town and the postcode in capitals, each on its own line.

GB_DISTRICT_NATIONSconstant

The postcode districts not wholly in the nation of their area, each with the nations its postcodes lie in, the one with most of them first: the districts that cross the borders of Wales and of Scotland, and those wholly across one (CH5 to CH8 are in Wales, though most of the CH area is in England).

GB_NATIONSconstant

The four nations of the United Kingdom, in order of their codes, each with its ISO 3166-2 code and its name in English and in Japanese.

GB_POSTCODE_AREASconstant

Every postcode area Royal Mail uses: the 121 of the United Kingdom, the three Crown Dependencies (GY, IM, JE), and the two that are not places, BF (the British Forces Post Office) and BX (addresses kept for organisations wherever they are).

GB_POSTCODE_DISTRICTSconstant

Every postcode district in Great Britain, by area: the numbered districts as runs, then those with a letter.

GB_THOROUGHFARE_DESCRIPTORSconstant

The thoroughfare descriptors the parser takes off the end of a street's name and reports, in full, as type (High Street is street High, type Street), with the abbreviations it reads for each.

getNationFromUKPostcodefunction

The nation of the United Kingdom a postcode delivers to, by its area, or by its district where the district crosses the border with Wales or with Scotland (the nation most of its postcodes are in).

getNationsForUKPostcodefunction

Every nation a postcode's district delivers to: one for most, two for the districts along the borders of Wales and of Scotland (from Code-Point Open), the nation with most of the district's postcodes first.

isValidUKPostcodefunction

Whether a postcode follows Royal Mail's grammar: one of the six shapes (M2 5BQ, M34 4AB, CR0 2YR, DN16 9AA, W1A 4ZZ, EC1A 1HQ) with the letters each place allows, or GIR 0AA.

looksBritishfunction

Whether an address is surely British, with no hint: it ends with the United Kingdom or one of its nations (or Jersey, Guernsey or the Isle of Man), or it holds a full postcode in Royal Mail's grammar whose area Royal Mail uses, or BFPO and a number.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

parseUKAddressfunction

Parses an address in the United Kingdom (or Jersey, Guernsey and the Isle of Man, which share Royal Mail's postcodes) into the parts of Royal Mail's Postcode Address File: a flat or unit (secUnitType, secUnitNum) or a named part of a building (subBuilding), a floor, the building's name, the number, a dependent thoroughfare, the thoroughfare (its name in street, its descriptor in full in type), the dependent localities, the post town in city, a county, and the postcode in zip with the nation it delivers to.

parseUKPostcodefunction

Takes a postcode apart: outward code, inward code, area, district and sector, and says where it delivers: the country (GB, or JE, GY or IM for the Crown Dependencies) and, in the United Kingdom, the nation.

UKAddressFieldstype

The fields an address in the United Kingdom fills beside the shared ones.

UKNationtype

A nation of the United Kingdom in the tables: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

UKNationCodetype

The code of one of the four nations of the United Kingdom, as ISO 3166-2:GB writes it after GB-.

UKPostcodetype

A postcode taken apart: the outward code (area and district) and the inward code (sector and unit), and where it delivers.

UKPostcodeAreatype

A postcode area: the town Royal Mail names it for, the country it delivers to (GB, or JE, GY and IM for the Crown Dependencies), and for the United Kingdom the nation, absent for an area that is not a place (BF, BX).

unitedKingdomconstant

The United Kingdom's module, for parseLocation and validateAddress: pass it in countries, and an address with a British postcode (or ending with the United Kingdom or a nation) is read as British; country: "GB" reads any address as one.

validateUKAddressfunction

Checks an address in the United Kingdom against Royal Mail's postcode grammar and the tables: the postcode is well formed, Royal Mail uses its area, and in Great Britain Code-Point Open lists its district.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/de

compareGermanAddressesfunction

Compares two addresses in Germany field by field: who it is care of, the building, the flat and floor, the street, the house number, the place and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

DE_BUILDING_WORDSconstant

The words for a part of a building, which open the line the parser keeps whole as building (Hinterhaus, Haus B, Gebäude 4, Block C), in lower case.

DE_COUNTRY_NAMESconstant

What a country at the end of an address may be called, in capitals with no umlauts: DEUTSCHLAND, GERMANY, ALLEMAGNE, BRD.

DE_STATESconstant

The sixteen Länder of Germany, in order of their codes, each with its ISO 3166-2 code and its name in English and in Japanese.

DE_STREET_OPENERSconstant

The words that begin a street's name with no suffix to end it (Am Markt, An der Weide, Zum alten Hof, Im Winkel), and the adjectives that begin one (Große Bleiche, Alte Dorfstraße), in lower case.

DE_STREET_SUFFIXESconstant

What a street's name may end with, which makes the word the name ends in a thoroughfare (Hauptstraße, Berliner Str., Kastanienallee), in lower case with their spellings: strasse for straße, str for the abbreviation.

DE_UNIT_TYPESconstant

The words for a flat or a room, which the parser reports as secUnitType in full, with the abbreviations it reads for each: `Whg.

findGermanStatefunction

Finds a Land of Germany by its code (BY, DE-BY) or its name in English, German or Japanese, without regard to letter case or umlauts written as ae, oe, ue.

formatDeutschePostfunction

Writes an address in Germany as Deutsche Post asks: who it is care of (c/o), the part of the building, the flat and the floor, the street and its house number, then the postcode and the place, each on its own line, with no punctuation at the end of a line.

GermanPostcodetype

A postcode taken apart: the Land it is in, and whether GeoNames' list has it.

GermanStatetype

A Land of Germany in the tables: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

GermanStateCodetype

The code of one of the sixteen Länder of Germany, as ISO 3166-2:DE writes it after DE-.

germanyconstant

Germany's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Germany or Deutschland, or has a German street and its number and a postcode first on its last line, is read as German; country: "DE" reads any address as one.

isKnownGermanPostcodefunction

Whether GeoNames' list for Germany has a postcode (its places include those of large firms, whose postcodes are their own).

looksGermanfunction

Whether an address is surely German, with no hint: it ends with Germany, Deutschland or a code such as D-10115 before the place, or its last line begins with a postcode and a place (10115 Berlin) while the address has a street that ends in a German suffix (Hauptstraße, Kastanienallee, Am Markt) followed by its number, or a Postfach or a Packstation.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseGermanAddressfunction

Parses an address in Germany into the parts Deutsche Post and DIN 5008 lay out: who it is care of (careOf, from c/o, `z.

parseGermanPostcodefunction

Takes a postcode apart: the Land it is in, from GeoNames' list (a postcode with places in two Länder takes the one most are in), and whether the list has it.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

validateGermanAddressfunction

Checks an address in Germany against Deutsche Post's postcode shape and GeoNames' list: the postcode is five digits and the list has it, and the place and the house number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/fr

compareFrenchAddressesfunction

Compares two addresses in France field by field: the delivery point, the building, the number and its extension, the type and name of the street, the lieu-dit, the box, the commune and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findFrenchDepartmentfunction

Finds a department of France by its code (75, 2A, 971) or its name (Paris, Haute-Corse), without regard to letter case or accents.

formatLaPostefunction

Writes an address in France as La Poste's specification asks (SP 8855): the person it is care of, then the line of the apartment, the floor and the staircase, the line of the entrance and the building, the number and street, the lieu-dit and the box, then the postcode, the commune and its CEDEX, each on its own line, in capitals without accents or punctuation.

FR_BUILDING_WORDSconstant

The words that open the line naming a building, a residence or a zone (La Poste's third line), which the parser keeps whole as building (Résidence Les Lilas, Bâtiment A, Zone industrielle Nord, ZAC des Prés), with their abbreviations.

FR_COLLECTIVITIESconstant

The overseas collectivities that have postcodes in La Poste's base: each with its code, its ISO 3166-1 country code and its name.

FR_DEPARTMENTSconstant

The 101 departments of France, in order of their codes, each with its code (75, 2A, 971), its name and its region's.

FR_NUMBER_EXTENSIONSconstant

The words that may follow the number as its indice de répétition: bis, ter, quater and the rest of the Latin series.

FR_STREET_TYPESconstant

The types of voie the parser takes off the front of a street's name and reports, in full, as type (rue de la Paix is street de la Paix, type Rue), with the abbreviations it reads for each.

FR_UNIT_TYPESconstant

The types of the part of a building that an address names below the number: an apartment or a door, which the parser reports as secUnitType and secUnitNum, with the abbreviations it reads for each.

franceconstant

France's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with France (or Monaco or an overseas territory), holds CEDEX, or has a French type of voie and a postcode first on its last line is read as French; country: "FR" reads any address as one, and so does the code of an overseas department or collectivity.

FrenchCollectivitytype

An overseas collectivity of France in the tables: its code (987), the ISO 3166-1 country code an address in it reads as (PF) and its name.

FrenchDepartmenttype

A department of France in the tables: its code (75, 2A, 971), its name and its region's, from INSEE's Code officiel géographique.

FrenchPostalCountrytype

The country an address in La Poste's base belongs to: FR for France (the metropolis and the overseas departments), MC for Monaco, and the ISO 3166-1 code of an overseas collectivity (PM, BL, MF, WF, PF, NC), which is French but has a country code of its own and is listed apart by the Universal Postal Union.

FrenchPostcodetype

A postcode taken apart: the code of the department or territory its number belongs to, the country it delivers to, and whether La Poste's base has it.

isKnownFrenchPostcodefunction

Whether La Poste's base officielle des codes postaux lists a postcode: France, the overseas departments and collectivities and Monaco.

looksFrenchfunction

Whether an address is surely French, with no hint: it ends with France, an overseas department, Monaco or one of the collectivities, or holds CEDEX beside a postcode, or its last line begins with a postcode whose number names a department, a collectivity or Monaco, followed by a commune (75008 Paris), while the address has a French type of voie (rue, avenue, chemin) at the start of a street, a BP, a TSA or a lieu-dit.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseFrenchAddressfunction

Parses an address in France (or Monaco, or an overseas department or collectivity, which are written the same way) into the parts La Poste's norm names: who it is care of (careOf), an apartment or a door (secUnitType, secUnitNum), a floor, a staircase, an entrance, the building or residence (building), the number with its extension (numberExtension: bis, ter, a letter), the type of voie in full in type and its name in street (rue de la Paix is Rue and de la Paix), a lieu-dit, a box (BP 12, CS 30001), the commune in city with its arrondissement and CEDEX, and the postcode in zip with the department's code in state.

parseFrenchPostcodefunction

Takes a postcode apart: the code of the department or territory its number belongs to, and the country it delivers to (FR for France and its overseas departments, MC for Monaco, PF, NC and the other collectivities' own codes), and whether La Poste's base lists it.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

validateFrenchAddressfunction

Checks an address in France against La Poste's postcode shape and the tables: the postcode is five digits, its number names a department, a collectivity or Monaco, and La Poste's base officielle lists it.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/nl

compareDutchAddressesfunction

Compares two addresses in the Netherlands field by field: the street, the house number and its addition, the place and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

formatPostNLfunction

Writes an address in the Netherlands as PostNL asks: who it is care of (t.a.v.), the street with its house number and addition, or the Postbus, then the postcode (four digits, a space, two capitals) and the place, each on its own line.

isKnownDutchPostcodefunction

Whether CBS's list of four-digit postcode areas for the Netherlands has the digits of a postcode (4,070 areas, from the statistics for 2023).

isValidDutchPostcodefunction

Whether a postcode follows PostNL's shape: four digits (the first not nought) and two letters (not beginning SA, SD or SS), with or without the space between.

looksDutchfunction

Whether an address is surely Dutch, with no hint: it ends with the Netherlands, Nederland or NL, or its last line is a postcode of four digits and two letters (1015 CJ, never beginning SA, SD or SS) and a place.

netherlandsconstant

The Netherlands' module, for parseLocation and validateAddress: pass it in countries, and an address that ends with the Netherlands, Nederland or NL, or has a postcode of four digits and two letters and a place on its last line, is read as Dutch; country: "NL" reads any address as one.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseDutchAddressfunction

Parses an address in the Netherlands into the parts PostNL lays out: who it is care of (careOf), a building or name above the street (building), the street in street, the house number in number with its addition in numberExtension (the A of 123A, the 2 of 123-2, bis), a Postbus (secUnitType and secUnitNum), the place in city and the postcode in zip in its canonical form (1015 CJ).

parseDutchPostcodefunction

Takes a postcode apart: its canonical form (1015 CJ) and whether CBS's list has its digits.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

validateDutchAddressfunction

Checks an address in the Netherlands: the postcode is four digits and two letters and CBS's list of postcode areas has the digits, and the place and the house number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/es

compareSpanishAddressesfunction

Compares two addresses in Spain field by field: the street, the number, the floor and the door, the place and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

ES_PROVINCESconstant

The provinces of Spain, with the two cities that are no province's.

findSpanishProvincefunction

Finds a province of Spain by its code (M, ES-M) or its name in English, ignoring accents and letter case.

formatCorreosfunction

Writes an address in Spain as Correos asks: who it is care of (A/A), the street with its number and the floor and the door (Calle de Alcalá, 42, 3º B), or the Apartado de Correos, then the postcode and the place, each on its own line.

isValidSpanishPostcodefunction

Whether a postcode follows Correos' shape: five digits, the first two a province's number (01 to 52).

looksSpanishfunction

Whether an address is surely Spanish, with no hint: it ends with Spain, España or ES, or its last line is a postcode of five digits (the first two 01 to 52) and a place while a part of the address begins with a Spanish street's type (Calle, C/, Avenida, Paseo, Plaza) or is an Apartado de Correos, and no state's code stands before the postcode.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

parseSpanishAddressfunction

Parses an address in Spain into the parts Correos lays out: who it is care of (careOf), the street as written with its type (street: Calle de Alcalá, C/ Mayor), its number in number (42, 12-14, S/N), the floor and the door (floorType Piso and floor, secUnitType Puerta and secUnitNum: 3º B), the staircase and the entrance, an Apartado de Correos, the place in city, the province in county when it is written in brackets, the postcode in zip and the province's code in state (M for Madrid), from the postcode.

parseSpanishPostcodefunction

Takes a postcode apart: the province it is in, and whether GeoNames' list has it.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

spainconstant

Spain's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Spain, España or ES, or has a Spanish street's type and a postcode of five digits and a place on its last line, is read as Spanish; country: "ES" reads any address as one.

validateSpanishAddressfunction

Checks an address in Spain: the postcode is five digits with a province's number first and GeoNames' list has it, the province written agrees with the postcode's, and the place and the street's number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/it

compareItalianAddressesfunction

Compares two addresses in Italy field by field: the street, the civic number, the staircase, the flat, the place and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findItalianProvincefunction

Finds a province of Italy by its sigla (RM, IT-RM) or its name in English, ignoring accents and letter case.

formatPosteItalianefunction

Writes an address in Italy as Poste Italiane asks: who it is care of (c/o), the street and its civic number, with the staircase, the floor and the flat after it, or the Casella Postale, then the postcode, the place and the province's sigla, each on its own line.

IT_PROVINCESconstant

The provinces, metropolitan cities and other second-level divisions of Italy.

italyconstant

Italy's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Italy, Italia or IT, or has an Italian street's type and a postcode of five digits and a place on its last line, is read as Italian; country: "IT" reads any address as one.

looksItalianfunction

Whether an address is surely Italian, with no hint: it ends with Italy, Italia or IT, or its last line is a postcode of five digits and a place while a part of the address begins with an Italian street's type (Via, Viale, Corso, Piazza, Largo) or is a Casella Postale, and no state's code stands before the postcode.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseItalianAddressfunction

Parses an address in Italy into the parts Poste Italiane lays out: who it is care of (careOf), a building (building: Palazzo Rossi), the street as written with its type (street: Via del Corso, V.le Monza), its civic number in number (12, 12-14, or SNC for senza numero civico) with its letter or sub-number in numberExtension (the A of 12/A, bis), the staircase (staircase), the floor (floorType Piano and floor), the flat (secUnitType Interno and secUnitNum), a Casella Postale, the frazione in locality, the place in city, the postcode (CAP) in zip and the province's sigla in state (RM), as written or from the postcode.

parseItalianPostcodefunction

Takes a postcode apart: the province it is in, and whether GeoNames' list has it.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

validateItalianAddressfunction

Checks an address in Italy: the postcode is five digits and GeoNames' list has it, the province written agrees with the postcode's, and the place and the civic number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/nz

compareNewZealandAddressesfunction

Compares two addresses in New Zealand field by field: the unit, the street, its number, the city and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findNewZealandRegionfunction

Finds a region of New Zealand by its code (AUK, NZ-AUK) or its name in English, ignoring macrons, hyphens and letter case.

formatNZPostfunction

Writes an address in New Zealand as NZ Post asks: who it is care of, the unit and the level, the street with its number (or the PO Box, the bag or the rural delivery), the suburb, then the city and the postcode, each on its own line.

getRegionFromNewZealandPostcodefunction

The region a postcode is in, by its ISO 3166-2 code without NZ- (AUK for Auckland): the one most of GeoNames' places for the postcode are in.

looksNewZealandfunction

Whether an address is surely from New Zealand, with no hint: it ends with New Zealand, Aotearoa or NZ, or it ends with a place and a postcode that GeoNames' list for New Zealand has and has a Private Bag, a rural delivery (RD 2) or Aotearoa in it.

newZealandconstant

New Zealand's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with New Zealand, Aotearoa or NZ is read as from New Zealand; country: "NZ" reads any address as one.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseNewZealandAddressfunction

Parses an address in New Zealand into the parts NZ Post lays out: who it is care of (careOf), the unit (secUnitType and secUnitNum, from Unit 3 or the 3 of 3/45), the level (floorType and floor), the street's number (number: 45, 12A, 12-14) and its name as written (street: Dominion Road), the suburb in locality, the city in city, a PO Box, a Private Bag or a rural delivery (secUnitType RD and secUnitNum), the postcode in zip and the region's code in state (AUK), from the postcode.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

validateNewZealandAddressfunction

Checks an address in New Zealand: the postcode is four digits and GeoNames' list has it, and the city and the street's number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/in

compareIndianAddressesfunction

Compares two addresses in India field by field: the unit, the street, its number, the area, the city and the PIN code.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findIndianStatefunction

Finds a state or union territory of India by its code (KA, IN-KA) or its name in English, ignoring accents, & for and, and letter case.

formatIndiaPostfunction

Writes an address in India as India Post asks: who it is care of, the flat and the building, the house number and the street, a landmark, the area, then the city and the PIN code, then the state, each on its own line.

getStateFromIndianPostcodefunction

The state or union territory a PIN code is in, by its code without IN- (KA for Karnataka): the one most of GeoNames' places for the PIN code are in.

IN_STATESconstant

The states and union territories of India.

indiaconstant

India's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with India, or with the word PIN and a PIN code, or with a state's name and a PIN code the list has, is read as Indian; country: "IN" reads any address as one.

isValidIndianPostcodefunction

Whether a PIN code follows India Post's shape: six digits, the first not nought, with or without a space after the third.

looksIndianfunction

Whether an address is surely Indian, with no hint: it ends with India (IN alone is Indiana's, so it is not read), or it ends with a PIN code after the word PIN or Pin code, or after the name of a state or union territory of India with a PIN code that GeoNames' list has.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseIndianAddressfunction

Parses an address in India into the parts India Post lays out: who it is care of (careOf, from C/o, S/o, D/o, W/o), a building's name (building), the flat or shop (secUnitType and secUnitNum: Flat 4B), the floor, the house number (number: 12, 12/3, 12-A) and the street as written (street: MG Road), a landmark (place: Near City Mall), the area in locality, the city in city, the PIN code in zip (560038, with no space) and the state's code in state (KA), as written or from the PIN code.

parseIndianPostcodefunction

Takes a PIN code apart: the state it is in, and whether GeoNames' list has it.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

validateIndianAddressfunction

Checks an address in India: the PIN code is six digits and GeoNames' list has it, the state written agrees with the PIN code's, and the city and the street's number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/kr

compareKoreanAddressesfunction

Compares two addresses in South Korea field by field: the province, the district, the road and its number, the dong, the floor, the unit and the postcode.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findKoreanProvincefunction

Finds a province or metropolitan city of South Korea by its code (11, KR-11), its name in English (Seoul, Gyeonggi-do) or its name in Korean (서울특별시, 서울), ignoring letter case, spaces and hyphens.

formatKoreaPostfunction

Writes an address in South Korea as Korea Post asks.

KR_PROVINCESconstant

The metropolitan cities and provinces of South Korea.

looksKoreanfunction

Whether an address is surely Korean, with no hint: it ends with South Korea, Korea or 대한민국, or it is written in Hangul with the name of a metropolitan city or province, or a road and its number, or it is written in Latin letters with a road (-ro, -daero, -gil), a province's name and a postcode the list has before the end.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

parseKoreanAddressfunction

Parses an address in South Korea, written in Hangul from the province down (서울특별시 중구 세종대로 110 (태평로1가)) or in Latin letters from the number up (110 Sejong-daero, Jung-gu, Seoul 04524).

parseKoreanPostcodefunction

Takes a postcode apart: the province it is in, and whether GeoNames' list has it.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

southKoreaconstant

South Korea's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with South Korea, Korea or 대한민국, or is written in Hangul with a province's name or a road and its number, is read as Korean; country: "KR" reads any address as one.

validateKoreanAddressfunction

Checks an address in South Korea: the postcode is five digits and GeoNames' list has it, the province written agrees with the postcode's, and the road's building number and the district are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/br

BR_STATESconstant

The states of Brazil and the Federal District.

brazilconstant

Brazil's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Brazil, Brasil or BR, or with a CEP written with its hyphen in the range of a state after CEP or a state's code, is read as Brazilian; country: "BR" reads any address as one.

compareBrazilianAddressesfunction

Compares two addresses in Brazil field by field: the street, its number, the complement, the bairro's city and the CEP.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

findBrazilianStatefunction

Finds a state of Brazil by its code (SP, BR-SP) or its name in English or Portuguese, ignoring accents and letter case.

formatBrazilianPostfunction

Writes an address in Brazil as the Correios ask: who it is care of, the street with its number and the complement (Avenida Paulista, 1578, Apto 45), the bairro, then the CEP, the city and the state's code, each on its own line.

isKnownBrazilianPostcodefunction

Whether a CEP is in a range the Correios gave a state: it has the shape and its first five digits fall in a state's range.

isValidBrazilianPostcodefunction

Whether a CEP follows the Correios' shape: eight digits, with a hyphen after the fifth or none.

looksBrazilianfunction

Whether an address is surely Brazilian, with no hint: it ends with Brazil, Brasil or BR, or with a CEP written with its hyphen (01310-200, five digits, a hyphen and three) in the range of a state, after the word CEP or a Brazilian state's code (SP).

parseBrazilianAddressfunction

Parses an address in Brazil into the parts the Correios lay out: who it is care of (careOf), the street as written with its type (street: Avenida Paulista, `R.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

validateBrazilianAddressfunction

Checks an address in Brazil: the CEP is eight digits and in a range the Correios gave a state, the state written agrees with the CEP's, and the city and the street's number are given.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

@johnmorrisdotca/address-plus/element

AddressFieldclass

A form-associated address input using the seven native country parsers.

AddressFieldOptionstype

Full native settings and a private callback; raw addresses never enter public events.

defineFieldfunction

Register the form field under its default or a custom tag, idempotently; safe on a server.

@johnmorrisdotca/address-plus/element/define

AddressFieldclass

A form-associated address input using the seven native country parsers.

AddressFieldOptionstype

Full native settings and a private callback; raw addresses never enter public events.

defineFieldfunction

Register the form field under its default or a custom tag, idempotently; safe on a server.

@johnmorrisdotca/address-plus

AddressComparisonOptionstype

Options for comparing addresses: what to normalize before comparing, whether to allow small typos, and whether every field must match exactly.

AddressDifferencetype

One part on which two addresses differ, with both values and the kind of difference.

AddressFormattingOptionstype

Options for formatAddress and cleanAddress: what to abbreviate, capitals, the unit, the country and the line separator.

AddressParsertype

The shape of the default export: the four parsers parse-address's users call on one object.

AddressParsingTestCasetype

A parsing case in the package's JSON test files: an address and the fields expected from it.

AddressSimilarityResulttype

How alike two addresses are: an overall score from 0 to 1, a score for each part, and the differences.

AddressValidationTestCasetype

A validation case in the package's JSON test files: an address and the verdict and codes expected.

AustralianPostcodeRangetype

One block of postcodes Australia Post allocates to a state or territory: every postcode from from to to, inclusive, written as four digits.

AustralianStatetype

An Australian state or territory in the tables: Australia Post's code, the ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

AustralianStateCodetype

The code of an Australian state or territory, as Australia Post writes it on the last line of an address.

BatchParseErrortype

One address a batch could not parse: its index, the input and the reason.

BatchParseOptionstype

Options for the batch parsers: the parse options, plus whether to stop at the first error and whether to include the statistics.

BatchParseResulttype

What a batch parser returns: the results in order, the errors and the statistics.

BatchParseStatstype

The counts and timing of a batch: how many were parsed, how many failed, and how long it took.

BatchProcessingTestCasetype

A batch case in the package's JSON test files: several addresses and the counts expected.

buildRegexFromDictfunction

A regular expression matching any key of a dictionary as a whole word, longest first.

CA_PROVINCE_ALTERNATIVESconstant

Other ways Canadian provinces are written (old and informal abbreviations such as PQ, Que., Nfld.), in lower case, to their codes.

CA_PROVINCE_NAMESconstant

Every Canadian province and territory by its English or French name, to its code.

CA_PROVINCE_NAMES_ENconstant

Every Canadian province and territory by its English name in lower case, to its two-letter code.

CA_PROVINCE_NAMES_FRconstant

Every Canadian province and territory by its French name in lower case, to its two-letter code.

CA_PROVINCESconstant

Every name and other spelling of a Canadian province, to its code: the names and the alternatives together.

CA_REGIONSconstant

Every name and other spelling of a Canadian province or territory as a Region object, for fuzzy matching by normalizeRegion.

CA_STREET_TYPESconstant

Every street type Canada Post lists, in English and French, with common spellings, in lower case, to the abbreviation the parser reports.

CanadaPostFormattingOptionstype

Options for formatCanadaPost: which lines to include, bilingual labels, and whether to set the letter case the Canada Post way.

CITY_PATTERNSconstant

Patterns for a city of one or more words at the end of a text, after a space, used where no comma marks it.

cleanAddressfunction

Tidies an address typed in a hurry: spaces, commas, letter case, the street type and the state, without changing what it says.

CleanAddressOptionstype

Options for cleanAddress: which tidying to do, and the letter case to set.

CleanAddressResulttype

What cleanAddressDetailed returns: the tidied address and what changed.

CleanAddressTestCasetype

A cleaning case in the package's JSON test files: an address and the tidied text expected.

COMMON_PARSER_PATTERNSconstant

Pattern builders the parsers share: a ZIP, a state or a postal code at the end of a text, and a city before a state.

compareAddressesfunction

Compares two parsed addresses field by field, allowing for abbreviations (Street and St), state names and codes, letter case and small typos.

CONNECTOR_WORDSconstant

Small words (of, the, and) that may be in lower case inside a facility's name written in title case.

COUNTRIESconstant

The country codes the parser reports: US, CA and JP.

CountryCodetype

A country code the parser reports: US, CA or JP.

CountryComparisontype

What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated).

CountryDifferencetype

One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form.

CountryModuletype

A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.

CountryValidationtype

What a country module's validator returns: the errors and the warnings it found.

defaultconstant

The default export, shaped like parse-address's module: parseLocation, parseAddress, parseIntersection and parseInformalAddress on one object, so import parser from "@johnmorrisdotca/address-plus" works where parse-address was imported.

detectCountryfunction

Which country a parsed address is in, from its postal code, then its state or province.

DIRECTIONAL_MAPconstant

Each directional word, in English or French, in lower case, to its abbreviation (northwest and nord-ouest to NW and NO).

FACILITY_DELIMITER_PATTERNSconstant

The ways a facility's name is set off from an address: in parentheses, before a delimiter, or as a trailing island.

FACILITY_INDICATORSconstant

Words that mark a place's name as a facility (center, tower, hospital, université), in lower case.

FACILITY_PATTERNSconstant

The patterns that find a facility's name, in English and French.

findMunicipalitiesByNamefunction

The municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima).

findMunicipalitiesByRomajifunction

The municipalities a romaji name could mean, written with or without macrons and designators (Chiyoda-ku, Chiyoda City, Sapporo-shi Chuo-ku, Chuo-ku, Sapporo).

findMunicipalityByCodefunction

The municipality with a JIS X 0402 code, a designated city's own code included.

findPrefecturefunction

The prefecture a name, reading, romaji spelling or JIS code refers to: 東京都, 東京, トウキョウト, Tokyo, Osaka Prefecture, 13.

formatAddressfunction

Writes a parsed address back out as lines and as one line, with abbreviations or in full.

formatCanadaPostfunction

Writes a parsed address the way Canada Post asks: capitals, the unit before the civic number joined by a hyphen, and the postal code two spaces after the province.

formatJapanesefunction

Writes a Japanese address in Japanese order, as an envelope is addressed: 〒100-0005, then 東京都千代田区丸の内1-2-3, then サンプルビル5階501号室.

formatJapaneseEnglishfunction

Writes a Japanese address in English order, as a form from abroad expects: building, room, block, town, municipality, prefecture, postal code, Japan.

formatUSPSfunction

Writes a parsed address the way USPS Publication 28 asks: capitals, standard abbreviations, the unit on the street line, and the city, state and ZIP+4 on the last.

FRENCH_PREPOSITIONSconstant

French particles that can open a street name, each with the space after it, to the way it is written there (de la as De la ).

FrenchCollectivitytype

An overseas collectivity of France in the tables: its code (987), the ISO 3166-1 country code an address in it reads as (PF) and its name.

FrenchDepartmenttype

A department of France in the tables: its code (75, 2A, 971), its name and its region's, from INSEE's Code officiel géographique.

FrenchPostalCountrytype

The country an address in La Poste's base belongs to: FR for France (the metropolis and the overseas departments), MC for Monaco, and the ISO 3166-1 code of an overseas collectivity (PM, BL, MF, WF, PF, NC), which is French but has a country code of its own and is listed apart by the Universal Postal Union.

FrenchPostcodetype

A postcode taken apart: the code of the department or territory its number belongs to, the country it delivers to, and whether La Poste's base has it.

FuzzyMatchOptionstype

Settings for fuzzy string matching: the lowest similarity that counts, the largest edit distance, and phonetic matching.

GermanPostcodetype

A postcode taken apart: the Land it is in, and whether GeoNames' list has it.

GermanStatetype

A Land of Germany in the tables: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

GermanStateCodetype

The code of one of the sixteen Länder of Germany, as ISO 3166-2:DE writes it after DE-.

getAddressAbbreviationsfunction

Every abbreviation the formatters use: street types, directionals, secondary units, states and provinces.

getAddressSimilarityfunction

The similarity of two parsed addresses, part by part, without a verdict: the score and each part's score, and the differences.

getPostalPrefixesForPrefecturefunction

The three-digit postal prefixes a prefecture's codes begin with, the reverse of getPrefectureFromJapanesePostalCode.

getPrefectureFromJapanesePostalCodefunction

The prefecture a Japanese postal code delivers to, from Japan Post's data: by its first three digits, and for the codes on the far side of a prefix that straddles a border, by the whole code.

getProvinceFromPostalCodefunction

The province or territory a Canadian postal code is in, from its first letter, and for the X codes of the north, its first three characters.

getZipPrefixesForStatefunction

The ZIP code prefixes a state or territory uses, the reverse of getStateFromZip: three digits where a whole block of a hundred belongs to it, five where only part of one does.

hasValidAddressComponentsfunction

Whether a string looks like an address at all: a number and a street, a PO box, a postal code or another recognised part.

INTERSECTION_PATTERNSconstant

The regular expressions and pattern builders the intersection parser uses to find the city and each street with its type.

ISLAND_TYPE_PATTERNconstant

The words for an island, for addresses on one (Island, Isle, Île).

isSameAddressfunction

Whether two parsed addresses are the same place, by the same rules as compareAddresses.

JapaneseMunicipalitytype

A municipality (市区町村) in the tables: its JIS code, its prefecture's code, its official name with the district for a town or village in one, its reading and its romaji.

JapanesePrefecturetype

A prefecture (都道府県) in the tables: its JIS code, official name, katakana reading and romaji.

JapaneseValidationtype

What validateJapaneseAddress returns: the errors and the warnings found.

JP_DESIGNATED_CITIESconstant

The twenty designated cities (政令指定都市) as municipalities of their own.

JP_MUNICIPALITIESconstant

Every municipality (市区町村) by JIS X 0402 code, with its prefecture, official name, reading and romaji; a designated city's wards are listed, and the city itself is in JP_DESIGNATED_CITIES.

JP_POSTAL_EXCEPTIONSconstant

The postal codes that deliver to another prefecture than the rest of their three-digit prefix, each to that prefecture's JIS code.

JP_POSTAL_PREFIXESconstant

Each three-digit postal prefix, to the JIS code of the prefecture most of its codes deliver to.

JP_PREFECTURESconstant

The 47 prefectures in JIS X 0401 order, each with its code, official name, katakana reading and romaji.

kanjiNumeralsToDigitsfunction

Turns the kanji numerals that stand for block, floor or room numbers into digits: 一丁目二番三号 becomes 1丁目2番3号.

looksJapanesefunction

Whether a text is a Japanese address: in Japanese script, ending with Japan, or naming a prefecture beside a Japanese postal code, a romaji designator (-ku, -shi) or a municipality written with an English word (Chiyoda City).

municipalitiesOffunction

Every municipality of a prefecture, the designated cities included.

normalizeJapaneseAddressTextfunction

Makes the text of a Japanese address uniform, as the parser reads it: widths folded, spaces tidied, numerals as digits, and 1の2の3, 1-2-3 or any other dash written 1-2-3.

normalizeRegionfunction

Finds the US state or Canadian province a name, code or misspelling means: Calfornia, Que., British Columbia, nfld.

normalizeTextfunction

Lower-cases a string, turns its periods, commas and semicolons into spaces, folds runs of spaces to one and trims it: the form the parsers compare words in.

parseAddressesfunction

Parses many street addresses with parseAddress, in order.

parseAddressesBatchfunction

Parses many street addresses with parseAddress, and reports which failed and how long it took.

ParsedAddresstype

What parseLocation returns: every part it found, each absent when the address has none.

ParsedIntersectiontype

What parseIntersection returns: two streets, each with its name, type and directionals, and the place.

parseDirectionalfunction

Takes a leading directional off a street (NW Main St), abbreviated.

parseFacilityfunction

Takes a facility's name (a building, a park, a hospital) off the start of an address.

parseInformalAddressfunction

Reads an address written loosely, as a fallback when parseLocation finds no street address: a description such as Downtown near City Hall is kept whole as the street, with any ZIP code after it.

parseInformalAddressesBatchfunction

Parses many loosely written addresses with parseInformalAddress, and reports which failed and how long it took.

parseIntersectionfunction

Parses an intersection of two streets, joined by &, and, at or @, with the city, state and ZIP that may follow.

parseIntersectionsBatchfunction

Parses many intersections with parseIntersection, and reports which failed and how long it took.

parseJapaneseAddressfunction

Parses a Japanese address, in Japanese script or in romaji, into the Japanese fields and the shared ones.

parseLocationfunction

Parses a US, Canadian or Japanese address into its parts.

parseLocationsfunction

Parses many addresses with parseLocation, in order.

parseLocationsBatchfunction

Parses many addresses with parseLocation, and reports which failed and how long it took.

ParseOptionstype

Options for every parser: the country, strict postal codes, snake_case keys and the rest.

parseParentheticalfunction

Takes words in parentheses out of an address, such as (Rear Entrance).

parsePostalCodefunction

Takes a ZIP code, ZIP+4 or Canadian postal code off the end of a text.

parseSecondaryUnitfunction

Takes a secondary unit (apartment, suite, floor and the rest) off a street line.

parseStateProvincefunction

Takes a US state or Canadian province off the end of a text, by code or by name.

parseStreetNumberfunction

Takes the house number off the start of a street line, with a fraction or a letter if it has one.

parseStreetTypefunction

Takes the street type off the end of a street, abbreviated the USPS way.

PO_BOX_PATTERNSconstant

The regular expressions the PO box parser uses: the box itself, a station after it, a box number first, and a trailing comma.

POSTAL_CODE_TO_PROVINCEconstant

Each first letter of a Canadian postal code, to the province or territory it is assigned to.

PostalValidationResulttype

What validatePostalCode returns: whether the code is well formed, its type, and the code written the standard way.

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

PostcodeRegiontype

A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

PROVINCE_EXPANSIONSconstant

Each Canadian province's code in lower case, to its name in lower case: English by default, the French names under their own keys.

PROVINCE_EXPANSIONS_ENconstant

Each Canadian province's code in lower case, to its English name in lower case.

Regiontype

A US state or Canadian province: its code, its country and its name, as normalizeRegion matches them.

SECONDARY_UNIT_PATTERNconstant

A unit at the end of a street line: group 1 is the street before it, group 2 the unit.

SECONDARY_UNIT_TYPESconstant

Each secondary unit designator, abbreviated or in full, in lower case, to the word the parser reports in full: USPS Publication 28 Appendix C2, and Canada Post's French unit words, which stay French.

setValidatedPostalCodefunction

Sets a ZIP or postal code on a result, the way the parsers do: split into ZIP and ZIP+4, a Canadian code in capitals with one space, with zipValid set, and in strict mode only when the code is well formed.

StateCodetype

A US state, DC or territory code that getStateFromZip can return.

STREET_NAME_ACRONYMSconstant

Acronyms written in capitals inside a street name (US, FBI), from their lower-case form, for capitalizeStreetName.

STREET_TYPE_PROPER_CASEconstant

Each street type abbreviation in lower case, to the way the parser reports it (Ave, Xing).

SubRegiontype

An administrative part of a city (a borough, a parish, a ward, an arrondissement) that may be written where the city is expected.

TERRITORY_POSTAL_PREFIXESconstant

The first three characters of each territory's postal codes, since the territories share a first letter.

TERRITORY_POSTAL_RANGESconstant

The patterns that tell the Northwest Territories' X codes from Nunavut's, by their first three characters.

TestCasetype

Any case in the package's JSON test files.

TestCaseBasetype

The fields every case in the package's JSON test files has: a name or description, the input, what is expected and the options.

UKAddressFieldstype

The fields an address in the United Kingdom fills beside the shared ones.

UKNationtype

A nation of the United Kingdom in the tables: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata).

UKNationCodetype

The code of one of the four nations of the United Kingdom, as ISO 3166-2:GB writes it after GB-.

UKPostcodetype

A postcode taken apart: the outward code (area and district) and the inward code (sector and unit), and where it delivers.

UNIT_TYPE_KEYWORDSconstant

The secondary unit designators that take a value after them, as one alternation for a regular expression, longest first so that apartment is tried before apt: USPS Publication 28 Appendix C2, Canada Post's English and French unit words, and a few spellings people write.

US_REGIONSconstant

Every name and other spelling of a US state, DC or territory as a Region object, for fuzzy matching by normalizeRegion.

US_STATE_ALTERNATIVESconstant

Other ways US states are written (shortened forms, old abbreviations, D.C.), in lower case, to their codes.

US_STATE_EXPANSIONSconstant

Each US state's code in lower case, to its name in lower case: the reverse of US_STATE_NAMES.

US_STATE_NAMESconstant

Every US state, DC and territory by its name in lower case, to its two-letter code.

US_STATESconstant

Every name and other spelling of a US state in lower case, to its code: US_STATE_NAMES and US_STATE_ALTERNATIVES together.

US_STREET_TYPESconstant

Every street type USPS Publication 28 lists, and the common spellings of each, in lower case, to its USPS abbreviation in lower case.

USPSFormattingOptionstype

Options for formatUSPS: which lines to include, and whether to set the letter case the USPS way.

validateAddressfunction

Checks an address: whether it has what an address needs, whether its ZIP or postal code is well formed and belongs to the state, province or prefecture named, and how sure the parser is.

validateJapaneseAddressfunction

Checks a parsed Japanese address against the tables: the postal code's shape, whether any code begins with its first three digits, whether it delivers to the prefecture named, and whether the municipality is a real one in that prefecture.

VALIDATION_PATTERNSconstant

Small regular expressions the validators share: letters, digits, a house number at the start, and the like.

ValidationErrortype

One finding of a validator: the field it is about, its code, a message, and how serious it is.

ValidationOptionstype

Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error.

WRITTEN_NUMBERSconstant

House numbers written as words (One, Twenty), as one alternation for a regular expression, so One Microsoft Way is read as number 1.