Multiword autocompletion

Hi,

I would like to write a search engine for a site, with real-time spell
checking.
So i need to pass the word beign written atm, not the full field value.
If the user clicks one of the suggested words, only the last word should
be
replaced, not the entire content.

Is there any way of doing this?

Thanks.