File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -879,37 +879,46 @@ def street_type_list_to_regex(street_type_list: list[str]) -> str:
879879 floor_indic = floor_indic
880880)
881881
882+ tower = r"(?:{re_post_direction}\ [Tt][Oo][Ww][Ee][Rr])" .format (
883+ re_post_direction = post_direction_re
884+ )
885+
882886building = r"""
883887 (?P<building_id>
884- (?:
885- (?:[Bb][Uu][Ii][Ll][Dd][Ii][Nn][Gg])\.?
886- |
887- (?:[Bb][Ll][Dd][Gg])\.?
888- |
889- (?:[Bb][Ll][Vv])\.?
890- )
891- \
892888 (?:
893889 (?:
894- [Aa][Nn][ Dd]\
890+ (?:[Bb][Uu][Ii][Ll][ Dd][Ii][Nn][Gg])\.?
895891 |
896- {thousand}
892+ (?:[Bb][Ll][Dd][Gg])\.?
897893 |
898- {hundred}
899- |
900- {zero_to_nine}
894+ (?:[Bb][Ll][Vv])\.?
895+ )
896+ \
897+ (?:
898+ (?:
899+ [Aa][Nn][Dd]\
900+ |
901+ {thousand}
902+ |
903+ {hundred}
904+ |
905+ {zero_to_nine}
906+ |
907+ {ten_to_ninety}
908+ ){{1,5}}
901909 |
902- {ten_to_ninety }
903- ){{1,5}}
910+ \d{{0,4}}(?:\.\d)?[A-Za-z]?[XxVvIi]{{0,4} }
911+ )
904912 |
905- \d{{0,4}}(?:\.\d)?[A-Za-z]?[XxVvIi]{{0,4} }
906- )
913+ {tower }
914+ )
907915 )
908916 """ .format (
909917 thousand = thousand ,
910918 hundred = hundred ,
911919 zero_to_nine = zero_to_nine ,
912920 ten_to_ninety = ten_to_ninety ,
921+ tower = tower ,
913922)
914923
915924occupancy_details = (
Original file line number Diff line number Diff line change @@ -304,6 +304,7 @@ def test_floor(input, expected):
304304 ("Building " , True ),
305305 ("building one " , True ),
306306 ("Building three " , True ),
307+ ("South Tower" , True ),
307308 # negative assertions
308309 ("bldg" , False ),
309310 ("bldgm" , False ),
@@ -521,6 +522,7 @@ def test_po_box_positive(input, expected):
521522 ("123 Chase Wimbledom St." , True ),
522523 ("82 ALBRO TRACT" , True ),
523524 ("6123 SHEFFIELD HOUSE" , True ),
525+ ("99 Valley Greens Dr\n South Tower" , True ),
524526 # negative assertions
525527 ("6 95 34 75 COMPANY PHONE IS" , False ),
526528 (", 666 Hell ST PMB 29700" , False ),
You can’t perform that action at this time.
0 commit comments