Opened 5 years ago
Closed 5 years ago
#17444 closed enhancement (invalid)
auto fix is not enabled for misspelled tag key
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core validator | Version: | |
Keywords: | Cc: | Klumbumbus |
Description
The current code in TagChecker sometimes calculates a fix command for misspelled tag keys (e.g.
higwhay=residential) but the Fix button is not enabled for the corresponding error code
MISSPELLED_KEY
I wonder if I should remove the useless code or if should enable the auto-fix?
The spell check for keys is still based on core\data\validator\words.cfg
Attachments (0)
Change History (7)
comment:1 by , 5 years ago
Cc: | added |
---|
comment:2 by , 5 years ago
comment:3 by , 5 years ago
OK, I'll enable the fix. I don't plan to use levenshtein distance for the key in the near future.
comment:4 by , 5 years ago
I just tested and I already get a fix button for e.g. citya=bla
Anyway, a few things should be removed from words.cfg:
+created_by -cretaed_by -crated_by -creared_by -creayed_by -{created_by -creeated_by -created_bu
(it's a changset tag)
+osmarender:nameDirection -name_direction -osmarender:name_direction +osmarender:renderName -osmarender:rendername -soamrender:renderName +osmarender:renderRef -osmrender:renderRef
(osmarender does not exist anymore and the tags are tagging for the renderer anyway)
+unknown -unknwon
(crap)
+city -citya +feature -featuer +highway_border -highway_boarder -highway_boreder +tramline -tram_line
(no documented key and the wrong spelling does not appear in the database atm)
+source:name -source:Name
(doesn't work. docu in words.cfg says "# There is no need to add bad spelling with different upper/lower case.")
comment:5 by , 5 years ago
You are right, I did not see that the an existing fix command overrides the value returned by isFixable().
I agree with your suggestions. I'll try to code something based on taginfo db that produces more candidates for this file.
comment:6 by , 5 years ago
It turned out that the comment regarding upper/lower case is not correct for keys with characters like ':', '-', or '
+source:name -source:Name
Without these lines the tag source:Name is just flagged as unknown key instead of saying ".. looks like source:name".
I am not yet sure if this is an error in the Java code or if I should change the comment.
comment:7 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Hmm, this is somehow special. There is no need to add bad spelling with different upper/lower case for keys which are in the presets,
those are handled automatically. For other tags, e.g.
+source:name -source:Name
it helps to produce the fix command.
I've also found another problem:
The entries in ignoreTags.cfg starting with K: were not used "as dictionary entry for spell checking the given key".
Instead they were only used for the tag value.
I'll open new tickets for the real errors.
I think for the cases in words.cfg the fix button would be ok. If you plan to replace words.cfg by the levenshtein distance too then it would be too risky as this probably produces even more false poaitives than the misspelled values test.