systemed/iD — pull request #1911 by aaronlidman (2013-10-23 05:38:15+00:00)
Title: Autocomplete names

Addresses #1752.

Starting with [the lists](https://gist.github.com/anonymous/7004663) @joto ran for us:
- top items from each list are put into their respective presets in a new "suggestions" property
- obvious duplicates and generic names are manually removed, most frequently used usage is favored
- when typing a name, tag presets are checked for the "suggestions" property, if it exists we get the items
- if more than one tag has suggestions the list just gets longer, everything is checked
- each item in the list is compared to the currently typed value (3 character minimum) and calculates a [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance), this is the same way other suggestions across iD also work
- the top 3 suggestions with a distance less than 4 are returned

There were many potential problems brought up in discussion on the issue. In usage, I think the lists are short enough and the suggestions are smart enough that it isn't too much of a problem and probably useful for the most common values.

@jfirebaugh looking for some test ideas, not sure if we should test returned suggestion values if there's a possibility of the "suggestions" property being edited or updated in the future.