From 7a07506edce6548557621c51159301cf84470ca9 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 17 May 2019 09:45:08 -0400 Subject: [PATCH] Skip ambiguous matches (like Target~(USA) vs Target~(Australia)) This also reorders the nsiKeys array to maybe match slightly quicker --- modules/validations/outdated_tags.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/validations/outdated_tags.js b/modules/validations/outdated_tags.js index bdab55cb2..4c5c7f1b6 100644 --- a/modules/validations/outdated_tags.js +++ b/modules/validations/outdated_tags.js @@ -15,7 +15,7 @@ export function validationOutdatedTags() { // initialize name-suggestion-index matcher var nsiMatcher = matcher(); nsiMatcher.buildMatchIndex(brands.brands); - var nsiKeys = ['amenity', 'leisure', 'shop', 'tourism']; + var nsiKeys = ['amenity', 'shop', 'tourism', 'leisure']; function oldTagIssues(entity, context) { @@ -64,6 +64,9 @@ export function validationOutdatedTags() { var match = nsiMatcher.matchKVN(k, newTags[k], newTags.name); if (!match) continue; + // for now skip ambiguous matches (like Target~(USA) vs Target~(Australia)) + if (match.d) continue; + var brand = brands.brands[match.kvnd]; if (brand) { Object.assign(newTags, brand.tags);