Skip to content

Commit 459f981

Browse files
authored
Merge pull request #78 from argyle-engineering/more-matches
Support `Ap` for appartment
2 parents f9a9b31 + 22bee76 commit 459f981

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

pyap/source_US/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ def street_type_list_to_regex(street_type_list: list[str]) -> str:
900900
[Ss][Uu][Ii][Tt][Ee]
901901
|
902902
# Apartment
903-
(?:[Aa][Pp][Tt]\#[\ \.]+)?(?:[Aa][Pp][Tt]|[Aa][Pp][Aa][Rr][Tt][Mm][Ee][Nn][Tt])
903+
(?:[Aa][Pp][Tt]\#[\ \.]+)?(?:[Aa][Pp][Tt]?|[Aa][Pp][Aa][Rr][Tt][Mm][Ee][Nn][Tt])
904904
|
905905
# Room
906906
[Rr][Oo][Oo][Mm]|[Rr][Mm]

tests/test_parser_us.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ def test_building(input, expected):
354354
("apt# apt 123", True),
355355
("SPC 42", True),
356356
("Space 13", True),
357+
("Ap B5", True),
358+
("Ap 5", True),
357359
# negative assertions
358360
("suite900 ", False),
359361
("Suite#2", False),
@@ -650,6 +652,7 @@ def test_full_street_positive(input, expected):
650652
("400 ave of the stars\nlakewood nj 08701", True),
651653
("930 laurel breeze dr\napt# apt 308\nknightdale nc 27545", True),
652654
("1234 PEDDY RD SPC 42,RIVERSIDE,CA,92509", True),
655+
("123 Blackwood street Ap B5 Philadelphia, PA 19116", True),
653656
],
654657
)
655658
def test_full_address(input, expected):

0 commit comments

Comments
 (0)