("König bei", "amenity", "royal", "near"),
("Könige", "amenity", "royal", "-"),
("strasse", "highway", "primary", "in")
- ])
+ ], True)
assert word_table.get_special() \
== set(((' könig bei', 'könig bei', 'amenity', 'royal', 'near'),
assert word_table.count_special() == 2
- analyzer.update_special_phrases([])
+ analyzer.update_special_phrases([], True)
assert word_table.count_special() == 0
+def test_update_special_phrases_no_replace(analyzer, word_table, temp_db_cursor,
+ make_standard_name):
+ word_table.add_special(' foo', 'foo', 'amenity', 'prison', 'in')
+ word_table.add_special(' bar', 'bar', 'highway', 'road', None)
+
+ assert word_table.count_special() == 2
+
+ analyzer.update_special_phrases([], False)
+
+ assert word_table.count_special() == 2
+
+
def test_update_special_phrase_modify(analyzer, word_table, make_standard_name):
word_table.add_special(' foo', 'foo', 'amenity', 'prison', 'in')
word_table.add_special(' bar', 'bar', 'highway', 'road', None)
('prison', 'amenity', 'prison', 'in'),
('bar', 'highway', 'road', '-'),
('garden', 'leisure', 'garden', 'near')
- ])
+ ], True)
assert word_table.get_special() \
== set(((' prison', 'prison', 'amenity', 'prison', 'in'),