删除不必要的单词的API

I want to search

Before: Who was the first Russian astronaut to do spacewalk

Converted to

After: First Russian astronaut spacewalk

Any API that would allow me to convert the before sentence to after sentence? Here are some more sample questions

Q: Who invented the paper clip? to invented paper clip Q: Who invented the electric guitar? to invented electric guitar Q: Who was the president of Vichy France? to president of Vichy France Q: Who is buried in the great pyramid of Giza? to buried pyramid Giza

What are you looking for is a so called stopword-list for the English language. You need to remove all stopwords from your text in order get what you want. You can find a proper stopword-list as an PHP array here

I think what you are looking for is a list of prepositions.

http://en.wikipedia.org/wiki/List_of_English_prepositions