I believe Google logs all queries and identifies when someone makes a spelling correction. This correction may then be suggested when others supply the same first query. This will work for any language, in fact any string of any characters.
Dr Norvig also discusses the "did you mean" in this excellent talk. Dr Norvig is 研究主管 at Google - when asked how "did you mean" is implemented, his answer is < em > 权威 .
string = "my haert wil go on"
string.gsub(/[\w\']+/) do |word|
if !speller.check(word)
# word is wrong
puts "Possible correction for #{word}:"
puts speller.suggest(word).first
end
end