datamade / usaddress

:us: a python library for parsing unstructured United States address strings into address components
https://parserator.datamade.us/usaddress
MIT License
1.51k stars 303 forks source link

usaddress.RepeatedLabelError: #289

Open UnderJollyRoger opened 3 years ago

UnderJollyRoger commented 3 years ago

Hello, I received this error when parsing an address point file table using the arcpy.da.UpdateCursor.

Traceback (most recent call last):
  File "\Jared\Python Scripts\ArcGISPro\USPS_ADDRE_copy.py", line 35, in <module>
    unitname()
  File "\Jared\Python Scripts\ArcGISPro\USPS_ADDRE_copy.py", line 31, in unitname
    adr = usaddress.tag(row[0])
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\usaddress\__init__.py", line 178, in tag
    label)
usaddress.RepeatedLabelError: 
ERROR: Unable to tag this string because more than one area of the string has the same label

ORIGINAL STRING:  CHECK S ST LOUIS ST  LOT 34 ELWOOD, IL 60421
PARSED TOKENS:    [('CHECK', 'StreetName'), ('S', 'StreetNamePostDirectional'), ('ST', 'PlaceName'), ('LOUIS', 'StreetName'), ('ST', 'StreetNamePostType'), ('LOT', 'OccupancyType'), ('34', 'OccupancyIdentifier'), ('ELWOOD,', 'PlaceName'), ('IL', 'StateName'), ('60421', 'ZipCode')]
UNCERTAIN LABEL:  StreetName

When this error is raised, it's likely that either (1) the string is not a valid person/corporation name or (2) some tokens were labeled incorrectly

For more information, see the documentation at https://usaddress.readthedocs.io/
UnderJollyRoger commented 3 years ago

UPDATE: I think the "CHECK" in the string is a note by the editor put in to remind him/her to come back to this particular address for whatever reason.