Skip to content

Commit

Permalink
Merge pull request #43 from argyle-engineering/support-one-letter-str…
Browse files Browse the repository at this point in the history
…eet-names

Support one-letter street names
  • Loading branch information
lmelninkas authored Apr 17, 2024
2 parents e06d3d5 + a5cceee commit dff82c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyap/source_US/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def str_list_to_upper_lower_regex(str_list: List[str]) -> str:
# 'Jean Baptiste Point du Sable Lake Shore Drive' and
# 'Northeast Kentucky Industrial Parkway'
# https://atkinsbookshelf.wordpress.com/tag/longest-street-name-in-us/
# On the other hand, there are streets like "Ed Drive".
# On the other hand, there are streets like "Ed Drive" and "M Street".
street_name_multi_word_re = r"""
(?:
[a-zA-Z0-9\ \.\-\'\’]{3,41}|[a-zA-Z]{2}(?=\ [a-zA-Z])
\b[a-zA-Z0-9\ \.\-\'\’]{3,41}|\b[A-Z][A-Za-z]?(?=\ [A-Z])
)
"""

Expand Down
1 change: 1 addition & 0 deletions tests/test_parser_us.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ def test_full_street_positive(input, expected):
("PO Box # A3656\nChicago, IL 60690", True),
("2006 Broadway Ave Suite 2A, PO Drawer J, Great Bend, KS 67530", True),
("135 Pinelawn Road STE 130 S, Melville, NY 11747", True),
("1800 M STREET NW SUITE 375 N, WASHINGTON, DC 20036", True),
# negative assertions
("ONE HEALING CENTER LLC, 16444", False),
("85 STEEL REGULAR SHAFT - NE", False),
Expand Down

0 comments on commit dff82c3

Please sign in to comment.