mirror of
https://codeberg.org/matkoniecz/list_how_openstreetmap_can_be_improved_with_alltheplaces_data.git
synced 2025-04-11 10:09:29 +02:00
try to clean more addresses
This commit is contained in:
parent
eda13885b0
commit
b7fb805103
2 changed files with 13 additions and 0 deletions
|
@ -39,6 +39,9 @@ def drop_extra_detail_blocking_nominatim(value):
|
|||
# US, Wichita, 7700 East Kellogg Drive
|
||||
# works
|
||||
value = re.sub(r'(,|, |)unit .*', '', value, flags=re.IGNORECASE)
|
||||
|
||||
# Shop 3, 60 Bold Street
|
||||
value = re.sub(r'Shop [^,]*,\s*', '', value, flags=re.IGNORECASE)
|
||||
return value
|
||||
|
||||
|
||||
|
|
10
test_nominatim.py
Normal file
10
test_nominatim.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
import unittest
|
||||
import nominatim
|
||||
|
||||
|
||||
class NominatimTests(unittest.TestCase):
|
||||
def test_drop_shop_mention_from_street_address(self):
|
||||
self.assertEqual(nominatim.drop_extra_detail_blocking_nominatim('Shop 3, 60 Bold Street'), '60 Bold Street')
|
||||
|
||||
def test_avoid_destroying_legit_street_name(self):
|
||||
self.assertEqual(nominatim.drop_extra_detail_blocking_nominatim('60 Shopping Street'), '60 Shopping Street')
|
Loading…
Add table
Reference in a new issue