You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parsing an address that contains words in the city name that also exists in the STREET_TYPES hash produces incorrect results if "punctuation" is not present between the street, city, and state components.
Example:
Correct (where punctuation is provided):
1.9.3p392 :005 > address = StreetAddress::US.parse("120 S Main St, Salt Lake City, UT 84101-1602")
=> 120 S Main St, Salt Lake City, UT 84101-1602
Incorrect (where punctuation is omitted or not available):
1.9.3p392 :006 > address = StreetAddress::US.parse("120 S Main St Salt Lake City UT 84101-1602")
=> 120 S Main St Salt Lk, City, UT 84101-1602
Salt becomes part of the street information, Lake is normalized to Lk and becomes the street_type, leaving the value of "City" to occupy the city element. Seems the "hunt" and delineation for STREET_TYPES may be a bit too "greedy" when punctuation is not available.
The text was updated successfully, but these errors were encountered:
StreetAddress (1.0.5)
Parsing an address that contains words in the city name that also exists in the STREET_TYPES hash produces incorrect results if "punctuation" is not present between the street, city, and state components.
Example:
Correct (where punctuation is provided):
1.9.3p392 :005 > address = StreetAddress::US.parse("120 S Main St, Salt Lake City, UT 84101-1602")
=> 120 S Main St, Salt Lake City, UT 84101-1602
1.9.3p392 :015 > address.street
=> "Main"
1.9.3p392 :016 > address.street_type
=> "St"
1.9.3p392 :017 > address.city
=> "Salt Lake City"
Incorrect (where punctuation is omitted or not available):
1.9.3p392 :006 > address = StreetAddress::US.parse("120 S Main St Salt Lake City UT 84101-1602")
=> 120 S Main St Salt Lk, City, UT 84101-1602
1.9.3p392 :008 > address.street
=> "Main St Salt"
1.9.3p392 :009 > address.street_type
=> "Lk"
1.9.3p392 :010 > address.city
=> "City"
In the case of "Salt Lake City":
Salt becomes part of the street information, Lake is normalized to Lk and becomes the street_type, leaving the value of "City" to occupy the city element. Seems the "hunt" and delineation for STREET_TYPES may be a bit too "greedy" when punctuation is not available.
The text was updated successfully, but these errors were encountered: