Skip to content

Commit 9f713f6

Browse files
deevromanwillemarcel
authored andcommitted
exclude "yandex panoramas" written in Russian
1 parent 1196ea9 commit 9f713f6

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

osmcha/changeset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ def verify_words(self):
356356
if word in self.source.lower():
357357
if word == 'yandex' and 'yandex panorama' in self.source.lower():
358358
pass
359+
elif word == 'яндекс' and ('яндекс панорам' in self.source.lower() or 'яндекс.панорам' in self.source.lower()):
360+
pass
359361
else:
360362
self.label_suspicious('suspect_word')
361363
break

osmcha/suspect_words.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ exclude:
5757
- important
5858
- importante
5959
- yandex panorama
60+
- яндекс панорам
61+
- яндекс.панорам

tests/test_mod.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def test_find_words():
2929
assert find_words('places from 2гис', suspect_words, excluded_words)
3030
assert find_words('places from yandex', suspect_words, excluded_words)
3131
assert not find_words('Yandex Panorama', suspect_words, excluded_words)
32+
assert not find_words('Яндекс Панорамы', suspect_words, excluded_words)
33+
assert not find_words('Яндекс.Панорамы', suspect_words, excluded_words)
3234

3335

3436
def test_changeset_list():
@@ -223,6 +225,48 @@ def test_analyse_verify_words():
223225
ch.verify_words()
224226
assert not ch.is_suspect
225227

228+
ch_dict = {
229+
'created_by': 'Potlatch 2',
230+
'created_at': '2015-04-25T18:08:46Z',
231+
'build': '2.3-650-gad99430',
232+
'version': '2.3',
233+
'comment': 'Somewhere in Brazil',
234+
'comments_count': '1',
235+
'source': 'Яндекс.Панорамы',
236+
'id': '1',
237+
'user': 'JustTest',
238+
'uid': '123123',
239+
'bbox': Polygon([
240+
(-71.0646843, 44.2371354), (-71.0048652, 44.2371354),
241+
(-71.0048652, 44.2430624), (-71.0646843, 44.2430624),
242+
(-71.0646843, 44.2371354)
243+
])
244+
}
245+
ch = Analyse(ch_dict)
246+
ch.verify_words()
247+
assert not ch.is_suspect
248+
249+
ch_dict = {
250+
'created_by': 'Potlatch 2',
251+
'created_at': '2015-04-25T18:08:46Z',
252+
'build': '2.3-650-gad99430',
253+
'version': '2.3',
254+
'comment': 'Somewhere in Brazil',
255+
'comments_count': '1',
256+
'source': 'Яндекс Панорамы',
257+
'id': '1',
258+
'user': 'JustTest',
259+
'uid': '123123',
260+
'bbox': Polygon([
261+
(-71.0646843, 44.2371354), (-71.0048652, 44.2371354),
262+
(-71.0048652, 44.2430624), (-71.0646843, 44.2430624),
263+
(-71.0646843, 44.2371354)
264+
])
265+
}
266+
ch = Analyse(ch_dict)
267+
ch.verify_words()
268+
assert not ch.is_suspect
269+
226270

227271
def test_analyse_verify_editor_josm():
228272
"""Test if JOSM is a powerfull_editor."""

0 commit comments

Comments
 (0)