We were set an algorithm problem in class today, as a \"if you figure out a solution you don\'t have to do this subject\". SO of course, we all thought we will give it a go.
Use (either online, or download) WordNet, and find the number of relationships you have to follow between words and each category.