Let's consider an example: one can mistype CodeIgniter as CodeIngiter. In fact, not one but 272 guys made such typos at SO (I've fixed something like a dozen a few days ago). Or another one: "fuction" instead of "function", about 3K posts.
What harm can this cause? Let's consider this before discussing any ideas for fixing typos automatically. Aside aesthetics, one can note that
- there's a number of questions with code containing typos (example). Usually they are flagged and deleted ("off-topic/can't be reproduced" flag) but take an amount of efforts (see also this discussion)
- sometimes this is exploited by badge hunters who make a number of similar edits which don't help that much and take efforts of reviewers which can be more productive (unfortunately, I haven't saved any links to examples I've seen)
- sometimes this attracts attention of those who review/edit consistently which is probably less harmful but still steals some workhours from community
- this may remove some questions out of search results
- this also may mislead a person who has made a typo in search query themselves (instead of empty results they see those with typos)
What's the scale of these effects? Are they of any importance? I'm not sure: it's hard to say without access to stats of reviews and search queries. This is somewhat I'd like to hear from you. This post, however, seems to draw some picture here (92 pages of results containing Javacript etc).
Possible solutions. Questions to consider are: what typos to fix and how to fix them?
Speaking of the first part, I can see some obvious options:
- allow to create tag "misspellings" aside synonyms (like CodeIngiter for CodeIgniter) so that they are autocorrected/suggested to be corrected
- usually questions have the corresponding tag so "CodeIngiter" can be automatically found as "CodeIgniter" (tag of the question being asked or answered) with 2 letters switched. This can give false-positives, though: I don't have a witty example at hand, but one can imagine that "lava" may get autocorrected to "java", "CEO" to "SEO" etc
- use something non-tag-based (a special dictionary?) or based on tags that are not necessarily present in the question (the question with
fuction
mentioned above is not taggedfunction
but such tag exists)
As for the way of fixing, that could be autosuggestions when creating/editing, autocorrection in the same place or simplified review (0 or 1 reviewer needed to approve the fuction
→ function
edit which is usually an edit of a title).
Also there can be batch-fixing for obvious problems like the above-mentioned Javacript/JavaScript example. This is something a mod should be able to do, isn't it? This can be suggested and reviewed, too, but probably in Meta since comments are needed (and I've read somewhere that tag synonyms are usually approved only after one posts at Meta anyway). There also can be a simplified reviewing for this (if there's some doubt that this may cause some harm): say, a block saying "this question was automatically corrected, please confirm or refute that the correction is valid" visible to users with say 50+ reputation and the author, with 1 vote being enough and nothing put into review queues.
To me, it seems that autosuggestions would be the best option (so that nothing is wrongly "corrected"); I would think that comparison with all tags would be nice, but obviously that can cause too much load on SO servers (get and compare with all tags for each word with length >4?) unless implemented in a smarter way. Along with batch-correcting + simplified reviews.
Finally, there can be autocorrect suggestions in search fields which may be useful without creating much load to SO.
Let me know what you think.
cron
or CodeIgniter so they create noise and are not really helpful. Second, because of this and other things (like poor locale dictionaries or no knowledge of slang) some people (including me) disable them. So they are both not very helpful and not used that widely.