Skip to content

Commit f3233e1

Browse files
committed
Avoid close name for NNth
This avoids e.g. 8th, 14th and 22nd from being converted to _, 1_ and 2_ respectively, after which a 1-character difference remains (which is subsequently reported as a close name)
1 parent ceb7fbf commit f3233e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

analysers/analyser_osmosis_highway_name_close.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
sql10_regex = """regexp_replace(regexp_replace(regexp_replace(regexp_replace(regexp_replace(regexp_replace(regexp_replace(regexp_replace({0},
2828
'([0-9]+-[а-я]{{2}})( |$)', '_', 'g'), -- Bulgaria
2929
'[-\\[\\]\\{{\\}}\\(\\)\"\\\\/]', '', 'g'),
30-
'(1st|2nd|3rd|[04-9]th)( |$)', '_', 'g'),
30+
'[0-9]*(1st|2nd|3rd|[04-9]th)( |$)', '_', 'g'),
3131
'(1ra|2da|3ra|4ta|5ta|6ta|7ma|8va|9na|0ma|1er|2do|3ro|4to|5to|6to|7mo|8vo|9no|0mo)( |$)', '_', 'g'),
3232
'[/.0-9\u0660-\u0669\u06F0-\u06F9\u2160-\u2188]', ' ', 'g'), -- Numbers, Arabic numbers (u06**), Roman numbers (u21**)
3333
'(^| )[a-zA-Z](?= |$)', '\\1', 'g'),

0 commit comments

Comments
 (0)