From 99f7b60f678161254524230cea067cdd87a03a59 Mon Sep 17 00:00:00 2001 From: Caique Date: Tue, 17 Feb 2026 12:21:48 -0300 Subject: [PATCH 1/2] parse street type --- pyap/source_US/data.py | 5 ++++- tests/test_parser_us.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyap/source_US/data.py b/pyap/source_US/data.py index 5ffadf7..73cccc2 100644 --- a/pyap/source_US/data.py +++ b/pyap/source_US/data.py @@ -789,7 +789,10 @@ def str_list_to_upper_lower_regex(str_list: List[str]) -> str: "Xrds", ] -street_type_leading_list = ["Camino", "El\ Camino", "Avenue", "Blvd", "Ave"] +street_type_leading_list = ["Camino", "El\ Camino", "Avenue", "Blvd", "Ave", + "La\ Rue", + "Rue", +] def street_type_list_to_regex(street_type_list: list[str]) -> str: diff --git a/tests/test_parser_us.py b/tests/test_parser_us.py index 46d5bec..3127922 100644 --- a/tests/test_parser_us.py +++ b/tests/test_parser_us.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -""" Test for USA address parser """ +"""Test for USA address parser""" import re import pytest @@ -236,6 +236,7 @@ def test_post_direction(input, expected): ("I- 35", True), ("I-35 Service Road", True), ("BAY", True), + ("Rue", True), # negative assertions # TODO ], @@ -251,6 +252,7 @@ def test_street_type(input, expected): # positive assertions ("ED DR", True), ("El Camino Real", True), + ("La Rue", True), # negative assertions ("Camino Del Toro Loco", False), ], @@ -645,6 +647,7 @@ def test_full_street_positive(input, expected): ("123 Route 75 STE 155 Toms River, NJ 08755", True), ("1234 WOODMONT DRIVE NORTHWEST APT# APT F-15 LENOIR NC 28645", True), ("1234 N Front Street\nSuite 3 South\nHarrisburg, PA 17102", True), + ("206 La Rue France, Lafayette, LA, 70508", True), # negative assertions ("ONE HEALING CENTER LLC, 16444", False), ("85 STEEL REGULAR SHAFT - NE", False), From fb2a514fc5b7e6223e0e7924aa780f9d92add6ce Mon Sep 17 00:00:00 2001 From: Caique Date: Tue, 17 Feb 2026 12:27:22 -0300 Subject: [PATCH 2/2] formatting fixes --- pyap/source_US/data.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyap/source_US/data.py b/pyap/source_US/data.py index 73cccc2..aa9daea 100644 --- a/pyap/source_US/data.py +++ b/pyap/source_US/data.py @@ -789,7 +789,12 @@ def str_list_to_upper_lower_regex(str_list: List[str]) -> str: "Xrds", ] -street_type_leading_list = ["Camino", "El\ Camino", "Avenue", "Blvd", "Ave", +street_type_leading_list = [ + "Camino", + "El\ Camino", + "Avenue", + "Blvd", + "Ave", "La\ Rue", "Rue", ]