Standardize()

Summary

Converts an address string into a normalized form for address matching, according to a file of transformation rules.

Changes

Regex rules and Queens-style numbers options added in Version 6.0/2012.

Syntax

std = Standardize(string input, string rules_file, array options)

Argument Contents
input The address string to be standardized
rules_file The path name of the transformation rules file; if null, Maptitude uses regex_rules, if provided, else the supplied fileCaliper.ruL
Option Type Contents
Queens-style numbers Boolean "True" if the input street address has Queens-style numbers (e.g.: 12-345), otherwise "False" (default)
regex rules Array Regular expression rules from a "RegEx" object

Returns

An options array with the names of the elements of the address and their values as strings. The possible elements are:

Element Description
STDNUMBER Standardized street number; suffix letters are removed
STDNAME Standardized street name
POSTADDRESS Items after the street name such as apartment number, floor, building, etc.
STDSTRT1 Standardized street name for first intersection street
STDSTRT2 Standardized street name for second intersection street

Notes

  • The available rules files are:

Element Description
Caliper.rul For street addresses in the U.S.
Num_str.rul For addresses with the street number followed by the street name
Str_Num.rul For addresses with the street name followed by the street number
  • Standardized street names have rule-based abbreviations for the prefix direction, type, and suffix direction (if present).

  • If the address is not an intersection, STDSTRT1 and STDSTRT2 will not appear. If the address is an intersection, STDNUMBER and STDNAME will not appear. POSTADDRESS will appear if the address has items after the street name.

  • regex_rules is an optional argument. If you use regex_rules set rules_file to null.

  • regex_rules contains regular expression rules that you specify with a Regex object. To standardize an address with your own rules, you first create an object of type RegEx and then use it with Standardize(). For more information, see "Address Standardization."

Examples

std = Standardize("123a no main street", )
// std.STDNUMBER = "123"
// std.STDNAME = "N MAIN ST"
rx = CreateObject("RegEx","{[0-9]+}:(STDNUMBER) {[a-z ]+}:(STDNAME)")
parsed = Standardize("123 MAIN STREET",null,rx.GetRules())
// parsed is the option array: {{"STDNUMBER","123"},{"STDNAME","MAIN STREET"}}

See Also

Function Summary
StandardizeView() Standardizes address strings in a view and writes the results to a table