findMunicipalitiesByNamefunction
The municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima).
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/auAU_CROSS_BORDER_POSTCODESconstantThe 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_POSTCODESconstantThe 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_RANGESconstantThe blocks of postcodes Australia Post allocates to each state and territory.
AU_STATESconstantThe 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_TYPESconstantAustralia's street types: each AS4590 abbreviation, in proper case as the parser reports it, with the word it stands for.
australiaconstantAustralia'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.
AustralianAddressFieldstypeThe fields an Australian address fills beside the shared ones.
AustralianPostcodeRangetypeOne block of postcodes Australia Post allocates to a state or territory: every postcode from from to to, inclusive, written as four digits.
AustralianStatetypeAn 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).
AustralianStateCodetypeThe code of an Australian state or territory, as Australia Post writes it on the last line of an address.
AustraliaPostFormattingOptionstypeOptions for formatAustraliaPost.
compareAustralianAddressesfunctionCompares two Australian addresses field by field: the unit, level, lot, number, street, suburb, state and postcode.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
expandAustralianStreetTypefunctionThe word an AS4590 street type stands for: Pde is Parade.
findAustralianStatefunctionFinds an Australian state or territory by its code (VIC, AU-VIC, Vic.) or its name in English or Japanese (Victoria, ビクトリア州), in any letter case.
formatAustraliaPostfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getPostcodeRangesForAustralianStatefunctionThe blocks of postcodes Australia Post allocates to a state or territory.
getStateFromAustralianPostcodefunctionThe state or territory whose block of postcodes a postcode is in.
getStatesForAustralianPostcodefunctionEvery 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.
looksAustralianfunctionWhether 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).
parseAustralianAddressfunctionParses 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
validateAustralianAddressfunctionChecks 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).
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/gbcompareUKAddressesfunctionCompares two addresses in the United Kingdom field by field: the flat, the building, the number, the thoroughfare, the post town and the postcode.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findUKNationfunctionFinds a nation of the United Kingdom by its code (SCT, GB-SCT) or its name in English or Japanese.
formatRoyalMailfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
GB_DISTRICT_NATIONSconstantThe 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_NATIONSconstantThe 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_AREASconstantEvery 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_DISTRICTSconstantEvery postcode district in Great Britain, by area: the numbered districts as runs, then those with a letter.
GB_THOROUGHFARE_DESCRIPTORSconstantThe 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.
getNationFromUKPostcodefunctionThe 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).
getNationsForUKPostcodefunctionEvery 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.
isValidUKPostcodefunctionWhether 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.
looksBritishfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
parseUKAddressfunctionParses 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.
parseUKPostcodefunctionTakes 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.
RoyalMailFormattingOptionstypeOptions for formatRoyalMail.
UKAddressFieldstypeThe fields an address in the United Kingdom fills beside the shared ones.
UKNationtypeA 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).
UKNationCodetypeThe code of one of the four nations of the United Kingdom, as ISO 3166-2:GB writes it after GB-.
UKPostcodetypeA postcode taken apart: the outward code (area and district) and the inward code (sector and unit), and where it delivers.
UKPostcodeAreatypeA 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).
unitedKingdomconstantThe 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.
validateUKAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/decompareGermanAddressesfunctionCompares 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.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
DE_BUILDING_WORDSconstantThe 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_NAMESconstantWhat a country at the end of an address may be called, in capitals with no umlauts: DEUTSCHLAND, GERMANY, ALLEMAGNE, BRD.
DE_STATESconstantThe 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_OPENERSconstantThe 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_SUFFIXESconstantWhat 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_TYPESconstantThe words for a flat or a room, which the parser reports as secUnitType in full, with the abbreviations it reads for each: `Whg.
DeutschePostFormattingOptionstypeOptions for formatDeutschePost.
findGermanStatefunctionFinds 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.
formatDeutschePostfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
GermanAddressFieldstypeThe fields an address in Germany fills beside the shared ones.
GermanPostcodetypeA postcode taken apart: the Land it is in, and whether GeoNames' list has it.
GermanStatetypeA 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).
GermanStateCodetypeThe code of one of the sixteen Länder of Germany, as ISO 3166-2:DE writes it after DE-.
germanyconstantGermany'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.
getStateFromGermanPostcodefunctionThe Land a postcode is in, by its code: BY for 80331, BE for 10115.
isKnownGermanPostcodefunctionWhether GeoNames' list for Germany has a postcode (its places include those of large firms, whose postcodes are their own).
isValidGermanPostcodefunctionWhether a postcode follows Deutsche Post's shape: five digits.
looksGermanfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseGermanAddressfunctionParses an address in Germany into the parts Deutsche Post and DIN 5008 lay out: who it is care of (careOf, from c/o, `z.
parseGermanPostcodefunctionTakes 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.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
validateGermanAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/frcompareFrenchAddressesfunctionCompares 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.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findFrenchDepartmentfunctionFinds a department of France by its code (75, 2A, 971) or its name (Paris, Haute-Corse), without regard to letter case or accents.
formatLaPostefunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
FR_BUILDING_WORDSconstantThe 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_COLLECTIVITIESconstantThe overseas collectivities that have postcodes in La Poste's base: each with its code, its ISO 3166-1 country code and its name.
FR_DEPARTMENTSconstantThe 101 departments of France, in order of their codes, each with its code (75, 2A, 971), its name and its region's.
FR_NUMBER_EXTENSIONSconstantThe 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_TYPESconstantThe 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_TYPESconstantThe 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.
franceconstantFrance'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.
FrenchAddressFieldstypeThe fields an address in France fills beside the shared ones.
FrenchCollectivitytypeAn 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.
FrenchDepartmenttypeA department of France in the tables: its code (75, 2A, 971), its name and its region's, from INSEE's Code officiel géographique.
FrenchPostalCountrytypeThe 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.
FrenchPostcodetypeA 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.
getDepartmentFromFrenchPostcodefunctionThe department a postcode's number belongs to, by its code: 75 for 75008, 2B for 20200, 971 for 97100.
isKnownFrenchPostcodefunctionWhether La Poste's base officielle des codes postaux lists a postcode: France, the overseas departments and collectivities and Monaco.
isValidFrenchPostcodefunctionWhether a postcode follows La Poste's shape: five digits.
LaPosteFormattingOptionstypeOptions for formatLaPoste.
looksFrenchfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseFrenchAddressfunctionParses 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.
parseFrenchPostcodefunctionTakes 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.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
validateFrenchAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/nlcompareDutchAddressesfunctionCompares two addresses in the Netherlands field by field: the street, the house number and its addition, the place and the postcode.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
formatPostNLfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
isKnownDutchPostcodefunctionWhether 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).
isValidDutchPostcodefunctionWhether 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.
looksDutchfunctionWhether 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.
netherlandsconstantThe 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseDutchAddressfunctionParses 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).
parseDutchPostcodefunctionTakes a postcode apart: its canonical form (1015 CJ) and whether CBS's list has its digits.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
PostNLFormattingOptionstypeOptions for formatPostNL.
validateDutchAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/escompareSpanishAddressesfunctionCompares two addresses in Spain field by field: the street, the number, the floor and the door, the place and the postcode.
CorreosFormattingOptionstypeOptions for formatCorreos.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
ES_PROVINCESconstantThe provinces of Spain, with the two cities that are no province's.
findSpanishProvincefunctionFinds a province of Spain by its code (M, ES-M) or its name in English, ignoring accents and letter case.
formatCorreosfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getProvinceFromSpanishPostcodefunctionThe province a postcode is in, as its ISO 3166-2 code without ES-: the province its first two digits name.
isKnownSpanishPostcodefunctionWhether GeoNames' list for Spain has a postcode (11,150 of them).
isValidSpanishPostcodefunctionWhether a postcode follows Correos' shape: five digits, the first two a province's number (01 to 52).
looksSpanishfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
parseSpanishAddressfunctionParses 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.
parseSpanishPostcodefunctionTakes a postcode apart: the province it is in, and whether GeoNames' list has it.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
spainconstantSpain'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.
validateSpanishAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/itcompareItalianAddressesfunctionCompares two addresses in Italy field by field: the street, the civic number, the staircase, the flat, the place and the postcode.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findItalianProvincefunctionFinds a province of Italy by its sigla (RM, IT-RM) or its name in English, ignoring accents and letter case.
formatPosteItalianefunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getProvinceFromItalianPostcodefunctionThe province a postcode is in, by its sigla (RM): the one most of GeoNames' places for the postcode are in.
isKnownItalianPostcodefunctionWhether GeoNames' list for Italy has a postcode (4,736 of them).
isValidItalianPostcodefunctionWhether a postcode follows Poste Italiane's shape: five digits.
IT_PROVINCESconstantThe provinces, metropolitan cities and other second-level divisions of Italy.
italyconstantItaly'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.
looksItalianfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseItalianAddressfunctionParses 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.
parseItalianPostcodefunctionTakes a postcode apart: the province it is in, and whether GeoNames' list has it.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
PosteItalianeFormattingOptionstypeOptions for formatPosteItaliane.
validateItalianAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/nzcompareNewZealandAddressesfunctionCompares two addresses in New Zealand field by field: the unit, the street, its number, the city and the postcode.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findNewZealandRegionfunctionFinds a region of New Zealand by its code (AUK, NZ-AUK) or its name in English, ignoring macrons, hyphens and letter case.
formatNZPostfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getRegionFromNewZealandPostcodefunctionThe 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.
isKnownNewZealandPostcodefunctionWhether GeoNames' list for New Zealand has a postcode (1,737 of them).
isValidNewZealandPostcodefunctionWhether a postcode follows NZ Post's shape: four digits.
looksNewZealandfunctionWhether 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.
newZealandconstantNew 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.
NZ_REGIONSconstantThe regions of New Zealand.
NZPostFormattingOptionstypeOptions for formatNZPost.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseNewZealandAddressfunctionParses 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.
parseNewZealandPostcodefunctionTakes a postcode apart: the region it is in, and whether GeoNames' list has it.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
validateNewZealandAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/incompareIndianAddressesfunctionCompares two addresses in India field by field: the unit, the street, its number, the area, the city and the PIN code.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findIndianStatefunctionFinds 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.
formatIndiaPostfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getStateFromIndianPostcodefunctionThe 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_STATESconstantThe states and union territories of India.
indiaconstantIndia'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.
IndiaPostFormattingOptionstypeOptions for formatIndiaPost.
isKnownIndianPostcodefunctionWhether GeoNames' list for India has a PIN code (19,238 of them).
isValidIndianPostcodefunctionWhether a PIN code follows India Post's shape: six digits, the first not nought, with or without a space after the third.
looksIndianfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseIndianAddressfunctionParses 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.
parseIndianPostcodefunctionTakes a PIN code apart: the state it is in, and whether GeoNames' list has it.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
validateIndianAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/krcompareKoreanAddressesfunctionCompares 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.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findKoreanProvincefunctionFinds 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.
formatKoreaPostfunctionWrites an address in South Korea as Korea Post asks.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getProvinceFromKoreanPostcodefunctionThe province or metropolitan city a postcode is in, by its ISO 3166-2 code without KR- (11 for Seoul).
isKnownKoreanPostcodefunctionWhether GeoNames' list for South Korea has a postcode (34,249 of them).
isValidKoreanPostcodefunctionWhether a postcode follows Korea Post's shape: five digits.
KoreaPostFormattingOptionstypeOptions for formatKoreaPost.
KR_PROVINCESconstantThe metropolitan cities and provinces of South Korea.
looksKoreanfunctionWhether 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
parseKoreanAddressfunctionParses 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).
parseKoreanPostcodefunctionTakes a postcode apart: the province it is in, and whether GeoNames' list has it.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
southKoreaconstantSouth 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.
validateKoreanAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/brBR_STATESconstantThe states of Brazil and the Federal District.
brazilconstantBrazil'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.
BrazilianPostFormattingOptionstypeOptions for formatBrazilianPost.
compareBrazilianAddressesfunctionCompares two addresses in Brazil field by field: the street, its number, the complement, the bairro's city and the CEP.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
findBrazilianStatefunctionFinds a state of Brazil by its code (SP, BR-SP) or its name in English or Portuguese, ignoring accents and letter case.
formatBrazilianPostfunctionWrites 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.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
getStateFromBrazilianPostcodefunctionThe state a CEP is in, by its code (SP): the state whose range holds the CEP's first five digits.
isKnownBrazilianPostcodefunctionWhether 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.
isValidBrazilianPostcodefunctionWhether a CEP follows the Correios' shape: eight digits, with a hyphen after the fifth or none.
looksBrazilianfunctionWhether 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).
parseBrazilianAddressfunctionParses 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.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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).
validateBrazilianAddressfunctionChecks 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.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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/elementADDRESS_FIELD_COUNTRIESconstantSeven built-in field countries; auto detects among them.
ADDRESS_FIELD_PARSE_KEYSconstantNative parser options checked by builder coverage.
ADDRESS_FIELD_VALIDATION_KEYSconstantNative validator options checked by builder coverage.
AddressFieldclassA form-associated address input using the seven native country parsers.
AddressFieldOptionstypeFull native settings and a private callback; raw addresses never enter public events.
defineFieldfunctionRegister the form field under its default or a custom tag, idempotently; safe on a server.
@johnmorrisdotca/address-plus/element/defineADDRESS_FIELD_COUNTRIESconstantSeven built-in field countries; auto detects among them.
ADDRESS_FIELD_PARSE_KEYSconstantNative parser options checked by builder coverage.
ADDRESS_FIELD_VALIDATION_KEYSconstantNative validator options checked by builder coverage.
AddressFieldclassA form-associated address input using the seven native country parsers.
AddressFieldOptionstypeFull native settings and a private callback; raw addresses never enter public events.
defineFieldfunctionRegister the form field under its default or a custom tag, idempotently; safe on a server.
@johnmorrisdotca/address-plusAddressAbbreviationstypeWhat getAddressAbbreviations returns: one map per kind of abbreviation.
AddressComparisonOptionstypeOptions for comparing addresses: what to normalize before comparing, whether to allow small typos, and whether every field must match exactly.
AddressComparisonResulttypeWhat compareAddresses returns: the verdict, the match type and the similarity.
AddressComparisonTestCasetypeA comparison case in the package's JSON test files: two addresses and the match expected.
AddressDifferencetypeOne part on which two addresses differ, with both values and the kind of difference.
AddressFormattingOptionstypeOptions for formatAddress and cleanAddress: what to abbreviate, capitals, the unit, the country and the line separator.
AddressFormattingTestCasetypeA formatting case in the package's JSON test files: an address and the text expected.
AddressMatchTypetypeHow strongly two addresses match, from exact to none.
AddressParsertypeThe shape of the default export: the four parsers parse-address's users call on one object.
AddressParsingTestCasetypeA parsing case in the package's JSON test files: an address and the fields expected from it.
AddressSimilarityResulttypeHow alike two addresses are: an overall score from 0 to 1, a score for each part, and the differences.
AddressValidationResulttypeWhat validateAddress returns.
AddressValidationTestCasetypeA validation case in the package's JSON test files: an address and the verdict and codes expected.
AustralianAddressFieldstypeThe fields an Australian address fills beside the shared ones.
AustralianPostcodeRangetypeOne block of postcodes Australia Post allocates to a state or territory: every postcode from from to to, inclusive, written as four digits.
AustralianStatetypeAn 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).
AustralianStateCodetypeThe code of an Australian state or territory, as Australia Post writes it on the last line of an address.
BatchParseErrortypeOne address a batch could not parse: its index, the input and the reason.
BatchParseOptionstypeOptions for the batch parsers: the parse options, plus whether to stop at the first error and whether to include the statistics.
BatchParseResulttypeWhat a batch parser returns: the results in order, the errors and the statistics.
BatchParseStatstypeThe counts and timing of a batch: how many were parsed, how many failed, and how long it took.
BatchProcessingTestCasetypeA batch case in the package's JSON test files: several addresses and the counts expected.
buildRegexFromDictfunctionA regular expression matching any key of a dictionary as a whole word, longest first.
CA_PROVINCE_ALTERNATIVESconstantOther ways Canadian provinces are written (old and informal abbreviations such as PQ, Que., Nfld.), in lower case, to their codes.
CA_PROVINCE_NAMESconstantEvery Canadian province and territory by its English or French name, to its code.
CA_PROVINCE_NAMES_ENconstantEvery Canadian province and territory by its English name in lower case, to its two-letter code.
CA_PROVINCE_NAMES_FRconstantEvery Canadian province and territory by its French name in lower case, to its two-letter code.
CA_PROVINCESconstantEvery name and other spelling of a Canadian province, to its code: the names and the alternatives together.
CA_REGIONSconstantEvery name and other spelling of a Canadian province or territory as a Region object, for fuzzy matching by normalizeRegion.
CA_STREET_TYPESconstantEvery street type Canada Post lists, in English and French, with common spellings, in lower case, to the abbreviation the parser reports.
CanadaPostFormattingOptionstypeOptions for formatCanadaPost: which lines to include, bilingual labels, and whether to set the letter case the Canada Post way.
CANADIAN_POSTAL_CODE_PATTERNconstantA Canadian postal code with the letters Canada Post assigns, with or without its space.
CANADIAN_POSTAL_LIBERAL_PATTERNconstantA Canadian postal code of any letters, for finding one before it is checked.
capitalizeStreetNamefunctionCapitalizes a street name the way it is signed.
capitalizeWordsfunctionCapitalizes the first letter of each word.
CITY_PATTERNSconstantPatterns for a city of one or more words at the end of a text, after a space, used where no comma marks it.
cleanAddressfunctionTidies an address typed in a hurry: spaces, commas, letter case, the street type and the state, without changing what it says.
cleanAddressDetailedfunctionTidies an address like cleanAddress, and says what it changed.
CleanAddressOptionstypeOptions for cleanAddress: which tidying to do, and the letter case to set.
CleanAddressResulttypeWhat cleanAddressDetailed returns: the tidied address and what changed.
CleanAddressTestCasetypeA cleaning case in the package's JSON test files: an address and the tidied text expected.
COMMON_PARSER_PATTERNSconstantPattern builders the parsers share: a ZIP, a state or a postal code at the end of a text, and a city before a state.
COMMON_STREET_NAMES_PATTERNconstantStreet names common enough that they must not be taken as part of a city's name.
compareAddressesfunctionCompares two parsed addresses field by field, allowing for abbreviations (Street and St), state names and codes, letter case and small typos.
CONNECTOR_WORDSconstantSmall words (of, the, and) that may be in lower case inside a facility's name written in title case.
COUNTRIESconstantThe country codes the parser reports: US, CA and JP.
CountryCodetypeA country code the parser reports: US, CA or JP.
CountryComparisontypeWhat 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).
CountryDifferencetypeOne 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.
CountryModuletypeA country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer.
CountryValidationtypeWhat a country module's validator returns: the errors and the warnings it found.
defaultconstantThe 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.
detectCountryfunctionWhich country a parsed address is in, from its postal code, then its state or province.
DIRECTION_EXPANSIONSconstantEach directional abbreviation in lower case, to the word in full.
DIRECTIONAL_MAPconstantEach directional word, in English or French, in lower case, to its abbreviation (northwest and nord-ouest to NW and NO).
FACILITY_DELIMITER_PATTERNconstantA facility's name followed by a comma or a dash and then the address.
FACILITY_DELIMITER_PATTERNSconstantThe ways a facility's name is set off from an address: in parentheses, before a delimiter, or as a trailing island.
FACILITY_INDICATORSconstantWords that mark a place's name as a facility (center, tower, hospital, université), in lower case.
FACILITY_PATTERNSconstantThe patterns that find a facility's name, in English and French.
findMunicipalitiesByNamefunctionThe municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima).
findMunicipalitiesByRomajifunctionThe municipalities a romaji name could mean, written with or without macrons and designators (Chiyoda-ku, Chiyoda City, Sapporo-shi Chuo-ku, Chuo-ku, Sapporo).
findMunicipalityByCodefunctionThe municipality with a JIS X 0402 code, a designated city's own code included.
findPrefecturefunctionThe prefecture a name, reading, romaji spelling or JIS code refers to: 東京都, 東京, トウキョウト, Tokyo, Osaka Prefecture, 13.
formatAddressfunctionWrites a parsed address back out as lines and as one line, with abbreviations or in full.
formatCanadaPostfunctionWrites 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.
formatJapanesefunctionWrites a Japanese address in Japanese order, as an envelope is addressed: 〒100-0005, then 東京都千代田区丸の内1-2-3, then サンプルビル5階501号室.
formatJapaneseEnglishfunctionWrites a Japanese address in English order, as a form from abroad expects: building, room, block, town, municipality, prefecture, postal code, Japan.
FormattedAddresstypeA formatted address: its lines, and the same on one line.
formatUSPSfunctionWrites 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_PREPOSITIONSconstantFrench 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 ).
FrenchAddressFieldstypeThe fields an address in France fills beside the shared ones.
FrenchCollectivitytypeAn 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.
FrenchDepartmenttypeA department of France in the tables: its code (75, 2A, 971), its name and its region's, from INSEE's Code officiel géographique.
FrenchPostalCountrytypeThe 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.
FrenchPostcodetypeA 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.
FuzzyMatchOptionstypeSettings for fuzzy string matching: the lowest similarity that counts, the largest edit distance, and phonetic matching.
GENERAL_DELIVERY_PATTERNSconstantGeneral delivery written alone or before a city.
GermanAddressFieldstypeThe fields an address in Germany fills beside the shared ones.
GermanPostcodetypeA postcode taken apart: the Land it is in, and whether GeoNames' list has it.
GermanStatetypeA 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).
GermanStateCodetypeThe code of one of the sixteen Länder of Germany, as ISO 3166-2:DE writes it after DE-.
getAddressAbbreviationsfunctionEvery abbreviation the formatters use: street types, directionals, secondary units, states and provinces.
getAddressSimilarityfunctionThe similarity of two parsed addresses, part by part, without a verdict: the score and each part's score, and the differences.
getPostalPrefixesForPrefecturefunctionThe three-digit postal prefixes a prefecture's codes begin with, the reverse of getPrefectureFromJapanesePostalCode.
getPostalPrefixesForProvincefunctionThe postal code prefixes a province or territory uses, the reverse of getProvinceFromPostalCode.
getPrefectureFromJapanesePostalCodefunctionThe 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.
getProvinceFromPostalCodefunctionThe 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.
getStateFromZipfunctionThe state or territory a US ZIP code is in.
getValidationErrorsfunctionThe errors validateAddress finds, without the rest of its result.
getZipPrefixesForStatefunctionThe 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.
hasValidAddressComponentsfunctionWhether a string looks like an address at all: a number and a street, a PO box, a postal code or another recognised part.
INTERSECTION_PATTERNSconstantThe regular expressions and pattern builders the intersection parser uses to find the city and each street with its type.
ISLAND_TYPE_PATTERNconstantThe words for an island, for addresses on one (Island, Isle, Île).
isSameAddressfunctionWhether two parsed addresses are the same place, by the same rules as compareAddresses.
isValidAddressfunctionWhether an address passes validateAddress.
JapaneseAddressFieldstypeThe fields a Japanese address fills on top of the shared ones.
JapaneseEnglishFormattingOptionstypeOptions for formatJapaneseEnglish.
JapaneseFormattingOptionstypeOptions for formatJapanese.
JapaneseMunicipalitytypeA 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.
JapanesePrefecturetypeA prefecture (都道府県) in the tables: its JIS code, official name, katakana reading and romaji.
JapaneseValidationtypeWhat validateJapaneseAddress returns: the errors and the warnings found.
JP_DESIGNATED_CITIESconstantThe twenty designated cities (政令指定都市) as municipalities of their own.
JP_MUNICIPALITIESconstantEvery 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_EXCEPTIONSconstantThe postal codes that deliver to another prefecture than the rest of their three-digit prefix, each to that prefecture's JIS code.
JP_POSTAL_PREFIXESconstantEach three-digit postal prefix, to the JIS code of the prefecture most of its codes deliver to.
JP_PREFECTURESconstantThe 47 prefectures in JIS X 0401 order, each with its code, official name, katakana reading and romaji.
kanjiNumeralsToDigitsfunctionTurns the kanji numerals that stand for block, floor or room numbers into digits: 一丁目二番三号 becomes 1丁目2番3号.
looksJapanesefunctionWhether 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).
municipalitiesOffunctionEvery municipality of a prefecture, the designated cities included.
MUSIC_SQUARE_EAST_PATTERNconstantNashville's Music Square East, whose name ends in a directional word that is part of it.
normalizeJapaneseAddressTextfunctionMakes 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.
normalizeRegionfunctionFinds the US state or Canadian province a name, code or misspelling means: Calfornia, Que., British Columbia, nfld.
normalizeStateProvinceNamefunctionThe code of a US state or Canadian province written in full, in lower case.
normalizeTextfunctionLower-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.
PARENTHETICAL_PATTERNconstantWords in parentheses inside an address; group 1 is what is inside them.
parseAddressfunctionParses a street address.
parseAddressesfunctionParses many street addresses with parseAddress, in order.
parseAddressesBatchfunctionParses many street addresses with parseAddress, and reports which failed and how long it took.
ParsedAddresstypeWhat parseLocation returns: every part it found, each absent when the address has none.
ParsedIntersectiontypeWhat parseIntersection returns: two streets, each with its name, type and directionals, and the place.
parseDirectionalfunctionTakes a leading directional off a street (NW Main St), abbreviated.
parseFacilityfunctionTakes a facility's name (a building, a park, a hospital) off the start of an address.
parseInformalAddressfunctionReads 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.
parseInformalAddressesfunctionParses many loosely written addresses with parseInformalAddress, in order.
parseInformalAddressesBatchfunctionParses many loosely written addresses with parseInformalAddress, and reports which failed and how long it took.
parseIntersectionfunctionParses an intersection of two streets, joined by &, and, at or @, with the city, state and ZIP that may follow.
parseIntersectionsfunctionParses many intersections with parseIntersection, in order.
parseIntersectionsBatchfunctionParses many intersections with parseIntersection, and reports which failed and how long it took.
parseJapaneseAddressfunctionParses a Japanese address, in Japanese script or in romaji, into the Japanese fields and the shared ones.
parseLocationfunctionParses a US, Canadian or Japanese address into its parts.
parseLocationsfunctionParses many addresses with parseLocation, in order.
parseLocationsBatchfunctionParses many addresses with parseLocation, and reports which failed and how long it took.
ParseOptionstypeOptions for every parser: the country, strict postal codes, snake_case keys and the rest.
parseParentheticalfunctionTakes words in parentheses out of an address, such as (Rear Entrance).
parsePostalCodefunctionTakes a ZIP code, ZIP+4 or Canadian postal code off the end of a text.
parseSecondaryUnitfunctionTakes a secondary unit (apartment, suite, floor and the rest) off a street line.
parseStateProvincefunctionTakes a US state or Canadian province off the end of a text, by code or by name.
parseStreetNumberfunctionTakes the house number off the start of a street line, with a fraction or a letter if it has one.
parseStreetTypefunctionTakes the street type off the end of a street, abbreviated the USPS way.
PO_BOX_PATTERNSconstantThe 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_PROVINCEconstantEach first letter of a Canadian postal code, to the province or territory it is assigned to.
PostalValidationResulttypeWhat validatePostalCode returns: whether the code is well formed, its type, and the code written the standard way.
PostcodeLookuptypeA 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.
PostcodeRegiontypeA 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_EXPANSIONSconstantEach 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_ENconstantEach Canadian province's code in lower case, to its English name in lower case.
PROVINCE_EXPANSIONS_FRconstantEach Canadian province's code in lower case, to its French name in lower case.
RegiontypeA US state or Canadian province: its code, its country and its name, as normalizeRegion matches them.
SECONDARY_UNIT_PATTERNconstantA unit at the end of a street line: group 1 is the street before it, group 2 the unit.
SECONDARY_UNIT_TYPESconstantEach 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.
setValidatedPostalCodefunctionSets 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.
StateCodetypeA US state, DC or territory code that getStateFromZip can return.
STREET_NAME_ACRONYMSconstantAcronyms written in capitals inside a street name (US, FBI), from their lower-case form, for capitalizeStreetName.
STREET_TYPE_DETECTION_PATTERNconstantWhether a text has a common street type in it, used to judge that a parse found a street.
STREET_TYPE_EXPANSIONSconstantEach USPS street type abbreviation in lower case, to the word in full.
STREET_TYPE_PROPER_CASEconstantEach street type abbreviation in lower case, to the way the parser reports it (Ave, Xing).
SubRegiontypeAn administrative part of a city (a borough, a parish, a ward, an arrondissement) that may be written where the city is expected.
TERRITORY_POSTAL_PREFIXESconstantThe first three characters of each territory's postal codes, since the territories share a first letter.
TERRITORY_POSTAL_RANGESconstantThe patterns that tell the Northwest Territories' X codes from Nunavut's, by their first three characters.
TestCasetypeAny case in the package's JSON test files.
TestCaseBasetypeThe fields every case in the package's JSON test files has: a name or description, the input, what is expected and the options.
UKAddressFieldstypeThe fields an address in the United Kingdom fills beside the shared ones.
UKNationtypeA 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).
UKNationCodetypeThe code of one of the four nations of the United Kingdom, as ISO 3166-2:GB writes it after GB-.
UKPostcodetypeA postcode taken apart: the outward code (area and district) and the inward code (sector and unit), and where it delivers.
UNIT_TYPE_KEYWORDSconstantThe 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.
UNIT_TYPE_NUMBER_PATTERNconstantA unit's designator and value: groups 1 and 2 (apt 123, `Apt.
US_REGIONSconstantEvery name and other spelling of a US state, DC or territory as a Region object, for fuzzy matching by normalizeRegion.
US_STATE_ALTERNATIVESconstantOther ways US states are written (shortened forms, old abbreviations, D.C.), in lower case, to their codes.
US_STATE_EXPANSIONSconstantEach US state's code in lower case, to its name in lower case: the reverse of US_STATE_NAMES.
US_STATE_NAMESconstantEvery US state, DC and territory by its name in lower case, to its two-letter code.
US_STATESconstantEvery name and other spelling of a US state in lower case, to its code: US_STATE_NAMES and US_STATE_ALTERNATIVES together.
US_STREET_TYPESconstantEvery street type USPS Publication 28 lists, and the common spellings of each, in lower case, to its USPS abbreviation in lower case.
USPSFormattingOptionstypeOptions for formatUSPS: which lines to include, and whether to set the letter case the USPS way.
validateAddressfunctionChecks 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.
validateJapaneseAddressfunctionChecks 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.
validatePostalCodefunctionChecks the shape of a US ZIP code or a Canadian postal code.
VALIDATION_PATTERNSconstantSmall regular expressions the validators share: letters, digits, a house number at the start, and the like.
ValidationErrortypeOne finding of a validator: the field it is about, its code, a message, and how serious it is.
ValidationOptionstypeOptions 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_NUMBERSconstantHouse numbers written as words (One, Twenty), as one alternation for a regular expression, so One Microsoft Way is read as number 1.
ZIP_CODE_PATTERNconstantA US ZIP code with an optional ZIP+4.
ZIP_CODE_REGEX_PATTERNconstantThe source of ZIP_CODE_PATTERN, for building larger patterns.
ZIP_VALIDATION_PATTERNSconstantThe shape of something that could be a ZIP code.