Skip to content

Remove all alt name variants when dropping names #2039

Open

Description

@nvkelso

In some cases when when we ask in queries.yaml to drop_properties and include the all_name_variants config, we still see alt_name variants.

image

The transform we use is:

def _is_name(key):
"""
Return True if this key looks like a name.
This isn't as simple as testing if key == 'name', as there are alternative
name-like tags such as 'official_name', translated names such as 'name:en',
and left/right names for boundaries. This function aims to match all of
those variants.
"""
# simplest and most common case first
if key == 'name':
return True
# translations next
if key.startswith('name:'):
return True
# then any of the alternative forms of name
return any(key.startswith(p) for p in tag_name_alternates)

    # then any of the alternative forms of name
    return any(key.startswith(p) for p in tag_name_alternates)

Which uses a list of alternate name tags:

tag_name_alternates = (
'int_name',
'loc_name',
'nat_name',
'official_name',
'old_name',
'reg_name',
'short_name',
'name_left',
'name_right',
'name:short',
)

So the action to take is to expand the list to include alt_name.

Activity

  1. added this to the v1.9.0 milestone on Dec 20, 2021
  2. nvkelso commented on Dec 20, 2021

    @nvkelso
    MemberAuthor
  3. modified the milestones: v1.9.0, v2.0.0 on Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions