﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11774	[Patch] Warn about obvious misspelled tag keys	mdk	team	"Inspired by [http://www.openstreetmap.org/user/marczoutendijk/diary/35512] mentioned in the current [http://blog.openstreetmap.de/blog/2015/08/wochennotiz-nr-263/ Wochennotiz Nr. 263] I extend the validator now for tag keys as I already did for tag values (see #11498):
> A lot of the (faulty) keys I found are of the uppercase/lowercase type:
> `Name` when `name` was meant for instance. Almost any regular key (`amenity`, `shop`, `tourism`, `highway`, `landuse` etc) appears in a misspelled version in the database (`tourims`, `land-use` etc). Also added interpunction (`name;` or `name,` or `name-`) counts for quiet a number of those one-time-only keys.

My patch don't cover all typos, but all uppercase/lowercase and some of the cases with additional and missplaced interpunction like `land-use`, `name;`, `name,` or `name-`.

More general, I first normalize all keys found in presets:
* convert to lower case
* replace `-`, `:` and SPACE with `_`
* remove all leading and trailing `-`, `_`, `;`, `:` and `,`
When during validation a key would trigger the ""Presets do not contain property key"" warning, I look now, if this key (also normalized) will match one of the normalized preset keys. If I found a match, I produce a warning like `Key 'Building' looks like 'building'.` with an auto fix to replace the key with the non normalized key I found in the presets.
See patch validateKeys1.diff.

I also add an alternative patch, where I merge this check with the existing spell checking feature using `data/validator/words.cfg` and the other optional dictionaries found by {{{Main.pref.getCollection(PREF_SOURCES, DEFAULT_SOURCES)}}}.
See patch validateKeys2.diff.

BTW only the second patch warns about `Key 'land-use' looks like 'landuse'.`, bacause words.cfg contains
{{{
+landuse
-land_use
}}}
and `land-use` is normalized to `land_use` :)

With the second patch, we could also reduce the size of words.cfg by eleminating all missspelled keys which are covered by the generic approach. We could also cover the `tourims` case by adding this to words.cfg, but this is a different story..."	enhancement	closed	normal	15.09	Core validator	latest	fixed		Klumbumbus
