Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown for royal_cypher doesn't show most popular values #5109

Closed
lakedistrictOSM opened this issue Jun 23, 2018 · 4 comments
Closed

Dropdown for royal_cypher doesn't show most popular values #5109

lakedistrictOSM opened this issue Jun 23, 2018 · 4 comments

Comments

@lakedistrictOSM
Copy link

When royal_cypher is added in all tags, it doesn't show the most popular values in the dropdown.

This is what it shows:
royalcypher id

These are the top values (from taginfo) which it should show:
royalcypher taginfo

It seems to ignore the values in all caps for some reason.

@bhousel
Copy link
Member

bhousel commented Jun 23, 2018

Oh yeah this is like #3377
Most of the time iD ignores results from taginfo that begin with capital letters, but we have a whitelist for tags that are allowed to autocomplete this way.

I wrote on that issue:
For most fields in OSM (cuisine, religion, denomination) it's the behavior we actually want.
e.g. prefer "french" instead of "French"... prefer "catholic" over "Catholic".

@pnorman
Copy link
Contributor

pnorman commented Jun 24, 2018

Whitelisting is the easy solution - perhaps an inherently "more correct" one is to ignore the one with capital letters when case insensitive matches something earlier in the list.

I'd probably just edit the whitelist ;)

@bhousel
Copy link
Member

bhousel commented Jun 24, 2018

I'd probably just edit the whitelist ;)

Yep - the history for this line of code is pretty great..

// In most cases we prefer taginfo value results with lowercase letters.
// A few OSM keys expect values to contain uppercase values (see #3377).
// This is not an exhaustive list (e.g. `name` also has uppercase values)
// but these are the fields where taginfo value lookup is most useful.
var re = /network|taxon|genus|species|brand|grape_variety|rating|:output|_hours|_times/;

A more correct solution would probably be to filter whatever we receive from taginfo and keep only the most popular string in situations where there are multiple strings that disagree in how they are cased.

@bhousel
Copy link
Member

bhousel commented Jun 24, 2018

I ended up just adding it to the whitelist and closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants