Awesome. So I started to answer the question, outlining an approach for the poster to use to solve her problem. What I didn’t pay attention to was the fact that the user had a single point on Stack Overflow.
Stack Overflow works on a point system: it taps the lizard brain in most geeks by awarding points for answering questions, posting question, upvoting, etc. You want a high score. You’re awarded badges for hitting different thresholds in the system. Points are the carrot and the stick (you lose points on downvotes) that get people to participate and behave themselves in the community.
Having 1 point means you just logged into the system. You haven’t upvoted any other answers or answered any other questions. You haven’t even completed your user profile. This is a red flag.
Almost immediately the poster started to request more and more detail, basically asking for an implementation. We went back and forth a bit until I finally posted a full code example to the problem, at which point the poster disappeared.
So, I did their work and didn’t even get tagged as “the answer”, which means I received no points. I got played.
My solution is somewhat naive, but it works (see Gist below). It takes the input text and breaks it into an array of words, which are then filtered against a giant list of stop words.
This is not something you would probably want to do in real time on a text of any length. You would probably schedule this as a background task.