From 6aaf3e732d8e0c58282301921626da8aed165cd1 Mon Sep 17 00:00:00 2001 From: Lukas Melninkas Date: Tue, 23 Apr 2024 19:34:45 +0300 Subject: [PATCH] Support PH near phone number --- pyap/source_US/data.py | 2 +- tests/test_parser_us.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyap/source_US/data.py b/pyap/source_US/data.py index 2c19b35..a239daf 100644 --- a/pyap/source_US/data.py +++ b/pyap/source_US/data.py @@ -936,7 +936,7 @@ def street_type_list_to_regex(street_type_list: list[str]) -> str: phone_number = r""" (?: - \*? + \*?(?:[Pp][Hh]\ )? (?P \(?\d{3}\)?\-?\ ?\d{3}\-?\ ?\-?\d{4} ) diff --git a/tests/test_parser_us.py b/tests/test_parser_us.py index 5ceb240..4e00040 100644 --- a/tests/test_parser_us.py +++ b/tests/test_parser_us.py @@ -475,6 +475,7 @@ def test_full_street_positive(input, expected): "input,expected", [ # positive assertions + ("P.O. BOX 10323 PH (205) 595-3511\nBIRMINGHAM, AL 35202", True), ("3602 HIGHPOINT\nSAN ANTONIO TX78217", True), ("8025 BLACK HORSE\nSTE 300\nPLEASANTVILLE NJ 08232", True), ("696 BEAL PKWY NW\nFT WALTON BCH FL 32547", True),