]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/test_tokenizer_legacy_icu.py
Merge pull request #2369 from lonvia/exclude-poi-from-housenumber-search
[nominatim.git] / test / python / test_tokenizer_legacy_icu.py
index 798fea37397e63e75bbe962da9310e9d660c8122..d8ca2f22660b9bde665a7563372398d9130225f2 100644 (file)
@@ -223,11 +223,25 @@ def test_update_special_phrase_modify(analyzer, word_table):
 
 
 def test_process_place_names(analyzer, getorcreate_term_id):
-
     with analyzer() as anl:
         info = anl.process_place({'name' : {'name' : 'Soft bAr', 'ref': '34'}})
 
-    assert info['names'] == '{1,2,3,4,5,6}'
+    assert info['names'] == '{1,2,3,4,5}'
+
+
+@pytest.mark.parametrize('sep', [',' , ';'])
+def test_full_names_with_separator(analyzer, getorcreate_term_id, sep):
+    with analyzer() as anl:
+        names = anl._compute_full_names({'name' : sep.join(('New York', 'Big Apple'))})
+
+    assert names == set(('NEW YORK', 'BIG APPLE'))
+
+
+def test_full_names_with_bracket(analyzer, getorcreate_term_id):
+    with analyzer() as anl:
+        names = anl._compute_full_names({'name' : 'Houseboat (left)'})
+
+    assert names == set(('HOUSEBOAT (LEFT)', 'HOUSEBOAT'))
 
 
 @pytest.mark.parametrize('pcode', ['12345', 'AB 123', '34-345'])