This is not at all impossible, in fact, just the kind of thing that artificial computer intelligence should be good at. Try this link:
http://rali.iro.umontreal.ca/zodiac/Reacc.fr.cgi/1?mySubmit=0&input_text
There is also an academic paper on how to do this and an implementation in Emacs...