How spell checker and auto-complete works in Google