mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Skip ambiguous matches (like Target~(USA) vs Target~(Australia))
This also reorders the nsiKeys array to maybe match slightly quicker
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user